From c4faae1d73f5b66f968e7306a8beb5fb43a36107 Mon Sep 17 00:00:00 2001 From: Rui_Li <877258667@qq.com> Date: Thu, 17 Jul 2025 10:29:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=90=8C=E6=AD=A5=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2sql=E4=BF=AE=E6=94=B9=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/spring/ifs/bean/BomServiceBean.java | 2 +- .../spring/ifs/bean/InventoryServiceBean.java | 17 ++++++----------- .../com/spring/ifs/bean/RecipeServiceBean.java | 2 +- .../spring/ifs/bean/RecipeServiceBeanTest.java | 2 +- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/spring/ifs/bean/BomServiceBean.java b/src/main/java/com/spring/ifs/bean/BomServiceBean.java index 487e3ca9..9a605081 100644 --- a/src/main/java/com/spring/ifs/bean/BomServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/BomServiceBean.java @@ -54,7 +54,7 @@ public class BomServiceBean { Map bomMap = BomApi.getBomHeader(srv, contract, partNo, engChgLevel, bomType); //判断是否需要插入到ifs if(bomMap == null || bomMap.size() == 0) { - throw new RuntimeException("Bom不存在!"); + throw new APException("Bom不存在!"); } //设置ifs 信息 inData.setIfsRowId(bomMap.get("IFSROWID")); diff --git a/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java b/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java index 73a57376..6914edb9 100644 --- a/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/InventoryServiceBean.java @@ -742,18 +742,13 @@ public class InventoryServiceBean { searchData.setPartNo(partNo); Map masterPartMap = null; //调用api方法获取事件的编码 - try { - masterPartMap = MasterPartApi.getMasterPart(srv, partNo); - } catch (APException e) { - throw new RuntimeException(e.getMessage()); - } - if (masterPartMap == null || masterPartMap.size() == 0) { - masterPartFlag = true; - }else { - masterPartFlag = false; - - } try{ + masterPartMap = MasterPartApi.getMasterPart(srv, partNo); + if (masterPartMap == null || masterPartMap.size() == 0) { + masterPartFlag = true; + }else { + masterPartFlag = false; + } //调用api方法获取事件的编码 Map resultMap = InventoryPartApi.getCopyPartEventNo(srv); String eventNo = resultMap.get("EVENT_NO"); diff --git a/src/main/java/com/spring/ifs/bean/RecipeServiceBean.java b/src/main/java/com/spring/ifs/bean/RecipeServiceBean.java index cc6f241b..ed5e58d5 100644 --- a/src/main/java/com/spring/ifs/bean/RecipeServiceBean.java +++ b/src/main/java/com/spring/ifs/bean/RecipeServiceBean.java @@ -52,7 +52,7 @@ public class RecipeServiceBean { Map RecipeMap = RecipeApi.getRecipeHeader(srv, contract, partNo, engChgLevel, bomType); //判断是否需要插入到ifs if(RecipeMap == null || RecipeMap.isEmpty()) { - throw new RuntimeException("Recipe不存在!"); + throw new APException("Recipe不存在!"); } //设置ifs 信息 inData.setIfsRowId(RecipeMap.get("IFSROWID")); diff --git a/src/main/java/com/spring/ifs/bean/RecipeServiceBeanTest.java b/src/main/java/com/spring/ifs/bean/RecipeServiceBeanTest.java index 8d59e019..a2ac6f7f 100644 --- a/src/main/java/com/spring/ifs/bean/RecipeServiceBeanTest.java +++ b/src/main/java/com/spring/ifs/bean/RecipeServiceBeanTest.java @@ -57,7 +57,7 @@ public class RecipeServiceBeanTest { Map RecipeMap = RecipeApi.getRecipeHeader(srv, contract, partNo, engChgLevel, bomType); //判断是否需要插入到ifs if(RecipeMap == null || RecipeMap.size() == 0) { - throw new RuntimeException("Recipe不存在!"); + throw new APException("Recipe不存在!"); } //设置ifs 信息 inData.setIfsRowId(RecipeMap.get("IFSROWID"));