From e098d5f4145c861f0ff4917b903da9f9ae2277a2 Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Thu, 4 Jul 2024 15:50:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=A0=87=E5=87=86=E8=A7=A3=E8=AF=BB?= =?UTF-8?q?=E6=B5=81=E7=A8=8B):=20=E5=9F=BA=E7=A1=80=E6=80=A7=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/activiti/entity/ProcessAll.java | 7 +- .../activiti/mapper/xml/ProcessAllMapper.xml | 3 +- .../common/StandardInterpretCommon.java | 13 ++ .../StandardInterpretFlowController.java | 8 +- .../dto/StandardInterpretDTO.java | 2 +- .../entity/ProcessStandardInterpret.java | 2 +- .../ProcessStandardInterpretClause.java | 2 + ...ProcessStandardInterpretClauseSublist.java | 3 + ...ssStandardInterpretClauseSublistMapper.xml | 1 + ...dardInterpretClauseSublistServiceImpl.java | 3 + .../StandardInterpretFlowServiceImpl.java | 118 ++++++++++++++++-- 11 files changed, 141 insertions(+), 21 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/entity/ProcessAll.java b/laws-modules/src/main/java/com/jero/modules/activiti/entity/ProcessAll.java index e4a9a9e1..1fa980e6 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/entity/ProcessAll.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/entity/ProcessAll.java @@ -188,4 +188,9 @@ public class ProcessAll { @TableField(exist = false) @ApiModelProperty(value = "超期标识(0:未超期 1:已超期)") private String overDue; -} \ No newline at end of file + + /**父任务id*/ + @ApiModelProperty(value = "父任务id") + @TableField(exist = false) + private String parentTaskId; +} diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/mapper/xml/ProcessAllMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/mapper/xml/ProcessAllMapper.xml index b86df78f..5371b924 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/mapper/xml/ProcessAllMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/activiti/mapper/xml/ProcessAllMapper.xml @@ -34,6 +34,7 @@ par.task_name, par.node_id, par.over_due, + par.parent_task_id, pa.id, pa.prc_name, pa.process_definition_id, @@ -112,4 +113,4 @@ ${ew.customSqlSegment} - \ No newline at end of file + diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/StandardInterpretCommon.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/StandardInterpretCommon.java index 194f827c..3d634a2c 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/StandardInterpretCommon.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/common/StandardInterpretCommon.java @@ -95,6 +95,10 @@ public class StandardInterpretCommon { * 解读人 */ public static final String INTERPRETING_PEOPLE = "interpretingPeople"; + /** + * 会签 + */ + public static final String JOINTLY_SIGN_LIST = "jointlySignList"; /** * 部门科室经理 */ @@ -116,4 +120,13 @@ public class StandardInterpretCommon { * 主解读重新分发 自动任务 */ public static final String AUTO_TASK_3 = "autoTask_3"; + + /** + * 标准主解读人 网关节点 + */ + public static final String PASS_FIRST = "passFirst"; + /** + * 标准主解读人 未分发数量 网关节点 + */ + public static final String UNALLOCATED_QUANTITY = "unallocatedQuantity"; } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java index 283b58bc..1fa6665d 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/controller/StandardInterpretFlowController.java @@ -67,8 +67,8 @@ public class StandardInterpretFlowController { * @param standardInterpretFlowDTO 标准解读流程对象 * @return 结果对象 */ - @AutoLog(value = "企标稽查整改-流程审批", operateType = CommonConstant.OPERATE_TYPE_3) - @ApiOperation(value="企标稽查整改-流程审批", notes="企标稽查整改-流程审批") + @AutoLog(value = "标准解读流程-流程审批", operateType = CommonConstant.OPERATE_TYPE_3) + @ApiOperation(value="标准解读流程-流程审批", notes="标准解读流程-流程审批") @PostMapping(value = "/flowApproval") public Result flowApproval(@RequestBody StandardInterpretFlowDTO standardInterpretFlowDTO) { standardInterpretFlowService.flowApproval(standardInterpretFlowDTO); @@ -80,8 +80,8 @@ public class StandardInterpretFlowController { * @param projectId 项目id * @return 结果对象 */ - @AutoLog(value = "企标稽查计划流程-办理详情", operateType = CommonConstant.OPERATE_TYPE_1) - @ApiOperation(value="企标稽查计划流程-办理详情", notes="企标稽查计划流程-办理详情") + @AutoLog(value = "标准解读流程-办理详情", operateType = CommonConstant.OPERATE_TYPE_1) + @ApiOperation(value="标准解读流程-办理详情", notes="标准解读流程-办理详情") @GetMapping(value = "/queryDetail") @Translation public Result queryDetail(@ApiParam("项目id") String projectId, diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretDTO.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretDTO.java index 106cb46c..9448f0ef 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretDTO.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/dto/StandardInterpretDTO.java @@ -26,7 +26,7 @@ public class StandardInterpretDTO implements Serializable { @ApiModelProperty(value = "标准解读流程_条款中间表") private List processStandardInterpretClauseList; - /**标准解读流程_条款中间表*/ + /**标准解读流程_条款中间表_子表*/ @ApiModelProperty(value = "标准解读流程_条款中间表_子表") private List processStandardInterpretClauseSublistList; } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java index 820705f7..b4e0a245 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpret.java @@ -58,7 +58,7 @@ public class ProcessStandardInterpret extends BaseEntity { private String projectId; /**分解单来源(字典)*/ @ApiModelProperty(value = "分解单来源(字典)") - @Dict(dicCode = "") + @Dict(dicCode = "process_manuscript") private String decompositionSource; /**是否下发(字典:1:是,2:否)*/ @ApiModelProperty(value = "是否下发(字典:1:是,2:否)") diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java index a2eccf1b..b97d50d5 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClause.java @@ -2,6 +2,7 @@ package com.jero.modules.activiti.process.standardinterpret.entity; import com.baomidou.mybatisplus.annotation.TableField; +import com.jero.common.aspect.annotation.Dict; import com.jero.modules.laws.documenttool.entity.BaseEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -39,6 +40,7 @@ public class ProcessStandardInterpretClause extends BaseEntity { private String interpretPersonIds; /**分解单来源(字典)*/ @ApiModelProperty(value = "分解单来源(字典)") + @Dict(dicCode = "process_manuscript") private String decompositionSource; } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClauseSublist.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClauseSublist.java index 2bd33396..cd0fedb8 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClauseSublist.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/entity/ProcessStandardInterpretClauseSublist.java @@ -20,6 +20,9 @@ public class ProcessStandardInterpretClauseSublist extends BaseEntity { /**条款id/标准id*/ @ApiModelProperty(value = "条款id/标准id") private String clauseId; + /**父任务id*/ + @ApiModelProperty(value = "父任务id") + private String parentTaskId; /**条款号/标准编号*/ @ApiModelProperty(value = "条款号/标准编号") @TableField(exist = false) diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml index 95cae1e6..7a23fecf 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseSublistMapper.xml @@ -53,6 +53,7 @@ left join laws_domestic_standard lds on psic.clause_id = lds.id and lds.del_flag = 0 left join laws_document_split lds2 on psic.clause_id = lds2.id and lds2.del_flag = 0) psic2 on psics.standard_interpret_clause_id = psic2.id + ${ew.customSqlSegment} diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseSublistServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseSublistServiceImpl.java index 3c83fd76..29de9997 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseSublistServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseSublistServiceImpl.java @@ -42,6 +42,9 @@ public class ProcessStandardInterpretClauseSublistServiceImpl queryWrapper.eq(StringUtils.isNotBlank(processStandardInterpretClauseSublist.getInterpretPersonId()), "interpret_person_id", processStandardInterpretClauseSublist.getInterpretPersonId()); + queryWrapper.eq(StringUtils.isNotBlank(processStandardInterpretClauseSublist.getParentTaskId()), + "psics.parent_task_id", + processStandardInterpretClauseSublist.getParentTaskId()); queryWrapper.eq("psics.del_flag", CommonConstant.DEL_FLAG_0); queryWrapper.orderByAsc("psics.id"); return processStandardInterpretClauseSublistMapper.queryList(queryWrapper); diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java index 93bb1399..7096e46a 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/StandardInterpretFlowServiceImpl.java @@ -17,6 +17,7 @@ import com.jero.modules.activiti.enums.ProcessStatusEnum; import com.jero.modules.activiti.process.common.enums.ProcessType; import com.jero.modules.activiti.process.common.utility.FlowUtility; import com.jero.modules.activiti.process.standardinterpret.common.StandardInterpretCommon; +import com.jero.modules.activiti.process.standardinterpret.controller.ProcessStandardInterpretClauseSublistController; import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretDTO; import com.jero.modules.activiti.process.standardinterpret.dto.StandardInterpretFlowDTO; import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret; @@ -30,6 +31,8 @@ import com.jero.modules.activiti.process.standardinterpret.vo.StandardInterpretF import com.jero.modules.activiti.service.ProcessAllService; import com.jero.modules.activiti.service.ProcessApprovalRecordService; import com.jero.modules.activiti.service.ProcessNodeLinkService; +import com.jero.modules.laws.standard.entity.LawsDomesticStandard; +import com.jero.modules.laws.standard.service.ILawsDomesticStandardService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.activiti.engine.ProcessEngines; @@ -68,6 +71,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe private final ProcessStandardInterpretService processStandardInterpretService; private final ProcessStandardInterpretClauseService processStandardInterpretClauseService; private final ProcessStandardInterpretClauseSublistService processStandardInterpretClauseSublistService; + private final ILawsDomesticStandardService lawsDomesticStandardService; + private final ProcessStandardInterpretClauseSublistController processStandardInterpretClauseSublist; @Override public void flowStart(StandardInterpretFlowDTO standardInterpretFlowDTO) { @@ -75,11 +80,21 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe ProcessAll processAll = standardInterpretFlowDTO.getProcessAll(); // 流程审批信息 ProcessApprovalRecord processApprovalRecord = standardInterpretFlowDTO.getProcessApprovalRecord(); + // 业务信息 + StandardInterpretDTO data = standardInterpretFlowDTO.getData(); // map(参数) Map map = standardInterpretFlowDTO.getMap(); + // 生成流程名称 + String standardId = data.getProcessStandardInterpret().getStandardId(); + LawsDomesticStandard lawsDomesticStandard = lawsDomesticStandardService.getById(standardId); + String prcName = lawsDomesticStandard.getStandardNumber() + "-" + + lawsDomesticStandard.getStandardName() + "-解读"; + processAll.setPrcName(prcName); + // 根据流程key启动流程,设置流程变量,更新流程总表信息,更新流程审批信息,返回任务信息 - Task task = startProcessInstanceByKey(StandardInterpretCommon.KEY_1, map, processAll, processApprovalRecord); + Task task = startProcessInstanceByKey(StandardInterpretCommon.KEY_1, map, + processAll, processApprovalRecord, data); // 处理业务信息 handleBusinessData(standardInterpretFlowDTO); @@ -94,11 +109,13 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe ProcessAll processAll = standardInterpretFlowDTO.getProcessAll(); // 流程审批信息 ProcessApprovalRecord processApprovalRecord = standardInterpretFlowDTO.getProcessApprovalRecord(); + // 业务信息 + StandardInterpretDTO data = standardInterpretFlowDTO.getData(); // map(参数) Map map = standardInterpretFlowDTO.getMap(); // 根据流程key启动流程,设置流程变量,更新流程总表信息,更新流程审批信息,返回任务信息 - startProcessInstanceByKey(StandardInterpretCommon.KEY_2, map, processAll, processApprovalRecord); + startProcessInstanceByKey(StandardInterpretCommon.KEY_2, map, processAll, processApprovalRecord, data); } @Override @@ -109,9 +126,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe ProcessApprovalRecord processApprovalRecord = standardInterpretFlowDTO.getProcessApprovalRecord(); // map(参数) Map map = standardInterpretFlowDTO.getMap(); - + // 业务信息 + StandardInterpretDTO data = standardInterpretFlowDTO.getData(); // 根据流程key启动流程,设置流程变量,更新流程总表信息,更新流程审批信息,返回任务信息 - startProcessInstanceByKey(StandardInterpretCommon.KEY_3, map, processAll, processApprovalRecord); + startProcessInstanceByKey(StandardInterpretCommon.KEY_3, map, processAll, processApprovalRecord, data); } @@ -127,6 +145,9 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe // 更新流程总表信息,更新流程审批信息 flowUtility.flowApprovalUpdate(processAll, processApprovalRecord); + // 更新业务表 + handleBusinessData(standardInterpretFlowDTO); + // 完成任务 taskService.complete(processAll.getTaskId(), map); @@ -165,8 +186,34 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe standardInterpretFlowDTO.setProcessAll(processAll); ProcessApprovalRecord processApprovalRecord = new ProcessApprovalRecord(); processApprovalRecord.setParentTaskId(taskId); + processApprovalRecord.setUserId(interpretingPeople); + processApprovalRecord.setFinishFlag(FinishFlagEnum.INCOMPLETE.getValue()); standardInterpretFlowDTO.setProcessApprovalRecord(processApprovalRecord); standardInterpretFlowDTO.setMap(variables); + + // 更新 标准解读流程_条款中间表_子表 parentId + ProcessStandardInterpret processStandardInterpret = processStandardInterpretService.getOne( + new LambdaQueryWrapper() + .eq(ProcessStandardInterpret::getProjectId, processAlls.getProjectId())); + if (!Objects.isNull(processStandardInterpret)){ + String id = processStandardInterpret.getId(); + List processStandardInterpretClauseList = + processStandardInterpretClauseService.list( + new LambdaQueryWrapper() + .eq(ProcessStandardInterpretClause::getStandardInterpretId, id)); + if (!processStandardInterpretClauseList.isEmpty()){ + List standardInterpretClauseIdList = processStandardInterpretClauseList.stream() + .map(ProcessStandardInterpretClause::getId).collect(Collectors.toList()); + processStandardInterpretClauseSublistService.update( + new LambdaUpdateWrapper() + .in(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId + , standardInterpretClauseIdList) + .eq(ProcessStandardInterpretClauseSublist::getInterpretPersonId, + interpretingPeople) + .set(ProcessStandardInterpretClauseSublist::getParentTaskId, taskId)); + } + } + childrenFlowStart(standardInterpretFlowDTO); log.info("循环发起 标准解读流程(主解读人重新分发子流程)"); } @@ -247,6 +294,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe if (StandardInterpretCommon.INTERPRETING_PEOPLE_FILLOUT.equals(node)){ processStandardInterpretClauseSublist.setInterpretPersonId(loginUser.getId()); } + // 标准主解读人审核(分发) + if (StandardInterpretCommon.MASTER_INTERPRET_APPROVE.equals(node)){ + processStandardInterpretClauseSublist.setParentTaskId(processApprovalRecord.getParentTaskId()); + } processStandardInterpretClauseSublistList = processStandardInterpretClauseSublistService.queryList(processStandardInterpretClauseSublist); } @@ -273,10 +324,13 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe } private void handleBusinessData(StandardInterpretFlowDTO standardInterpretFlowDTO) { + // map(参数) + Map map = standardInterpretFlowDTO.getMap(); StandardInterpretDTO data = standardInterpretFlowDTO.getData(); // 标准解读流程 ProcessStandardInterpret processStandardInterpret = data.getProcessStandardInterpret(); - String standardInterpretId = processStandardInterpret.getId(); + String standardInterpretId = StringUtils.isBlank(processStandardInterpret.getId()) ? + String.valueOf(SnowflakeUtils.snowflake()) : processStandardInterpret.getId(); // 标准解读流程_条款中间表 List processStandardInterpretClauseList = data.getProcessStandardInterpretClauseList(); @@ -284,7 +338,9 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe List processStandardInterpretClauseSublistList = data.getProcessStandardInterpretClauseSublistList(); // 当前任务节点 - String node = standardInterpretFlowDTO.getProcessApprovalRecord().getNodeId(); + String node = StringUtils.isBlank(standardInterpretFlowDTO.getProcessApprovalRecord().getNodeId()) ? + StandardInterpretCommon.REGULATORY_ENGINEER_START + : standardInterpretFlowDTO.getProcessApprovalRecord().getNodeId(); switch (node){ // 法规工程师发起 @@ -299,12 +355,18 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe break; // 主控部门联络人分发 case StandardInterpretCommon.CONTACT_PERSON_DISTRIBUTE: + // 保存主解读人 + processStandardInterpret.setMasterInterpretId( + String.valueOf(map.get(StandardInterpretCommon.MASTER_INTERPRET))); + + processStandardInterpretService.updateById(processStandardInterpret); + List clauseIdList = processStandardInterpretClauseList.stream() .map(ProcessStandardInterpretClause::getId) .collect(Collectors.toList()); // 删除旧数据 LambdaQueryWrapper removeQueryWrapper = new LambdaQueryWrapper<>(); - removeQueryWrapper.notIn(ProcessStandardInterpretClause::getStandardInterpretId, clauseIdList); + removeQueryWrapper.notIn(ProcessStandardInterpretClause::getId, clauseIdList); removeQueryWrapper.eq(ProcessStandardInterpretClause::getStandardInterpretId, standardInterpretId); processStandardInterpretClauseService.remove(removeQueryWrapper); break; @@ -317,10 +379,19 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe // 生成 标准解读流程_条款中间表_子表 数据 List processStandardInterpretClauseSublists = new ArrayList<>(); + // 未分配数量 + int unallocatedQuantity = 0; + // 子解读人 + List interpretPersonIdList = new ArrayList<>(); for (ProcessStandardInterpretClause StandardInterpretClause : processStandardInterpretClauseList) { + if (StringUtils.isBlank(StandardInterpretClause.getInterpretPersonIds())){ + ++ unallocatedQuantity; + continue; + } // 子解读人 - String[] interpretPersonIds = StandardInterpretClause.getInterpretPersonIds().split(","); - for (String interpretPersonId : interpretPersonIds) { + interpretPersonIdList = Arrays.asList( + StandardInterpretClause.getInterpretPersonIds().split(",")); + for (String interpretPersonId : interpretPersonIdList) { ProcessStandardInterpretClauseSublist clauseSublist = new ProcessStandardInterpretClauseSublist(); clauseSublist.setStandardInterpretClauseId(StandardInterpretClause.getId()); @@ -329,12 +400,32 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe processStandardInterpretClauseSublists.add(clauseSublist); } } + // 设置未分配数量 + map.put(StandardInterpretCommon.UNALLOCATED_QUANTITY, unallocatedQuantity); + // 设置子解读人 + map.put(StandardInterpretCommon.INTERPRETING_PEOPLE, interpretPersonIdList); processStandardInterpretClauseSublistService.saveBatch(processStandardInterpretClauseSublists); }else { // 不分发 processStandardInterpretClauseSublistService .saveOrUpdateBatch(processStandardInterpretClauseSublistList); } + + map.put(StandardInterpretCommon.PASS_FIRST, + Integer.parseInt(processStandardInterpret.getIsDistribute())); + processStandardInterpretService.updateById(processStandardInterpret); + break; + // 标准主解读汇总(分发) + case StandardInterpretCommon.MASTER_INTERPRET_SUMMARY: + // 保存会签人员、审核人员、批准人员 + processStandardInterpretService.updateById(processStandardInterpret); + map.put(StandardInterpretCommon.JOINTLY_SIGN_LIST, processStandardInterpret.getCountersignPersonIds()); + map.put(StandardInterpretCommon.DEPARTMENT_MANAGER, + Arrays.asList(processStandardInterpret.getUploader().split(","))); + map.put(StandardInterpretCommon.TECHNICAL_OFFICER, + processStandardInterpret.getApprovePersonId()); + processStandardInterpretClauseSublistService + .saveOrUpdateBatch(processStandardInterpretClauseSublistList); break; default: processStandardInterpretClauseSublistService @@ -345,7 +436,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe } private Task startProcessInstanceByKey(String key, Map map, ProcessAll processAll, - ProcessApprovalRecord processApprovalRecord) { + ProcessApprovalRecord processApprovalRecord, StandardInterpretDTO data) { // 启动流程 ProcessInstance processInstance = runtimeService .startProcessInstanceByKey(key, map); @@ -373,10 +464,11 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe // 更新流程审批信息 LambdaUpdateWrapper processApprovalRecordUpdate = new LambdaUpdateWrapper<>(); - processApprovalRecordUpdate.eq(StringUtils.isNotBlank(task.getId()), - ProcessApprovalRecord::getTaskId, task.getId()); + if (!Objects.isNull(task)){ + processApprovalRecordUpdate.eq(ProcessApprovalRecord::getTaskId, task.getId()); + } processApprovalRecordUpdate.eq(StringUtils.isNotBlank(processApprovalRecord.getParentTaskId()), - ProcessApprovalRecord::getParentTaskId, task.getParentTaskId()); + ProcessApprovalRecord::getParentTaskId, processApprovalRecord.getParentTaskId()); processApprovalRecordUpdate.set(ProcessApprovalRecord::getUserId, loginUser.getId()); processApprovalRecordUpdate.set(ProcessApprovalRecord::getProjectId, processAll.getProjectId()); processApprovalRecordUpdate.set(ProcessApprovalRecord::getFinishFlag, FinishFlagEnum.COMPLETE.getValue());