Merge branch 'feature/DM/nflg-bom' of http://112.74.186.154:3000/nflj/nflg_project into feature/DM/nflg-bom

This commit is contained in:
jing's 2024-01-25 16:25:38 +08:00
commit 1d8d523e0f
1 changed files with 8 additions and 4 deletions

View File

@ -37,7 +37,7 @@ public class TechnologyPackageParamBuilder {
BomNewPbomParentEntity parent; BomNewPbomParentEntity parent;
@Getter @Getter
List<BomNewPbomParentEntity> packageParent=null; List<BomNewPbomParentEntity> packageParent=new ArrayList<>();
@Getter @Getter
List<BomNewPbomChildEntity> packageChildren=new ArrayList<>(); List<BomNewPbomChildEntity> packageChildren=new ArrayList<>();
@ -110,7 +110,10 @@ public class TechnologyPackageParamBuilder {
private BomNewPbomParentEntity buildParentForTechnologyPackage(){ private BomNewPbomParentEntity buildParentForTechnologyPackage(){
BomNewPbomParentEntity oldBom =SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, packageParam.getTechnologyPackageMaterialNo()).eq(BomNewPbomParentEntity::getLastVersionIs, 1).one(); BomNewPbomParentEntity oldBom =SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, packageParam.getTechnologyPackageMaterialNo())
.eq(BomNewPbomParentEntity::getLastVersionIs, 1)
.eq(BomNewPbomParentEntity::getFacCode,parent.getFacCode())
.one();
VUtils.isTure(Objects.nonNull(oldBom) && oldBom.getStatus()< PBomStatusEnum.PUBLISH.getValue()).throwMessage("该工艺包存在未发布的BOM版本"); VUtils.isTure(Objects.nonNull(oldBom) && oldBom.getStatus()< PBomStatusEnum.PUBLISH.getValue()).throwMessage("该工艺包存在未发布的BOM版本");
@ -133,8 +136,8 @@ public class TechnologyPackageParamBuilder {
newBom.setDeptName(SessionUtil.getDepartName()); newBom.setDeptName(SessionUtil.getDepartName());
newBom.setCreatedBy(SessionUtil.getUserCode()); newBom.setCreatedBy(SessionUtil.getUserCode());
newBom.setCreatedTime(LocalDateTime.now()); newBom.setCreatedTime(LocalDateTime.now());
newBom.setSourceRowId(0L);
if(Objects.isNull(oldBom)){ if(Objects.nonNull(oldBom)){
oldBom.setLastVersionIs(0); oldBom.setLastVersionIs(0);
SpringUtil.getBean(BomNewPbomParentService.class).updateById(oldBom); SpringUtil.getBean(BomNewPbomParentService.class).updateById(oldBom);
} }
@ -162,6 +165,7 @@ public class TechnologyPackageParamBuilder {
child.setCreatedBy(SessionUtil.getUserCode()); child.setCreatedBy(SessionUtil.getUserCode());
child.setCreatedTime(LocalDateTime.now()); child.setCreatedTime(LocalDateTime.now());
child.setModifyTime(LocalDateTime.now()); child.setModifyTime(LocalDateTime.now());
child.setSourceRowId(0L);
this.packageChildren.add(child); this.packageChildren.add(child);
} }
} }