From f4f992e32804485936255836061ad26182e06d24 Mon Sep 17 00:00:00 2001 From: jing's Date: Thu, 28 Dec 2023 13:36:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/constant/EbomEditStatusEnum.java | 2 +- .../service/BomNewEbomParentService.java | 16 ++++--- .../bomnew/service/domain/EBom/EBomEdit.java | 43 +++++++++---------- 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EbomEditStatusEnum.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EbomEditStatusEnum.java index 6acbfd6f..8d162090 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EbomEditStatusEnum.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EbomEditStatusEnum.java @@ -8,7 +8,7 @@ import lombok.Getter; @Getter public enum EbomEditStatusEnum implements ValueEnum { - HANDLER_CREATED(1, "待处理 "), + HANDLER_CREATED(1, "待处理"), HANDLER_FINISHED(2, "处理完成"); 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 dfa936ae..343f0a88 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 @@ -1130,17 +1130,19 @@ public class BomNewEbomParentService extends ServiceImpl allBom = Convert.convert(new TypeReference>() { }, eBomEdit.childEntities); - if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) { - allBom.add(Convert.convert(BomNewEbomParentVO.class, eBomEdit.parentEntities.get(0))); - } CheckEBomException checkEBomException = new CheckEBomException(allBom); - checkEBomException.initException(); + checkEBomException.initException("material", "materialTexture", "projectType"); + checkEBomException.checkContainExcept(checkStatus); + } if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) { this.saveOrUpdateBatch(eBomEdit.parentEntities); @@ -1157,7 +1159,9 @@ public class BomNewEbomParentService extends ServiceImpl computeLevelNumAndRootState()); return true; } @@ -1175,6 +1179,8 @@ public class BomNewEbomParentService extends ServiceImpl delTagList = new ArrayList<>(); + CheckEBomException checkEBomException = new CheckEBomException(delList); + checkEBomException.initException("material", "materialTexture", "projectType"); //原始bom不正常 List s1List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource()) && !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList()); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java index 76b5b9b4..171ccb64 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java @@ -146,8 +146,8 @@ public class EBomEdit { } child.setEditStatus(dto.getOpType()); - parent.setCreatedJob(roleList.contains(EBomConstant.TECHNICIAN)?UserJobEnum.ENGINEER.getValue():UserJobEnum.DESIGNER.getValue()); - parent.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum())); + // parent.setCreatedJob(roleList.contains(EBomConstant.TECHNICIAN)?UserJobEnum.ENGINEER.getValue():UserJobEnum.DESIGNER.getValue()); + // parent.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum())); } @@ -185,24 +185,26 @@ public class EBomEdit { } else { BomNewEbomParentEntity parent; - List exceptList=new ArrayList<>(); - exceptList.addAll(dto.getDatas()); - //缺bom if (dto.getParent().getBomRowId() == null || dto.getParent().getBomRowId().longValue() == 0) { dto.getParent().setBomRowId(dto.getParent().getRowId()); - exceptList.add(dto.getParent()); - CheckEBomException eBomException=new CheckEBomException( exceptList ); - eBomException.checkException(); parent = createParentBomInfo(dto.getParent()); parent.setEditStatus(dto.getOpType()); + + //工艺人员 + if(roleList.contains(EBomConstant.TECHNICIAN)){ + parent.setStatus(EBomStatusEnum.CHECKED.getValue()); + } + parentEntities.add(parent); }else { - exceptList.add(dto.getParent()); - CheckEBomException eBomException=new CheckEBomException( exceptList ); - eBomException.checkException(); parent = Convert.convert(BomNewEbomParentEntity.class, dto.getParent()); parent.setEditStatus(dto.getOpType()); + //工艺人员 + if(roleList.contains(EBomConstant.TECHNICIAN)){ + parent.setStatus(EBomStatusEnum.CHECKED.getValue()); + } + parentEntities.add(parent); } @@ -216,31 +218,28 @@ public class EBomEdit { //child.setProjectTypeInputType(ProjectTypeInputTypeEnum.MANUAL_INPUT.getValue()); child.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum())); - + child.setEditStatus(dto.getOpType()); //新增数据 if(child.getRowId()==null || child.getRowId().longValue()==0){ child.setRowId(IdWorker.getId()); child.setIdentityNo(StrUtil.join("-", parent.getRowId(), parent.getRowId())); child.setSource(source); - child.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue()); + child.setCreatedTime(LocalDateTime.now()); child.setCreatedBy(SessionUtil.getUserCode()); child.setSourceRowId(0l); child.setParentRowId(parent.getRowId()); child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); - parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); - - //工艺人员 - if(roleList.contains(EBomConstant.TECHNICIAN)){ - parent.setStatus(EBomStatusEnum.CHECKED.getValue()); - } + // parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); } - child.setEditStatus(dto.getOpType()); - parent.setCreatedJob(roleList.contains(EBomConstant.TECHNICIAN)?UserJobEnum.ENGINEER.getValue():UserJobEnum.DESIGNER.getValue()); - parent.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum())); + + child.setEditStatus(dto.getOpType()); + // parent.setCreatedJob(roleList.contains(EBomConstant.TECHNICIAN)?UserJobEnum.ENGINEER.getValue():UserJobEnum.DESIGNER.getValue()); + + // parent.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum())); if(StrUtil.isEmpty(child.getProjectType())){ child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue());