|
@@ -459,15 +459,16 @@ public class CustomExcelImportUtil {
|
|
|
public static void main(String[] args) throws IOException, InvalidFormatException {
|
|
|
//String path = "C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson";
|
|
|
//File dirFile = new File("C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson");
|
|
|
- String[] files = {"C:\\Users\\cyz\\Desktop\\新建文件夹\\2021.7.15设备基础信息 更新自定义设备类型和部分第一维修人 (1) - 副本.xls"};
|
|
|
+ String[] files = {"C:\\Users\\cyz\\\\Downloads\\2021.8.3设备基础导入 修改设备等级 设备类型 自定义类型.xls"};
|
|
|
for(String fileStr:files){
|
|
|
System.out.println(fileStr);
|
|
|
InputStream inputstream = new FileInputStream(fileStr);
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
- List<SbInfoVO> list = importSbInfoList(inputstream);
|
|
|
- /* list.forEach(item -> {
|
|
|
+ //List<SbInfoVO> list = importSbInfoList(inputstream);
|
|
|
+ List<SbInfoVO> list = importListByUpdateALl(inputstream);
|
|
|
+ list.forEach(item -> {
|
|
|
System.out.println(item.toString());
|
|
|
- });*/
|
|
|
+ });
|
|
|
System.out.println("处理数量:" + list.size());
|
|
|
}
|
|
|
}
|
|
@@ -607,11 +608,11 @@ public class CustomExcelImportUtil {
|
|
|
}
|
|
|
|
|
|
private static Integer getLevel(String stringCellValue) {
|
|
|
- if ("A级".equals(stringCellValue)) {
|
|
|
+ if ("A".equals(stringCellValue) || "A级".equals(stringCellValue)) {
|
|
|
return 1;
|
|
|
- } else if ("B级".equals(stringCellValue)) {
|
|
|
+ } else if ("B".equals(stringCellValue) || "B级".equals(stringCellValue)) {
|
|
|
return 2;
|
|
|
- } else if ("C级".equals(stringCellValue)) {
|
|
|
+ } else if ("C".equals(stringCellValue) || "C级".equals(stringCellValue)) {
|
|
|
return 3;
|
|
|
} else {
|
|
|
return 1;
|
|
@@ -1273,7 +1274,7 @@ public class CustomExcelImportUtil {
|
|
|
}
|
|
|
record.setStatus(getSbInfoStatus(row.getCell(18).getStringCellValue()));
|
|
|
record.setRemark(row.getCell(19).getStringCellValue().trim());
|
|
|
- System.out.println("row.getPhysicalNumberOfCells(): " + row.getPhysicalNumberOfCells());
|
|
|
+ //System.out.println("row.getPhysicalNumberOfCells(): " + row.getPhysicalNumberOfCells());
|
|
|
// 主子设备和是否大屏显示
|
|
|
if(row.getPhysicalNumberOfCells()>20){
|
|
|
record.setIsChild(getChild(row.getCell(20).getStringCellValue().trim()));
|