From f229387c77bacbd673f3cdce9940d0d62d54086b Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Mon, 15 Jul 2024 14:03:49 +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=E6=B5=81=E7=A8=8B=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jero/common/api/vo/ResultCommon.java | 3 + .../common/StandardInterpretCommon.java | 17 +++++ .../StandardInterpretFlowController.java | 13 ++++ .../service/StandardInterpretFlowService.java | 9 +++ .../StandardInterpretFlowServiceImpl.java | 64 ++++++++++++++++--- .../resources/i18n/messages_en.properties | 4 +- .../resources/i18n/messages_zh.properties | 4 +- 7 files changed, 103 insertions(+), 11 deletions(-) diff --git a/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java b/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java index c6315504..710cafeb 100644 --- a/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java +++ b/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java @@ -167,4 +167,7 @@ public class ResultCommon { public static final String ASSESS_DELETE_ERROR = "assess.delete.error"; //项目中有评估中的数据时,不允许删除 public static final String ASSESS_DELETE_ERROR2 = "assess.delete.error2"; + + // 流程已分发,禁止驳回 + public static final String PROCESS_ALREADY_DISTRIBUTED = "process.already.distributed"; } 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 99cd823b..e5730e26 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 @@ -129,6 +129,10 @@ public class StandardInterpretCommon { * 标准主解读人 网关节点 */ public static final String PASS_FIRST = "passFirst"; + /** + * 标准主解读人 普通网关 + */ + public static final String PASS = "pass"; /** * 标准主解读人 未分发数量 网关节点 */ @@ -148,4 +152,17 @@ public class StandardInterpretCommon { * 分发的数据id */ public static final String DISTRIBUTE_ID_LIST = "distributeIdList"; + + /** + * 是否下发:1:是 2:否 0:驳回 + */ + public static final Integer IS_DISTRIBUTE_1 = 1; + /** + * 是否下发:1:是 2:否 0:驳回 + */ + public static final Integer IS_DISTRIBUTE_2 = 2; + /** + * 是否下发:1:是 2:否 0:驳回 + */ + public static final Integer IS_DISTRIBUTE_0 = 0; } 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 bc937d15..56d8d69d 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 @@ -155,6 +155,19 @@ public class StandardInterpretFlowController { return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); } + /** + * 标准解读流程-流程加签 + * @return 结果对象 + */ + @AutoLog(value = "标准解读流程-流程加签", operateType = CommonConstant.OPERATE_TYPE_3) + @ApiOperation(value="标准解读流程-流程加签", notes="标准解读流程-流程加签") + @GetMapping(value = "/flowCountersign") + public Result flowCountersign(@ApiParam("任务id") String taskId, @ApiParam("用户id") String userId, + @ApiParam("项目id") String projectId) { + standardInterpretFlowService.flowCountersign(taskId, userId, projectId); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + /** * 标准解读流程-导出(标准主解读人分发) */ diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/StandardInterpretFlowService.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/StandardInterpretFlowService.java index 3d9ea5b1..300b1b38 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/StandardInterpretFlowService.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/standardinterpret/service/StandardInterpretFlowService.java @@ -114,4 +114,13 @@ public interface StandardInterpretFlowService { * @return */ ModelAndView exportExcelByUnDistribute(HttpServletRequest request); + + /** + * 流程加签 + * + * @param taskId + * @param userId + * @param projectId + */ + void flowCountersign(String taskId, String userId, String projectId); } 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 8d6ad9f1..df9ed986 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 @@ -249,7 +249,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe parameter.put("file_type", standardInterpretDTO.getProcessStandardInterpret().getDecompositionSource()); List> maps = documentSplitService.queryDocumentSplitDetailByList(parameter); - if (!Objects.isNull(maps)){ + if (CollectionUtils.isNotEmpty(maps)){ lawsDocumentSplit.setId(String.valueOf(maps.get(0).get("id"))); } }else { @@ -375,7 +375,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe processStandardInterpretClauseSublistService.remove( new LambdaQueryWrapper() .eq(ProcessStandardInterpretClauseSublist::getStandardInterpretClauseId, - processStandardInterpretClauseSublist.getStandardInterpretClauseId())); + processStandardInterpretClauseSublist.getStandardInterpretClauseId()) + .eq(ProcessStandardInterpretClauseSublist::getSnowFlake, snowflake)); }else if (StandardInterpretCommon.MASTER_INTERPRET_SUMMARY.equals(taskDefinitionKey)){ // 标准主解读汇总 合并条款 ProcessStandardInterpret processStandardInterpret = processStandardInterpretService.getOne( @@ -842,6 +843,34 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe return mv; } + @Override + public void flowCountersign(String taskId, String userId, String projectId) { + ProcessStandardInterpret processStandardInterpret = processStandardInterpretService.getOne( + new LambdaQueryWrapper() + .eq(ProcessStandardInterpret::getProjectId, projectId)); + if (!Objects.isNull(processStandardInterpret)){ + String newCountersignPersonIds = processStandardInterpret.getCountersignPersonIds() + "," + userId; + // 更新会签用户 + Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); + runtimeService.setVariable(task.getExecutionId(), StandardInterpretCommon.JOINTLY_SIGN_LIST, + Arrays.asList(newCountersignPersonIds.split(","))); + + taskService.addCandidateUser(taskId, newCountersignPersonIds); + // 增加会签数量 + Integer all = (Integer) taskService.getVariable(taskId, "nrOfInstances"); + taskService.setVariable(taskId, "nrOfInstances", all + 1); + System.out.println("===================="+task); + + List subTasks = taskService.createTaskQuery().executionId(task.getExecutionId()).list(); + + + processStandardInterpretService.update( + new LambdaUpdateWrapper() + .eq(ProcessStandardInterpret::getId, processStandardInterpret.getId()) + .set(ProcessStandardInterpret::getCountersignPersonIds, newCountersignPersonIds)); + } + } + private List sixthVerify(ProcessStandardInterpretClauseSublist data) { List errorList = new ArrayList<>(); String enterpriseStandard = data.getEnterpriseStandard(); @@ -849,7 +878,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe LawsEnterpriseStandard lawsEnterpriseStandard = lawsEnterpriseStandardService.queryByStandardNumber(enterpriseStandard); if (Objects.isNull(lawsEnterpriseStandard)){ - errorList.add("企标标准不存在!"); + errorList.add("企业标准不存在!"); } } @@ -1289,7 +1318,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe case StandardInterpretCommon.MASTER_INTERPRET_DISTRIBUTE: // 标准主解读人重新分发(分发) case StandardInterpretCommon.MASTER_INTERPRET_AGAIN_DISTRIBUTE: - if (YesOrNoEnum.YES.getValue().equals(processStandardInterpret.getDistribute())){ + Integer passFirst = (Integer) map.get(StandardInterpretCommon.PASS_FIRST); + if (StandardInterpretCommon.IS_DISTRIBUTE_1.equals(passFirst)){ // 分发 // 删除旧数据 processStandardInterpretClauseService.removeByIds(processAllDelIds); @@ -1336,7 +1366,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe map.put(ActivitiCommon.MAIN_INSTANCE_ID, standardInterpretFlowDTO.getProcessAll().getProcessInstanceId()); processStandardInterpretClauseSublistService.saveBatch(processStandardInterpretClauseSublists); - }else { + }else if (StandardInterpretCommon.IS_DISTRIBUTE_2.equals(passFirst)){ // 不分发 // 保存会签人员、审核人员、批准人员 processStandardInterpretService.updateById(processStandardInterpret); @@ -1383,14 +1413,30 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe } } processStandardInterpretClauseService.saveOrUpdateBatch(newProcessStandardInterpretClauseList); + }else { + // 驳回 + ProcessApprovalRecord processApprovalRecord = standardInterpretFlowDTO.getProcessApprovalRecord(); + // 查询是否存在子流程 + int count = processApprovalRecordService.count( + new LambdaQueryWrapper() + .eq(ProcessApprovalRecord::getProcessInstanceId, + processApprovalRecord.getProcessInstanceId()) + .isNotNull(ProcessApprovalRecord::getParentTaskId)); + if (count > 0){ + throw new JeroBootException(ResultCommon.PROCESS_ALREADY_DISTRIBUTED); + } } - if (StringUtils.isNotBlank(processStandardInterpret.getDistribute())){ - map.put(StandardInterpretCommon.PASS_FIRST, - Integer.parseInt(processStandardInterpret.getDistribute())); - } processStandardInterpretService.updateById(processStandardInterpret); break; + // 解读人填写信息(分发) + case StandardInterpretCommon.INTERPRETING_PEOPLE_FILLOUT: + boolean pass = (boolean) map.get(StandardInterpretCommon.PASS); + if (pass){ + processStandardInterpretClauseSublistService + .saveOrUpdateBatch(processStandardInterpretClauseSublistList); + } + break; // 标准主解读汇总(分发) case StandardInterpretCommon.MASTER_INTERPRET_SUMMARY: // 保存会签人员、审核人员、批准人员 diff --git a/laws-single-startup/src/main/resources/i18n/messages_en.properties b/laws-single-startup/src/main/resources/i18n/messages_en.properties index 65fb4557..afa1b02b 100644 --- a/laws-single-startup/src/main/resources/i18n/messages_en.properties +++ b/laws-single-startup/src/main/resources/i18n/messages_en.properties @@ -79,4 +79,6 @@ task.urging.error.2=I currently do not have the authority to urge this process horizontal.transgression.select=no permission at the moment please reselect assess.delete.error=When there is data under rectification or approval in the non compliant items, deletion is not allowed assess.delete.error2=When there is data under evaluation in the project, deletion is not allowed -new.en.standard.number.conflict=The new enterprise standard number is duplicated with the existing enterprise standard number, please modify and submit it again \ No newline at end of file +new.en.standard.number.conflict=The new enterprise standard number is duplicated with the existing enterprise standard number, please modify and submit it again + +process.already.distributed=The process has been distributed, do not reject! diff --git a/laws-single-startup/src/main/resources/i18n/messages_zh.properties b/laws-single-startup/src/main/resources/i18n/messages_zh.properties index 96c92fa3..99fd2cd5 100644 --- a/laws-single-startup/src/main/resources/i18n/messages_zh.properties +++ b/laws-single-startup/src/main/resources/i18n/messages_zh.properties @@ -79,4 +79,6 @@ task.urging.error.2=\u6682\u65E0\u8BE5\u6D41\u7A0B\u50AC\u529E\u6743\u9650 horizontal.transgression.select=\u6682\u65E0\u6743\u9650\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9 assess.delete.error=\u672A\u7B26\u5408\u9879\u4E2D\u6709\u6574\u6539\u4E2D\u3001\u5BA1\u6279\u4E2D\u7684\u6570\u636E\u65F6\uFF0C\u4E0D\u5141\u8BB8\u5220\u9664 assess.delete.error2=\u9879\u76EE\u4E2D\u6709\u8BC4\u4F30\u4E2D\u7684\u6570\u636E\u65F6\uFF0C\u4E0D\u5141\u8BB8\u5220\u9664 -new.en.standard.number.conflict=\u8BE5\u65B0\u4F01\u6807\u7F16\u53F7\u4E0E\u5DF2\u5B58\u5728\u7684\u4F01\u6807\u7F16\u53F7\u91CD\u590D\uFF0C\u8BF7\u91CD\u65B0\u4FEE\u6539\u63D0\u4EA4 \ No newline at end of file +new.en.standard.number.conflict=\u8BE5\u65B0\u4F01\u6807\u7F16\u53F7\u4E0E\u5DF2\u5B58\u5728\u7684\u4F01\u6807\u7F16\u53F7\u91CD\u590D\uFF0C\u8BF7\u91CD\u65B0\u4FEE\u6539\u63D0\u4EA4 + +process.already.distributed=\u6D41\u7A0B\u5DF2\u5206\u53D1,\u7981\u6B62\u9A73\u56DE!