From 2cfd2a91b2f59aa05a83b792dfee5c0d6a58487c Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Wed, 14 Aug 2024 11:34:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(88310):=20=E5=A2=9E=E5=8A=A0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardInterpretFlowServiceImpl.java | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) 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 09c3a992..bc4a0e25 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 @@ -855,20 +855,38 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe String standardInterpretId = request.getParameter("standardInterpretId"); String standardId = request.getParameter("standardId"); String splitInfoId = request.getParameter("splitInfoId"); - int total = Integer.parseInt(request.getParameter("total")); LawsDomesticStandard lawsDomesticStandard = lawsDomesticStandardService.getById(standardId); - if (list.size() != total){ + // 获取当前列表数据 + ProcessAll processAll = new ProcessAll(); + processAll.setProjectId(request.getParameter("projectId")); + ProcessApprovalRecord processApprovalRecord = new ProcessApprovalRecord(); + processApprovalRecord.setNodeId(request.getParameter("nodeId")); + processApprovalRecord.setTaskId(request.getParameter("taskId")); + StandardInterpretDTO standardInterpretDTO = queryBusinessData(processAll, processApprovalRecord); + if (Objects.isNull(standardInterpretDTO) || + Objects.isNull(standardInterpretDTO.getProcessStandardInterpretClauseSublistList())){ if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) { - throw new JeroBootException("列表数量和导入数量不一致!"); + throw new JeroBootException("列表不可导入数据!"); + } else { + throw new JeroBootException("The list cannot import data!"); + } + } + List processStandardInterpretClauseSublistList = + standardInterpretDTO.getProcessStandardInterpretClauseSublistList(); + if (list.size() != processStandardInterpretClauseSublistList.size()){ + if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) { + throw new JeroBootException("业务分派信息数量和导入数量不一致!"); } else { throw new JeroBootException("The number of lists is inconsistent with the number of imports!"); } } + // 字段校验 for (int i = 0; i < list.size(); i++) { list.get(i).setStandardInterpretId(standardInterpretId); String head = "第" + (i + 2) + "行:"; - List firstVerify = firstVerify(i, list.get(i), lawsDomesticStandard, splitInfoId); + List firstVerify = firstVerify(i, list.get(i), lawsDomesticStandard, splitInfoId, + processStandardInterpretClauseSublistList); List secondVerify = secondVerify(list.get(i)); List thirdVerify = thirdVerify(list.get(i)); List fifthVerify = fifthVerify(list.get(i)); @@ -1256,7 +1274,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe } private List firstVerify(int i, ProcessStandardInterpretClauseSublist data, - LawsDomesticStandard lawsDomesticStandard, String splitInfoId) { + LawsDomesticStandard lawsDomesticStandard, String splitInfoId, + List clauseSublistList) { List errorList = new ArrayList<>(); String itemNum = data.getItemNum(); String itemTitle = data.getItemTitle(); @@ -1282,6 +1301,13 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe if (i > 0 && exist){ // 条款校验 + long count = clauseSublistList.stream().filter(o -> + o.getItemNum().equals(itemNum) + && o.getItemTitle().equals(itemTitle)).count(); + if (count < 1){ + errorList.add("该数据在业务分派信息中不存在!"); + } + LawsDocumentSplit lawsDocumentSplits = documentSplitMapper.selectOne( new LambdaQueryWrapper() .eq(LawsDocumentSplit::getInfoId, splitInfoId)