diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewDQbomExceptionCheckService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewDQbomExceptionCheckService.java index 69e7f056..b33834aa 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewDQbomExceptionCheckService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewDQbomExceptionCheckService.java @@ -127,8 +127,6 @@ public class BomNewDQbomExceptionCheckService { if (StrUtil.isBlank(parent.getMaterialName())) { status = EBomExceptionStatusEnum.EXCEPT_NO_4; } - // } else if (parent.getMaterialNo().startsWith(BomConstant.NO_TEMPORARY_PREFIX)) { - // status = EBomExceptionStatusEnum.EXCEPT_NO_4; } else { BaseMaterialVO materialVO = materialVOS.stream() .filter(v -> v.getMaterialNo().equals(parent.getMaterialNo())) @@ -138,7 +136,7 @@ public class BomNewDQbomExceptionCheckService { status = EBomExceptionStatusEnum.EXCEPT_NO_7; } else if (materialVO.getMaterialState().equals(MaterialGetEnum.MaterialStateEnum.STATE_NO_4.getValue())) { status = EBomExceptionStatusEnum.EXCEPT_NO_2; - } else if (!materialVO.getMaterialName().equals(parent.getMaterialName())) { + } else if (!materialVO.getMaterialDesc().equals(parent.getMaterialName())) { status = EBomExceptionStatusEnum.EXCEPT_NO_15; } else if (Objects.isNull(parent.getNum()) || parent.getNum().equals(BigDecimal.ZERO)) { status = EBomExceptionStatusEnum.EXCEPT_NO_4; @@ -178,7 +176,7 @@ public class BomNewDQbomExceptionCheckService { status = EBomExceptionStatusEnum.EXCEPT_NO_7; } else if (materialVO.getMaterialState().equals(MaterialGetEnum.MaterialStateEnum.STATE_NO_4.getValue())) { status = EBomExceptionStatusEnum.EXCEPT_NO_2; - } else if (!materialVO.getMaterialName().equals(child.getMaterialName())) { + } else if (!materialVO.getMaterialDesc().equals(child.getMaterialName())) { status = EBomExceptionStatusEnum.EXCEPT_NO_15; } else if (Objects.isNull(child.getNum()) || child.getNum().equals(BigDecimal.ZERO)) { status = EBomExceptionStatusEnum.EXCEPT_NO_4; diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java index 6adfb1a4..71fcd35d 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java @@ -144,11 +144,7 @@ public class DQBomService { parents.forEach(p -> { if (Objects.isNull(vo.getStatus())) { vo.setStatus(p.getStatus()); - // vo.setCurrentVersion("A00"); } - // if (Objects.equals(vo.getBomExist(), 0) && Objects.equals(vo.getShouldBomExist(), 1)) { - // vo.setCurrentVersion("A-1"); - // } p.setChildNodes(CollUtil.toList(vo)); datas.addAll(buildParent(p)); }); @@ -188,7 +184,7 @@ public class DQBomService { BaseMaterialVO bm = materialBaseInfos.stream().filter(m -> m.getMaterialNo().equals(d.getMaterialNo())).findFirst().orElse(null); if (bm != null) { d.setMaterialState(bm.getMaterialState()); - d.setSystemMaterialName(bm.getMaterialName()); + d.setSystemMaterialName(bm.getMaterialDesc()); d.setSystemMaterialCategoryName(bm.getCategoryName()); d.setSystemMaterialUnit(bm.getMaterialUnit()); d.setMaterialRowId(bm.getMaterialRowId()); @@ -220,7 +216,7 @@ public class DQBomService { */ @Transactional(rollbackFor = Exception.class) public BomNewDQbomSaveQuery save(BomNewDQbomSaveQuery query) { - BomNewDQbomParentEntity parent; + BomNewDQbomParentEntity parent = Convert.convert(BomNewDQbomParentEntity.class, query.getParent()); if (Objects.isNull(query.getParent()) || query.getParent().getBomRowId() == 0) { //新增父级节点 @@ -232,7 +228,6 @@ public class DQBomService { .throwMessage("父级已被其他人创建"); VUtils.isTure(CollUtil.isEmpty(query.getChildren())).throwMessage("新添加的bom必须有子级"); - parent = Convert.convert(BomNewDQbomParentEntity.class, query.getParent()); parent.setRowId(IdWorker.getId()); parent.setLevel(1); parent.setBomExist(1); @@ -249,7 +244,8 @@ public class DQBomService { } else { //删除所有子级关系 dQBomChildService.deleteAllChildren(query.getParent().getBomRowId()); - parent = dQBomParentService.getById(query.getParent().getBomRowId()); + + parent.setRowId(query.getParent().getBomRowId()); parent.setModifyTime(LocalDateTime.now()); if (CollUtil.isEmpty(query.getChildren())) { parent.setBomExist(0); @@ -412,12 +408,14 @@ public class DQBomService { p.setCreatedTime(LocalDateTime.now()); p.setCreatedBy(SessionUtil.getUserCode()); p.setModifyTime(null); + initMaterialInfo(Collections.singletonList(p)); vo.setParent(p); } else { BomNewDQbomParentEntity parent = dQBomParentService.getById(bomRowId); BomNewDQbomVO p = Convert.convert(BomNewDQbomVO.class, parent); p.setBomRowId(bomRowId); p.setRowId(rowId); + initMaterialInfo(Collections.singletonList(p)); vo.setParent(p); vo.setDatas(getChild(bomRowId)); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewDQbomParentMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewDQbomParentMapper.xml index deec9537..1f20a57c 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewDQbomParentMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewDQbomParentMapper.xml @@ -129,16 +129,7 @@