uapbd_bom新增接口优化_修改三方注册编码_添加物料查询为空判断

This commit is contained in:
李正@用友 2025-05-07 09:28:28 +08:00
parent eef8d75183
commit d119f9afb0
1 changed files with 9 additions and 2 deletions

View File

@ -120,6 +120,11 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
for (int i = 0; i < items.length; i++) { for (int i = 0; i < items.length; i++) {
MaterialVO bankAccSub = (MaterialVO) iUifService.queryByPrimaryKey(MaterialVO.class, MaterialVO bankAccSub = (MaterialVO) iUifService.queryByPrimaryKey(MaterialVO.class,
items[i].getAttributeValue("cmaterialid").toString()); 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")); items[i].setAttributeValue("cmaterialvid", bankAccSub.getAttributeValue("pk_source"));
} }
} }
@ -162,7 +167,7 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
newAggVOList.add(result[0]); newAggVOList.add(result[0]);
} }
return ResultMessageUtil.toJSON(newAggVOList.toArray(new AggBomVO[0]), "BOM保存成功"); return ResultMessageUtil.toJSON(newAggVOList.toArray(new AggBomVO[0]), "BOM保存成功");
} else if ("dlkght".equals(userCode)) { } else if ("dlkgsrm".equals(userCode)) {
for (AggBomVO aggvo : commitAggvoList) { for (AggBomVO aggvo : commitAggvoList) {
try { try {
result = service.insertCommitBomWithParam_RequiresNew(new AggBomVO[] { aggvo }, true, true); 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", return ResultMessageUtil.toJSON(newAggVOList.toArray(new AggBomVO[0]), "100999",
"BOM保存提交成功部分成功部分失败", true); "BOM保存提交成功部分成功部分失败", true);
}else{
return ResultMessageUtil.exceptionToJSON("BOM保存失败,新增不允许单据状态自由或者空和审批通过同时存在", "999");
} }
} else { } else {
return ResultMessageUtil.exceptionToJSON("BOM保存失败,新增不允许单据状态自由或者空和审批通过同时存在", "999"); ExceptionUtils.wrappBusinessException("未匹配到符合条件的三方注册账号,请检查!!!");
} }
// 请求参数状态为审批通过时自动提交--不设审批流 end // 请求参数状态为审批通过时自动提交--不设审批流 end
return ResultMessageUtil.toJSON(result, "BOM保存成功"); return ResultMessageUtil.toJSON(result, "BOM保存成功");