Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom
This commit is contained in:
commit
07b4f1bc17
|
|
@ -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.setVirtualPackageIs(parentEntity.getVirtualPackageIs());
|
||||||
child.setChangeDesc(parentEntity.getChangeDesc());
|
child.setChangeDesc(parentEntity.getChangeDesc());
|
||||||
child.setNoticeNums(parentEntity.getNoticeNums());
|
child.setNoticeNums(parentEntity.getNoticeNums());
|
||||||
|
child.setSuperMaterialStatus(parentEntity.getSuperMaterialStatus());
|
||||||
|
|
||||||
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue()) && EBomStatusEnum.PUBLISHED.getValue() > parentEntity.getStatus()) {
|
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue()) && EBomStatusEnum.PUBLISHED.getValue() > parentEntity.getStatus()) {
|
||||||
child.setStatus(EBomStatusEnum.BORROWED_PARTS.getValue());
|
child.setStatus(EBomStatusEnum.BORROWED_PARTS.getValue());
|
||||||
|
|
@ -333,6 +333,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
child.setStatus(parent.getStatus());
|
child.setStatus(parent.getStatus());
|
||||||
child.setEditStatus(parent.getEditStatus());
|
child.setEditStatus(parent.getEditStatus());
|
||||||
child.setVirtualPackageIs(parent.getVirtualPackageIs());
|
child.setVirtualPackageIs(parent.getVirtualPackageIs());
|
||||||
|
child.setSuperMaterialStatus(parent.getSuperMaterialStatus());
|
||||||
if (MaterialshouldBomExistUtil.checkShouldBomExist(child)) {
|
if (MaterialshouldBomExistUtil.checkShouldBomExist(child)) {
|
||||||
child.setCurrentVersion(OriginalConstant.NO_BOM_VERSION);
|
child.setCurrentVersion(OriginalConstant.NO_BOM_VERSION);
|
||||||
child.setStatus(parent.getStatus());
|
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>
|
* <p>
|
||||||
|
|
@ -1441,6 +1470,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
//ebomChildService.getBaseMapper().updateEBomMaterialUse();
|
//ebomChildService.getBaseMapper().updateEBomMaterialUse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
superMaterialStatus(dto.getDatas());
|
||||||
|
|
||||||
|
|
||||||
if (dto.getParent() != null) {
|
if (dto.getParent() != null) {
|
||||||
if (CollectionUtil.isNotEmpty(dto.getDelDatas())) {
|
if (CollectionUtil.isNotEmpty(dto.getDelDatas())) {
|
||||||
deleteBomChild(dto.getDelDatas());
|
deleteBomChild(dto.getDelDatas());
|
||||||
|
|
@ -1513,7 +1545,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
ebomChildService.saveOrUpdateBatch(eBomEdit.childEntities);
|
ebomChildService.saveOrUpdateBatch(eBomEdit.childEntities);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
superMaterialStatus(dto.getDatas());
|
||||||
|
|
||||||
// checkAndSaveEBomException(dto.getParent().getBomRowId());
|
// checkAndSaveEBomException(dto.getParent().getBomRowId());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue