feat: 导入SAP结果的错误信息统一格式

This commit is contained in:
曹鹏飞 2024-07-18 14:58:24 +08:00
parent 3fd368c135
commit 780dbb8216
1 changed files with 8 additions and 13 deletions

View File

@ -26,7 +26,6 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@Service @Service
@ -197,18 +196,14 @@ public class SapOpUtilService {
list.stream() list.stream()
.filter(f -> f.getFLAG().equals("0")) .filter(f -> f.getFLAG().equals("0"))
.forEach(it -> { .forEach(it -> {
if (it.getSTATUS().contains("修改失败计量单位")) { // Matcher matcher = PATTERN.matcher(it.getSTATUS());
errorMsgVOS.add(OperationErrorMsgVO.create(it.getMATNR(), it.getSTATUS())); // if (matcher.find()) {
} else { // if (errorMsgVOS.stream().noneMatch(f -> StrUtil.equals(f.getPrimaryKey(), matcher.group()))) {
Matcher matcher = PATTERN.matcher(it.getSTATUS()); // errorMsgVOS.add(OperationErrorMsgVO.create(matcher.group(), it.getSTATUS()));
if (matcher.find()) { // }
if (errorMsgVOS.stream().noneMatch(f -> StrUtil.equals(f.getPrimaryKey(), matcher.group()))) { // } else {
errorMsgVOS.add(OperationErrorMsgVO.create(matcher.group(), it.getSTATUS()));
}
} else {
errorMsgVOS.add(OperationErrorMsgVO.create(buildErrCol1(it), it.getSTATUS())); errorMsgVOS.add(OperationErrorMsgVO.create(buildErrCol1(it), it.getSTATUS()));
} // }
}
}); });
return errorMsgVOS; return errorMsgVOS;