From 8d5dcc464fa9b974ad7c53c6e9357309833399d6 Mon Sep 17 00:00:00 2001 From: 10001392 <1055202292@qq.com> Date: Thu, 14 Nov 2024 15:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=99=E6=A1=83=E7=94=A8=E6=88=B7EBOM?= =?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 | 13 +++++++++++++ 1 file changed, 13 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 996c91cd..b80c77f7 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; @@ -100,6 +101,7 @@ public class BomNewEbomExportToSAP { // } 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()) { @@ -123,6 +125,17 @@ 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) && ObjectUtil.isNotEmpty(SessionUtil.getFullDeptName()) && SessionUtil.getFullDeptName().contains("仙桃")) { + liErrMsg.removeAll(filterList); + } + } + /** * 单层导入,过滤出指定父级物料号的子级即可 * @param materialNo 父级物料号