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> 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> getByStandardsEngineer(@Param("processId") String processId);
@@ -82,6 +82,26 @@
and ppstu.id is not null
</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
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.exception.JeroBootException;
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.LoginUser;
import com.jero.modules.activiti.entity.ProcessAll;
@@ -167,7 +166,7 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
break;
//模块责任人审批
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::getParentExecutionId, executionParentId);
termUserList = termUserService.list(wrapper);
@@ -488,6 +487,10 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
wrapper.eq(ProcessProjectStandardTermUser::getProcessId,businessId);
wrapper.eq(ProcessProjectStandardTermUser::getResponsibleUnitLeader,originUserId);
List<ProcessProjectStandardTermUser> termUserList = termUserMapper.selectList(wrapper);
for (ProcessProjectStandardTermUser termUser : termUserList) {
termUser.setParentExecutionId(executionId);
}
termUserService.updateBatchById(termUserList);
//选择不涉及的模块责任人
List<String> notInvolvedModuleOwnerList = termUserList.stream()
.filter(i -> StringUtils.isBlank(i.getDesignEngineer()))
@@ -531,7 +534,6 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
List<ProcessProjectStandardTerm> termList = businessInfoDTO.getProcessProjectStandardTermList();
List<String> carbonCopyPersonnelList = new ArrayList<>();
List<ProcessProjectStandardTerm> updateTermList = new ArrayList<>();
List<String> designEngineerList = new ArrayList<>();
Date date = new Date();
for (ProcessProjectStandardTerm term : termList) {
ProcessProjectStandardTerm term1 = new ProcessProjectStandardTerm();
@@ -541,7 +543,9 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
term1.setId(termId);
term1.setAssessResults(assessResults);
term1.setDescription(designEngineer);
designEngineerList.add(designEngineer);
if (!pass){
continue;
}
updateTermList.add(term1);
carbonCopyPersonnelList.addAll(Arrays.asList(term.getCarbonCopyPersonnels().split(",")));
@@ -575,25 +579,41 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
lawsSpecialProjectLibraryService.save(projectLibrary);
}
//更新数据
termService.updateBatchById(updateTermList);
if (pass){
termService.updateBatchById(updateTermList);
}
// 完成任务
String taskId = processDTO.getTaskId();
Map<String, Object> variables = new HashMap<>();
variables.put(ProcessProjectStandardCommon.PASS, pass);
variables.put(ProcessProjectStandardCommon.DESIGN_ENGINEER_LIST, designEngineerList);
variables.put(ProcessProjectStandardCommon.DESIGN_ENGINEER_LIST_SIZE, designEngineerList.size());
if (!pass){
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);
//发送消息
String carbonCopyPersonnels = carbonCopyPersonnelList.stream().distinct().collect(Collectors.joining(","));
SendMessageDTO sendMessageDTO = new SendMessageDTO();
sendMessageDTO.setTemplateCode(MessageTemplateCodeCommon.PROJECT_STANDARD_COMPLETE);
sendMessageDTO.setToUserId(carbonCopyPersonnels);
Map<String, String> sendMap = new HashMap<>();
sendMap.put("prcName", process.getPrcName());
sendMap.put("termNumber", process.getPrcName());
sendMap.put("termName", process.getPrcName());
sendMessageDTO.setMap(sendMap);
sendMessageAPI.sendMessage(sendMessageDTO);
if (pass){
//发送消息
String carbonCopyPersonnels = carbonCopyPersonnelList.stream().distinct().collect(Collectors.joining(","));
SendMessageDTO sendMessageDTO = new SendMessageDTO();
sendMessageDTO.setTemplateCode(MessageTemplateCodeCommon.PROJECT_STANDARD_COMPLETE);
sendMessageDTO.setToUserId(carbonCopyPersonnels);
Map<String, String> sendMap = new HashMap<>();
sendMap.put("prcName", process.getPrcName());
sendMap.put("termNumber", process.getPrcName());
sendMap.put("termName", process.getPrcName());
sendMessageDTO.setMap(sendMap);
sendMessageAPI.sendMessage(sendMessageDTO);
}
}
//部所主管级领导下发
@@ -806,7 +826,7 @@ public class ProcessProjectStandardService extends ServiceImpl<ProcessProjectSta
String processInstanceId = delegateTask.getProcessInstanceId();
ProcessAll processAll = processAllService.getByProcessInstanceId(processInstanceId);
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()
.map(ProcessProjectStandardTerm::getDesignEngineer)
.distinct()