添加null判断

This commit is contained in:
曹鹏飞 2024-03-18 08:40:46 +08:00
parent 046a0b4854
commit 7e60d7a606
1 changed files with 5 additions and 4 deletions

View File

@ -126,12 +126,14 @@ public class PlmBomToOriginalConvert extends BaseConvert {
} else { //非草稿状态
//判断Ebom 的状态 eBom草稿
BomNewEbomParentEntity ebom = getEbom(parent.getChartNo());
if (ebom.getStatus()<EBomStatusEnum.PUBLISHED.getValue()) {
if(ebom==null){
importErrorResult.add(new ImportOriginalBomVO(parent.getChartNo(),"未找到ebom数据") );
}
else if (ebom.getStatus()<EBomStatusEnum.PUBLISHED.getValue()) {
//相同用户
if (ebom.getCreatedBy() == parent.getCreatedBy()) {
if (Objects.equals(ebom.getCreatedBy(), parent.getCreatedBy())) {
importErrorResult.add(new ImportOriginalBomVO(parent.getChartNo(),"此数据已创建BOM请删除BOM重新导入") );
// VUtils.isTure(true).throwMessage("图号:"+parent.getChartNo()+"此数据已创建BOM请删除BOM重新导入");
} else {
UserInfoVO userInfo =SpringUtil.getBean(UserInfoService.class).getUserInfoByUserCode(ebom.getCreatedBy());
importErrorResult.add(new ImportOriginalBomVO( parent.getChartNo(),"此数据已被"+userInfo.getRealName()+"("+userInfo.getUserCode()+")创建请联系TA处理"));
@ -147,7 +149,6 @@ public class PlmBomToOriginalConvert extends BaseConvert {
}
}
}
}
}
else //无子级