Ebom超级物料标签
This commit is contained in:
parent
9efab16980
commit
d369a0daae
|
|
@ -0,0 +1,18 @@
|
|||
package com.nflg.product.bomnew.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
|
||||
public enum EBomSuperMaterialStatusEnum implements ValueEnum<Integer> {
|
||||
|
||||
//超级物料 0-否 1-是
|
||||
SUPER_MATERIAL_0(0, "否"),
|
||||
SUPER_MATERIAL_1(1, "是");
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -314,7 +314,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
child.setVirtualPackageIs(parentEntity.getVirtualPackageIs());
|
||||
child.setChangeDesc(parentEntity.getChangeDesc());
|
||||
child.setNoticeNums(parentEntity.getNoticeNums());
|
||||
|
||||
child.setSuperMaterialStatus(parentEntity.getSuperMaterialStatus());
|
||||
|
||||
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue()) && EBomStatusEnum.PUBLISHED.getValue() > parentEntity.getStatus()) {
|
||||
child.setStatus(EBomStatusEnum.BORROWED_PARTS.getValue());
|
||||
|
|
@ -333,6 +333,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
child.setStatus(parent.getStatus());
|
||||
child.setEditStatus(parent.getEditStatus());
|
||||
child.setVirtualPackageIs(parent.getVirtualPackageIs());
|
||||
child.setSuperMaterialStatus(parent.getSuperMaterialStatus());
|
||||
if (MaterialshouldBomExistUtil.checkShouldBomExist(child)) {
|
||||
child.setCurrentVersion(OriginalConstant.NO_BOM_VERSION);
|
||||
child.setStatus(parent.getStatus());
|
||||
|
|
@ -1419,6 +1420,34 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 2. 只有含有BOM的物料才可以打“超级物料的”标签,如果不存在下级BOM时,不可以打标。
|
||||
* 3. 需求:编辑页面需要添加一个是否为超级物料的选项,属于一个打标签的功能
|
||||
* @param datas
|
||||
*/
|
||||
private void superMaterialStatus( List<BomNewEbomParentVO> datas){
|
||||
|
||||
List<BomNewEbomParentVO> superTagList=datas.stream().filter(item-> item.getSuperMaterialStatus()!=null
|
||||
// && item.getSuperMaterialStatus().equals(EBomSuperMaterialStatusEnum.SUPER_MATERIAL_1.getValue())
|
||||
&& item.getBomRowId()!=null && item.getBomRowId().longValue()>0
|
||||
).collect(Collectors.toList());
|
||||
|
||||
List<BomNewEbomParentEntity> updateList=new ArrayList<>();
|
||||
for (BomNewEbomParentVO vo:superTagList){
|
||||
BomNewEbomParentEntity entity=new BomNewEbomParentEntity();
|
||||
entity.setRowId(vo.getBomRowId());
|
||||
entity.setSuperMaterialStatus(vo.getSuperMaterialStatus());
|
||||
updateList.add(entity);
|
||||
}
|
||||
|
||||
if(CollectionUtil.isNotEmpty(updateList)){
|
||||
this.updateBatchById(updateList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 暂存
|
||||
* <p>
|
||||
|
|
@ -1441,6 +1470,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
//ebomChildService.getBaseMapper().updateEBomMaterialUse();
|
||||
}
|
||||
|
||||
superMaterialStatus(dto.getDatas());
|
||||
|
||||
|
||||
if (dto.getParent() != null) {
|
||||
if (CollectionUtil.isNotEmpty(dto.getDelDatas())) {
|
||||
deleteBomChild(dto.getDelDatas());
|
||||
|
|
@ -1513,7 +1545,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
ebomChildService.saveOrUpdateBatch(eBomEdit.childEntities);
|
||||
|
||||
}
|
||||
|
||||
superMaterialStatus(dto.getDatas());
|
||||
|
||||
// checkAndSaveEBomException(dto.getParent().getBomRowId());
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue