|
@@ -342,23 +342,14 @@ public class ConstructionPlanManage { |
|
|
* @param dto |
|
|
* @param dto |
|
|
*/ |
|
|
*/ |
|
|
public void constructionSuggestions(ContructionSuggestionsDTO 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()); |
|
|
Project project = projectService.getProjectByCode(dto.getProjectCode()); |
|
|
if(Objects.isNull(project)){ |
|
|
if(Objects.isNull(project)){ |
|
|
throw new BizException("该项目不存在!"); |
|
|
throw new BizException("该项目不存在!"); |
|
|
} |
|
|
} |
|
|
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
.eq(ProjectInst::getInstCode, processInstanceId) |
|
|
|
|
|
|
|
|
.eq(ProjectInst::getInstCode, instanceId) |
|
|
.eq(ProjectInst::getProjectId,project.getId()) |
|
|
.eq(ProjectInst::getProjectId,project.getId()) |
|
|
.last(BizConst.LIMIT_1)); |
|
|
.last(BizConst.LIMIT_1)); |
|
|
if(Objects.isNull(projectInst)){ |
|
|
if(Objects.isNull(projectInst)){ |
|
@@ -372,12 +363,12 @@ public class ConstructionPlanManage { |
|
|
ProjectConstructionSuggestions saveEntity = BeanUtil.copyProperties(dto,ProjectConstructionSuggestions.class); |
|
|
ProjectConstructionSuggestions saveEntity = BeanUtil.copyProperties(dto,ProjectConstructionSuggestions.class); |
|
|
ProjectConstructionSuggestions pcs = constrctionSuggestionsService.getOne(Wrappers.lambdaQuery(ProjectConstructionSuggestions.class) |
|
|
ProjectConstructionSuggestions pcs = constrctionSuggestionsService.getOne(Wrappers.lambdaQuery(ProjectConstructionSuggestions.class) |
|
|
.eq(ProjectConstructionSuggestions::getProjectCode, dto.getProjectCode()) |
|
|
.eq(ProjectConstructionSuggestions::getProjectCode, dto.getProjectCode()) |
|
|
.eq(ProjectConstructionSuggestions::getInstanceId, processInstanceId) |
|
|
|
|
|
|
|
|
.eq(ProjectConstructionSuggestions::getInstanceId, instanceId) |
|
|
.last(BizConst.LIMIT_1)); |
|
|
.last(BizConst.LIMIT_1)); |
|
|
if(Objects.nonNull(pcs)){ |
|
|
if(Objects.nonNull(pcs)){ |
|
|
saveEntity.setId(pcs.getId()); |
|
|
saveEntity.setId(pcs.getId()); |
|
|
} |
|
|
} |
|
|
saveEntity.setInstanceId(processInstanceId); |
|
|
|
|
|
|
|
|
saveEntity.setInstanceId(instanceId); |
|
|
constrctionSuggestionsService.saveOrUpdate(saveEntity); |
|
|
constrctionSuggestionsService.saveOrUpdate(saveEntity); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|