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