|
|
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import com.google.common.collect.Maps; |
|
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.basic.util.StrPool; |
|
|
@@ -1689,4 +1690,73 @@ public class GovProjectCollectionManage { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public String rebuildProjectCode(List<String> baseProjIds){ |
|
|
|
if(CollUtil.isEmpty(baseProjIds)){ |
|
|
|
throw new BizException("项目编号不能为空"); |
|
|
|
} |
|
|
|
for(String baseProjId : baseProjIds){ |
|
|
|
GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class) |
|
|
|
.eq(GovBizProjectBaseinfo::getBaseProjId, baseProjId) |
|
|
|
.orderByDesc(GovBizProjectBaseinfo::getTongTime) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
GovBizProjectApply apply = projectApplyService.getOne(Wrappers.lambdaQuery(GovBizProjectApply.class) |
|
|
|
.eq(GovBizProjectApply::getBaseProjId, baseProjId) |
|
|
|
.orderByDesc(GovBizProjectApply::getTongTime) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if(Objects.isNull(baseinfo)){ |
|
|
|
System.out.println("项目不存在 直接下一个"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
GovBizProjectSaveDTO saveDTO = new GovBizProjectSaveDTO(); |
|
|
|
saveDTO.setApply(BeanUtil.copyProperties(apply, GovBizProjectApplyDTO.class)); |
|
|
|
saveDTO.setBaseinfo(BeanUtil.copyProperties(baseinfo, GovBizProjectBaseinfoDTO.class)); |
|
|
|
String newProjId = generateProjectCodeUtil.generateProjectCode(saveDTO); |
|
|
|
|
|
|
|
baseinfo.setBaseProjId(newProjId); |
|
|
|
baseinfoService.updateById(baseinfo); |
|
|
|
apply.setBaseProjId(newProjId); |
|
|
|
projectApplyService.updateById(apply); |
|
|
|
|
|
|
|
GovBizProjectApprove approve = approveService.getOne(Wrappers.lambdaUpdate(GovBizProjectApprove.class) |
|
|
|
.eq(GovBizProjectApprove::getBaseProjId, baseProjId) |
|
|
|
.orderByDesc(GovBizProjectApprove::getTongTime) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if(Objects.nonNull(approve)){ |
|
|
|
approve.setBaseProjId(newProjId); |
|
|
|
approveService.updateById(approve); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GovBizProjectCimplement cimplement = cimplementService.getOne(Wrappers.lambdaQuery(GovBizProjectCimplement.class) |
|
|
|
.eq(GovBizProjectCimplement::getBaseProjId, baseProjId) |
|
|
|
.orderByDesc(GovBizProjectCimplement::getTongTime) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if(Objects.nonNull(cimplement)){ |
|
|
|
cimplement.setBaseProjId(newProjId); |
|
|
|
cimplement.setBaseBidCode(newProjId); |
|
|
|
cimplementService.updateById(cimplement); |
|
|
|
} |
|
|
|
|
|
|
|
GovBizProjectMimplement mimplement = mimplementService.getOne(Wrappers.lambdaQuery(GovBizProjectMimplement.class) |
|
|
|
.eq(GovBizProjectMimplement::getBaseProjId, baseProjId) |
|
|
|
.orderByDesc(GovBizProjectMimplement::getTongTime) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if(Objects.nonNull(mimplement)){ |
|
|
|
mimplement.setBaseProjId(newProjId); |
|
|
|
mimplement.setBaseBidCode(newProjId); |
|
|
|
mimplementService.updateById(mimplement); |
|
|
|
} |
|
|
|
|
|
|
|
List<GovBizProjectProcure> procures = procureService.list(Wrappers.lambdaUpdate(GovBizProjectProcure.class) |
|
|
|
.eq(GovBizProjectProcure::getBaseProjId, baseProjId)); |
|
|
|
|
|
|
|
for(GovBizProjectProcure procure : procures){ |
|
|
|
procure.setBaseProjId(newProjId); |
|
|
|
procure.setBaseBidCode(newProjId + "-" + procure.getBaseBidCode().split("-")[1]); |
|
|
|
procureService.updateById(procure); |
|
|
|
} |
|
|
|
} |
|
|
|
return "运行成功 重新生成" + baseProjIds.size() + "个项目编号"; |
|
|
|
} |
|
|
|
} |