EBOM工作明细中【删除】时,校验状态是否为草稿状态中

This commit is contained in:
10002327 2024-11-06 10:40:26 +08:00
parent 8e97f53ffa
commit ac23d075a5
2 changed files with 6 additions and 3 deletions

View File

@ -451,8 +451,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
child.setEditStatus(parent.getEditStatus()); child.setEditStatus(parent.getEditStatus());
child.setVirtualPackageIs(parent.getVirtualPackageIs()); child.setVirtualPackageIs(parent.getVirtualPackageIs());
child.setSuperMaterialStatus(parent.getSuperMaterialStatus()); child.setSuperMaterialStatus(parent.getSuperMaterialStatus());
// 1040506070大类以及200201小类这些不需要BOM的物料版本号显示B00 by 10002327 241012 // 1040506070大类以及200201小类这些不需要BOM的物料项目类别为T项版本号显示B00 by 10002327 241012
if(MaterialshouldBomExistUtil.checkNoNeedBom(child)){ if(MaterialshouldBomExistUtil.checkNoNeedBom(child)
|| Objects.equals(child.getProjectType(),"T")){
child.setCurrentVersion(OriginalConstant.NO_NEED_BOM); child.setCurrentVersion(OriginalConstant.NO_NEED_BOM);
}else if (MaterialshouldBomExistUtil.checkShouldBomExist(child)) { }else if (MaterialshouldBomExistUtil.checkShouldBomExist(child)) {
child.setCurrentVersion(OriginalConstant.NO_BOM_VERSION); child.setCurrentVersion(OriginalConstant.NO_BOM_VERSION);
@ -3214,6 +3215,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
BomNewEbomParentEntity parent = getById(bomRowId); BomNewEbomParentEntity parent = getById(bomRowId);
VUtils.isTure(Objects.isNull(parent)).throwMessage("bom不存在"); VUtils.isTure(Objects.isNull(parent)).throwMessage("bom不存在");
// VUtils.isTure(root.getRootIs() != 1 && root.getUserRootIs() != 1).throwMessage("请选择根节点"); // VUtils.isTure(root.getRootIs() != 1 && root.getUserRootIs() != 1).throwMessage("请选择根节点");
//校验状态发布PBOM以后不能再删除 10002327 241106
VUtils.isTure(parent.getStatus() != null && parent.getStatus() >= EBomStatusEnum.PUBLISHED.getValue()).throwMessage("发布PBOM之后不能再删除~");
LogRecordContext.putVariable("bom", parent); LogRecordContext.putVariable("bom", parent);

View File

@ -494,7 +494,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
} else { } else {
child.setCurrentVersion(OriginalConstant.DEFAULT_BOM_VERSION); child.setCurrentVersion(OriginalConstant.DEFAULT_BOM_VERSION);
} }
if (type == 0 && child.getStatus() >= EBomStatusEnum.PUBLISHED.getValue()) { if (type == 0 && child.getStatus() != null && child.getStatus() >= EBomStatusEnum.PUBLISHED.getValue()) {
child.setStatus(PBomStatusEnum.BORROWED_PARTS.getValue()); child.setStatus(PBomStatusEnum.BORROWED_PARTS.getValue());
} }
} }