|
|
@@ -189,12 +189,13 @@ public class GovProjectCollectionManage { |
|
|
|
} |
|
|
|
|
|
|
|
//5.最后查询采购信息 |
|
|
|
GovBizProjectProcure procure = procureService.getOne(Wrappers.lambdaQuery(GovBizProjectProcure.class) |
|
|
|
List<GovBizProjectProcure> procures = procureService.list(Wrappers.lambdaQuery(GovBizProjectProcure.class) |
|
|
|
.eq(GovBizProjectProcure::getBaseProjId, projId) |
|
|
|
.orderByDesc(GovBizProjectProcure::getBizTime) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if(Objects.nonNull(procure)){ |
|
|
|
res.setProcure(BeanUtil.copyProperties(procure, GovBizProjectProcureVO.class)); |
|
|
|
.orderByDesc(GovBizProjectProcure::getBizTime)); |
|
|
|
if(CollUtil.isNotEmpty(procures)){ |
|
|
|
res.setProcures(procures.stream() |
|
|
|
.map(p -> BeanUtil.copyProperties(p, GovBizProjectProcureVO.class)) |
|
|
|
.collect(Collectors.toList())); |
|
|
|
} |
|
|
|
|
|
|
|
return res; |
|
|
@@ -329,27 +330,31 @@ public class GovProjectCollectionManage { |
|
|
|
} |
|
|
|
|
|
|
|
// 6.保存 采购信息 |
|
|
|
GovBizProjectProcureDTO procure = saveDTO.getProcure(); |
|
|
|
procure.setBaseProjId(baseProjId); |
|
|
|
procure.setBaseProjName(baseProjName); |
|
|
|
if(Objects.nonNull(procure)){ |
|
|
|
GovBizProjectProcure oldProcure = procureService.getOne(Wrappers.lambdaQuery(GovBizProjectProcure.class) |
|
|
|
.eq(GovBizProjectProcure::getBaseProjId, baseProjId) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
List<GovBizProjectProcureDTO> procures = saveDTO.getProcures(); |
|
|
|
for(GovBizProjectProcureDTO procure : procures){ |
|
|
|
procure.setBaseProjId(baseProjId); |
|
|
|
procure.setBaseProjName(baseProjName); |
|
|
|
|
|
|
|
GovBizProjectProcure saveProcure = BeanUtil.copyProperties(procure,GovBizProjectProcure.class); |
|
|
|
saveProcure.setBaseProjId(baseProjId); |
|
|
|
if(Objects.nonNull(oldProcure)){ |
|
|
|
saveProcure.setId(oldProcure.getId()); |
|
|
|
|
|
|
|
if(Objects.nonNull(saveBase.getBaseAreaCode())){ |
|
|
|
saveProcure.setAreaCode(saveBase.getBaseAreaCode()); |
|
|
|
} |
|
|
|
if(Objects.isNull(procure.getId())){ |
|
|
|
saveProcure.setTongTime(LocalDateTime.now()); |
|
|
|
}else{ |
|
|
|
if(Objects.nonNull(saveBase.getBaseAreaCode())){ |
|
|
|
saveProcure.setAreaCode(saveBase.getBaseAreaCode()); |
|
|
|
//如果是修改 那就看下库里是否有 |
|
|
|
Long id = saveProcure.getId(); |
|
|
|
GovBizProjectProcure old = procureService.getById(id); |
|
|
|
if(Objects.isNull(old)){ |
|
|
|
saveProcure.setId(null); |
|
|
|
} |
|
|
|
saveProcure.setTongTime(LocalDateTime.now()); |
|
|
|
} |
|
|
|
procureService.saveOrUpdate(saveProcure); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//7. 推送数据 |
|
|
|
pushProject(saveDTO); |
|
|
|
|
|
|
|