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:
commit
1d8d523e0f
|
|
@ -37,7 +37,7 @@ public class TechnologyPackageParamBuilder {
|
|||
BomNewPbomParentEntity parent;
|
||||
|
||||
@Getter
|
||||
List<BomNewPbomParentEntity> packageParent=null;
|
||||
List<BomNewPbomParentEntity> packageParent=new ArrayList<>();
|
||||
|
||||
@Getter
|
||||
List<BomNewPbomChildEntity> packageChildren=new ArrayList<>();
|
||||
|
|
@ -110,7 +110,10 @@ public class TechnologyPackageParamBuilder {
|
|||
|
||||
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版本");
|
||||
|
||||
|
||||
|
|
@ -133,8 +136,8 @@ public class TechnologyPackageParamBuilder {
|
|||
newBom.setDeptName(SessionUtil.getDepartName());
|
||||
newBom.setCreatedBy(SessionUtil.getUserCode());
|
||||
newBom.setCreatedTime(LocalDateTime.now());
|
||||
|
||||
if(Objects.isNull(oldBom)){
|
||||
newBom.setSourceRowId(0L);
|
||||
if(Objects.nonNull(oldBom)){
|
||||
oldBom.setLastVersionIs(0);
|
||||
SpringUtil.getBean(BomNewPbomParentService.class).updateById(oldBom);
|
||||
}
|
||||
|
|
@ -162,6 +165,7 @@ public class TechnologyPackageParamBuilder {
|
|||
child.setCreatedBy(SessionUtil.getUserCode());
|
||||
child.setCreatedTime(LocalDateTime.now());
|
||||
child.setModifyTime(LocalDateTime.now());
|
||||
child.setSourceRowId(0L);
|
||||
this.packageChildren.add(child);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue