From 27225bf8f4877834d192cdc59b5f8e0a0606bec1 Mon Sep 17 00:00:00 2001 From: maolei Date: Fri, 20 Jun 2025 14:56:06 +0800 Subject: [PATCH] =?UTF-8?q?APIBOM=20=E6=96=B0=E5=A2=9E:=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20MES=20=E7=94=A8=E6=88=B7=E5=AF=B9=20BOM=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=92=8C=E9=BB=98=E8=AE=A4=E7=9A=84=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 MES 用户判断逻辑,允许 MES 用户在特定条件下设置 BOM 默认版本 - 在数据补充阶段添加 MES 用户的特殊处理方法 --- .../mmbd/bom/APIBomBusinessServiceImpl.java | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/uapbd/src/private/nccloud/api/impl/mmbd/bom/APIBomBusinessServiceImpl.java b/uapbd/src/private/nccloud/api/impl/mmbd/bom/APIBomBusinessServiceImpl.java index 485c686..7f1d50f 100644 --- a/uapbd/src/private/nccloud/api/impl/mmbd/bom/APIBomBusinessServiceImpl.java +++ b/uapbd/src/private/nccloud/api/impl/mmbd/bom/APIBomBusinessServiceImpl.java @@ -53,11 +53,13 @@ import java.util.stream.Stream; public class APIBomBusinessServiceImpl implements IAPIBomBusinessService { - // 2025528 ֯˼άBOM汾Զ㴦 + // 2025528 ֯˼άBOM汾Զ㴦 private static final BaseDAO DAO = new BaseDAO(); private static final IHttpPostOtherSys HTTP_POST_OTHER_SYS = NCLocator.getInstance().lookup(IHttpPostOtherSys.class); + public static final String MESUSERCODE = "MES"; + private static String HEADTABLE = "bd_bom"; private static String BODYTABLE = "bd_bom_b"; @@ -788,6 +790,8 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService { // sdlizheng --Ӷж--plmԽУ if ("gaoning".equals(userCode) || "dlkgsrm".equals(userCode)|| "C029".equals(this.orgCodeFlag)) { // AggBomVO afterVO = service.canceldefault(aggBomVO); + } else if (MESUSERCODE.equals(userCode)) { + //2025-6-20 MESûж } else { return UFBoolean.TRUE; } @@ -811,6 +815,9 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService { private void dataSupplement(AggBomVO agg, String userCode) { orgSupplement(agg, userCode); + // 2025620 - MESûhbdefault(Ĭ)ֶ + handleMesUserDefaultSetting(agg, userCode); + versionTypeSupplement(agg); materialidSupplement(agg); @@ -1663,4 +1670,32 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService { throw new BusinessException("BOM汾쳣" + e.getMessage()); } } + + /** + * MESûhbdefaultֶ߼ + * 2025620 - רMESûĴ + * orgSupplementд + * @auther ë + * @param agg AggBomVO + * @param userCode û + */ + private void handleMesUserDefaultSetting(AggBomVO agg, String userCode) { + // MESûд + if (!MESUSERCODE.equals(userCode)) { + return; + } + + Object fbillstatus = agg.getParent().getAttributeValue("fbillstatus"); + + // MESûʱgaoningdlkgsrmͬ߼hbdefaultֶ + if (fbillstatus != null && "1".equals(fbillstatus.toString())) { + // ̬ʱΪĬЧ + agg.getParent().setAttributeValue("hfversiontype", Integer.valueOf(1)); + agg.getParent().setAttributeValue("hbdefault", UFBoolean.TRUE); + } else if (fbillstatus != null && "-1".equals(fbillstatus.toString())) { + // ̬ʱΪĬЧgaoningû߼һ£ + agg.getParent().setAttributeValue("hfversiontype", Integer.valueOf(1)); + agg.getParent().setAttributeValue("hbdefault", UFBoolean.TRUE); + } + } }