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