fix(88310): 增加校验
This commit is contained in:
+31
-5
@@ -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<ProcessStandardInterpretClauseSublist> 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<String> firstVerify = firstVerify(i, list.get(i), lawsDomesticStandard, splitInfoId);
|
||||
List<String> firstVerify = firstVerify(i, list.get(i), lawsDomesticStandard, splitInfoId,
|
||||
processStandardInterpretClauseSublistList);
|
||||
List<String> secondVerify = secondVerify(list.get(i));
|
||||
List<String> thirdVerify = thirdVerify(list.get(i));
|
||||
List<String> fifthVerify = fifthVerify(list.get(i));
|
||||
@@ -1256,7 +1274,8 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
||||
}
|
||||
|
||||
private List<String> firstVerify(int i, ProcessStandardInterpretClauseSublist data,
|
||||
LawsDomesticStandard lawsDomesticStandard, String splitInfoId) {
|
||||
LawsDomesticStandard lawsDomesticStandard, String splitInfoId,
|
||||
List<ProcessStandardInterpretClauseSublist> clauseSublistList) {
|
||||
List<String> 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<LawsDocumentSplit>()
|
||||
.eq(LawsDocumentSplit::getInfoId, splitInfoId)
|
||||
|
||||
Reference in New Issue
Block a user