fix(ebom): 增加为空判断

This commit is contained in:
曹鹏飞 2024-06-19 08:22:12 +08:00
parent 9ae5eaaed6
commit 1d50b4686d
2 changed files with 9 additions and 1 deletions

View File

@ -30,4 +30,8 @@ public class BomExceptionQuery implements Serializable {
@ApiModelProperty(value = "rowId", required = true)
@NotNull
protected Long rowId;
@ApiModelProperty(value = "materialNo", required = true)
@NotNull
protected String materialNo;
}

View File

@ -2391,13 +2391,17 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
BomExceptionQuery bom = query.get(index);
BomExceptionVO vo = new BomExceptionVO();
if (index == 0) {
BomNewEbomParentEntity parent = getById(bom.getBomRowId());
VUtils.isTure(Objects.isNull(parent)).throwMessage(bom.getMaterialNo() + "不存在");
checkAndSaveEBomException(bom.getBomRowId(), bom.getRowId());
BomNewEbomParentEntity parent = getById(bom.getBomRowId());
vo.setMaterialNo(parent.getMaterialNo());
vo.setExceptionStatus(parent.getExceptionStatus());
} else {
BomNewEbomChildEntity child = ebomChildService.getById(bom.getRowId());
VUtils.isTure(Objects.isNull(child)).throwMessage(bom.getMaterialNo() + "不存在");
vo.setMaterialNo(child.getMaterialNo());
if (Objects.equals(child.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())) {
BomNewEbomParentEntity parent = getById(bom.getBomRowId());