From 187bd3d7bc1ca62e1ab4a71e1a8bffbfefca7de7 Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Thu, 8 Aug 2024 18:20:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(88290):=20=20=E6=A0=87=E5=87=86=E8=A7=A3?= =?UTF-8?q?=E8=AF=BB=E6=B5=81=E7=A8=8B=EF=BC=88=E6=A0=87=E5=87=86=E4=B8=BB?= =?UTF-8?q?=E8=A7=A3=E8=AF=BB=E4=BA=BA=E5=88=86=E5=8F=91=EF=BC=89=20--?= =?UTF-8?q?=E4=B8=8D=E5=88=86=E5=8F=91--=E5=AF=BC=E5=85=A5=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=B2=A1=E6=9C=89=E5=81=9A=E6=95=B0=E6=8D=AE=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardInterpretFlowServiceImpl.java | 89 ++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) 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 327168a8..3c409e52 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 @@ -143,7 +143,9 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); private final List tempList = new ArrayList<>(); - + private final int TEXT_LENGTH = 50; + private final int TEXT_DICT_LENGTH = 500; + private final int TEXT_AREA_LENGTH = 2000; @Override public void flowStart(StandardInterpretFlowDTO standardInterpretFlowDTO) { // 流程信息 @@ -991,6 +993,39 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe } } + String technicalSpecificationDesignGuide = data.getTechnicalSpecificationDesignGuide(); + textLenghtCheck(technicalSpecificationDesignGuide, TEXT_LENGTH, errorList, "技术规范/设计指南"); + + String drawingTemplate = data.getDrawingTemplate(); + textLenghtCheck(drawingTemplate, TEXT_LENGTH, errorList, "图纸模板"); + + String technicalAgreementTemplate = data.getTechnicalAgreementTemplate(); + textLenghtCheck(technicalAgreementTemplate, TEXT_LENGTH, errorList, "技术协议模板"); + + String verificationReportTemplateChecklist = data.getVerificationReportTemplateChecklist(); + textLenghtCheck(verificationReportTemplateChecklist, TEXT_LENGTH, errorList, "校验报告模块/checklist"); + + String dvpTemplate = data.getDvpTemplate(); + textLenghtCheck(dvpTemplate, TEXT_LENGTH, errorList, "DVP模板"); + + String dfema = data.getDfema(); + textLenghtCheck(dfema, TEXT_LENGTH, errorList, "DFEMA"); + + String keyTechnologyDecompositionTable = data.getKeyTechnologyDecompositionTable(); + textLenghtCheck(keyTechnologyDecompositionTable, TEXT_LENGTH, errorList, "关键技术分解表"); + + String otherDocumentsTemplates = data.getOtherDocumentsTemplates(); + textLenghtCheck(otherDocumentsTemplates, TEXT_LENGTH, errorList, "其他文件或模板"); + + String p3 = data.getP3(); + textLenghtCheck(p3, TEXT_LENGTH, errorList, "P3证明符合性的交付物名称"); + + String p5 = data.getP5(); + textLenghtCheck(p5, TEXT_LENGTH, errorList, "P5证明符合性的交付物名称"); + + String remarks = data.getRemarks(); + textLenghtCheck(remarks, TEXT_AREA_LENGTH, errorList, "备注"); + String investigationStage = data.getInvestigationStage(); if (StringUtils.isNotBlank(investigationStage)){ boolean flag = true; @@ -1014,6 +1049,14 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe return errorList; } + private void textLenghtCheck(String technicalSpecificationDesignGuide, int length, List errorList, String x) { + if (StringUtils.isNotBlank(technicalSpecificationDesignGuide)) { + if (technicalSpecificationDesignGuide.length() > length) { + errorList.add(x + "长度超出" + length + "位!"); + } + } + } + private List fifthVerify(ProcessStandardInterpretClauseSublist data) { List errorList = new ArrayList<>(); String applications = data.getApplications(); @@ -1228,6 +1271,9 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe String isSameAsPrevVersion = data.getIsSameAsPrevVersion(); if (StringUtils.isNotBlank(isSameAsPrevVersion)){ + if (isSameAsPrevVersion.length() > 1){ + textLenghtCheck(isSameAsPrevVersion, 1, errorList, "是否与上一版相同"); + } List dictItems = sysDictService.getDictItems("yn"); Optional optionalDictModel = dictItems.stream() .filter(dictModel -> dictModel.getText().equals(isSameAsPrevVersion)).findFirst(); @@ -1238,6 +1284,12 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe } } + String changeDescription = data.getChangeDescription(); + textLenghtCheck(changeDescription, TEXT_LENGTH, errorList, "相对上一版变化点说明长度超出"); + + String regulatoryNotes = data.getRegulatoryNotes(); + textLenghtCheck(regulatoryNotes, TEXT_LENGTH, errorList, "法规注释长度超出"); + String domainArea = data.getDomainArea(); if (StringUtils.isNotBlank(domainArea)){ boolean flag = true; @@ -1258,11 +1310,32 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe } } + String configurationRequirements = data.getConfigurationRequirements(); + if (StringUtils.isNotBlank(configurationRequirements)){ + boolean flag = true; + List list = new ArrayList<>(); + List dictItems = sysDictService.getDictItems("configuration_requirements"); + for (String str : configurationRequirements.split(",")) { + Optional optionalDictModel = dictItems.stream() + .filter(dictModel -> dictModel.getText().equals(str)).findFirst(); + if (!optionalDictModel.isPresent()){ + errorList.add("配置需求不存在!"); + flag = false; + break; + } + list.add(optionalDictModel.get().getValue()); + } + if (flag){ + data.setConfigurationRequirements(String.join(",", list)); + } + } + String newCerImplementDate = data.getNewCerImplementDate(); if (StringUtils.isNotBlank(newCerImplementDate)){ for (String str : newCerImplementDate.split(",")) { try { dateFormat.parse(str); + textLenghtCheck(str.split("-")[0], 4, errorList, "新认证车实施日期年份"); } catch (ParseException e) { errorList.add("新认证车实施日期格式错误!"); break; @@ -1270,11 +1343,25 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe } } + String newProductionImplementation = data.getNewProductionImplementation(); + if (StringUtils.isNotBlank(newProductionImplementation)){ + for (String str : newProductionImplementation.split(",")) { + try { + dateFormat.parse(str); + textLenghtCheck(str.split("-")[0], 4, errorList, "新生产车实施日期年份"); + } catch (ParseException e) { + errorList.add("新生产车实施日期格式错误!"); + break; + } + } + } + String registrationDate = data.getRegistrationDate(); if (StringUtils.isNotBlank(registrationDate)){ for (String str : registrationDate.split(",")) { try { dateFormat.parse(str); + textLenghtCheck(str.split("-")[0], 4, errorList, "注册日期年份"); } catch (ParseException e) { errorList.add("注册日期格式错误!"); break;