update 法规合规评估流程

This commit is contained in:
lijiarao
2024-01-19 18:37:13 +08:00
parent 1142d59cc9
commit 539d4f0e02
3 changed files with 61 additions and 19 deletions
@@ -16,6 +16,8 @@ public interface ProcessProjectStandardTermMapper extends BaseMapper<ProcessProj
List<ProcessProjectStandardTerm> getByModuleOwner(@Param("processId") String processId, @Param("originUserId") String originUserId, @Param("executionParentId") String executionParentId, @Param("hasDesignEngineer") Boolean hasDesignEngineer); List<ProcessProjectStandardTerm> getByModuleOwner(@Param("processId") String processId, @Param("originUserId") String originUserId, @Param("executionParentId") String executionParentId, @Param("hasDesignEngineer") Boolean hasDesignEngineer);
List<ProcessProjectStandardTerm> getByModuleOwnerAutoComplete(@Param("processId") String processId, @Param("originUserId") String originUserId, @Param("executionParentId") String executionParentId);
List<ProcessProjectStandardTerm> getByDesignEngineer(@Param("processId") String processId, @Param("originUserId") String originUserId, @Param("executionParentId") String executionParentId); List<ProcessProjectStandardTerm> getByDesignEngineer(@Param("processId") String processId, @Param("originUserId") String originUserId, @Param("executionParentId") String executionParentId);
List<ProcessProjectStandardTerm> getByStandardsEngineer(@Param("processId") String processId); List<ProcessProjectStandardTerm> getByStandardsEngineer(@Param("processId") String processId);
@@ -82,6 +82,26 @@
and ppstu.id is not null and ppstu.id is not null
</select> </select>
<select id="getByModuleOwnerAutoComplete" resultMap="BaseResultMap">
select ppstu.id term_user_id,
ppstu.not_involved,
ppstu.assess_results,
ppstu.model_series,
ppstu.description,
ppstu.file_id,
ppstu.design_engineer,
<include refid="Base_Column_List">
<property name="alias" value="ppst"/>
</include>
from process_project_standard_term ppst
left join process_project_standard_term_user ppstu on ppst.id = ppstu.term_id
where ppst.process_id = #{processId}
and ppstu.module_owner = #{originUserId}
and ppstu.parent_execution_id = #{executionParentId}
and ppstu.design_engineer is not null
and ppstu.id is not null
</select>
<select id="getByDesignEngineer" resultMap="BaseResultMap"> <select id="getByDesignEngineer" resultMap="BaseResultMap">
select select
ppstu.id term_user_id, ppstu.id term_user_id,
@@ -14,7 +14,6 @@ import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.enums.YesOrNoEnum; import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.system.api.ISysBaseAPI; import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.DictModel; import com.jero.common.system.vo.DictModel;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.modules.activiti.entity.ProcessAll; import com.jero.modules.activiti.entity.ProcessAll;
@@ -167,7 +166,7 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
break; break;
//模块责任人审批 //模块责任人审批
case ProcessProjectStandardCommon.MKZRRSP_: case ProcessProjectStandardCommon.MKZRRSP_:
processProjectStandardTermList = termMapper.getByModuleOwner(processId, originUserId, executionParentId, false); processProjectStandardTermList = termMapper.getByModuleOwner(processId, originUserId, executionParentId, true);
wrapper.eq(ProcessProjectStandardTermUser::getModuleOwner, originUserId); wrapper.eq(ProcessProjectStandardTermUser::getModuleOwner, originUserId);
wrapper.eq(ProcessProjectStandardTermUser::getParentExecutionId, executionParentId); wrapper.eq(ProcessProjectStandardTermUser::getParentExecutionId, executionParentId);
termUserList = termUserService.list(wrapper); termUserList = termUserService.list(wrapper);
@@ -488,6 +487,10 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
wrapper.eq(ProcessProjectStandardTermUser::getProcessId,businessId); wrapper.eq(ProcessProjectStandardTermUser::getProcessId,businessId);
wrapper.eq(ProcessProjectStandardTermUser::getResponsibleUnitLeader,originUserId); wrapper.eq(ProcessProjectStandardTermUser::getResponsibleUnitLeader,originUserId);
List<ProcessProjectStandardTermUser> termUserList = termUserMapper.selectList(wrapper); List<ProcessProjectStandardTermUser> termUserList = termUserMapper.selectList(wrapper);
for (ProcessProjectStandardTermUser termUser : termUserList) {
termUser.setParentExecutionId(executionId);
}
termUserService.updateBatchById(termUserList);
//选择不涉及的模块责任人 //选择不涉及的模块责任人
List<String> notInvolvedModuleOwnerList = termUserList.stream() List<String> notInvolvedModuleOwnerList = termUserList.stream()
.filter(i -> StringUtils.isBlank(i.getDesignEngineer())) .filter(i -> StringUtils.isBlank(i.getDesignEngineer()))
@@ -531,7 +534,6 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
List<ProcessProjectStandardTerm> termList = businessInfoDTO.getProcessProjectStandardTermList(); List<ProcessProjectStandardTerm> termList = businessInfoDTO.getProcessProjectStandardTermList();
List<String> carbonCopyPersonnelList = new ArrayList<>(); List<String> carbonCopyPersonnelList = new ArrayList<>();
List<ProcessProjectStandardTerm> updateTermList = new ArrayList<>(); List<ProcessProjectStandardTerm> updateTermList = new ArrayList<>();
List<String> designEngineerList = new ArrayList<>();
Date date = new Date(); Date date = new Date();
for (ProcessProjectStandardTerm term : termList) { for (ProcessProjectStandardTerm term : termList) {
ProcessProjectStandardTerm term1 = new ProcessProjectStandardTerm(); ProcessProjectStandardTerm term1 = new ProcessProjectStandardTerm();
@@ -541,7 +543,9 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
term1.setId(termId); term1.setId(termId);
term1.setAssessResults(assessResults); term1.setAssessResults(assessResults);
term1.setDescription(designEngineer); term1.setDescription(designEngineer);
designEngineerList.add(designEngineer); if (!pass){
continue;
}
updateTermList.add(term1); updateTermList.add(term1);
carbonCopyPersonnelList.addAll(Arrays.asList(term.getCarbonCopyPersonnels().split(","))); carbonCopyPersonnelList.addAll(Arrays.asList(term.getCarbonCopyPersonnels().split(",")));
@@ -575,25 +579,41 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
lawsSpecialProjectLibraryService.save(projectLibrary); lawsSpecialProjectLibraryService.save(projectLibrary);
} }
//更新数据 //更新数据
termService.updateBatchById(updateTermList); if (pass){
termService.updateBatchById(updateTermList);
}
// 完成任务 // 完成任务
String taskId = processDTO.getTaskId(); String taskId = processDTO.getTaskId();
Map<String, Object> variables = new HashMap<>(); Map<String, Object> variables = new HashMap<>();
variables.put(ProcessProjectStandardCommon.PASS, pass); variables.put(ProcessProjectStandardCommon.PASS, pass);
variables.put(ProcessProjectStandardCommon.DESIGN_ENGINEER_LIST, designEngineerList); if (!pass){
variables.put(ProcessProjectStandardCommon.DESIGN_ENGINEER_LIST_SIZE, designEngineerList.size()); LambdaQueryWrapper<ProcessProjectStandardTermUser> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(ProcessProjectStandardTermUser::getProcessId, businessId);
wrapper1.isNotNull(ProcessProjectStandardTermUser::getResponsibleUnitLeader);
List<ProcessProjectStandardTermUser> termUserList = termUserService.list(wrapper1);
List<String> designEngineerList = termUserList.stream()
.map(ProcessProjectStandardTermUser::getResponsibleUnitLeader)
.distinct()
.collect(Collectors.toList());
variables.put(ProcessProjectStandardCommon.DESIGN_ENGINEER_LIST, designEngineerList);
variables.put(ProcessProjectStandardCommon.DESIGN_ENGINEER_LIST_SIZE, designEngineerList.size());
}
taskService.complete(taskId, variables); taskService.complete(taskId, variables);
//发送消息 if (pass){
String carbonCopyPersonnels = carbonCopyPersonnelList.stream().distinct().collect(Collectors.joining(",")); //发送消息
SendMessageDTO sendMessageDTO = new SendMessageDTO(); String carbonCopyPersonnels = carbonCopyPersonnelList.stream().distinct().collect(Collectors.joining(","));
sendMessageDTO.setTemplateCode(MessageTemplateCodeCommon.PROJECT_STANDARD_COMPLETE); SendMessageDTO sendMessageDTO = new SendMessageDTO();
sendMessageDTO.setToUserId(carbonCopyPersonnels); sendMessageDTO.setTemplateCode(MessageTemplateCodeCommon.PROJECT_STANDARD_COMPLETE);
Map<String, String> sendMap = new HashMap<>(); sendMessageDTO.setToUserId(carbonCopyPersonnels);
sendMap.put("prcName", process.getPrcName()); Map<String, String> sendMap = new HashMap<>();
sendMap.put("termNumber", process.getPrcName()); sendMap.put("prcName", process.getPrcName());
sendMap.put("termName", process.getPrcName()); sendMap.put("termNumber", process.getPrcName());
sendMessageDTO.setMap(sendMap); sendMap.put("termName", process.getPrcName());
sendMessageAPI.sendMessage(sendMessageDTO); sendMessageDTO.setMap(sendMap);
sendMessageAPI.sendMessage(sendMessageDTO);
}
} }
//部所主管级领导下发 //部所主管级领导下发
@@ -806,7 +826,7 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
String processInstanceId = delegateTask.getProcessInstanceId(); String processInstanceId = delegateTask.getProcessInstanceId();
ProcessAll processAll = processAllService.getByProcessInstanceId(processInstanceId); ProcessAll processAll = processAllService.getByProcessInstanceId(processInstanceId);
String projectId = processAll.getProjectId(); String projectId = processAll.getProjectId();
List<ProcessProjectStandardTerm> termList = termMapper.getByModuleOwner(projectId, assignee, executionParentId, true); List<ProcessProjectStandardTerm> termList = termMapper.getByModuleOwnerAutoComplete(projectId, assignee, executionParentId);
List<String> designEngineerIds = termList.stream() List<String> designEngineerIds = termList.stream()
.map(ProcessProjectStandardTerm::getDesignEngineer) .map(ProcessProjectStandardTerm::getDesignEngineer)
.distinct() .distinct()