From e5d8013c6644e58b78a3e306a260131a91167070 Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 11 Mar 2025 16:54:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DBug=EF=BC=9A45556=EF=BC=8CPCN?= =?UTF-8?q?-=E7=94=B5=E5=AD=90=E5=8C=96=E6=A3=80=E9=AA=8C=E3=80=81?= =?UTF-8?q?=E6=9D=A1=E7=A0=81=E6=89=93=E5=8D=B0=E7=9A=84=E9=9B=B6=E4=BB=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BC=80=E7=AA=97=EF=BC=8C=E8=A6=81=E7=94=A8?= =?UTF-8?q?unit=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apiservice/controller/busi/MesPartController.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPartController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPartController.java index 6ca491d..a830739 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPartController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPartController.java @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.Iterator; import java.util.List; /** @@ -41,11 +42,18 @@ public class MesPartController { ListPager mesPartListPager = mesPartService.queryMesPart(mesPart, pager); List partList = mesPartListPager.getObjectList(); - for (MesPart part : partList) { - MesPartSap partSap = mesPartService.getMesPartSapByPartNo(part.getPartNo(), part.getOrganizeCode()); - if (partSap != null) { - part.setUnit(partSap.getUnit()); + Iterator iterator = partList.iterator(); + while (iterator.hasNext()) { + MesPart part = iterator.next(); + try { + MesPartSap partSap = mesPartService.getMesPartSapByPartNo(part.getPartNo(), part.getOrganizeCode()); + if (partSap != null) { + part.setUnit(partSap.getUnit()); + } + } catch (ImppBusiException e) { + iterator.remove(); } + } mesPartListPager.setObjectList(partList); return ResultBean.success("查询成功").setListPager(mesPartListPager);