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 b49d012..62af813 100644 --- a/uapbd/src/private/nccloud/api/impl/mmbd/bom/APIBomBusinessServiceImpl.java +++ b/uapbd/src/private/nccloud/api/impl/mmbd/bom/APIBomBusinessServiceImpl.java @@ -120,6 +120,11 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService { for (int i = 0; i < items.length; i++) { MaterialVO bankAccSub = (MaterialVO) iUifService.queryByPrimaryKey(MaterialVO.class, items[i].getAttributeValue("cmaterialid").toString()); + //2025年5月7日08点41分 添加为空校验 sdlizheng --start + if(bankAccSub==null){ + ExceptionUtils.wrappBusinessException("根据【cmaterialid:"+items[i].getAttributeValue("cmaterialid").toString()+"】查询物料失败!!!"); + } + //2025年5月7日08点41分 添加为空校验 sdlizheng --end items[i].setAttributeValue("cmaterialvid", bankAccSub.getAttributeValue("pk_source")); } } @@ -162,7 +167,7 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService { newAggVOList.add(result[0]); } return ResultMessageUtil.toJSON(newAggVOList.toArray(new AggBomVO[0]), "BOM保存成功"); - } else if ("dlkght".equals(userCode)) { + } else if ("dlkgsrm".equals(userCode)) { for (AggBomVO aggvo : commitAggvoList) { try { result = service.insertCommitBomWithParam_RequiresNew(new AggBomVO[] { aggvo }, true, true); @@ -185,9 +190,11 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService { } return ResultMessageUtil.toJSON(newAggVOList.toArray(new AggBomVO[0]), "100999", "BOM保存提交成功部分成功部分失败", true); + }else{ + return ResultMessageUtil.exceptionToJSON("BOM保存失败,新增不允许单据状态自由或者空和审批通过同时存在", "999"); } } else { - return ResultMessageUtil.exceptionToJSON("BOM保存失败,新增不允许单据状态自由或者空和审批通过同时存在", "999"); + ExceptionUtils.wrappBusinessException("未匹配到符合条件的三方注册账号,请检查!!!"); } // 请求参数状态为审批通过时,自动提交--不设审批流 end return ResultMessageUtil.toJSON(result, "BOM保存成功");