1、发货前装配包
This commit is contained in:
parent
d10962d79c
commit
7ecfa7d53d
|
|
@ -645,7 +645,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void generateVirtualPackage(VirtualPackageParamDto paramDto) throws IOException {
|
public void generateVirtualPackage(VirtualPackageParamDto paramDto) throws IOException {
|
||||||
// try {
|
|
||||||
|
|
||||||
|
|
||||||
BomNewEbomParentEntity root = this.getById(paramDto.getBomRowId());
|
BomNewEbomParentEntity root = this.getById(paramDto.getBomRowId());
|
||||||
VUtils.isTure(Objects.isNull(root)).throwMessage("Bom不存在");
|
VUtils.isTure(Objects.isNull(root)).throwMessage("Bom不存在");
|
||||||
VUtils.isTure(!Objects.equals(root.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue()))
|
VUtils.isTure(!Objects.equals(root.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue()))
|
||||||
|
|
@ -678,9 +680,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// } catch (Exception ex) {
|
|
||||||
// throw new NflgBusinessException(STATE.BusinessError, ex.getMessage());
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -126,15 +126,17 @@ public abstract class VirtualPackageBase {
|
||||||
BomNewEbomParentEntity oldParent= SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery()
|
BomNewEbomParentEntity oldParent= SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery()
|
||||||
.eq(BomNewEbomParentEntity::getMaterialNo, addM.getMaterialNo())
|
.eq(BomNewEbomParentEntity::getMaterialNo, addM.getMaterialNo())
|
||||||
.eq(BomNewEbomParentEntity::getLastVersionIs,1)
|
.eq(BomNewEbomParentEntity::getLastVersionIs,1)
|
||||||
.ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
|
//.ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
|
||||||
.one();
|
.one();
|
||||||
|
|
||||||
|
if(Objects.nonNull(oldParent) && !EBomStatusEnum.PUBLISHED.equalsValue(oldParent.getStatus()) ){
|
||||||
|
return oldParent;
|
||||||
|
}
|
||||||
|
|
||||||
if(Objects.nonNull(oldParent)){
|
if(Objects.nonNull(oldParent)){
|
||||||
oldParent.setLastVersionIs(0);
|
oldParent.setLastVersionIs(0);
|
||||||
this.parentResult.add(oldParent);
|
this.parentResult.add(oldParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// String materialNo = SpringUtil.getBean(MaterialService.class).addMaterial(drawingNo, vMaterialName,materialDesc, virtualPackageType.getMaterialCategoryCode());
|
// String materialNo = SpringUtil.getBean(MaterialService.class).addMaterial(drawingNo, vMaterialName,materialDesc, virtualPackageType.getMaterialCategoryCode());
|
||||||
BomNewEbomParentEntity parent =new BomNewEbomParentEntity();
|
BomNewEbomParentEntity parent =new BomNewEbomParentEntity();
|
||||||
parent.setRowId(IdWorker.getId());
|
parent.setRowId(IdWorker.getId());
|
||||||
|
|
@ -194,15 +196,19 @@ public abstract class VirtualPackageBase {
|
||||||
return SpringUtil.getBean(BomNewEbomParentService.class).getChild(bomRowId);
|
return SpringUtil.getBean(BomNewEbomParentService.class).getChild(bomRowId);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BomNewEbomParentEntity getParentZhiZuo(){
|
protected BomNewEbomParentEntity getParentZhiZuo(String inDrawingNo){
|
||||||
List<BomNewEbomChildEntity> list = SpringUtil.getBean(BomNewEbomChildService.class).lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, bomRowId).list();
|
|
||||||
List<BomNewEbomChildEntity> zhiZuo = list.stream().filter(u -> u.getMaterialName().contains(VirtualPackageTypeEnum.MAKING_PACKAGE.getConMaterialName())).collect(Collectors.toList());
|
return SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery().eq(BomNewEbomParentEntity::getDrawingNo,StrUtil.join("","(", inDrawingNo,VirtualPackageTypeEnum.MAKING_PACKAGE.getConMaterialName(),")"))
|
||||||
if(CollUtil.isNotEmpty(zhiZuo)){
|
.eq(BomNewEbomParentEntity::getLastVersionIs,1).one();
|
||||||
String materialNo=zhiZuo.get(0).getMaterialNo();
|
|
||||||
return SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo,materialNo)
|
// List<BomNewEbomChildEntity> list = SpringUtil.getBean(BomNewEbomChildService.class).lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, inBomRowId).list();
|
||||||
.eq(BomNewEbomParentEntity::getLastVersionIs,1).one();
|
// List<BomNewEbomChildEntity> zhiZuo = list.stream().filter(u -> u.getMaterialName().contains(VirtualPackageTypeEnum.MAKING_PACKAGE.getConMaterialName())).collect(Collectors.toList());
|
||||||
}
|
// if(CollUtil.isNotEmpty(zhiZuo)){
|
||||||
return null;
|
// String materialNo=zhiZuo.get(0).getMaterialNo();
|
||||||
|
// return SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo,materialNo)
|
||||||
|
// .eq(BomNewEbomParentEntity::getLastVersionIs,1).one();
|
||||||
|
// }
|
||||||
|
// return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ public class VirtualPackageFor21 extends VirtualPackageBase {
|
||||||
if(virtualPackageValue.contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) && (parent.getVirtrualPackageEnum()| VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue())!=VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) {
|
if(virtualPackageValue.contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) && (parent.getVirtrualPackageEnum()| VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue())!=VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) {
|
||||||
//构建构建发货前装配包
|
//构建构建发货前装配包
|
||||||
if(Objects.isNull(makingPackage)){
|
if(Objects.isNull(makingPackage)){
|
||||||
makingPackage=getParentZhiZuo();
|
makingPackage=getParentZhiZuo(parent.getDrawingNo());
|
||||||
}
|
}
|
||||||
BomNewEbomParentEntity preAssemblyPackage = buildParentVirtualPackage(parent.getRowId(), VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,parent.getOrderNumber());
|
BomNewEbomParentEntity preAssemblyPackage = buildParentVirtualPackage(parent.getRowId(), VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,parent.getOrderNumber());
|
||||||
buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,parent.getMaterialNo());
|
buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,parent.getMaterialNo());
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ public class VirtualPackageFor31 extends VirtualPackageBase {
|
||||||
BomNewEbomParentEntity preAssemblyPackage = buildParentVirtualPackage(item.getRowId(), VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,item.getOrderNumber());
|
BomNewEbomParentEntity preAssemblyPackage = buildParentVirtualPackage(item.getRowId(), VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,item.getOrderNumber());
|
||||||
//构建构建发货前装配包
|
//构建构建发货前装配包
|
||||||
if(Objects.isNull(makingPackage)){
|
if(Objects.isNull(makingPackage)){
|
||||||
makingPackage=getParentZhiZuo();
|
makingPackage=getParentZhiZuo(item.getDrawingNo());
|
||||||
}
|
}
|
||||||
buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,parent.getMaterialNo());
|
buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,parent.getMaterialNo());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue