From bd74999ef6e3bcc9714f52ecf619223fd40398c7 Mon Sep 17 00:00:00 2001 From: 10001392 <1055202292@qq.com> Date: Fri, 27 Sep 2024 13:38:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=A4=84=E7=90=86EBOM?= =?UTF-8?q?=E5=AF=BC=E5=85=A5SAP=E6=8A=A5=E9=94=99=E6=83=85=E5=86=B5?= =?UTF-8?q?=EF=BC=9ASAP=E4=BF=A1=E6=81=AF=E5=90=AB=E6=9C=89=E2=80=9C?= =?UTF-8?q?=E5=9C=A8=E5=B7=A5=E5=8E=821010=E4=B8=AD=E6=9C=AA=E8=A2=AB?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E2=80=9D=EF=BC=8C=E4=B8=8D=E7=AE=97=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/service/BomNewEbomExportToSAP.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomExportToSAP.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomExportToSAP.java index cd7c39c9..f159c2f5 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomExportToSAP.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomExportToSAP.java @@ -3,6 +3,7 @@ package com.nflg.product.bomnew.service; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.spring.SpringUtil; @@ -79,6 +80,7 @@ public class BomNewEbomExportToSAP { sapDto.setI_EMPNO(root.getCreatedBy()); sapDto.setT1(Convert.toList(T1DTO.class, this.children.stream().filter(c -> !c.isIgnore()).collect(Collectors.toList()))); liErrMsg = SpringUtil.getBean(SapOpUtilService.class).importToSapV2(sapDto, null); + this.tempHandleSapErrMsg(liErrMsg); if (CollUtil.isEmpty(liErrMsg)) { state = SapStatusEnum.PUB_SUCCESS; } else if (sapDto.getT1().size() != liErrMsg.size()) { @@ -102,6 +104,18 @@ public class BomNewEbomExportToSAP { return liErrMsg; } + // 乔生要求,临时处理EBOM导入SAP报错情况:SAP信息含有“在工厂1010中未被维护”,不算报错 + // 后面可能取消掉 + private void tempHandleSapErrMsg(List liErrMsg) { + if (CollUtil.isEmpty(liErrMsg)) { + return; + } + List filterList = liErrMsg.stream().filter(item -> ObjectUtil.isNotEmpty(item.msg) && item.msg.contains("在工厂1010中未被维护")).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(filterList)) { + liErrMsg.removeAll(filterList); + } + } + /** * 构建child数据发包编号 * @param p 上级节点的parent