bom新增接口优化_V8_添加表头物料翻译判断

This commit is contained in:
李正@用友 2025-05-09 09:12:38 +08:00
parent 089b56a8b6
commit 7764819dd9
1 changed files with 11 additions and 2 deletions

View File

@ -117,6 +117,15 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
IUifService iUifService = NCLocator.getInstance().lookup(IUifService.class);
for (AggBomVO aggtwo : aggVOs) {
BomItemVO[] items = aggtwo.getChildrenVO();
//2025年5月9日08点56分--添加表头物料翻译校验 start
if(aggtwo.getParent().getAttributeValue("hcmaterialid")!=null){
MaterialVO headMaterialVO = (MaterialVO) iUifService.queryByPrimaryKey(MaterialVO.class,
aggtwo.getParent().getAttributeValue("hcmaterialid").toString());
if(headMaterialVO==null){
ExceptionUtils.wrappBusinessException("根据物料【"+aggtwo.getParent().getAttributeValue("hcmaterialid").toString()+"】查询物料失败请在BIP里确认是否物料已存在");
}
}
//2025年5月9日08点56分--添加表头物料翻译校验 end
for (int i = 0; i < items.length; i++) {
MaterialVO bankAccSub = (MaterialVO) iUifService.queryByPrimaryKey(MaterialVO.class,
items[i].getAttributeValue("cmaterialid").toString());
@ -191,10 +200,10 @@ public class APIBomBusinessServiceImpl implements IAPIBomBusinessService {
return ResultMessageUtil.toJSON(newAggVOList.toArray(new AggBomVO[0]), "100999",
"BOM保存提交成功部分成功部分失败", true);
}else{
return ResultMessageUtil.exceptionToJSON("BOM保存失败,新增不允许单据状态自由或者空和审批通过同时存在", "999");
ExceptionUtils.wrappBusinessException("未匹配到符合条件的三方注册用户账号【"+userCode+"】,请检查!!!");
}
} else {
ExceptionUtils.wrappBusinessException("未匹配到符合条件的三方注册账号,请检查!!!");
return ResultMessageUtil.exceptionToJSON("BOM保存失败,新增不允许单据状态自由或者空和审批通过同时存在", "999");
}
// 请求参数状态为审批通过时自动提交--不设审批流 end
return ResultMessageUtil.toJSON(result, "BOM保存成功");