法规清单-编辑,如果编辑了法规工程师,同步清单确认、符合性流程待办任务办理人。
This commit is contained in:
+82
-1
@@ -68,7 +68,9 @@ import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
||||
import com.jero.modules.todoCenter.enums.DesignComplianceFlowNodeKeyEnum;
|
||||
import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum;
|
||||
import com.jero.modules.todoCenter.enums.VerifyComplianceFlowNodeKeyEnum;
|
||||
import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService;
|
||||
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
|
||||
import com.jero.modules.wkflow.entity.ProcessHistoryEO;
|
||||
@@ -648,11 +650,24 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
ProjectLawsInventoryEO projectLawsInventoryOld = this.queryById(projectLawsInventoryEO.getId());
|
||||
// 清单待校核
|
||||
boolean toBeCheckedFlag = (
|
||||
StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|
||||
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|
||||
);
|
||||
if((StringUtils.isNotEmpty(projectLawsInventoryOld.getRegulationOwnerId()) && StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId())) && toBeCheckedFlag){
|
||||
// 结果待审查
|
||||
boolean toBeReviewedFlag = (
|
||||
StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|
||||
|| StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|
||||
);
|
||||
|
||||
// 编辑前、编辑后的法规工程师都不为空。
|
||||
boolean regulationOwnerIsNotNull = (
|
||||
StringUtils.isNotEmpty(projectLawsInventoryOld.getRegulationOwnerId())
|
||||
&& StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId())
|
||||
);
|
||||
|
||||
if(regulationOwnerIsNotNull && (toBeCheckedFlag || toBeReviewedFlag)){
|
||||
// 如果编辑了法规工程师,给之前的法规工程师发消息
|
||||
if (!StringUtils.equals(projectLawsInventoryOld.getRegulationOwnerId(), projectLawsInventoryEO.getRegulationOwnerId())) {
|
||||
String endTime = "";
|
||||
@@ -685,6 +700,72 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
params.put("Initiator",regulationOwnerUserName);
|
||||
|
||||
this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(),params);
|
||||
|
||||
// 将之前的法规工程师的待办任务,转给新的法规工程师办理
|
||||
QueryWrapper<ProcessInfoDetailEO> pidEoQueryWrap = new QueryWrapper<>();
|
||||
pidEoQueryWrap.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId,projectLawsInventoryEO.getId());
|
||||
List<ProcessInfoDetailEO> pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap);
|
||||
if(CollectionUtils.isNotEmpty(pidEoList)){
|
||||
// 过滤出来,清单确认流程,并且是法规工程师审核节点的数据,转办给新的法规工程师
|
||||
List<ProcessInfoDetailEO> qdqrPidEoList = pidEoList.stream().filter(pidEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pidEo.getFlowType(),FlowTypeEnum.QDQR.getValue())
|
||||
&& StringUtils.equals(pidEo.getTaskDefinitionKey(),InventoryAffirmNodeEnum.REGULATION_OWNER_AUDIT.getKey())
|
||||
&& StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(qdqrPidEoList)) {
|
||||
qdqrPidEoList.forEach(qdqrPidEo -> {
|
||||
qdqrPidEo.setUserId(projectLawsInventoryEO.getRegulationOwnerId());
|
||||
});
|
||||
this.processInfoDetailEOService.updateBatchById(qdqrPidEoList);
|
||||
}
|
||||
|
||||
List<String> taskIdList = new ArrayList<>();
|
||||
|
||||
// 过滤出来,设计符合性流程,并且是法规工程师审核节点的数据,转办给新的法规工程师
|
||||
List<ProcessInfoDetailEO> designFlowPidEoList = pidEoList.stream().filter(pidEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pidEo.getFlowType(),FlowTypeEnum.SJFHXSHLC.getValue())
|
||||
&& StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.FGGCSSH.getValue())
|
||||
&& StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(designFlowPidEoList)) {
|
||||
designFlowPidEoList.forEach(qdqrPidEo -> {
|
||||
qdqrPidEo.setUserId(projectLawsInventoryEO.getRegulationOwnerId());
|
||||
});
|
||||
this.processInfoDetailEOService.updateBatchById(designFlowPidEoList);
|
||||
|
||||
taskIdList.addAll(designFlowPidEoList.stream().map(ProcessInfoDetailEO::getTaskId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
// 过滤出来,验证符合性流程,并且是法规工程师审核节点的数据,转办给新的法规工程师
|
||||
List<ProcessInfoDetailEO> verifyFlowPidEoList = pidEoList.stream().filter(pidEo -> {
|
||||
boolean flag = (
|
||||
StringUtils.equals(pidEo.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())
|
||||
&& StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.FGGCSSH.getValue())
|
||||
&& StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue())
|
||||
);
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(verifyFlowPidEoList)) {
|
||||
verifyFlowPidEoList.forEach(qdqrPidEo -> {
|
||||
qdqrPidEo.setUserId(projectLawsInventoryEO.getRegulationOwnerId());
|
||||
});
|
||||
this.processInfoDetailEOService.updateBatchById(verifyFlowPidEoList);
|
||||
|
||||
taskIdList.addAll(verifyFlowPidEoList.stream().map(ProcessInfoDetailEO::getTaskId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(taskIdList)) {
|
||||
String taskIds = String.join(",", taskIdList);
|
||||
// 更新流程服务办理人
|
||||
this.workFlowFeignClient.changeAssigneeBatch(taskIds,projectLawsInventoryEO.getRegulationOwnerId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if((projectLawsInventoryOld.getDesignDueDate() != null && projectLawsInventoryEO.getDesignDueDate() != null) && toBeCheckedFlag){
|
||||
|
||||
+7
@@ -205,4 +205,11 @@ public interface WorkFlowFeignClient {
|
||||
|
||||
@RequestMapping(value = "/bat-wkflow/task/getTaskConfirmAskedEngineer",method = RequestMethod.GET)
|
||||
Set<String> getTaskConfirmAskedEngineer(@RequestParam("projectLawInventoryId")String projectLawInventoryId);
|
||||
|
||||
/**
|
||||
* 批量改派任务
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/bat-wkflow/changeAssigneeBatch",method = RequestMethod.GET)
|
||||
Result<String> changeAssigneeBatch(@RequestParam("taskIds") String taskIds,@RequestParam("newAssignee") String newAssignee);
|
||||
}
|
||||
|
||||
+9
@@ -212,4 +212,13 @@ public class WorkFlowFeignClientImpl{
|
||||
public Result dispostHistoryBusProcessNewData() {
|
||||
return workFlowFeignClient.dispostHistoryBusProcessNewData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量改派任务
|
||||
* @return
|
||||
*/
|
||||
public Result<String> changeAssigneeBatch(@RequestParam("taskIds") String taskIds,@RequestParam("newAssignee") String newAssignee){
|
||||
Result<String> run = workFlowFeignClient.changeAssigneeBatch(taskIds,newAssignee);
|
||||
return run;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user