From 3ea43051afdfc201d1c875b65e3df543325769d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Tue, 21 May 2024 17:02:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.31=E8=BD=ACPBOM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BomNewEbomParentService.java | 2 +- .../service/domain/EBom/EBomToPBom.java | 419 +---------------- .../service/domain/EBom/EBomToPBomFor31.java | 126 ++++++ .../service/domain/EBom/EBomToPbomBase.java | 428 ++++++++++++++++++ .../domain/EBom/EbomInitProjectType.java | 6 - 5 files changed, 563 insertions(+), 418 deletions(-) create mode 100644 nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPBomFor31.java create mode 100644 nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index 28d1c565..a38ba16b 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java @@ -864,7 +864,7 @@ public class BomNewEbomParentService extends ServiceImpl facCodes; - - private List allBomDetail; +public class EBomToPBom extends EBomToPbomBase { - private List result = new ArrayList<>(); - - - @Getter - private List pBomParentResult = new ArrayList<>(); - - @Getter - private List pBomChildResult = new ArrayList<>(); - - @Getter - private List virtualPackageCompositionResult = new ArrayList<>(); - - @Getter - private List upgradeChangeResult = new ArrayList<>(); - - @Getter - private List upgradeChangeDetailResult = new ArrayList<>(); - - private Set hasBuildVNo = Sets.newHashSet(); public EBomToPBom(BomNewEbomParentVO inParent, List inAllBomDetail, List inFacCodes, Long parentRowId) { @@ -74,6 +36,7 @@ public class EBomToPBom { /** * 31項体层 */ + @Override public void convert() { //效验数据是否OK @@ -122,373 +85,7 @@ public class EBomToPBom { } } - /** - * BOM 明细对比,如只有T项变化则,不升级直接修改 - */ - private Boolean compareContentIsSame(BomNewEbomParentVO pVo, List newChildren, String facCode) { - BomNewPbomParentEntity oldParent = SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery() - .eq(BomNewPbomParentEntity::getMaterialNo, pVo.getMaterialNo()) - .eq(BomNewPbomParentEntity::getFacCode, facCode).last(" order by current_version desc limit 1").one(); - if (oldParent != null) { - List oldBomDetail = SpringUtil.getBean(BomNewPbomParentService.class).getBaseMapper().getParentChild(oldParent.getRowId()); - //旧bom除T项之外 - List oldBomNoTChildren = oldBomDetail.stream().filter(u -> !EBomConstant.PROJECT_TYPE_T.equalsIgnoreCase(u.getProjectType())).collect(Collectors.toList()); - //新BOM 除T项外 - List newBomNoTChildren = newChildren.stream().filter(u -> !EBomConstant.PROJECT_TYPE_T.equalsIgnoreCase(u.getProjectType())).collect(Collectors.toList()); - if(oldBomNoTChildren.size()!= newBomNoTChildren.size()) { - return false; - } - //除T项外的对比 - Map oldBomMap = oldBomNoTChildren.stream().collect(Collectors.toMap(BomNewPbomParentVO::getMaterialNoAndProjectType, u -> u, (k1, k2) -> k1)); - for (BomNewEbomParentVO newVo : newBomNoTChildren) { - if(!oldBomMap.containsKey(newVo.getMaterialNoAndProductType()) || !Objects.equals(newVo.getNum(),oldBomMap.get(newVo.getMaterialNoAndProductType()).getNum())){ - return false; - } - } - //当T项外都一致时,直接更新T项 - List bomDetailForT = oldBomDetail.stream().filter(u -> EBomConstant.PROJECT_TYPE_T.equalsIgnoreCase(u.getProcureType())).collect(Collectors.toList()); - if(CollUtil.isNotEmpty(bomDetailForT)){ - List bomRowIdsForT = bomDetailForT.stream().map(u -> u.getRowId()).collect(Collectors.toList()); - SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteBatchIds(bomRowIdsForT); - } - List newBomT = newChildren.stream().filter(u -> EBomConstant.PROJECT_TYPE_T.equalsIgnoreCase(u.getProcureType())).collect(Collectors.toList()); - if(CollUtil.isNotEmpty(newBomT)) { - for (BomNewEbomParentVO netT : newBomT) { - BomNewPbomChildEntity childEnt = new BomNewPbomChildEntity(); - BeanUtil.copyProperties(netT, childEnt); - childEnt.setRowId(IdWorker.getId()); - childEnt.setParentRowId(oldParent.getRowId()); - childEnt.setFacCode(facCode); - childEnt.setIdentityNo(StrUtil.join("-", oldParent.getMaterialNo(), netT.getMaterialNo())); - this.pBomChildResult.add(childEnt); - } - } - return true; - } - return false; - } - - //合并子级 - public List mergeChild(List child) { - - List result = child.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).collect(Collectors.toList()); - - Map> listMp = ListCommonUtil.listGroupMap(child, BomNewEbomParentVO::getMaterialNo); - - for (String key : listMp.keySet()) { - List voList = listMp.get(key); - BomNewEbomParentVO ent = voList.get(0); - ent.setNum(voList.stream().map(aa -> aa.getNum()).reduce(BigDecimal.ZERO, BigDecimal::add)); - result.add(ent); - } - return result; - } - - - /** - * 数据效验 - */ - private void check() { - //动态判断异常 - // CheckEBomExceptoinDynamic.check(allBomDetail); - // List collect = allBomDetail.stream().filter(u -> !EBomExceptionStatusEnum.OK.getValue().equals(u.getExceptionStatus())).collect(Collectors.toList()); - - // VUtils.isTure(CollUtil.isNotEmpty(collect)).throwMessage("存在异常数据,请处理完再转换"); - VUtils.isTure(!Objects.equals(parent.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).throwMessage("存在异常数据,请处理完再转换"); - } - - - /** - * 构建父 - * - * @param parentVo - * @return Pair key, 0-旧 1-新 value:pBomParent - */ - private BomNewPbomParentEntity buildPBomParent(BomNewEbomParentVO parentVo, String facCode) { - BomNewPbomParentEntity oldParent = SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery() - .eq(BomNewPbomParentEntity::getMaterialNo, parentVo.getMaterialNo()) - .eq(BomNewPbomParentEntity::getFacCode, facCode).last(" order by current_version desc limit 1").one(); - - // this.hasConvertEBomRowIds.add(parentVo.getRowId()); - if (Objects.nonNull(oldParent) && !EBomStatusEnum.PUBLISHED.equalsValue(oldParent.getStatus())) { - SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId())); - oldParent.setCurrentVersion(parentVo.getCurrentVersion()); - this.pBomParentResult.add(oldParent); - return oldParent; - } else { - BomNewPbomParentEntity pBomParent = new BomNewPbomParentEntity(); - BeanUtil.copyProperties(parentVo, pBomParent); - pBomParent.setSourceRowId(parentVo.getBomRowId()); - pBomParent.setRowId(IdWorker.getId()); - pBomParent.setStatus(PBomStatusEnum.WAIT_PUBLISH.getValue()); - pBomParent.setLastVersionIs(1); - pBomParent.setFacCode(facCode); - pBomParent.setTechnologyUserCode(SessionUtil.getUserCode()); - pBomParent.setTechnologyUserName(SessionUtil.getRealName()); - //pBomParent.setCurrentVersion(VersionUtil.getNextVersion("")); - //版本=EBom版本 - pBomParent.setCurrentVersion(parentVo.getCurrentVersion()); - pBomParent.setEditStatus(PBomEditStatusEnum.HANDLER_CREATED.getValue()); - if (Objects.nonNull(oldParent)) { - // pBomParent.setCurrentVersion(VersionUtil.getNextVersion(oldParent.getCurrentVersion())); - oldParent.setExpireEndTime(LocalDateTime.now()); - oldParent.setLastVersionIs(0); - } - this.pBomParentResult.add(pBomParent); - return pBomParent; - } - - - } - - /** - * 31提层 - * - * @param - * @param - */ - private void liftingLayer() { - for (BomNewEbomParentVO vo : allBomDetail) { - if (StrUtil.isNotBlank(vo.getProjectType()) && vo.getProjectType().equals(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getProductTypeKey())) { - BomNewEbomParentVO lastVirtualPackage = getLastVirtualPackage(vo, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE); - if (Objects.nonNull(lastVirtualPackage)) { - liftingLayerSummary(lastVirtualPackage, vo); - vo.setSourceRowId(String.valueOf(vo.getParentRowId())); - vo.setSourceParentMaterialNo(getParentMaterialNo(vo.getBomRowId())); - vo.setParentRowId(lastVirtualPackage.getBomRowId()); - result.add(vo); - } - //当没找到直发包时,丢弃 -// else { -// // buildUpgradeChange(vo); -// } - continue; - } - if (StrUtil.isNotBlank(vo.getProjectType()) && vo.getProjectType().equals(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getProductTypeKey())) { - BomNewEbomParentVO lastVirtualPackage = getLastVirtualPackage(vo, VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE); - if (Objects.nonNull(lastVirtualPackage)) { - liftingLayerSummary(lastVirtualPackage, vo); - vo.setSourceRowId(String.valueOf(vo.getParentRowId())); - vo.setSourceParentMaterialNo(getParentMaterialNo(vo.getBomRowId())); - vo.setParentRowId(lastVirtualPackage.getBomRowId()); - result.add(vo); - } -// else { //当没找到直发包时,丢弃 -// // buildUpgradeChange(vo); -// } - continue; - } - result.add(vo); - } - } - - //变更记录(明细) - private void buildUpgradeChangeDetail(BomNewEbomParentVO parent, VirtualPackageTypeEnum packageTypeEnum) { - - List list = SpringUtil.getBean(BomNewEbomVirtualPackageCompositionService.class).lambdaQuery() - .eq(BomNewEbomVirtualPackageCompositionEntity::getParentMaterialNo, parent.getMaterialNo()) - .eq(BomNewEbomVirtualPackageCompositionEntity::getProjectType, packageTypeEnum.getProductTypeKey()).list(); - if (CollUtil.isNotEmpty(list)) { - //老的虚拟包组成 - Set oldMaterialNoAndNumSet = list.stream().filter(u -> u.getParentMaterialNo().equals(parent.getMaterialNo())).map(u -> StrUtil.join("-", u.getChildMaterialNo(), u.getNum())).collect(Collectors.toSet()); - - List parentChildren = allBomDetail.stream().filter(u -> u.getParentRowId().equals(parent.getBomRowId())).collect(Collectors.toList()); - //物料编码 +数量 - Set newSet = parentChildren.stream().filter(u -> Objects.nonNull(u.getProjectType()) && VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getProductTypeKey().equals(u.getProjectType())).map(u -> StrUtil.join("-", u.getMaterialNo(), u.getNum())).collect(Collectors.toSet()); - //bom 发生了改变-影响了虚拟包 - if (CollUtil.isNotEmpty(Sets.difference(oldMaterialNoAndNumSet, newSet)) || CollUtil.isNotEmpty(Sets.difference(newSet, oldMaterialNoAndNumSet))) { - - List vmaterialNoList = list.stream().map(u -> u.getVirtualPackageMaterialNo()).distinct().collect(Collectors.toList()); - //记录变更明细行 - buildChangeDetailD0(vmaterialNoList, parent, parentChildren); - //变更 - buildUpgradeChange(list, parent); - } - } - - } - - private void buildChangeDetailD0(List vmaterialNoList, BomNewEbomParentVO parent, List parentChildren) { - for (BomNewEbomParentVO vo : parentChildren) { - for (String vNo : vmaterialNoList) { - BomNewEbomUpdateDetailEntity changeDetailEnt = new BomNewEbomUpdateDetailEntity(); - changeDetailEnt.setRowId(IdWorker.getId()); - changeDetailEnt.setVirtualPackageMaterialNo(vNo); - changeDetailEnt.setParentMaterialNo(parent.getMaterialNo()); - changeDetailEnt.setCurrentVersion(parent.getCurrentVersion()); - changeDetailEnt.setChildMaterialNo(vo.getMaterialNo()); - changeDetailEnt.setNum(vo.getNum()); - changeDetailEnt.setProjectType(vo.getProjectType()); - changeDetailEnt.setUpdatedTime(LocalDateTime.now()); - changeDetailEnt.setEbomSourceRowId(vo.getRowId()); - this.upgradeChangeDetailResult.add(changeDetailEnt); - } - - - } - } - - - private void buildUpgradeChange(List changeList, BomNewEbomParentVO parent) { - List vmaterialNoList = changeList.stream().map(u -> u.getVirtualPackageMaterialNo()).distinct().collect(Collectors.toList()); - for (String vmaterialNo : vmaterialNoList) { - String key = StrUtil.join("-", vmaterialNo, parent.getMaterialNo()); - if (hasBuildVNo.contains(key)) { - continue; - } - BomNewEbomUpgradeChangeEntity changeEntity = new BomNewEbomUpgradeChangeEntity(); - changeEntity.setRowId(IdWorker.getId()); - changeEntity.setMaterialNo(vmaterialNo); - changeEntity.setVersionOld(parent.getCurrentVersion()); - changeEntity.setVersionNew(VersionUtil.getNextVersionForSmallVersion(parent.getCurrentVersion())); - changeEntity.setDeviseName(SessionUtil.getRealName()); - changeEntity.setDeptName(SessionUtil.getDepartName()); - changeEntity.setRelMaterialNo(parent.getMaterialNo()); - changeEntity.setRelMaterialDesc(parent.getMaterialDesc()); - changeEntity.setStatus(0); - upgradeChangeResult.add(changeEntity); - - hasBuildVNo.add(key); - } - - } - - - /** - * 提层汇总数量 - * - * @param lastVirtualPackage 虚拟包 - * @param vo 提层项 - */ - private void liftingLayerSummary(BomNewEbomParentVO lastVirtualPackage, BomNewEbomParentVO vo) { - BigDecimal sum = vo.getNum(); - String parentLevelNo = BomLevelUtil.getParentLevelNo(vo.getLevelNo()); - List parentFullPathNum = new ArrayList<>(); - while (parentLevelNo.length() >= lastVirtualPackage.getLevelNo().length()) { - String pNo = parentLevelNo; - List parentList = allBomDetail.stream().filter(u -> u.getLevelNo().equals(pNo)).collect(Collectors.toList()); - if (CollUtil.isNotEmpty(parentList)) { - sum = NumberUtil.mul(sum, parentList.get(0).getNum()); - parentFullPathNum.add(parentList.get(0).getNum()); - } -// else { -// parentFullPathNum.add(parentList.get(0).getNum()); -// } - parentLevelNo = BomLevelUtil.getParentLevelNo(parentLevelNo); - - } - vo.setNum(sum); - //构建虚拟包组成 - buildVirtualPackageComposition(lastVirtualPackage, vo, parentFullPathNum); - - } - - private void buildVirtualPackageComposition(BomNewEbomParentVO lastVirtualPackage, BomNewEbomParentVO vo, List parentFullPathNum) { - - BomNewEbomVirtualPackageCompositionEntity packageCompositionEntity = new BomNewEbomVirtualPackageCompositionEntity(); - packageCompositionEntity.setRowId(IdWorker.getId()); - packageCompositionEntity.setVirtualPackageMaterialNo(lastVirtualPackage.getMaterialNo()); - List voParent = allBomDetail.stream().filter(u -> u.getBomRowId().equals(vo.getParentRowId())).collect(Collectors.toList()); - VUtils.isTure(CollUtil.isEmpty(voParent)).throwMessage(vo.getMaterialNo() + " 未找到父级"); - packageCompositionEntity.setParentMaterialNo(voParent.get(0).getMaterialNo()); - packageCompositionEntity.setChildMaterialNo(vo.getMaterialNo()); - packageCompositionEntity.setParentFullPathNum(StrUtil.join(",", parentFullPathNum)); - packageCompositionEntity.setProjectType(vo.getProjectType()); - packageCompositionEntity.setUnitWeight(vo.getUnitWeight()); - packageCompositionEntity.setTotalWeight(vo.getTotalWeight()); - packageCompositionEntity.setUpdatedTime(LocalDateTime.now()); - this.virtualPackageCompositionResult.add(packageCompositionEntity); - } - - private String getParentMaterialNo(Long parentRowId) { - List collect = allBomDetail.stream().filter(u -> u.getBomRowId().equals(parentRowId)).collect(Collectors.toList()); - if (CollUtil.isNotEmpty(collect)) { - return collect.get(0).getMaterialNo(); - } - return ""; - - } - - - private BomNewEbomParentVO getLastVirtualPackage(BomNewEbomParentVO vo, VirtualPackageTypeEnum virtualPackageTypeEnum) { - List zhiFaList = allBomDetail.stream().filter(u -> vo.getLevelNumber().compareTo(u.getLevelNumber()) > 0 && u.getMaterialName().contains(virtualPackageTypeEnum.getConMaterialName())).collect(Collectors.toList()); - if (CollUtil.isNotEmpty(zhiFaList)) { - return Collections.max(zhiFaList, Comparator.comparing(BomNewEbomParentVO::getLevelNumber)); - } - return null; - - } - - - private BomNewEbomParentVO getVirtualPackageByName(VirtualPackageTypeEnum virtualPackageTypeEnum) { - List list = allBomDetail.stream().filter(u -> u.getMaterialName().contains(virtualPackageTypeEnum.getConMaterialName())).collect(Collectors.toList()); - if (CollUtil.isNotEmpty(list)) { - return list.get(0); - } - return null; - - } - - - /** - * 生成 层级号 - * - * @param saveBomDetailParamDTO - * @param bomRowID - * @param parentDrawingNo - */ - public void generateDrawingNo(List saveBomDetailParamDTO, Long bomRowID, String parentDrawingNo) { - List firstLevelBoms = saveBomDetailParamDTO.stream().filter(u -> u.getParentRowId().equals(bomRowID)).collect(Collectors.toList()); - parentDrawingNo = StrUtil.isNotBlank(parentDrawingNo) ? parentDrawingNo : ""; - Integer gNo = 1; - - String preAssemblyPackageLevelNo = StrUtil.isNotBlank(parentDrawingNo) ? StrUtil.join("-", parentDrawingNo, "1") : "1"; - for (BomNewEbomParentVO firstLevelBom : firstLevelBoms) { - - if (firstLevelBom.getMaterialName().contains(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getConMaterialName()) || firstLevelBom.getMaterialName().contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getConMaterialName())) { - firstLevelBom.setLevelNumber(levelToNum(preAssemblyPackageLevelNo)); - firstLevelBom.setLevelNo(preAssemblyPackageLevelNo); - continue; - } - - String levelKey = StrUtil.isNotBlank(parentDrawingNo) ? StrUtil.join("-", parentDrawingNo, gNo.toString()) : gNo.toString(); - firstLevelBom.setLevelNumber(levelToNum(levelKey)); - firstLevelBom.setLevelNo(levelKey); - gNo++; - generateDrawingNo(saveBomDetailParamDTO, firstLevelBom.getChildBomRowId(), firstLevelBom.getLevelNo()); - - - } - - } - - /** - * 转换层级号为数字 - * - * @param strLevel - * @return - */ - private BigDecimal levelToNum(String strLevel) { - if (StrUtil.isEmpty(strLevel)) { - return null; - } - if (strLevel.indexOf('-') == -1) { - return new BigDecimal(strLevel); - } - String[] fromArray = strLevel.split("-"); - String reuslt = ""; - for (int i = 0; i < fromArray.length; i++) { - if (i == 0) { - reuslt = fromArray[i] + '.'; - } else { - reuslt += StrUtil.padPre(fromArray[i], 2, '0'); - } - - } - return new BigDecimal(reuslt); - } - } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPBomFor31.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPBomFor31.java new file mode 100644 index 00000000..c845b0c6 --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPBomFor31.java @@ -0,0 +1,126 @@ +package com.nflg.product.bomnew.service.domain.EBom; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.nflg.product.bomnew.constant.EBomConstant; +import com.nflg.product.bomnew.constant.PBomStatusEnum; +import com.nflg.product.bomnew.constant.VirtualPackageTypeEnum; +import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity; +import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity; +import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import com.nflg.product.bomnew.util.ListCommonUtil; + +/** + * 31码转PBOM + */ +@NoArgsConstructor +public class EBomToPBomFor31 extends EBomToPbomBase { + + + + private Map> facBomDataMp=new HashMap<>(); + + + public EBomToPBomFor31(BomNewEbomParentVO inParent, List inAllBomDetail, List inFacCodes, Long parentRowId) { + this.parent = inParent; + this.allBomDetail = inAllBomDetail; + this.facCodes = inFacCodes; + generateDrawingNo(allBomDetail, parentRowId, ""); + + } + + private void splitData(){ + this.facCodes=new ArrayList<>(); + //1020数据 + List data1020=new ArrayList<>(); + List deliveryPackage1020 = result.stream().filter(u -> u.getParentRowId().equals(parent.getRowId()) && u.getMaterialName().contains("仙桃") && u.getMaterialName().contains("发货")).collect(Collectors.toList()); + if(CollUtil.isNotEmpty(deliveryPackage1020)){ + facCodes.add(EBomConstant.XIAN_TAO_FACTORY_CODE_1020); + data1020.add(parent); + for (BomNewEbomParentVO data: deliveryPackage1020){ + List subVos = result.stream().filter(u -> u.getLevelNumber().compareTo(data.getLevelNumber()) >= 0 && u.getLevelNumber().compareTo(NumberUtil.add(data.getLevelNumber(), new BigDecimal(0.01))) < 0).collect(Collectors.toList()); + data1020.addAll(subVos); + } + facBomDataMp.put(EBomConstant.XIAN_TAO_FACTORY_CODE_1020,data1020); + } + + //1010 数据 + facCodes.add(EBomConstant.MAIN_FACTORY_CODE_1010); + List data1010=new ArrayList<>(); + List deliveryPackage1010 = result.stream().filter(u -> u.getParentRowId().equals(parent.getRowId()) && !u.getMaterialName().contains("仙桃") && u.getMaterialName().contains("发货")).collect(Collectors.toList()); + if(CollUtil.isNotEmpty(deliveryPackage1010)){ + data1010.add(parent); + for (BomNewEbomParentVO data: deliveryPackage1010){ + List subVos = result.stream().filter(u -> u.getLevelNumber().compareTo(data.getLevelNumber()) >= 0 && u.getLevelNumber().compareTo(NumberUtil.add(data.getLevelNumber(), new BigDecimal(0.01))) < 0).collect(Collectors.toList()); + data1010.addAll(subVos); + } + facBomDataMp.put(EBomConstant.MAIN_FACTORY_CODE_1010,data1010); + } + + } + + /** + * 31項体层 + */ + @Override + public void convert() { + + //效验数据是否OK + check(); + //bom 提层 + liftingLayer(); + splitData(); + List hasConvert = new ArrayList<>(); + + for (String facCode : facCodes) { + List parentList = ListCommonUtil.toDistinct(facBomDataMp.get(facCode).stream().filter(u -> u.getBomRowId() > 0).collect(Collectors.toList()), BomNewEbomParentVO::getBomRowId); + for (BomNewEbomParentVO vo : parentList) { + String hasConvertKey = StrUtil.join("-", facCode, vo.getBomRowId()); + if (hasConvert.contains(hasConvertKey) || PBomStatusEnum.PUBLISH.equalsValue(vo.getStatus())) { + continue; + } + hasConvert.add(hasConvertKey); + //构建变更明细 + buildUpgradeChangeDetail(vo, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE); + buildUpgradeChangeDetail(vo, VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE); + + //子级 + List child = result.stream().filter(u -> u.getParentRowId().equals(vo.getBomRowId())).distinct().collect(Collectors.toList()); + List mergeChild = mergeChild(child); + if( compareContentIsSame(vo, mergeChild, facCode)){ + continue; + } + + BomNewPbomParentEntity parentEnt = buildPBomParent(vo, facCode); + //子级 + if (CollUtil.isNotEmpty(child)) { + //合并子级 + for (BomNewEbomParentVO eb : mergeChild) { + BomNewPbomChildEntity childEnt = new BomNewPbomChildEntity(); + BeanUtil.copyProperties(eb, childEnt); + childEnt.setRowId(IdWorker.getId()); + childEnt.setParentRowId(parentEnt.getRowId()); + childEnt.setFacCode(facCode); + childEnt.setIdentityNo(StrUtil.join("-", parentEnt.getMaterialNo(), eb.getMaterialNo())); + this.pBomChildResult.add(childEnt); + } + + + } + } + } + } + + +} diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java new file mode 100644 index 00000000..91d833b9 --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java @@ -0,0 +1,428 @@ +package com.nflg.product.bomnew.service.domain.EBom; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +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; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Sets; +import com.nflg.product.base.core.conmon.util.SessionUtil; +import com.nflg.product.bomnew.constant.*; +import com.nflg.product.bomnew.pojo.entity.*; +import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO; +import com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO; +import com.nflg.product.bomnew.service.BomNewEbomVirtualPackageCompositionService; +import com.nflg.product.bomnew.service.BomNewPbomChildService; +import com.nflg.product.bomnew.service.BomNewPbomParentService; +import com.nflg.product.bomnew.util.BomLevelUtil; +import com.nflg.product.bomnew.util.VUtils; +import com.nflg.product.bomnew.util.VersionUtil; +import lombok.Getter; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.*; +import java.util.stream.Collectors; + +public abstract class EBomToPbomBase { + + protected BomNewEbomParentVO parent; + + //工厂编码列表 + protected List facCodes; + + protected List allBomDetail; + + + protected List result = new ArrayList<>(); + + + @Getter + protected List pBomParentResult = new ArrayList<>(); + + @Getter + protected List pBomChildResult = new ArrayList<>(); + + @Getter + protected List virtualPackageCompositionResult = new ArrayList<>(); + + @Getter + protected List upgradeChangeResult = new ArrayList<>(); + + @Getter + protected List upgradeChangeDetailResult = new ArrayList<>(); + + protected Set hasBuildVNo = Sets.newHashSet(); + + public abstract void convert(); + + /** + * BOM 明细对比,如只有T项变化则,不升级直接修改 + */ + protected Boolean compareContentIsSame(BomNewEbomParentVO pVo, List newChildren, String facCode) { + BomNewPbomParentEntity oldParent = SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery() + .eq(BomNewPbomParentEntity::getMaterialNo, pVo.getMaterialNo()) + .eq(BomNewPbomParentEntity::getFacCode, facCode).last(" order by current_version desc limit 1").one(); + if (oldParent != null) { + List oldBomDetail = SpringUtil.getBean(BomNewPbomParentService.class).getBaseMapper().getParentChild(oldParent.getRowId()); + //旧bom除T项之外 + List oldBomNoTChildren = oldBomDetail.stream().filter(u -> !EBomConstant.PROJECT_TYPE_T.equalsIgnoreCase(u.getProjectType())).collect(Collectors.toList()); + //新BOM 除T项外 + List newBomNoTChildren = newChildren.stream().filter(u -> !EBomConstant.PROJECT_TYPE_T.equalsIgnoreCase(u.getProjectType())).collect(Collectors.toList()); + if(oldBomNoTChildren.size()!= newBomNoTChildren.size()) { + return false; + } + //除T项外的对比 + Map oldBomMap = oldBomNoTChildren.stream().collect(Collectors.toMap(BomNewPbomParentVO::getMaterialNoAndProjectType, u -> u, (k1, k2) -> k1)); + for (BomNewEbomParentVO newVo : newBomNoTChildren) { + if(!oldBomMap.containsKey(newVo.getMaterialNoAndProductType()) || !Objects.equals(newVo.getNum(),oldBomMap.get(newVo.getMaterialNoAndProductType()).getNum())){ + return false; + } + } + //当T项外都一致时,直接更新T项 + List bomDetailForT = oldBomDetail.stream().filter(u -> EBomConstant.PROJECT_TYPE_T.equalsIgnoreCase(u.getProcureType())).collect(Collectors.toList()); + if(CollUtil.isNotEmpty(bomDetailForT)){ + List bomRowIdsForT = bomDetailForT.stream().map(u -> u.getRowId()).collect(Collectors.toList()); + SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteBatchIds(bomRowIdsForT); + } + List newBomT = newChildren.stream().filter(u -> EBomConstant.PROJECT_TYPE_T.equalsIgnoreCase(u.getProcureType())).collect(Collectors.toList()); + if(CollUtil.isNotEmpty(newBomT)) { + for (BomNewEbomParentVO netT : newBomT) { + BomNewPbomChildEntity childEnt = new BomNewPbomChildEntity(); + BeanUtil.copyProperties(netT, childEnt); + childEnt.setRowId(IdWorker.getId()); + childEnt.setParentRowId(oldParent.getRowId()); + childEnt.setFacCode(facCode); + childEnt.setIdentityNo(StrUtil.join("-", oldParent.getMaterialNo(), netT.getMaterialNo())); + this.pBomChildResult.add(childEnt); + } + } + return true; + } + return false; + + + } + + //合并子级 + public List mergeChild(List child) { + + List result = child.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).collect(Collectors.toList()); + + Map> listMp =child.stream().collect(Collectors.groupingBy(BomNewEbomParentVO::getMaterialNo)); + + for (String key : listMp.keySet()) { + List voList = listMp.get(key); + BomNewEbomParentVO ent = voList.get(0); + ent.setNum(voList.stream().map(aa -> aa.getNum()).reduce(BigDecimal.ZERO, BigDecimal::add)); + result.add(ent); + } + return result; + } + + + /** + * 数据效验 + */ + protected void check() { + //动态判断异常 + // CheckEBomExceptoinDynamic.check(allBomDetail); + // List collect = allBomDetail.stream().filter(u -> !EBomExceptionStatusEnum.OK.getValue().equals(u.getExceptionStatus())).collect(Collectors.toList()); + + // VUtils.isTure(CollUtil.isNotEmpty(collect)).throwMessage("存在异常数据,请处理完再转换"); + VUtils.isTure(!Objects.equals(parent.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).throwMessage("存在异常数据,请处理完再转换"); + } + + + /** + * 构建父 + * + * @param parentVo + * @return Pair key, 0-旧 1-新 value:pBomParent + */ + protected BomNewPbomParentEntity buildPBomParent(BomNewEbomParentVO parentVo, String facCode) { + BomNewPbomParentEntity oldParent = SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery() + .eq(BomNewPbomParentEntity::getMaterialNo, parentVo.getMaterialNo()) + .eq(BomNewPbomParentEntity::getFacCode, facCode).last(" order by current_version desc limit 1").one(); + + // this.hasConvertEBomRowIds.add(parentVo.getRowId()); + if (Objects.nonNull(oldParent) && !EBomStatusEnum.PUBLISHED.equalsValue(oldParent.getStatus())) { + SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId())); + oldParent.setCurrentVersion(parentVo.getCurrentVersion()); + this.pBomParentResult.add(oldParent); + return oldParent; + } else { + BomNewPbomParentEntity pBomParent = new BomNewPbomParentEntity(); + BeanUtil.copyProperties(parentVo, pBomParent); + pBomParent.setSourceRowId(parentVo.getBomRowId()); + pBomParent.setRowId(IdWorker.getId()); + pBomParent.setStatus(PBomStatusEnum.WAIT_PUBLISH.getValue()); + pBomParent.setLastVersionIs(1); + pBomParent.setFacCode(facCode); + pBomParent.setTechnologyUserCode(SessionUtil.getUserCode()); + pBomParent.setTechnologyUserName(SessionUtil.getRealName()); + //pBomParent.setCurrentVersion(VersionUtil.getNextVersion("")); + //版本=EBom版本 + pBomParent.setCurrentVersion(parentVo.getCurrentVersion()); + pBomParent.setEditStatus(PBomEditStatusEnum.HANDLER_CREATED.getValue()); + if (Objects.nonNull(oldParent)) { + // pBomParent.setCurrentVersion(VersionUtil.getNextVersion(oldParent.getCurrentVersion())); + oldParent.setExpireEndTime(LocalDateTime.now()); + oldParent.setLastVersionIs(0); + } + this.pBomParentResult.add(pBomParent); + return pBomParent; + } + + + } + + /** + * 31提层 + * + * @param + * @param + */ + protected void liftingLayer() { + for (BomNewEbomParentVO vo : allBomDetail) { + if (StrUtil.isNotBlank(vo.getProjectType()) && vo.getProjectType().equals(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getProductTypeKey())) { + BomNewEbomParentVO lastVirtualPackage = getLastVirtualPackage(vo, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE); + if (Objects.nonNull(lastVirtualPackage)) { + liftingLayerSummary(lastVirtualPackage, vo); + vo.setSourceRowId(String.valueOf(vo.getParentRowId())); + vo.setSourceParentMaterialNo(getParentMaterialNo(vo.getBomRowId())); + vo.setParentRowId(lastVirtualPackage.getBomRowId()); + result.add(vo); + } + //当没找到直发包时,丢弃 +// else { +// // buildUpgradeChange(vo); +// } + continue; + } + if (StrUtil.isNotBlank(vo.getProjectType()) && vo.getProjectType().equals(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getProductTypeKey())) { + BomNewEbomParentVO lastVirtualPackage = getLastVirtualPackage(vo, VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE); + if (Objects.nonNull(lastVirtualPackage)) { + liftingLayerSummary(lastVirtualPackage, vo); + vo.setSourceRowId(String.valueOf(vo.getParentRowId())); + vo.setSourceParentMaterialNo(getParentMaterialNo(vo.getBomRowId())); + vo.setParentRowId(lastVirtualPackage.getBomRowId()); + result.add(vo); + } +// else { //当没找到直发包时,丢弃 +// // buildUpgradeChange(vo); +// } + continue; + } + result.add(vo); + } + } + + //变更记录(明细) + protected void buildUpgradeChangeDetail(BomNewEbomParentVO parent, VirtualPackageTypeEnum packageTypeEnum) { + + List list = SpringUtil.getBean(BomNewEbomVirtualPackageCompositionService.class).lambdaQuery() + .eq(BomNewEbomVirtualPackageCompositionEntity::getParentMaterialNo, parent.getMaterialNo()) + .eq(BomNewEbomVirtualPackageCompositionEntity::getProjectType, packageTypeEnum.getProductTypeKey()).list(); + if (CollUtil.isNotEmpty(list)) { + //老的虚拟包组成 + Set oldMaterialNoAndNumSet = list.stream().filter(u -> u.getParentMaterialNo().equals(parent.getMaterialNo())).map(u -> StrUtil.join("-", u.getChildMaterialNo(), u.getNum())).collect(Collectors.toSet()); + + List parentChildren = allBomDetail.stream().filter(u -> u.getParentRowId().equals(parent.getBomRowId())).collect(Collectors.toList()); + //物料编码 +数量 + Set newSet = parentChildren.stream().filter(u -> Objects.nonNull(u.getProjectType()) && VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getProductTypeKey().equals(u.getProjectType())).map(u -> StrUtil.join("-", u.getMaterialNo(), u.getNum())).collect(Collectors.toSet()); + //bom 发生了改变-影响了虚拟包 + if (CollUtil.isNotEmpty(Sets.difference(oldMaterialNoAndNumSet, newSet)) || CollUtil.isNotEmpty(Sets.difference(newSet, oldMaterialNoAndNumSet))) { + + List vmaterialNoList = list.stream().map(u -> u.getVirtualPackageMaterialNo()).distinct().collect(Collectors.toList()); + //记录变更明细行 + buildChangeDetailD0(vmaterialNoList, parent, parentChildren); + //变更 + buildUpgradeChange(list, parent); + } + } + + } + + private void buildChangeDetailD0(List vmaterialNoList, BomNewEbomParentVO parent, List parentChildren) { + for (BomNewEbomParentVO vo : parentChildren) { + for (String vNo : vmaterialNoList) { + BomNewEbomUpdateDetailEntity changeDetailEnt = new BomNewEbomUpdateDetailEntity(); + changeDetailEnt.setRowId(IdWorker.getId()); + changeDetailEnt.setVirtualPackageMaterialNo(vNo); + changeDetailEnt.setParentMaterialNo(parent.getMaterialNo()); + changeDetailEnt.setCurrentVersion(parent.getCurrentVersion()); + changeDetailEnt.setChildMaterialNo(vo.getMaterialNo()); + changeDetailEnt.setNum(vo.getNum()); + changeDetailEnt.setProjectType(vo.getProjectType()); + changeDetailEnt.setUpdatedTime(LocalDateTime.now()); + changeDetailEnt.setEbomSourceRowId(vo.getRowId()); + this.upgradeChangeDetailResult.add(changeDetailEnt); + } + + + } + } + + + private void buildUpgradeChange(List changeList, BomNewEbomParentVO parent) { + List vmaterialNoList = changeList.stream().map(u -> u.getVirtualPackageMaterialNo()).distinct().collect(Collectors.toList()); + for (String vmaterialNo : vmaterialNoList) { + String key = StrUtil.join("-", vmaterialNo, parent.getMaterialNo()); + if (hasBuildVNo.contains(key)) { + continue; + } + BomNewEbomUpgradeChangeEntity changeEntity = new BomNewEbomUpgradeChangeEntity(); + changeEntity.setRowId(IdWorker.getId()); + changeEntity.setMaterialNo(vmaterialNo); + changeEntity.setVersionOld(parent.getCurrentVersion()); + changeEntity.setVersionNew(VersionUtil.getNextVersionForSmallVersion(parent.getCurrentVersion())); + changeEntity.setDeviseName(SessionUtil.getRealName()); + changeEntity.setDeptName(SessionUtil.getDepartName()); + changeEntity.setRelMaterialNo(parent.getMaterialNo()); + changeEntity.setRelMaterialDesc(parent.getMaterialDesc()); + changeEntity.setStatus(0); + upgradeChangeResult.add(changeEntity); + + hasBuildVNo.add(key); + } + + } + + + /** + * 提层汇总数量 + * + * @param lastVirtualPackage 虚拟包 + * @param vo 提层项 + */ + private void liftingLayerSummary(BomNewEbomParentVO lastVirtualPackage, BomNewEbomParentVO vo) { + BigDecimal sum = vo.getNum(); + String parentLevelNo = BomLevelUtil.getParentLevelNo(vo.getLevelNo()); + List parentFullPathNum = new ArrayList<>(); + while (parentLevelNo.length() >= lastVirtualPackage.getLevelNo().length()) { + String pNo = parentLevelNo; + List parentList = allBomDetail.stream().filter(u -> u.getLevelNo().equals(pNo)).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(parentList)) { + sum = NumberUtil.mul(sum, parentList.get(0).getNum()); + parentFullPathNum.add(parentList.get(0).getNum()); + } +// else { +// parentFullPathNum.add(parentList.get(0).getNum()); +// } + parentLevelNo = BomLevelUtil.getParentLevelNo(parentLevelNo); + + } + vo.setNum(sum); + //构建虚拟包组成 + buildVirtualPackageComposition(lastVirtualPackage, vo, parentFullPathNum); + + } + + private void buildVirtualPackageComposition(BomNewEbomParentVO lastVirtualPackage, BomNewEbomParentVO vo, List parentFullPathNum) { + + BomNewEbomVirtualPackageCompositionEntity packageCompositionEntity = new BomNewEbomVirtualPackageCompositionEntity(); + packageCompositionEntity.setRowId(IdWorker.getId()); + packageCompositionEntity.setVirtualPackageMaterialNo(lastVirtualPackage.getMaterialNo()); + List voParent = allBomDetail.stream().filter(u -> u.getBomRowId().equals(vo.getParentRowId())).collect(Collectors.toList()); + VUtils.isTure(CollUtil.isEmpty(voParent)).throwMessage(vo.getMaterialNo() + " 未找到父级"); + packageCompositionEntity.setParentMaterialNo(voParent.get(0).getMaterialNo()); + packageCompositionEntity.setChildMaterialNo(vo.getMaterialNo()); + packageCompositionEntity.setParentFullPathNum(StrUtil.join(",", parentFullPathNum)); + packageCompositionEntity.setProjectType(vo.getProjectType()); + packageCompositionEntity.setUnitWeight(vo.getUnitWeight()); + packageCompositionEntity.setTotalWeight(vo.getTotalWeight()); + packageCompositionEntity.setUpdatedTime(LocalDateTime.now()); + this.virtualPackageCompositionResult.add(packageCompositionEntity); + } + + private String getParentMaterialNo(Long parentRowId) { + List collect = allBomDetail.stream().filter(u -> u.getBomRowId().equals(parentRowId)).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(collect)) { + return collect.get(0).getMaterialNo(); + } + return ""; + + } + + + private BomNewEbomParentVO getLastVirtualPackage(BomNewEbomParentVO vo, VirtualPackageTypeEnum virtualPackageTypeEnum) { + List zhiFaList = allBomDetail.stream().filter(u -> vo.getLevelNumber().compareTo(u.getLevelNumber()) > 0 && u.getMaterialName().contains(virtualPackageTypeEnum.getConMaterialName())).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(zhiFaList)) { + return Collections.max(zhiFaList, Comparator.comparing(BomNewEbomParentVO::getLevelNumber)); + } + return null; + + } + + + private BomNewEbomParentVO getVirtualPackageByName(VirtualPackageTypeEnum virtualPackageTypeEnum) { + List list = allBomDetail.stream().filter(u -> u.getMaterialName().contains(virtualPackageTypeEnum.getConMaterialName())).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(list)) { + return list.get(0); + } + return null; + + } + + + /** + * 生成 层级号 + * + * @param saveBomDetailParamDTO + * @param bomRowID + * @param parentDrawingNo + */ + public void generateDrawingNo(List saveBomDetailParamDTO, Long bomRowID, String parentDrawingNo) { + List firstLevelBoms = saveBomDetailParamDTO.stream().filter(u -> u.getParentRowId().equals(bomRowID)).collect(Collectors.toList()); + String parentDrawingNoRe = StrUtil.isNotBlank(parentDrawingNo) ? parentDrawingNo : ""; + Integer gNo = 1; + + String preAssemblyPackageLevelNo = StrUtil.isNotBlank(parentDrawingNoRe) ? StrUtil.join("-", parentDrawingNoRe, "1") : "1"; + for (BomNewEbomParentVO firstLevelBom : firstLevelBoms) { + + if (firstLevelBom.getMaterialName().contains(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getConMaterialName()) || firstLevelBom.getMaterialName().contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getConMaterialName())) { + firstLevelBom.setLevelNumber(levelToNum(preAssemblyPackageLevelNo)); + firstLevelBom.setLevelNo(preAssemblyPackageLevelNo); + continue; + } + + String levelKey = StrUtil.isNotBlank(parentDrawingNoRe) ? StrUtil.join("-", parentDrawingNoRe, gNo.toString()) : gNo.toString(); + firstLevelBom.setLevelNumber(levelToNum(levelKey)); + firstLevelBom.setLevelNo(levelKey); + gNo++; + generateDrawingNo(saveBomDetailParamDTO, firstLevelBom.getChildBomRowId(), firstLevelBom.getLevelNo()); + + + } + + } + + /** + * 转换层级号为数字 + * + * @param strLevel + * @return + */ + private BigDecimal levelToNum(String strLevel) { + if (StrUtil.isEmpty(strLevel)) { + return null; + } + if (strLevel.indexOf('-') == -1) { + return new BigDecimal(strLevel); + } + String[] fromArray = strLevel.split("-"); + String reuslt = ""; + for (int i = 0; i < fromArray.length; i++) { + if (i == 0) { + reuslt = fromArray[i] + '.'; + } else { + reuslt += StrUtil.padPre(fromArray[i], 2, '0'); + } + + } + return new BigDecimal(reuslt); + } +} diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EbomInitProjectType.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EbomInitProjectType.java index 21021d1a..8dcb839f 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EbomInitProjectType.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EbomInitProjectType.java @@ -2,14 +2,9 @@ package com.nflg.product.bomnew.service.domain.EBom; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; -import cn.hutool.extra.spring.SpringUtil; import com.google.common.collect.Sets; -import com.nflg.product.bomnew.constant.EBomExceptionStatusEnum; import com.nflg.product.bomnew.constant.ProjectTypeInputTypeEnum; -import com.nflg.product.bomnew.mapper.master.BomNewEbomParentMapper; -import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity; import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO; -import com.nflg.product.bomnew.pojo.vo.MaterialHistoryProjectTypeVO; import lombok.Getter; import java.util.ArrayList; @@ -17,7 +12,6 @@ import java.util.List; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * 初始化项目类别 From 8a3a1d3bf29877620de71dfd3db68b8c5c80b7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Tue, 21 May 2024 17:04:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.31=E8=BD=ACPBOM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/service/BomNewEbomParentService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index b117b057..9acdd0ef 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java @@ -875,9 +875,7 @@ public class BomNewEbomParentService extends ServiceImpl