【物料主数据】批量变更,图号校验问题

This commit is contained in:
10001392 2024-10-16 16:31:07 +08:00
parent 04503f8c26
commit 3842817345
1 changed files with 1 additions and 1 deletions

View File

@ -700,9 +700,9 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
List<String> drawingNoList = excelContext.stream().map(TwentyMaterialTemplateExcelDTO::getDrawingNo).collect(Collectors.toList()); List<String> drawingNoList = excelContext.stream().map(TwentyMaterialTemplateExcelDTO::getDrawingNo).collect(Collectors.toList());
List<MaterialMainEntity> entityList = this.materialMainService.lambdaQuery().in(MaterialMainEntity::getDrawingNo, drawingNoList).list(); List<MaterialMainEntity> entityList = this.materialMainService.lambdaQuery().in(MaterialMainEntity::getDrawingNo, drawingNoList).list();
if (entityList != null && entityList.size() > 0) { if (entityList != null && entityList.size() > 0) {
List<String> drawingNos = entityList.stream().map(MaterialMainEntity::getDrawingNo).collect(Collectors.toList());
List<MaterialMainEntity> others = entityList.stream().filter(item -> !upMaterialNos.contains(item.getMaterialNo())).collect(Collectors.toList()); List<MaterialMainEntity> others = entityList.stream().filter(item -> !upMaterialNos.contains(item.getMaterialNo())).collect(Collectors.toList());
if (others.size() > 0) { if (others.size() > 0) {
List<String> drawingNos = others.stream().map(MaterialMainEntity::getDrawingNo).collect(Collectors.toList());
throw new NflgBusinessException(STATE.ParamErr, StrUtil.join(",", drawingNos).concat("的图号在正式物料中已存在")); throw new NflgBusinessException(STATE.ParamErr, StrUtil.join(",", drawingNos).concat("的图号在正式物料中已存在"));
} }
} }