|
|
@@ -342,23 +342,14 @@ public class ConstructionPlanManage { |
|
|
|
* @param dto |
|
|
|
*/ |
|
|
|
public void constructionSuggestions(ContructionSuggestionsDTO dto) { |
|
|
|
String nodeId = dto.getNodeId(); |
|
|
|
List<HistoricActivityInstance> hai = historyService.createHistoricActivityInstanceQuery() |
|
|
|
.activityId(nodeId) |
|
|
|
.orderByHistoricActivityInstanceStartTime() |
|
|
|
.asc().list(); |
|
|
|
if(CollUtil.isEmpty(hai)){ |
|
|
|
throw new BizException("该节点的流程不存在!"); |
|
|
|
} |
|
|
|
//实例ID |
|
|
|
String processInstanceId = hai.get(0).getProcessInstanceId(); |
|
|
|
String instanceId = dto.getInstanceId(); |
|
|
|
|
|
|
|
Project project = projectService.getProjectByCode(dto.getProjectCode()); |
|
|
|
if(Objects.isNull(project)){ |
|
|
|
throw new BizException("该项目不存在!"); |
|
|
|
} |
|
|
|
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.eq(ProjectInst::getInstCode, processInstanceId) |
|
|
|
.eq(ProjectInst::getInstCode, instanceId) |
|
|
|
.eq(ProjectInst::getProjectId,project.getId()) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if(Objects.isNull(projectInst)){ |
|
|
@@ -372,12 +363,12 @@ public class ConstructionPlanManage { |
|
|
|
ProjectConstructionSuggestions saveEntity = BeanUtil.copyProperties(dto,ProjectConstructionSuggestions.class); |
|
|
|
ProjectConstructionSuggestions pcs = constrctionSuggestionsService.getOne(Wrappers.lambdaQuery(ProjectConstructionSuggestions.class) |
|
|
|
.eq(ProjectConstructionSuggestions::getProjectCode, dto.getProjectCode()) |
|
|
|
.eq(ProjectConstructionSuggestions::getInstanceId, processInstanceId) |
|
|
|
.eq(ProjectConstructionSuggestions::getInstanceId, instanceId) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
if(Objects.nonNull(pcs)){ |
|
|
|
saveEntity.setId(pcs.getId()); |
|
|
|
} |
|
|
|
saveEntity.setInstanceId(processInstanceId); |
|
|
|
saveEntity.setInstanceId(instanceId); |
|
|
|
constrctionSuggestionsService.saveOrUpdate(saveEntity); |
|
|
|
} |
|
|
|
|
|
|
|