From 3a0367cabfc044e343a75df8d995493d92573b19 Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Mon, 15 Jul 2024 18:48:04 +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=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/StandardInterpretCommon.java | 4 ++ .../StandardInterpretFlowServiceImpl.java | 45 ++++++++++++++++--- 2 files changed, 43 insertions(+), 6 deletions(-) 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 966ba3d2..1acea7b3 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 @@ -152,6 +152,10 @@ public class StandardInterpretCommon { * 分发的数据id */ public static final String DISTRIBUTE_ID_LIST = "distributeIdList"; + /** + * 要分发的数据中间表子表id + */ + public static final String DISTRIBUTE_ID_SUB_LIST = "distributeIdSubList"; /** * 是否下发:1:是 2:否 0:驳回 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 076118f2..2d21bda2 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 @@ -282,6 +282,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe String projectId = (String) delegateTask.getVariable(StandardInterpretCommon.PROJECT_ID); String snowflake = (String) delegateTask.getVariable(StandardInterpretCommon.SNOWFLAKE); String distributeIdList = (String) delegateTask.getVariable(StandardInterpretCommon.DISTRIBUTE_ID_LIST); + String distributeIdSubList = (String) delegateTask.getVariable(StandardInterpretCommon.DISTRIBUTE_ID_SUB_LIST); ProcessAll processAlls = processAllService.getOne(new LambdaQueryWrapper() .eq(ProcessAll::getProjectId, projectId)); @@ -310,11 +311,16 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe processStandardInterpretClauseService.list(queryWrapper); for (ProcessStandardInterpretClause processStandardInterpretClause : processStandardInterpretClauseList) { + LambdaQueryWrapper queryWrapper1 = + new LambdaQueryWrapper<>(); + queryWrapper1.eq(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId, + processStandardInterpretClause.getId()); + if (StringUtils.isNotBlank(distributeIdSubList)){ + queryWrapper1.in(ProcessStandardInterpretClauseSublist::getId, + Arrays.asList(distributeIdSubList.split(","))); + } List list = - processStandardInterpretClauseSublistService.list( - new LambdaQueryWrapper() - .eq(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId, - processStandardInterpretClause.getId())); + processStandardInterpretClauseSublistService.list(queryWrapper1); for (ProcessStandardInterpretClauseSublist processStandardInterpretClauseSublist : list) { // 解读人 String interpretPersonId = processStandardInterpretClauseSublist.getInterpretPersonId(); @@ -1334,8 +1340,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe int unallocatedQuantity = 0; // 子解读人 List interpretPersonIdList = new ArrayList<>(); - // 要分发的数据id + // 要分发的数据中间表id List distributeIdList = new ArrayList<>(); + // 要分发的数据中间表子表id + List distributeIdSubList = new ArrayList<>(); for (ProcessStandardInterpretClause StandardInterpretClause : processStandardInterpretClauseList) { distributeIdList.add(StandardInterpretClause.getId()); if (StringUtils.isBlank(StandardInterpretClause.getInterpretPersonIds())){ @@ -1347,11 +1355,14 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe StandardInterpretClause.getInterpretPersonIds().split(",")) { ProcessStandardInterpretClauseSublist clauseSublist = new ProcessStandardInterpretClauseSublist(); + String id = String.valueOf(SnowflakeUtils.snowflake()); + clauseSublist.setId(id); clauseSublist.setStandardInterpretClauseId(StandardInterpretClause.getId()); clauseSublist.setClauseId(StandardInterpretClause.getClauseId()); clauseSublist.setInterpretPersonId(interpretPersonId); processStandardInterpretClauseSublists.add(clauseSublist); interpretPersonIdList.add(interpretPersonId); + distributeIdSubList.add(id); } } // 设置未分配数量 @@ -1359,9 +1370,12 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe // 设置子解读人 map.put(StandardInterpretCommon.INTERPRETING_PEOPLE, String.join(",", interpretPersonIdList)); - // 设置要分发的数据id + // 要分发的数据中间表id map.put(StandardInterpretCommon.DISTRIBUTE_ID_LIST, String.join(",", distributeIdList)); + // 要分发的数据中间表子表id + map.put(StandardInterpretCommon.DISTRIBUTE_ID_SUB_LIST, + String.join(",", distributeIdSubList)); // 设置主流程实例id map.put(ActivitiCommon.MAIN_INSTANCE_ID, standardInterpretFlowDTO.getProcessAll().getProcessInstanceId()); @@ -1437,6 +1451,25 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe .saveOrUpdateBatch(processStandardInterpretClauseSublistList); } break; + // 会签(不分发) + case StandardInterpretCommon.JOINTLY_SIGN_2: + // 各涉及部门科室经理审核(不分发) + case StandardInterpretCommon.DEPARTMENT_MANAGER_APPROVE_2: + // 主控部门高级经理/法规认证技术管批准(不分发) + case StandardInterpretCommon.TECHNICAL_OFFICER_APPROVAL_2: + boolean passs = (boolean) map.get(StandardInterpretCommon.PASS); + if (passs){ + processStandardInterpretClauseSublistService + .saveOrUpdateBatch(processStandardInterpretClauseSublistList); + }else { + // 驳回 + // 删除 标准解读流程_条款中间表_子表 数据 +// List idList = processStandardInterpretClauseSublistList.stream() +// .map(ProcessStandardInterpretClauseSublist::getId) +// .collect(Collectors.toList()); +// processStandardInterpretClauseSublistService.removeByIds(idList); + } + break; // 标准主解读汇总(分发) case StandardInterpretCommon.MASTER_INTERPRET_SUMMARY: // 保存会签人员、审核人员、批准人员