diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/EBomImportService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/EBomImportService.java index 66301957..9fa7a53f 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/EBomImportService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/EBomImportService.java @@ -220,7 +220,7 @@ public class EBomImportService { if (Objects.isNull(dto.getNum())) { dto.setNum(BigDecimal.ONE); } - if (Objects.isNull(dto.getUnit())) { + if (StrUtil.isBlank(dto.getUnit())) { dto.setUnit("PC"); } } @@ -294,7 +294,10 @@ public class EBomImportService { List parents = new ArrayList<>(); List children = new ArrayList<>(); - List materialNos = datas.stream().map(EbomExcelDTO::getMaterialNo).collect(Collectors.toList()); + List materialNos = datas.stream() + .filter(d -> !StrUtil.equals(d.getProjectType(), BomConstant.PROJECT_TYPE_TEMPORARY, true)) + .map(EbomExcelDTO::getMaterialNo) + .collect(Collectors.toList()); materialNos.addAll(datas.stream().map(EbomExcelDTO::getParentMaterialNo).collect(Collectors.toList())); materialNos = materialNos.stream().distinct().collect(Collectors.toList()); List materialBaseInfos = materialMainService.getMaterialBaseInfo(materialNos); @@ -338,7 +341,7 @@ public class EBomImportService { .filter(m -> m.getMaterialNo().equals(child.getMaterialNo())) .findFirst() .orElse(null); - if (!Objects.isNull(vo)) { + if (Objects.nonNull(vo)) { child.setMaterialCategoryCode(vo.getMaterialCategoryCode()); child.setMaterialName(vo.getMaterialName()); child.setDrawingNo(vo.getDrawingNo()); @@ -379,7 +382,7 @@ public class EBomImportService { .filter(m -> m.getMaterialNo().equals(data.getParentMaterialNo())) .findFirst() .orElse(null); - if (!Objects.isNull(vo)) { + if (Objects.nonNull(vo)) { parent.setDrawingNo(vo.getDrawingNo()); parent.setUnitWeight(vo.getMaterialWeight()); parent.setMaterialName(vo.getMaterialName()); @@ -438,7 +441,7 @@ public class EBomImportService { .filter(m -> m.getMaterialNo().equals(materialNo)) .findFirst() .orElse(null); - if (!Objects.isNull(vo)) { + if (Objects.nonNull(vo)) { parent.setDrawingNo(vo.getDrawingNo()); parent.setUnitWeight(vo.getMaterialWeight()); parent.setMaterialName(vo.getMaterialName());