From a4335e94755c0e7f3dd5cd7b4f0f6451043fedb5 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Wed, 1 Apr 2026 16:40:53 +0800 Subject: [PATCH] =?UTF-8?q?2026-04-01=20=E9=85=8D=E6=96=B9BOM=E3=80=90copy?= =?UTF-8?q?=E3=80=91=E4=BC=98=E5=8C=96=EF=BC=8C=E8=B0=83=E7=94=A8IFS?= =?UTF-8?q?=E6=A0=87=E5=87=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RecipeManagementServiceImpl.java | 55 ++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/spring/modules/part/service/impl/RecipeManagementServiceImpl.java b/src/main/java/com/spring/modules/part/service/impl/RecipeManagementServiceImpl.java index efb710fd..6a61be97 100644 --- a/src/main/java/com/spring/modules/part/service/impl/RecipeManagementServiceImpl.java +++ b/src/main/java/com/spring/modules/part/service/impl/RecipeManagementServiceImpl.java @@ -12,6 +12,8 @@ import com.spring.common.utils.PageUtils; import com.spring.ifs.api.IfsServer; import com.spring.ifs.bean.BomServiceBean; import com.spring.ifs.bean.RecipeServiceBean; +import com.spring.ifs.bean.InventoryServiceBean; +import com.spring.ifs.data.CopyBomStructureData; import com.spring.modules.base.utils.DataUtils; import com.spring.modules.base.utils.HttpClientUtil; import com.spring.modules.base.utils.ResponseData; @@ -48,6 +50,8 @@ public class RecipeManagementServiceImpl extends ServiceImpl().eq("site", data.getPreviousVersion().getSite()).eq("part_no", data.getPreviousVersion().getPartNo())); + boolean isFromPartFormal = fromPartInfo != null && "Y".equals(fromPartInfo.getStatus()); + boolean isToPartFormal = "Y".equals(partInformationEntity.getStatus()); + boolean callIfsCopy = isFromPartFormal && isToPartFormal; + + if (callIfsCopy) { + data.setOfficialFlag("Y"); + } // 1、创建recipeHeader RecipeHeaderEntity header = recipeManagementMapper.queryRecipeHeader(data.getPreviousVersion()); data.setNoteText(header.getNoteText()); @@ -1030,8 +1044,13 @@ public class RecipeManagementServiceImpl extends ServiceImpl copyResult = recipeServiceBean.copyRecipeStructure(srv, copyData); + if (!"200".equals(copyResult.get("resultCode"))) { + throw new RuntimeException("IFS Recipe复制异常:" + copyResult.get("resultMsg")); + } + } catch (Exception e) { + throw new RuntimeException("IFS Recipe复制异常:" + e.getMessage()); + } + } + } + return data; }