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
f21f7585b4
|
|
@ -126,7 +126,7 @@ public class EbomApi extends BaseApi {
|
|||
@ApiOperation("生成虚拟包")
|
||||
@LogRecord(success = "生成虚拟包:物料编码:{{#gvbom.materialNo}} 版本:{{#gvbom.currentVersion}},操作结果:{{#_ret}}",
|
||||
bizNo = "{{#paramDto.bomRowId}}", type = "生成虚拟包")
|
||||
public ResultVO<Boolean> generateVirtualPackage(@RequestBody VirtualPackageParamDto paramDto) {
|
||||
public ResultVO<Boolean> generateVirtualPackage(@RequestBody VirtualPackageParamDto paramDto) throws IOException {
|
||||
VUtils.isTure(CollUtil.isEmpty(paramDto.getVirtualPackageValue())).throwMessage("请选择要生成的虚拟包");
|
||||
|
||||
//检查-是否已
|
||||
|
|
|
|||
|
|
@ -644,8 +644,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
* @param paramDto
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void generateVirtualPackage(VirtualPackageParamDto paramDto) {
|
||||
try {
|
||||
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()))
|
||||
|
|
@ -661,7 +661,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, root);
|
||||
materialMainService.intiMaterialInfo(ImmutableList.of(parent), BomNewEbomParentVO::getMaterialNo);
|
||||
if (parent.getMaterialCategoryCode().startsWith("30") || parent.getMaterialCategoryCode().equals("200401")) {
|
||||
if (parent.getMaterialCategoryCode().startsWith("30") || ImmutableList.of("200601","200401").contains(parent.getMaterialCategoryCode())) {
|
||||
VirtualPackageBase generate;
|
||||
if (parent.getMaterialCategoryCode().startsWith("30")) {
|
||||
generate = new VirtualPackageFor31(paramDto.getBomRowId(), paramDto.getVirtualPackageValue());
|
||||
|
|
@ -678,9 +678,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
}
|
||||
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
throw new NflgBusinessException(STATE.BusinessError, ex.getMessage());
|
||||
}
|
||||
// } catch (Exception ex) {
|
||||
// throw new NflgBusinessException(STATE.BusinessError, ex.getMessage());
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
}
|
||||
|
||||
public List<BomNewPbomParentVO> getAllocationFactoryBomTree(AllocationFactoryBomQuery param) throws ExecutionException, InterruptedException {
|
||||
List<BomNewPbomParentVO> allBom = getAllBom(param.getBomRowId(), 0);
|
||||
List<BomNewPbomParentVO> allBom = getAllBom(param.getBomRowId(), 1);
|
||||
materialMainService.intiMaterialInfo(allBom, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
||||
return CTreePBomUtils.toTree(param.getBomRowId(), allBom, BomNewPbomParentVO::getParentRowId, BomNewPbomParentVO::getBomRowId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class VirtualPackageFor21 extends VirtualPackageBase {
|
|||
|
||||
|
||||
BomNewEbomParentEntity makingPackage=null;
|
||||
if((parent.getVirtrualPackageEnum()| VirtualPackageTypeEnum.MAKING_PACKAGE.getValue())!=VirtualPackageTypeEnum.MAKING_PACKAGE.getValue()) {
|
||||
if((parent.getVirtrualPackageEnum()& VirtualPackageTypeEnum.MAKING_PACKAGE.getValue())!=VirtualPackageTypeEnum.MAKING_PACKAGE.getValue()) {
|
||||
//构建构建发货包下制作包
|
||||
makingPackage = buildParentVirtualPackage( parent.getRowId(), VirtualPackageTypeEnum.MAKING_PACKAGE,"001");
|
||||
//构建构建发货包下直发
|
||||
|
|
@ -69,13 +69,15 @@ public class VirtualPackageFor21 extends VirtualPackageBase {
|
|||
}
|
||||
List<BomNewEbomParentVO> child = getChild();
|
||||
//将产品子级放制作包下
|
||||
for (BomNewEbomParentVO item : child) {
|
||||
if(Objects.nonNull(makingPackage)) {
|
||||
for (BomNewEbomParentVO item : child) {
|
||||
|
||||
BomNewEbomChildEntity itemUp = new BomNewEbomChildEntity();
|
||||
itemUp.setRowId(item.getRowId());
|
||||
itemUp.setParentRowId(makingPackage.getRowId());
|
||||
this.childResult.add(itemUp);
|
||||
BomNewEbomChildEntity itemUp = new BomNewEbomChildEntity();
|
||||
itemUp.setRowId(item.getRowId());
|
||||
itemUp.setParentRowId(makingPackage.getRowId());
|
||||
this.childResult.add(itemUp);
|
||||
|
||||
}
|
||||
}
|
||||
parent.setVirtrualPackageEnum(virtualPackageValue.stream().collect(Collectors.summingInt(u->u)));
|
||||
parentResult.add(parent);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.nflg.product.bomnew.service.domain.OriginalBom;
|
|||
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
|
|
@ -127,6 +128,7 @@ public abstract class BaseConvert {
|
|||
parentEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||
parentEntity.setCreatedTime(LocalDateTime.now());
|
||||
parentEntity.setShouldBomExist(material.getShouldBomExist());
|
||||
parentEntity.setTotalWeight(NumberUtil.mul(parentEntity.getUnitWeight(),parentEntity.getNum()) );
|
||||
|
||||
if (StrUtil.isNotBlank(material.getMaterialCategoryCode()) &&(material.getMaterialCategoryCode().equals(OriginalConstant.COMMON_MATERIAL_CATEGORY_CODE) || material.getMaterialCategoryCode().startsWith("30") ||
|
||||
( material.getMaterialCategoryCode().startsWith("20") && material.getMaterialGetType().equals(MaterialGetEnum.developing.getValue())))){
|
||||
|
|
@ -156,6 +158,7 @@ public abstract class BaseConvert {
|
|||
childEntity.setCreatedBy(SessionUtil.getUserCode());
|
||||
childEntity.setRemark(material.getRemark());
|
||||
childEntity.setShouldBomExist(material.getShouldBomExist());
|
||||
childEntity.setTotalWeight(NumberUtil.mul(childEntity.getUnitWeight(),childEntity.getNum()));
|
||||
this.resultChild.add(childEntity);
|
||||
return childEntity;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue