From a4d1925ee2bcfa58fdb4cc1e2ff4798fe5c17fea Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Fri, 12 Jul 2024 15:18:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(=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=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/StandardInterpretCommon.java | 5 ++ .../ProcessStandardInterpretClause.java | 3 ++ .../ProcessStandardInterpretClauseMapper.xml | 3 +- ...essStandardInterpretClauseServiceImpl.java | 4 +- .../StandardInterpretFlowServiceImpl.java | 54 ++++++++++--------- 5 files changed, 42 insertions(+), 27 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 24fb37a5..99cd823b 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 @@ -143,4 +143,9 @@ public class StandardInterpretCommon { * 唯一标识 */ public static final String PROJECT_ID = "projectId"; + + /** + * 分发的数据id + */ + public static final String DISTRIBUTE_ID_LIST = "distributeIdList"; } 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 7fa939fb..0da21848 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 @@ -50,5 +50,8 @@ public class ProcessStandardInterpretClause extends BaseEntity { /**是否驳回过(1:是 0:否)*/ @ApiModelProperty(value = "是否驳回过(1:是 0:否)") private String isReject; + /**是否分发(1:是 0:否)*/ + @ApiModelProperty(value = "是否分发(1:是 0:否)") + private String isDistribute; } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml index 5cb07a1d..2fe31102 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/mapper/xml/ProcessStandardInterpretClauseMapper.xml @@ -11,7 +11,8 @@ standard_interpret_id, psic.clause_id, interpret_person_ids, - is_reject + is_reject, + is_distribute from laws_chery_dev.process_standard_interpret_clause psic 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 diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java index 8f0c9a70..9cf8396d 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/impl/ProcessStandardInterpretClauseServiceImpl.java @@ -37,8 +37,8 @@ public class ProcessStandardInterpretClauseServiceImpl queryWrapper.eq(StringUtils.isNotBlank(processStandardInterpretClause.getStandardInterpretId()), "standard_interpret_id", processStandardInterpretClause.getStandardInterpretId()); // 标准主解读人分发 节点查询未分发数据 - queryWrapper.isNull("null".equals(processStandardInterpretClause.getInterpretPersonIds()), - "interpret_person_ids"); + queryWrapper.eq(StringUtils.isNotBlank(processStandardInterpretClause.getIsDistribute()), + "is_distribute", processStandardInterpretClause.getIsDistribute()); // 标准主解读人重新分发 节点查询驳回数据 queryWrapper.eq(StringUtils.isNotBlank(processStandardInterpretClause.getIsReject()), "is_reject", processStandardInterpretClause.getIsReject()); 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 cfa3984d..959e0afd 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 @@ -252,8 +252,9 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe String taskDefinitionKey = delegateTask.getTaskDefinitionKey(); String processInstanceId = delegateTask.getProcessInstanceId(); - String projectId =(String) delegateTask.getVariable(StandardInterpretCommon.PROJECT_ID); - String snowflake =(String) delegateTask.getVariable(StandardInterpretCommon.SNOWFLAKE); + String projectId = (String) delegateTask.getVariable(StandardInterpretCommon.PROJECT_ID); + String snowflake = (String) delegateTask.getVariable(StandardInterpretCommon.SNOWFLAKE); + String distributeIdList = (String) delegateTask.getVariable(StandardInterpretCommon.DISTRIBUTE_ID_LIST); ProcessAll processAlls = processAllService.getOne(new LambdaQueryWrapper() .eq(ProcessAll::getProjectId, projectId)); @@ -272,10 +273,14 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe .eq(ProcessStandardInterpret::getProjectId, processAlls.getProjectId())); if (!Objects.isNull(processStandardInterpret)){ String id = processStandardInterpret.getId(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ProcessStandardInterpretClause::getStandardInterpretId, id); + if (StringUtils.isNotBlank(distributeIdList)){ + queryWrapper.in(ProcessStandardInterpretClause::getId, + Arrays.asList(distributeIdList.split(","))); + } List processStandardInterpretClauseList = - processStandardInterpretClauseService.list( - new LambdaQueryWrapper() - .eq(ProcessStandardInterpretClause::getStandardInterpretId, id)); + processStandardInterpretClauseService.list(queryWrapper); for (ProcessStandardInterpretClause processStandardInterpretClause : processStandardInterpretClauseList) { List list = @@ -304,6 +309,13 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe // 发起子流程 childrenFlowStart(standardInterpretFlowDTO); + processStandardInterpretClauseService.update( + new LambdaUpdateWrapper() + .eq(ProcessStandardInterpretClause::getId, + processStandardInterpretClause.getId()) + .set(ProcessStandardInterpretClause::getIsDistribute, + YesOrNoEnum.YES.getValue())); + processStandardInterpretClauseSublistService.update( new LambdaUpdateWrapper() .eq(ProcessStandardInterpretClauseSublist::getId, @@ -332,11 +344,12 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe processStandardInterpretClauseSublistService.getOne( new LambdaQueryWrapper() .eq(ProcessStandardInterpretClauseSublist::getSnowFlake, snowflake)); - // 清除中间表解读人 + // 清除中间表解读人,设置驳回标识 processStandardInterpretClauseService.update( new LambdaUpdateWrapper() .eq(ProcessStandardInterpretClause::getId, processStandardInterpretClauseSublist.getStandardInterpretClauseId()) + .set(ProcessStandardInterpretClause::getIsReject, YesOrNoEnum.YES.getValue()) .set(ProcessStandardInterpretClause::getInterpretPersonIds, null)); // 删除旧分发数据 @@ -525,7 +538,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe processStandardInterpretClause.setStandardInterpretId(processStandardInterpret.getId()); // 标准主解读人分发 if (StandardInterpretCommon.MASTER_INTERPRET_DISTRIBUTE.equals(node)){ - processStandardInterpretClause.setInterpretPersonIds("null"); + processStandardInterpretClause.setIsDistribute(YesOrNoEnum.NO.getValue()); } // 标准主解读人重新分发(分发) if (StandardInterpretCommon.MASTER_INTERPRET_AGAIN_DISTRIBUTE.equals(node)){ @@ -1153,15 +1166,6 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe // 主控部门联络人分发 case StandardInterpretCommon.CONTACT_PERSON_DISTRIBUTE: processStandardInterpretService.updateById(processStandardInterpret); - -// List clauseIdList = processStandardInterpretClauseList.stream() -// .map(ProcessStandardInterpretClause::getId) -// .collect(Collectors.toList()); - // 删除旧数据 -// LambdaQueryWrapper removeQueryWrapper = new LambdaQueryWrapper<>(); -// removeQueryWrapper.notIn(ProcessStandardInterpretClause::getId, clauseIdList); -// removeQueryWrapper.eq(ProcessStandardInterpretClause::getStandardInterpretId, standardInterpretId); -// processStandardInterpretClauseService.remove(removeQueryWrapper); processStandardInterpretClauseService.removeByIds(processAllDelIds); // 标准主解读人 @@ -1174,12 +1178,6 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe if (YesOrNoEnum.YES.getValue().equals(processStandardInterpret.getIsDistribute())){ // 分发 // 删除旧数据 -// List clauseIdList2 = processStandardInterpretClauseList.stream() -// .map(ProcessStandardInterpretClause::getId) -// .collect(Collectors.toList()); -// LambdaQueryWrapper removeQueryWrapper2 = new LambdaQueryWrapper<>(); -// removeQueryWrapper2.notIn(ProcessStandardInterpretClause::getId, clauseIdList2); -// removeQueryWrapper2.eq(ProcessStandardInterpretClause::getStandardInterpretId, standardInterpretId); processStandardInterpretClauseService.removeByIds(processAllDelIds); // 更新 标准解读流程_条款中间表 @@ -1192,13 +1190,17 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe int unallocatedQuantity = 0; // 子解读人 List interpretPersonIdList = new ArrayList<>(); + // 要分发的数据id + List distributeIdList = new ArrayList<>(); for (ProcessStandardInterpretClause StandardInterpretClause : processStandardInterpretClauseList) { + distributeIdList.add(StandardInterpretClause.getId()); if (StringUtils.isBlank(StandardInterpretClause.getInterpretPersonIds())){ ++ unallocatedQuantity; continue; } - for (String interpretPersonId : StandardInterpretClause.getInterpretPersonIds().split(",")) { + for (String interpretPersonId : + StandardInterpretClause.getInterpretPersonIds().split(",")) { ProcessStandardInterpretClauseSublist clauseSublist = new ProcessStandardInterpretClauseSublist(); clauseSublist.setStandardInterpretClauseId(StandardInterpretClause.getId()); @@ -1213,8 +1215,12 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe // 设置子解读人 map.put(StandardInterpretCommon.INTERPRETING_PEOPLE, String.join(",", interpretPersonIdList)); + // 设置要分发的数据id + map.put(StandardInterpretCommon.DISTRIBUTE_ID_LIST, + String.join(",", distributeIdList)); // 设置主流程实例id - map.put(ActivitiCommon.MAIN_INSTANCE_ID, standardInterpretFlowDTO.getProcessAll().getProcessInstanceId()); + map.put(ActivitiCommon.MAIN_INSTANCE_ID, + standardInterpretFlowDTO.getProcessAll().getProcessInstanceId()); processStandardInterpretClauseSublistService.saveBatch(processStandardInterpretClauseSublists); }else { // 保存会签人员、审核人员、批准人员