Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -214,4 +214,6 @@ public class ResultCommon {
|
|||||||
|
|
||||||
public static final String CAN_NOT_FIND_FIELD = "can_not_find_field";
|
public static final String CAN_NOT_FIND_FIELD = "can_not_find_field";
|
||||||
|
|
||||||
|
public static final String TREE_NODE_EXISTS = "tree.node.exists";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+45
-21
@@ -85,8 +85,10 @@ import java.io.InputStream;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import static com.jero.modules.activiti.common.ActivitiCommon.*;
|
import static com.jero.modules.activiti.common.ActivitiCommon.*;
|
||||||
import static com.jero.modules.activiti.process.standardComplianceCheck.common.ProcessStandardComplianceCheckConstants.UNALLOCATED_QUANTITY;
|
import static com.jero.modules.activiti.process.standardComplianceCheck.common.ProcessStandardComplianceCheckConstants.UNALLOCATED_QUANTITY;
|
||||||
@@ -625,6 +627,9 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> importExcelWithData(MultipartFile file, String taskId) throws IOException {
|
public Map<String, Object> importExcelWithData(MultipartFile file, String taskId) throws IOException {
|
||||||
|
// 异步获取 handleData
|
||||||
|
CompletableFuture<ProcessInfoVO<ProcessSccVO>> handleDataFuture = CompletableFuture.supplyAsync(() -> this.getHandleData(taskId));
|
||||||
|
|
||||||
List<SysDictItemCore> listDict = commonAPI.getDictItemAll();
|
List<SysDictItemCore> listDict = commonAPI.getDictItemAll();
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
List<String> errorMsgs = new ArrayList<>();
|
List<String> errorMsgs = new ArrayList<>();
|
||||||
@@ -715,8 +720,9 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
|||||||
resultMap.put("flag", YesOrNoEnum.YES.getValue());
|
resultMap.put("flag", YesOrNoEnum.YES.getValue());
|
||||||
// 转换为字典值
|
// 转换为字典值
|
||||||
this.transToDictValue(list, listDict, fileMap);
|
this.transToDictValue(list, listDict, fileMap);
|
||||||
|
// 等待异步获取的数据返回
|
||||||
|
ProcessInfoVO<ProcessSccVO> handleData = handleDataFuture.join();
|
||||||
// 清洗
|
// 清洗
|
||||||
ProcessInfoVO<ProcessSccVO> handleData = this.getHandleData(taskId);
|
|
||||||
this.cleanData(list, handleData.getBusinessInfoDTO().getDetailInfoList());
|
this.cleanData(list, handleData.getBusinessInfoDTO().getDetailInfoList());
|
||||||
resultMap.put("dataList", list);
|
resultMap.put("dataList", list);
|
||||||
}
|
}
|
||||||
@@ -760,37 +766,55 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void cleanData(List<WithoutDistributeExcelTemplate> list, List<ProcessStandardComplianceCheckDetail> existDataList) {
|
private void cleanData(List<WithoutDistributeExcelTemplate> list, List<ProcessStandardComplianceCheckDetail> existDataList) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
IntStream.range(0, list.size()).parallel().forEach(i -> {
|
||||||
WithoutDistributeExcelTemplate item = list.get(i);
|
WithoutDistributeExcelTemplate item = list.get(i);
|
||||||
item.setId(existDataList.get(i).getId());
|
ProcessStandardComplianceCheckDetail existingData = existDataList.get(i);
|
||||||
item.setProcessInstanceId(existDataList.get(i).getProcessInstanceId());
|
|
||||||
item.setCheckId(existDataList.get(i).getCheckId());
|
// 设置基础属性
|
||||||
|
item.setId(existingData.getId());
|
||||||
|
item.setProcessInstanceId(existingData.getProcessInstanceId());
|
||||||
|
item.setCheckId(existingData.getCheckId());
|
||||||
|
|
||||||
|
// 根据 result 进行条件清理
|
||||||
String result = item.getResult();
|
String result = item.getResult();
|
||||||
if (StrUtil.isBlank(result)) {
|
if (StrUtil.isBlank(result)) {
|
||||||
item.setUnsatisfiedRequire(null);
|
clearFieldsForBlankResult(item);
|
||||||
item.setCorrectionSolution(null);
|
|
||||||
item.setCorrectionCost(null);
|
|
||||||
item.setCommonality(null);
|
|
||||||
item.setCommonalityCost(null);
|
|
||||||
item.setRemark(null);
|
|
||||||
item.setMaterial(null);
|
|
||||||
} else {
|
} else {
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case CONFORM_TO:
|
case CONFORM_TO:
|
||||||
case NOT_INVOLVE:
|
case NOT_INVOLVE:
|
||||||
item.setUnsatisfiedRequire(null);
|
clearFieldsForConformOrNotInvolve(item);
|
||||||
item.setCorrectionSolution(null);
|
|
||||||
item.setCorrectionCost(null);
|
|
||||||
item.setCommonality(null);
|
|
||||||
item.setCommonalityCost(null);
|
|
||||||
break;
|
break;
|
||||||
case DISCREPANCY:
|
case DISCREPANCY:
|
||||||
case TO_BE_VERIFIED:
|
case TO_BE_VERIFIED:
|
||||||
item.setRemark(null);
|
clearFieldsForDiscrepancyOrToBeVerified(item);
|
||||||
item.setMaterial(null);
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearFieldsForBlankResult(WithoutDistributeExcelTemplate item) {
|
||||||
|
item.setUnsatisfiedRequire(null);
|
||||||
|
item.setCorrectionSolution(null);
|
||||||
|
item.setCorrectionCost(null);
|
||||||
|
item.setCommonality(null);
|
||||||
|
item.setCommonalityCost(null);
|
||||||
|
item.setRemark(null);
|
||||||
|
item.setMaterial(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearFieldsForConformOrNotInvolve(WithoutDistributeExcelTemplate item) {
|
||||||
|
item.setUnsatisfiedRequire(null);
|
||||||
|
item.setCorrectionSolution(null);
|
||||||
|
item.setCorrectionCost(null);
|
||||||
|
item.setCommonality(null);
|
||||||
|
item.setCommonalityCost(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearFieldsForDiscrepancyOrToBeVerified(WithoutDistributeExcelTemplate item) {
|
||||||
|
item.setRemark(null);
|
||||||
|
item.setMaterial(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transToDictValue(List<WithoutDistributeExcelTemplate> list, List<SysDictItemCore> listDict, Map<String, File> fileMap) {
|
private void transToDictValue(List<WithoutDistributeExcelTemplate> list, List<SysDictItemCore> listDict, Map<String, File> fileMap) {
|
||||||
@@ -802,7 +826,7 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
|||||||
|
|
||||||
private List<String> validationList(List<WithoutDistributeExcelTemplate> list, List<SysDictItemCore> listDict, Map<String, File> fileMap) {
|
private List<String> validationList(List<WithoutDistributeExcelTemplate> list, List<SysDictItemCore> listDict, Map<String, File> fileMap) {
|
||||||
List<String> errorMsgs = new ArrayList<>();
|
List<String> errorMsgs = new ArrayList<>();
|
||||||
int i = 4;
|
int i = 2;
|
||||||
Iterator<WithoutDistributeExcelTemplate> iterator = list.iterator();
|
Iterator<WithoutDistributeExcelTemplate> iterator = list.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
WithoutDistributeExcelTemplate data = iterator.next();
|
WithoutDistributeExcelTemplate data = iterator.next();
|
||||||
|
|||||||
+3
-4
@@ -3,6 +3,7 @@ package com.jero.modules.laws.standard.service.impl;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.jero.common.api.vo.ResultCommon;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
import com.jero.common.constant.FillRuleConstant;
|
import com.jero.common.constant.FillRuleConstant;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
@@ -161,8 +162,7 @@ public class LawsTreeNodeServiceImpl extends ServiceImpl<LawsTreeNodeMapper, Law
|
|||||||
query.eq(LawsTreeNode::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
query.eq(LawsTreeNode::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||||
List<LawsTreeNode> lawsTreeNodes = this.list(query);
|
List<LawsTreeNode> lawsTreeNodes = this.list(query);
|
||||||
if (lawsTreeNodes != null && !lawsTreeNodes.isEmpty()) {
|
if (lawsTreeNodes != null && !lawsTreeNodes.isEmpty()) {
|
||||||
//TODO 翻译
|
throw new JeroBootException(ResultCommon.TREE_NODE_EXISTS, lawsTreeNode.getNodeName());
|
||||||
throw new JeroBootException("已存在名为" + lawsTreeNode.getNodeName() + "的节点");
|
|
||||||
}
|
}
|
||||||
String s = UUID.randomUUID().toString().replace("-", "");
|
String s = UUID.randomUUID().toString().replace("-", "");
|
||||||
lawsTreeNode.setId(s);
|
lawsTreeNode.setId(s);
|
||||||
@@ -196,8 +196,7 @@ public class LawsTreeNodeServiceImpl extends ServiceImpl<LawsTreeNodeMapper, Law
|
|||||||
query.ne(LawsTreeNode::getId,lawsTreeNode.getId());
|
query.ne(LawsTreeNode::getId,lawsTreeNode.getId());
|
||||||
List<LawsTreeNode> lawsTreeNodes = this.list(query);
|
List<LawsTreeNode> lawsTreeNodes = this.list(query);
|
||||||
if (lawsTreeNodes != null && !lawsTreeNodes.isEmpty()) {
|
if (lawsTreeNodes != null && !lawsTreeNodes.isEmpty()) {
|
||||||
//TODO 翻译
|
throw new JeroBootException(ResultCommon.TREE_NODE_EXISTS, lawsTreeNode.getNodeName());
|
||||||
throw new JeroBootException("已存在名为" + lawsTreeNode.getNodeName() + "的节点");
|
|
||||||
}
|
}
|
||||||
this.updateById(lawsTreeNode);
|
this.updateById(lawsTreeNode);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -87,3 +87,4 @@ model.import.data.error=\u8F66\u578B\u9879\u76EE\u6587\u4EF6\u4E0A\u4F20\u6570\u
|
|||||||
file.empty.import.error=\u6587\u4EF6\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5
|
file.empty.import.error=\u6587\u4EF6\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5
|
||||||
can_not_find_template_file=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u6A21\u677F\u6587\u4EF6
|
can_not_find_template_file=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u6A21\u677F\u6587\u4EF6
|
||||||
can_not_find_field=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u5B57\u6BB5
|
can_not_find_field=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u5B57\u6BB5
|
||||||
|
tree.node.exists=\u5DF2\u5B58\u5728\u540D\u4E3A"{0}"\u7684\u8282\u70B9"
|
||||||
@@ -105,3 +105,4 @@ row.size.too.large=Row size too large
|
|||||||
can_not_find_template_file=Can not find template file name {0}
|
can_not_find_template_file=Can not find template file name {0}
|
||||||
can_not_find_field=Can not find field {0}
|
can_not_find_field=Can not find field {0}
|
||||||
tag.add.error.1=The attribute name is too long
|
tag.add.error.1=The attribute name is too long
|
||||||
|
tree.node.exists=Name {0} tree node exists
|
||||||
@@ -104,3 +104,4 @@ row.size.too.large=\u884C\u5927\u5C0F\u592A\u5927
|
|||||||
can_not_find_template_file=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u6A21\u677F\u6587\u4EF6
|
can_not_find_template_file=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u6A21\u677F\u6587\u4EF6
|
||||||
can_not_find_field=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u5B57\u6BB5
|
can_not_find_field=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u5B57\u6BB5
|
||||||
tag.add.error.1=\u5C5E\u6027\u540D\u79F0\u592A\u957F
|
tag.add.error.1=\u5C5E\u6027\u540D\u79F0\u592A\u957F
|
||||||
|
tree.node.exists=\u5DF2\u5B58\u5728\u540D\u4E3A"{0}"\u7684\u8282\u70B9"
|
||||||
Reference in New Issue
Block a user