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 40532422..a7854e2a 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 @@ -91,6 +91,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.View; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -146,6 +147,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe private final int TEXT_LENGTH = 50; private final int TEXT_DICT_LENGTH = 500; private final int TEXT_AREA_LENGTH = 2000; + private final View error; + @Override public void flowStart(StandardInterpretFlowDTO standardInterpretFlowDTO) { // 流程信息 @@ -556,7 +559,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe log.info("标准解读流程-流程监听器 结束"); } - private void checkLength(ProcessStandardInterpretClauseSublist clauseSublist, int i) { + private String checkLength(ProcessStandardInterpretClauseSublist clauseSublist, int i) { + StringBuilder error = new StringBuilder(); List tagList = lawsTagService.list( new LambdaQueryWrapper() .eq(LawsTag::getTableName, "laws_document_split") @@ -584,16 +588,25 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe if (StringUtils.isNotBlank(value)) { if (value.length() > v.getDbLength()) { if(LanguageEnum.CN.equals(MessageUtils.getLanguage())) { - throw new JeroBootException("第" + (i + 1) + "行: 字段 " + - v.getDbFieldTxt() + "长度不能超过" + v.getDbLength() + "
"); + error.append("字段 ").append(v.getDbFieldTxt()).append("长度不能超过") + .append(v.getDbLength()).append(","); }else { - throw new JeroBootException("Line " + (i + 1) + ": The field " + - v.getDbFieldName() + "length shall not exceed" + v.getDbFieldEnName() + "
"); + error.append("The field ").append(v.getDbFieldEnName()).append("length shall not exceed") + .append(v.getDbLength()).append(","); } } } }); } + if (error.length() > 0){ + if(LanguageEnum.CN.equals(MessageUtils.getLanguage())) { + error.insert(0,"第" + (i + 1) + "行:"); + }else { + error.insert(0,"Line " + (i + 1) + ":"); + } + error.delete(error.length() - 1, error.length()).append("
"); + } + return error.toString(); } private void distinct(ProcessStandardInterpretClauseSublist data) { @@ -1777,8 +1790,12 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe break; // 标准主解读汇总(分发) case StandardInterpretCommon.MASTER_INTERPRET_SUMMARY: + List mesList = new ArrayList<>(); for (int i = 0; i < processStandardInterpretClauseSublistList.size(); i++) { - checkLength(processStandardInterpretClauseSublistList.get(i), i); + mesList.add(checkLength(processStandardInterpretClauseSublistList.get(i), i)); + } + if (CollectionUtils.isNotEmpty(mesList)){ + throw new JeroBootException(String.join("", mesList)); } // 保存会签人员、审核人员、批准人员 processStandardInterpretService.updateById(processStandardInterpret);