|
|
@@ -346,32 +346,26 @@ public class GovProjectCollectionManage { |
|
|
|
// 6.保存 采购信息 |
|
|
|
List<GovBizProjectProcureDTO> procures = saveDTO.getProcures(); |
|
|
|
Integer index = 1; |
|
|
|
for(GovBizProjectProcureDTO procure : procures){ |
|
|
|
procure.setBaseProjId(baseProjId); |
|
|
|
procure.setBaseProjName(baseProjName); |
|
|
|
procure.setBaseBidCode(baseProjId + StrPool.DASH + index); |
|
|
|
|
|
|
|
GovBizProjectProcure saveProcure = BeanUtil.copyProperties(procure,GovBizProjectProcure.class); |
|
|
|
saveProcure.setBaseProjId(baseProjId); |
|
|
|
|
|
|
|
if(Objects.nonNull(saveBase.getAreaCode())){ |
|
|
|
saveProcure.setAreaCode(saveBase.getAreaCode()); |
|
|
|
} |
|
|
|
if(Objects.isNull(procure.getId())){ |
|
|
|
saveProcure.setTongTime(LocalDateTime.now()); |
|
|
|
}else{ |
|
|
|
//如果是修改 那就看下库里是否有 |
|
|
|
Long id = saveProcure.getId(); |
|
|
|
GovBizProjectProcure old = procureService.getById(id); |
|
|
|
if(Objects.isNull(old)){ |
|
|
|
saveProcure.setId(null); |
|
|
|
if(Objects.nonNull(procures)){ |
|
|
|
procureService.remove(Wrappers.lambdaQuery(GovBizProjectProcure.class) |
|
|
|
.eq(GovBizProjectProcure::getBaseProjId,baseProjId)); |
|
|
|
for(GovBizProjectProcureDTO procure : procures){ |
|
|
|
procure.setBaseProjId(baseProjId); |
|
|
|
procure.setBaseProjName(baseProjName); |
|
|
|
procure.setBaseBidCode(baseProjId + StrPool.DASH + index); |
|
|
|
|
|
|
|
GovBizProjectProcure saveProcure = BeanUtil.copyProperties(procure,GovBizProjectProcure.class); |
|
|
|
saveProcure.setBaseProjId(baseProjId); |
|
|
|
saveProcure.setId(null); |
|
|
|
if(Objects.nonNull(saveBase.getAreaCode())){ |
|
|
|
saveProcure.setAreaCode(saveBase.getAreaCode()); |
|
|
|
} |
|
|
|
saveProcure.setTongTime(LocalDateTime.now()); |
|
|
|
procureService.save(saveProcure); |
|
|
|
index++; |
|
|
|
} |
|
|
|
procureService.saveOrUpdate(saveProcure); |
|
|
|
index++; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//7. 推送数据 |
|
|
|
pushProject(saveDTO); |
|
|
|
|
|
|
|