|
@@ -1,5 +1,6 @@
|
|
|
package com.persagy.dmp.rwd.dic;
|
|
|
|
|
|
+import cn.hutool.core.io.FileUtil;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.CellType;
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
@@ -93,7 +94,8 @@ public class ExcelUtilsForEdit {
|
|
|
String key = item.getKey();
|
|
|
String value = item.getValue();
|
|
|
if (name.contains(value)) {
|
|
|
- System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 2) + "\", \"/附表7-系统类对象分类属性点表/" + name + "\", \"" + sheetName + "\",\"2\");");
|
|
|
+ System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 2) + "\", \"/附表7-系统类对象分类属性点表/" + name + "\", \"" + sheetName + "\",\"2\",systemCommonSeq);");
|
|
|
+ System.out.println("systemCommonSeq = new AtomicInteger(this.systemCommonSeq.intValue());");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -127,7 +129,8 @@ public class ExcelUtilsForEdit {
|
|
|
Sheet sheet = workbook.getSheetAt(i);
|
|
|
String sheetName = sheet.getSheetName();
|
|
|
|
|
|
- System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 4) + "\", \"" + pathName + "/" + name + "\", \"" + sheetName + "\",\"2\");");
|
|
|
+ System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 4) + "\", \"" + pathName + "/" + name + "\", \"" + sheetName + "\",\"2\",equipCommonSeq);");
|
|
|
+ System.out.println("equipCommonSeq = new AtomicInteger(this.equipCommonSeq.intValue());");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -165,13 +168,28 @@ public class ExcelUtilsForEdit {
|
|
|
String key = item.getKey();
|
|
|
String value = item.getValue();
|
|
|
if (name.contains(value)) {
|
|
|
- System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 6) + "\", \"/附表9-部件类对象分类属性点表/" + name + "\", \"" + sheetName + "\",\"2\");");
|
|
|
+ System.out.println("analysisSheetDataAndWriteToFile(\"" + key + sheetName.substring(0, 6) + "\", \"/附表9-部件类对象分类属性点表/" + name + "\", \"" + sheetName + "\",\"2\",componentCommonSeq);");
|
|
|
+ System.out.println("componentCommonSeq = new AtomicInteger(this.componentCommonSeq.intValue());");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ @Test
|
|
|
+ public void test4() throws Exception {
|
|
|
+ showPathForTool(basepath + "/附表12-工具类对象分类属性点表");
|
|
|
+ }
|
|
|
+
|
|
|
+ public void showPathForTool(String path) throws Exception {
|
|
|
+ List<File> files = listFiles(path);
|
|
|
+ for (File file : files) {
|
|
|
+ String absolutePath = file.getAbsolutePath();
|
|
|
+ System.out.println(absolutePath);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
private List<String> listFile(String path) {
|
|
@@ -180,4 +198,9 @@ public class ExcelUtilsForEdit {
|
|
|
return Arrays.stream(files).map(File::getName).filter(item -> !item.startsWith("~")).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
+ private List<File> listFiles(String path) {
|
|
|
+ List<File> files = FileUtil.loopFiles(path);
|
|
|
+ return files.stream().filter(file -> !file.getName().startsWith("~")).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
}
|