|
|
|
@ -4407,7 +4407,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
List<Integer> emptyPartNoRows = new ArrayList<>(); |
|
|
|
List<Integer> repeatPartNoRows = new ArrayList<>(); |
|
|
|
List<Integer> wrongBuNoRows = new ArrayList<>(); |
|
|
|
List<String> wrongIfsPartNos = new ArrayList<>(); |
|
|
|
List<Integer> wrongIfsPartNoRows = new ArrayList<>(); |
|
|
|
List<PlmProjectPartData> partList = new ArrayList<>(); |
|
|
|
BuData buData = new BuData(); |
|
|
|
buData.setSite(data.getOrderRef1()); |
|
|
|
@ -4435,26 +4435,26 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
part.setFinalPartNo(getStringCellValue(row, 0)); |
|
|
|
if (part.getFinalPartNo()==null|| part.getFinalPartNo().isEmpty()){ |
|
|
|
flag = false; |
|
|
|
emptyPartNoRows.add(j); |
|
|
|
emptyPartNoRows.add(j+1); |
|
|
|
} |
|
|
|
if (j <= 2000) { |
|
|
|
if (!partNoSet.add(part.getFinalPartNo())) { |
|
|
|
flag = false; |
|
|
|
repeatPartNoRows.add(j); |
|
|
|
repeatPartNoRows.add(j+1); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (!partNoSet1.add(part.getFinalPartNo())) { |
|
|
|
flag = false; |
|
|
|
repeatPartNoRows.add(j); |
|
|
|
repeatPartNoRows.add(j+1); |
|
|
|
} |
|
|
|
} |
|
|
|
ifsPartNoMap.put(part.getFinalPartNo(), j); |
|
|
|
ifsPartNoMap.put(part.getFinalPartNo(), j+1); |
|
|
|
part.setBuNo(getStringCellValue(row, 1)); |
|
|
|
// 检验BU |
|
|
|
if (part.getBuNo()!=null&&!part.getBuNo().isEmpty()){ |
|
|
|
if(buMap.get(part.getBuNo())==null||buMap.get(part.getBuNo()).isEmpty()){ |
|
|
|
flag = false; |
|
|
|
wrongBuNoRows.add(j); |
|
|
|
wrongBuNoRows.add(j+1); |
|
|
|
} |
|
|
|
} |
|
|
|
part.setCustomerPartNo(getStringCellValue(row, 2)); |
|
|
|
@ -4475,7 +4475,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
for (PlmProjectPartData part : partList) { |
|
|
|
List list2 = getProjectPartList1(part).getList(); |
|
|
|
if (list2.isEmpty()) { |
|
|
|
wrongIfsPartNos.add(part.getFinalPartNo()); |
|
|
|
wrongIfsPartNoRows.add(ifsPartNoMap.get(part.getFinalPartNo())); |
|
|
|
continue; |
|
|
|
} |
|
|
|
Object item = list2.get(0); |
|
|
|
@ -4491,20 +4491,27 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
return new PageUtils(list); |
|
|
|
}else { |
|
|
|
IPage<String> list = new Page<String>(page, 4 *limit); |
|
|
|
if (emptyPartNoRows.size()>0){ |
|
|
|
String emptyPartNoRowsStr = "第" + emptyPartNoRows.stream().map(Object::toString).collect(Collectors.joining(",")) + "行料号为空!"; |
|
|
|
if (!emptyPartNoRows.isEmpty()){ |
|
|
|
String emptyPartNoRowsStr = "空料号: 第" + emptyPartNoRows.stream().map(Object::toString).collect(Collectors.joining("/")) + "行"; |
|
|
|
exceptionList.add(emptyPartNoRowsStr); |
|
|
|
} |
|
|
|
if (repeatPartNoRows.size()>0){ |
|
|
|
String repeatPartNoRowsStr = "第" + repeatPartNoRows.stream().map(Object::toString).collect(Collectors.joining(",")) + "行出现重复料号!"; |
|
|
|
if (!repeatPartNoRows.isEmpty()){ |
|
|
|
String repeatPartNoRowsStr = "重复料号: 第" + repeatPartNoRows.stream().map(Object::toString).collect(Collectors.joining("/")) + "行"; |
|
|
|
exceptionList.add(repeatPartNoRowsStr); |
|
|
|
} |
|
|
|
if (wrongBuNoRows.size()>0){ |
|
|
|
String wrongBuNoRowsStr = "第" + wrongBuNoRows.stream().map(Object::toString).collect(Collectors.joining(",")) + "行数据的BU在系统中不存在!"; |
|
|
|
if (!wrongBuNoRows.isEmpty()){ |
|
|
|
String wrongBuNoRowsStr = "BU异常: 第" + wrongBuNoRows.stream().map(Object::toString).collect(Collectors.joining("/")) + "行"; |
|
|
|
exceptionList.add(wrongBuNoRowsStr); |
|
|
|
} |
|
|
|
if (wrongIfsPartNos.size()>0){ |
|
|
|
String wrongIfsPartNosStr = "系统中不存在以下ifs物料编码:" + wrongIfsPartNos.stream().map(Object::toString).collect(Collectors.joining(",")) + "!"; |
|
|
|
if (!wrongIfsPartNoRows.isEmpty()){ |
|
|
|
String wrongIfsPartNosStr = null; |
|
|
|
if ("N".equals(searchType)){ |
|
|
|
// Inventory Part |
|
|
|
wrongIfsPartNosStr = "IFS物料编码在Inventory Part中不存在: 第"+ wrongIfsPartNoRows.stream().map(Object::toString).collect(Collectors.joining("/")) + "行"; |
|
|
|
} else { |
|
|
|
// Project Part |
|
|
|
wrongIfsPartNosStr = "IFS物料编码在Project Part中不存在: 第"+ wrongIfsPartNoRows.stream().map(Object::toString).collect(Collectors.joining("/")) + "行"; |
|
|
|
} |
|
|
|
exceptionList.add(wrongIfsPartNosStr); |
|
|
|
} |
|
|
|
list.setRecords(exceptionList); |
|
|
|
|