From 27aefc328d6b841114213e4821cf4000616fc752 Mon Sep 17 00:00:00 2001 From: maolei Date: Thu, 19 Jun 2025 14:58:28 +0800 Subject: [PATCH] =?UTF-8?q?Bom:=20=E4=BF=AE=E6=94=B9=20BOM=20=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -增加排除用户和金思维 MES 同步组织的判断逻辑 - 对不同情况执行相应的保存处理逻辑 - 优化异常处理,确保错误信息正确记录 --- .../mmbd/bom/APIBomBusinessServiceImpl.java | 56 ++++++++++++++++++- 1 file changed, 54 insertions(+), 2 deletions(-) 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 7efe53a..485c686 100644 --- a/uapbd/src/private/nccloud/api/impl/mmbd/bom/APIBomBusinessServiceImpl.java +++ b/uapbd/src/private/nccloud/api/impl/mmbd/bom/APIBomBusinessServiceImpl.java @@ -199,9 +199,61 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService { } return ResultMessageUtil.toJSON(newAggVOList.toArray(new AggBomVO[0]), "100999", "BOMύɹֳɹʧ", true); - }else{ - ExceptionUtils.wrappBusinessException("δƥ䵽עû˺š"+userCode+"飡"); + } else { + try { + IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class); + + // 鵱ǰûǷΪųû + if (httpPostOtherSys.checkIfExcludeUser()) { + // ųûֱִͬͨ߼ + for (AggBomVO aggvo : commitAggvoList) { + result = service.insertBom(new AggBomVO[] { aggvo }); + newAggVOList.add(result[0]); + } + return ResultMessageUtil.toJSON(newAggVOList.toArray(new AggBomVO[0]), "BOMɹ(ųû)"); + } + + // 鵱ǰ֯Ƿڽ˼άMESͬ֯(֯) + String currentOrgCode = this.orgCodeFlag; + boolean isIncludeOrg = httpPostOtherSys.checkIfIncludeOrg(currentOrgCode); + + if (isIncludeOrg) { + // ڽ˼άMESִͬ֯⴦߼ + for (AggBomVO aggvo : commitAggvoList) { + result = service.insertCommitBomWithParam(new AggBomVO[] { aggvo }, true, true); + newAggVOList.add(result[0]); + } + return ResultMessageUtil.toJSON(newAggVOList.toArray(new AggBomVO[0]), "BOMɹ(˼άMESͬ֯)"); + } else { + // ڽ˼άMESִͬ֯Ĭϴ߼ + for (AggBomVO aggvo : commitAggvoList) { + try { + result = service.insertCommitBomWithParam_RequiresNew(new AggBomVO[] { aggvo }, true, true); + newAggVOList.add(result[0]); + } catch (Exception e) { + if (e.getMessage() != null) { + if (e.getMessage().length() > 100) { + aggvo.getParent().setAttributeValue("hvdef2", e.getMessage().substring(0, 100)); + } else { + aggvo.getParent().setAttributeValue("hvdef2", + e.getMessage().substring(0, e.getMessage().length() - 1)); + } + } else { + Throwable unmarsh = ExceptionUtils.unmarsh(e); + aggvo.getParent().setAttributeValue("hvdef2", "쳣" + unmarsh.getMessage()); + } + newAggVOList.add(aggvo); + } + } + return ResultMessageUtil.toJSON(newAggVOList.toArray(new AggBomVO[0]), "100999", + "BOMύɹֳɹʧ", true); + } + } catch (BusinessException e) { + // HTTPʧʱ˵ԭе쳣 + ExceptionUtils.wrappBusinessException("HTTPжʧܣ" + e.getMessage() + "δƥ䵽עû˺š"+userCode+"飡"); + } } + } else { return ResultMessageUtil.exceptionToJSON("BOMʧ,״̬ɻ߿պͨͬʱ", "999"); }