update 标准征求意见流程表-发起流程

This commit is contained in:
liao
2023-11-10 10:58:57 +08:00
parent 07e2725429
commit 959b765e9a
3 changed files with 29 additions and 5 deletions
@@ -37,10 +37,10 @@ public class ProcessFbConsultationUserLink implements Serializable {
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键ID")
private java.lang.String id;
/**标准征求意见流程表id*/
@Excel(name = "标准征求意见流程表id", width = 15)
@ApiModelProperty(value = "标准征求意见流程表id")
private java.lang.String standardConsultationId;
/**业务id*/
@Excel(name = "业务id", width = 15)
@ApiModelProperty(value = "业务id")
private java.lang.String businessId;
/**部门主管级领导*/
@Excel(name = "部门主管级领导", width = 15)
@ApiModelProperty(value = "部门主管级领导")
@@ -3,7 +3,7 @@
<mapper namespace="com.jero.modules.activiti.process.fb.mapper.ProcessFbConsultationUserLinkMapper">
<resultMap id="ProcessFbConsultationUserLinkResultMap" type="com.jero.modules.activiti.process.fb.entity.ProcessFbConsultationUserLink">
<id column="id" property="id" />
<result column="standard_consultation_id" property="standardConsultationId" />
<result column="business_id" property="businessId" />
<result column="depart_leader_id" property="departLeaderId" />
<result column="module_owner_id" property="moduleOwnerId" />
<result column="design_engineer_id" property="designEngineerId" />
@@ -1,22 +1,29 @@
package com.jero.modules.activiti.process.fb.service.impl;
import com.jero.common.api.vo.ResultCommon;
import com.jero.common.util.UUIDUtils;
import com.jero.modules.activiti.enums.ProcessTypeEnum;
import com.jero.modules.activiti.process.fb.common.ProcessDefinitionKey;
import com.jero.modules.activiti.process.fb.dto.BasicProcessInfoDTO;
import com.jero.modules.activiti.process.fb.entity.ProcessFbConsultationUserLink;
import com.jero.modules.activiti.process.fb.entity.ProcessFbStandardConsultation;
import com.jero.modules.activiti.process.fb.mapper.ProcessFbStandardConsultationMapper;
import com.jero.modules.activiti.process.fb.service.IProcessFbConsultationUserLinkService;
import com.jero.modules.activiti.process.fb.service.IProcessFbStandardConsultationService;
import com.jero.modules.activiti.process.fb.service.IProcessHandleService;
import com.jero.modules.activiti.process.fb.vo.ProcessFbStandardConsultationVO;
import com.jero.modules.activiti.process.fb.vo.ProcessInfoVO;
import com.jero.modules.laws.common.util.CurrentUserUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jero.common.exception.JeroBootException;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -32,6 +39,8 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
@Resource
private IProcessHandleService processHandleService;
@Resource
private IProcessFbConsultationUserLinkService processFbConsultationUserLinkService;
/**
* @Author: liao
@@ -46,11 +55,26 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl<Proces
processInfoVO.setBusinessId(businessInfoDTO.getId());
Map<String, Object> userInfoMap = processInfoVO.getUserInfoMap(); // 用户变量map
String departLeaders = (String) userInfoMap.get("departLeaderList");
if (StringUtils.isBlank(departLeaders)) {
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "departLeaderList");
}
userInfoMap.put("engineer", CurrentUserUtil.getId()); // 第一个任务节点设置成自己
BasicProcessInfoDTO basicProcessInfoDTO = processInfoVO.getBasicProcessInfoDTO();
basicProcessInfoDTO.setProcessDefinitionId(processHandleService.getDefinitionIdByKey(ProcessDefinitionKey.FB_STANDARD_CONSULTATION)); // 流程定义id
basicProcessInfoDTO.setProcessName(businessInfoDTO.getStandardNumber() + "-" + businessInfoDTO.getStandardName() + "-" + "征求意见"); // 流程名称
basicProcessInfoDTO.setProcessType(ProcessTypeEnum.FB_STANDARD_CONSULTATION.getValue()); // 流程类型
processHandleService.startProcess(processInfoVO);
// 把各部所主管级领导数据存入关联人员表
List<String> departLeaderList = Arrays.asList(departLeaders.split(","));
List<ProcessFbConsultationUserLink> linkList = new ArrayList<>();
departLeaderList.forEach(departLeader -> {
ProcessFbConsultationUserLink link = new ProcessFbConsultationUserLink();
link.setBusinessId(processInfoVO.getBusinessId());
link.setDepartLeaderId(departLeader);
linkList.add(link);
});
processFbConsultationUserLinkService.saveBatch(linkList, linkList.size());
}
}