feat: 企标立项变更发起流程接口
This commit is contained in:
@@ -14,8 +14,11 @@ public enum ProcessTypeEnum {
|
||||
/**
|
||||
* A
|
||||
*/
|
||||
//TODO 企标制修订的implClass不对
|
||||
A("企标制修订流程", 1, "com.jero.modules.activiti.process.esInitChange.service.impl.ProcessEsInitChangeServiceImpl"),
|
||||
B("企标立项变更流程",2, "com.jero.modules.activiti.process.esInitChange.service.impl.ProcessEsInitChangeServiceImpl"),
|
||||
C("年度制修订-各部门主动上报",3, "com.jero.modules.activiti.process.esAnnualReport.service.impl.ProcessEsAnnualReportChangeServiceImpl"),
|
||||
D("年度制修订-标准化发起",4, "com.jero.modules.activiti.process.esAnnualInit.service.impl.ProcessEsAnnualInitServiceImpl"),
|
||||
;
|
||||
|
||||
private String name;
|
||||
|
||||
-13
@@ -90,17 +90,4 @@ public class ProcessCenterController {
|
||||
public Result<?> draftList(@Valid CenterQueryVO centerQueryVO) {
|
||||
return Result.OK(draftService.getDraftList(centerQueryVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 办理
|
||||
* @param processInstanceId
|
||||
*/
|
||||
@AutoLog(value = "流程中心-办理")
|
||||
@ApiOperation(value="流程中心-办理", notes="流程中心-办理")
|
||||
@GetMapping("/handle")
|
||||
@Translation
|
||||
public Result<?> handle(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
return Result.OK(actFlowCommonService.handleTask(processInstanceId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.jero.modules.activiti.process.common.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/10/26 7:46
|
||||
*/
|
||||
@Data
|
||||
public class CommonVO {
|
||||
|
||||
String taskId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
String commitText;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
String commitFile;
|
||||
|
||||
/**
|
||||
* 同意驳回标识
|
||||
*/
|
||||
Integer commitFlag;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
String prcName;
|
||||
|
||||
/**
|
||||
* 截止日期
|
||||
*/
|
||||
Date dueTime;
|
||||
|
||||
/**
|
||||
* 流程描述
|
||||
*/
|
||||
String prcMes;
|
||||
}
|
||||
+1
-11
@@ -46,20 +46,10 @@ public class ProcessDraft implements Serializable {
|
||||
*/
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 草稿Id
|
||||
*/
|
||||
private String draftId;
|
||||
|
||||
/**
|
||||
* 实体类Id
|
||||
*/
|
||||
private String businessId;
|
||||
|
||||
/**
|
||||
* 流程类型
|
||||
*/
|
||||
private String processKey;
|
||||
private String prcName;
|
||||
|
||||
/**
|
||||
* 流程实例id
|
||||
|
||||
+2
-23
@@ -5,6 +5,7 @@ import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.activiti.process.common.entity.CenterQueryVO;
|
||||
import com.jero.modules.activiti.process.common.enums.ProcessType;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.vo.InitChangeDataVO;
|
||||
import com.jero.modules.activiti.util.SpringContextUtil;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -43,17 +44,13 @@ public class ActFlowCommonService {
|
||||
/**
|
||||
* 启动流程实例
|
||||
*/
|
||||
public ProcessInstance startProcess(String processDefinitionKey, String beanName, String businessId) {
|
||||
public ProcessInstance startProcess(String processDefinitionKey, InitChangeDataVO initChangeData, Map<String, Object> variables) {
|
||||
ProcessDefinition latestProcessDefinition = repositoryService.createProcessDefinitionQuery()
|
||||
.processDefinitionKey(processDefinitionKey)
|
||||
.orderByProcessDefinitionVersion().desc()
|
||||
.list()
|
||||
.get(0); // 获取最新版本的流程定义
|
||||
|
||||
IActFlowCustomService customService = (IActFlowCustomService) SpringContextUtil.getBean(beanName);
|
||||
// 修改业务的状态
|
||||
// customService.startRunTask(businessId);
|
||||
Map<String, Object> variables = customService.setVariables(businessId);
|
||||
// 第一个节点默认通过
|
||||
variables.put("pass", true);
|
||||
// 启动流程
|
||||
@@ -202,24 +199,6 @@ public class ActFlowCommonService {
|
||||
return processDefinition.getKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* 办理任务
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
public Object handleTask(String processInstanceId) {
|
||||
String processKey = getProcessKeyByInstanceId(processInstanceId);
|
||||
Object result = null;
|
||||
switch (processKey) {
|
||||
case "es-init-change":
|
||||
IActFlowCustomService service = (IActFlowCustomService) SpringContextUtil.getBean(ProcessType.ES_INIT_CHANGE.getServiceClassName());
|
||||
result = service.getHandleData(processInstanceId);
|
||||
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void autoCompleteFirstTask(String userId, String processInstanceId, String processDefinitionId) {
|
||||
// 自动完成第一个任务
|
||||
List<Map<String, Object>> taskList = this.myTaskList(userId);
|
||||
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
package com.jero.modules.activiti.process.common.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 业务service 的接口 必须实现接口 实现其方法
|
||||
*/
|
||||
public interface IActFlowCustomService {
|
||||
|
||||
|
||||
/**
|
||||
* 设置流程变量
|
||||
* @param processInstanceId
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> setVariables(String processInstanceId);
|
||||
|
||||
|
||||
/**
|
||||
* 整个流程开始时需要执行的任务
|
||||
* @param id
|
||||
*/
|
||||
void startRunTask(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 整个流程结束需要执行的任务
|
||||
* @param id
|
||||
*/
|
||||
void endRunTask(String id);
|
||||
|
||||
/**
|
||||
* 获取办理数据
|
||||
* @param id
|
||||
*/
|
||||
Object getHandleData(String id);
|
||||
}
|
||||
+1
-24
@@ -9,7 +9,6 @@ import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.SysDictItemCore;
|
||||
import com.jero.modules.activiti.process.common.enums.ProcessType;
|
||||
import com.jero.modules.activiti.process.common.service.ActFlowCommonService;
|
||||
import com.jero.modules.activiti.process.common.service.IActFlowCustomService;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.entity.ProcessEsAnnualReport;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.mapper.ProcessEsAnnualReportMapper;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.service.ProcessEsAnnualReportService;
|
||||
@@ -45,7 +44,7 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnualReportMapper, ProcessEsAnnualReport>
|
||||
implements ProcessEsAnnualReportService, IActFlowCustomService {
|
||||
implements ProcessEsAnnualReportService {
|
||||
|
||||
@Resource
|
||||
private CommonAPI commonAPI;
|
||||
@@ -68,28 +67,6 @@ public class ProcessEsAnnualReportServiceImpl extends ServiceImpl<ProcessEsAnnua
|
||||
@Resource
|
||||
private TaskService taskService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> setVariables(String processInstanceId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startRunTask(String id) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endRunTask(String id) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getHandleData(String id) {
|
||||
// 根据当前task定义判断返回数据
|
||||
String userId = UserUtils.getUserId();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startProcess() {
|
||||
String userId = UserUtils.getUserId();
|
||||
|
||||
+17
-13
@@ -4,6 +4,7 @@ import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.activiti.process.common.entity.TransferVO;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.vo.InitChangeDataVO;
|
||||
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
||||
import com.jero.modules.laws.common.constant.FieldCommon;
|
||||
import com.jero.modules.laws.enterprise.entity.dto.ESPlanQueryDTO;
|
||||
@@ -37,6 +38,19 @@ public class ProcessESInitChangeController {
|
||||
@Resource
|
||||
private EnterpriseStandardPlanService espService;
|
||||
|
||||
/**
|
||||
* 新增立项变更申请
|
||||
*
|
||||
* @param initChangeData
|
||||
*/
|
||||
@AutoLog(value = "企标立项变更流程-发起立项变更申请")
|
||||
@ApiOperation(value="企标立项变更流程-发起立项变更申请", notes="企标立项变更流程-发起立项变更申请")
|
||||
@PostMapping("/start")
|
||||
public Result<?> startInitChange(@RequestBody InitChangeDataVO initChangeData) {
|
||||
initChangeService.startInitChange(initChangeData);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成企标编号并返回
|
||||
* @param esInitChange
|
||||
@@ -64,23 +78,11 @@ public class ProcessESInitChangeController {
|
||||
@PostMapping("/save")
|
||||
public Result<?> save(@RequestParam(value = "taskId", required = false) String taskId,
|
||||
@RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
||||
// TODO 按照Demo重写
|
||||
initChangeService.saveToDraft(taskId, esInitChangeList);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增立项变更申请
|
||||
*
|
||||
* @param esInitChangeList
|
||||
*/
|
||||
@AutoLog(value = "企标立项变更流程-发起立项变更申请")
|
||||
@ApiOperation(value="企标立项变更流程-发起立项变更申请", notes="企标立项变更流程-发起立项变更申请")
|
||||
@PostMapping("/start")
|
||||
public Result<?> startInitChange(@RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
||||
initChangeService.startInitChange(esInitChangeList);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 同意
|
||||
@@ -92,6 +94,7 @@ public class ProcessESInitChangeController {
|
||||
@ApiOperation(value="企标立项变更流程-同意", notes="企标立项变更流程-同意")
|
||||
@PostMapping("/agree")
|
||||
public Result<?> agree(@RequestParam("taskId") String taskId, @RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
||||
// TODO 重写
|
||||
initChangeService.approvalInitChange(taskId, esInitChangeList, true);
|
||||
return Result.OK();
|
||||
}
|
||||
@@ -106,6 +109,7 @@ public class ProcessESInitChangeController {
|
||||
@ApiOperation(value="企标立项变更流程-驳回", notes="企标立项变更流程-驳回")
|
||||
@PostMapping("/reject")
|
||||
public Result<?> reject(@RequestParam("taskId") String taskId, @RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
||||
// TODO 重写
|
||||
initChangeService.approvalInitChange(taskId, esInitChangeList, false);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
+12
-1
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.activiti.process.esInitChange.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -9,36 +10,46 @@ import lombok.Data;
|
||||
@Data
|
||||
public class FlowUserInfoVO {
|
||||
|
||||
// 主起草人
|
||||
@ApiModelProperty("主起草人")
|
||||
private String mainDraftUser;
|
||||
|
||||
// 部所联络人
|
||||
@ApiModelProperty("部所联络人")
|
||||
private String contactUser;
|
||||
|
||||
// 标准专家
|
||||
@ApiModelProperty("标准专家")
|
||||
private String standardExpert;
|
||||
|
||||
// 主起草人主管级领导
|
||||
@ApiModelProperty("主起草人主管级领导")
|
||||
private String mainDraftUserLeader;
|
||||
|
||||
// 主起草人主管级领导上级领导
|
||||
@ApiModelProperty("主起草人主管级领导上级领导")
|
||||
private String mainDraftUserLeaderLeader;
|
||||
|
||||
// 标准化审批人
|
||||
@ApiModelProperty("标准化审批人")
|
||||
private String standardizationApprovalUser;
|
||||
|
||||
// 新起草部门主管级领导上级领导
|
||||
@ApiModelProperty("新起草部门主管级领导上级领导")
|
||||
private String newMainDraftUserLeaderLeader;
|
||||
|
||||
// 新起草部门主管级领导
|
||||
@ApiModelProperty("新起草部门主管级领导")
|
||||
private String newMainDraftUserLeader;
|
||||
|
||||
// 相关人员
|
||||
@ApiModelProperty("相关人员")
|
||||
private String relatedUser;
|
||||
|
||||
// 抄送人
|
||||
@ApiModelProperty("抄送人")
|
||||
private String copyUser;
|
||||
|
||||
// 创建人
|
||||
@ApiModelProperty("创建人")
|
||||
private String createUser;
|
||||
}
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.jero.modules.activiti.process.esInitChange.entity.vo;
|
||||
|
||||
import com.jero.modules.activiti.process.common.entity.CommonVO;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/10/26 8:13
|
||||
*/
|
||||
@Data
|
||||
public class InitChangeDataVO {
|
||||
|
||||
CommonVO commonVO;
|
||||
|
||||
List<ProcessEsInitChange> dataList;
|
||||
|
||||
FlowUserInfoVO flowUserInfoVO;
|
||||
}
|
||||
+3
-2
@@ -2,6 +2,7 @@ package com.jero.modules.activiti.process.esInitChange.service;
|
||||
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.vo.InitChangeDataVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,10 +15,10 @@ public interface ProcessEsInitChangeService extends IService<ProcessEsInitChange
|
||||
|
||||
/**
|
||||
* 新增记录
|
||||
* @param esInitChange
|
||||
* @param initChangeData
|
||||
* @return
|
||||
*/
|
||||
void startInitChange(List<ProcessEsInitChange> esInitChange);
|
||||
void startInitChange(InitChangeDataVO initChangeData);
|
||||
|
||||
/**
|
||||
* 转办
|
||||
|
||||
+86
-91
@@ -5,21 +5,19 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.activiti.process.common.entity.ProcessDraft;
|
||||
import com.jero.modules.activiti.entity.ProcessAll;
|
||||
import com.jero.modules.activiti.process.common.enums.ProcessType;
|
||||
import com.jero.modules.activiti.process.common.service.ActFlowCommonService;
|
||||
import com.jero.modules.activiti.process.common.service.IActFlowCustomService;
|
||||
import com.jero.modules.activiti.process.common.service.ProcessDraftService;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.vo.FlowUserInfoVO;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.vo.InitChangeDataVO;
|
||||
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
||||
import com.jero.modules.activiti.process.esInitChange.mapper.ProcessEsInitChangeMapper;
|
||||
import com.jero.modules.activiti.service.ProcessAllService;
|
||||
import com.jero.modules.laws.enterprise.service.ESSequenceNumberProvider;
|
||||
import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysDepartService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -39,7 +37,10 @@ import java.util.stream.Collectors;
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
@Slf4j
|
||||
public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitChangeMapper, ProcessEsInitChange>
|
||||
implements ProcessEsInitChangeService, IActFlowCustomService, ESSequenceNumberProvider {
|
||||
implements ProcessEsInitChangeService, ESSequenceNumberProvider {
|
||||
|
||||
@Resource
|
||||
private ProcessAllService processAllService;
|
||||
|
||||
@Resource
|
||||
private ProcessDraftService processDraftService;
|
||||
@@ -50,84 +51,69 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
@Resource
|
||||
private EnterpriseStandardUtil esUtil;
|
||||
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Resource
|
||||
private ISysDepartService sysDepartService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> setVariables(String id) {
|
||||
ProcessEsInitChange initChange = getById(id);
|
||||
// 设置流程中各个节点的人
|
||||
return this.setVariables(initChange);
|
||||
}
|
||||
|
||||
private Map<String, Object> setVariables(ProcessEsInitChange initChange) {
|
||||
public Map<String, Object> setVariables(InitChangeDataVO initChangeData) {
|
||||
FlowUserInfoVO flowUserInfoVO = initChangeData.getFlowUserInfoVO();
|
||||
ProcessEsInitChange initChange = initChangeData.getDataList().get(0);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 设置流程中各个节点的人
|
||||
map.put("createUser", UserUtils.getUserIdByUserName(initChange.getCreateBy()));
|
||||
map.put("contactUser", initChange.getContactUser());
|
||||
map.put("standardExpertList", Optional.ofNullable(initChange.getStandardExpert()).map(s -> Arrays.asList(s.split(","))).orElse(Collections.emptyList()));
|
||||
map.put("mainDraftUserLeader", initChange.getMainDraftUserLeader());
|
||||
map.put("mainDraftUserLeaderLeader", initChange.getMainDraftUserLeaderLeader());
|
||||
map.put("standardizationApprovalUser", initChange.getStandardizationApprovalUser());
|
||||
map.put("newMainDraftUserLeaderLeader", initChange.getNewMainDraftUserLeaderLeader());
|
||||
map.put("newMainDraftUserLeader", initChange.getNewMainDraftUserLeader());
|
||||
map.put("relatedUserList", Optional.ofNullable(initChange.getRelatedUser()).map(s -> Arrays.asList(s.split(","))).orElse(Collections.emptyList()));
|
||||
map.put("copyUser", initChange.getCopyUser());
|
||||
map.put("createUser", UserUtils.getUserIdByUserName(flowUserInfoVO.getCreateUser()));
|
||||
map.put("contactUser", flowUserInfoVO.getContactUser());
|
||||
map.put("standardExpertList", Optional.ofNullable(flowUserInfoVO.getStandardExpert()).map(s -> Arrays.asList(s.split(","))).orElse(Collections.emptyList()));
|
||||
map.put("mainDraftUserLeader", flowUserInfoVO.getMainDraftUserLeader());
|
||||
map.put("mainDraftUserLeaderLeader", flowUserInfoVO.getMainDraftUserLeaderLeader());
|
||||
map.put("standardizationApprovalUser", flowUserInfoVO.getStandardizationApprovalUser());
|
||||
map.put("newMainDraftUserLeaderLeader", flowUserInfoVO.getNewMainDraftUserLeaderLeader());
|
||||
map.put("newMainDraftUserLeader", flowUserInfoVO.getNewMainDraftUserLeader());
|
||||
map.put("relatedUserList", Optional.ofNullable(flowUserInfoVO.getRelatedUser()).map(s -> Arrays.asList(s.split(","))).orElse(Collections.emptyList()));
|
||||
map.put("copyUser", flowUserInfoVO.getCopyUser());
|
||||
// 设置流程分支判断变量
|
||||
map.put("applicationCategory", initChange.getApplicationCategory());
|
||||
map.put("projectType", initChange.getProjectType());
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startRunTask(String id) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endRunTask(String id) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getHandleData(String processInstanceId) {
|
||||
LambdaQueryWrapper<ProcessEsInitChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
||||
lambdaQueryWrapper.eq(ProcessEsInitChange::getDelFlag, YesOrNoEnum.NO.getValue());
|
||||
return list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startInitChange(List<ProcessEsInitChange> esInitChangeList) {
|
||||
public void startRunTask(InitChangeDataVO initChangeData) {
|
||||
List<ProcessEsInitChange> esInitChangeList = initChangeData.getDataList();
|
||||
// 校验企标编号是否冲突
|
||||
if (!esUtil.verifyEnStandardNumber(esInitChangeList.get(0).getOriginEnStandardNo())) {
|
||||
throw new JeroBootException("企标编号冲突,请重新生成");
|
||||
}
|
||||
}
|
||||
|
||||
public InitChangeDataVO getHandleData(String processInstanceId) {
|
||||
// TODO 获取流程实例数据
|
||||
// LambdaQueryWrapper<ProcessEsInitChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// lambdaQueryWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
||||
// lambdaQueryWrapper.eq(ProcessEsInitChange::getDelFlag, YesOrNoEnum.NO.getValue());
|
||||
// return list(lambdaQueryWrapper);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startInitChange(InitChangeDataVO initChangeData) {
|
||||
this.startRunTask(initChangeData);
|
||||
|
||||
// 流程Key
|
||||
String processDefinitionKey = ProcessType.ES_INIT_CHANGE.getProcessKey();
|
||||
String userId = UserUtils.getUserId();
|
||||
// 保存到业务流程表
|
||||
saveBatch(esInitChangeList);
|
||||
ProcessEsInitChange initChange = esInitChangeList.get(0);
|
||||
List<ProcessEsInitChange> esInitChangeList = initChangeData.getDataList();
|
||||
|
||||
// 对数据进行其他操作
|
||||
String beanName = ProcessType.ES_INIT_CHANGE.getServiceClassName();
|
||||
|
||||
ProcessInstance processInstance = actFlowCommonService.startProcess(processDefinitionKey, beanName, initChange.getId());
|
||||
// 设置流程变量
|
||||
Map<String, Object> variables = setVariables(initChangeData);
|
||||
// 启动流程
|
||||
ProcessInstance processInstance = actFlowCommonService.startProcess(processDefinitionKey, initChangeData, variables);
|
||||
|
||||
// 获取流程实例ID
|
||||
String processDefinitionId = processInstance.getProcessDefinitionId();
|
||||
String processInstanceId = processInstance.getId();
|
||||
log.info("启动流程实例成功,流程定义ID为:{}", processDefinitionId);
|
||||
|
||||
// 完成第一个任务
|
||||
List<Map<String, Object>> taskList = actFlowCommonService.myTaskList(userId);
|
||||
if (!CollectionUtils.isEmpty(taskList)) {
|
||||
for (Map<String, Object> map : taskList) {
|
||||
if (map.get("assignee").toString().equals(userId) &&
|
||||
map.get("processDefinitionId").toString().equals(processDefinitionId) &&
|
||||
map.get("processInstanceId").toString().equals(processInstance.getId())) { // 添加这一行来进行更精确的匹配
|
||||
map.get("processInstanceId").toString().equals(processInstanceId)) { // 添加这一行来进行更精确的匹配
|
||||
|
||||
log.info("当前用户ID:{},相关联的流程定义ID:{}", userId, map.get("processDefinitionId").toString());
|
||||
log.info("匹配到的任务ID:{}", map.get("taskId").toString());
|
||||
@@ -141,8 +127,17 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
for (ProcessEsInitChange esInitChange : esInitChangeList) {
|
||||
esInitChange.setProcessInstanceId(processInstance.getId());
|
||||
}
|
||||
// 更新流程实例Id
|
||||
saveOrUpdateBatch(esInitChangeList);
|
||||
// 保存到业务流程表
|
||||
saveBatch(esInitChangeList);
|
||||
|
||||
// 根据流程实例id更新流程总表
|
||||
ProcessAll process = processAllService.getByProcessInstanceId(processInstanceId);
|
||||
process.setCreateUserId(UserUtils.getUserId());
|
||||
process.setPrcName(initChangeData.getCommonVO().getPrcName());
|
||||
process.setPrcMes(initChangeData.getCommonVO().getPrcMes());
|
||||
process.setDueTime(initChangeData.getCommonVO().getDueTime());
|
||||
process.setProjectId(esInitChangeList.get(0).getId());
|
||||
processAllService.updateById(process);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -152,40 +147,40 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
|
||||
@Override
|
||||
public void approvalInitChange(String taskId, List<ProcessEsInitChange> esInitChangeList, boolean pass) {
|
||||
String userId = UserUtils.getUserId();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (pass) {
|
||||
// 校验企标编号是否冲突
|
||||
if (!esUtil.verifyEnStandardNumber(esInitChangeList.get(0).getOriginEnStandardNo())) {
|
||||
throw new JeroBootException("企标编号冲突");
|
||||
}
|
||||
// 更新业务流程数据
|
||||
saveOrUpdateBatch(esInitChangeList);
|
||||
map = setVariables(esInitChangeList.get(0));
|
||||
}
|
||||
// 设置流程变量
|
||||
map.put("pass", pass);
|
||||
actFlowCommonService.completeTask(esInitChangeList.get(0).getRemarks(), taskId, userId, map);
|
||||
// TODO 保存流程审批信息
|
||||
// String userId = UserUtils.getUserId();
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
// if (pass) {
|
||||
// // 校验企标编号是否冲突
|
||||
// if (!esUtil.verifyEnStandardNumber(esInitChangeList.get(0).getOriginEnStandardNo())) {
|
||||
// throw new JeroBootException("企标编号冲突");
|
||||
// }
|
||||
// // 更新业务流程数据
|
||||
// saveOrUpdateBatch(esInitChangeList);
|
||||
// map = setVariables(esInitChangeList.get(0));
|
||||
// }
|
||||
// // 设置流程变量
|
||||
// map.put("pass", pass);
|
||||
// actFlowCommonService.completeTask(esInitChangeList.get(0).getRemarks(), taskId, userId, map);
|
||||
// // TODO 保存流程审批信息
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveToDraft(String taskId, List<ProcessEsInitChange> esInitChange) {
|
||||
saveOrUpdateBatch(esInitChange);
|
||||
// 先删后增
|
||||
LambdaUpdateWrapper<ProcessDraft> draftWrapper = new LambdaUpdateWrapper<>();
|
||||
draftWrapper.in(ProcessDraft::getBusinessId, esInitChange.stream().map(ProcessEsInitChange::getId).collect(Collectors.toList()));
|
||||
processDraftService.remove(draftWrapper);
|
||||
List<ProcessDraft> draftList = new ArrayList<>();
|
||||
for (ProcessEsInitChange esInitChangeItem : esInitChange) {
|
||||
ProcessDraft draft = new ProcessDraft();
|
||||
draft.setDraftId(UUID.randomUUID().toString());
|
||||
draft.setBusinessId(esInitChangeItem.getId());
|
||||
draft.setProcessKey(ProcessType.ES_INIT_CHANGE.getProcessKey());
|
||||
draftList.add(draft);
|
||||
}
|
||||
processDraftService.saveBatch(draftList);
|
||||
// saveOrUpdateBatch(esInitChange);
|
||||
// // 先删后增
|
||||
// LambdaUpdateWrapper<ProcessDraft> draftWrapper = new LambdaUpdateWrapper<>();
|
||||
// draftWrapper.in(ProcessDraft::getBusinessId, esInitChange.stream().map(ProcessEsInitChange::getId).collect(Collectors.toList()));
|
||||
// processDraftService.remove(draftWrapper);
|
||||
// List<ProcessDraft> draftList = new ArrayList<>();
|
||||
// for (ProcessEsInitChange esInitChangeItem : esInitChange) {
|
||||
// ProcessDraft draft = new ProcessDraft();
|
||||
// draft.setDraftId(UUID.randomUUID().toString());
|
||||
// draft.setBusinessId(esInitChangeItem.getId());
|
||||
// draft.setProcessKey(ProcessType.ES_INIT_CHANGE.getProcessKey());
|
||||
// draftList.add(draft);
|
||||
// }
|
||||
// processDraftService.saveBatch(draftList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user