master
黄海 3 years ago
parent a5183be02d
commit faeee1b78e

@ -27,14 +27,15 @@ public class RplaceChuangChunRpx {
} }
//读取测试报表 //读取测试报表
static String sourcePath = "D:/Work/dsMin/RunQianUpdate/CcRpx"; static String sourcePath = "C:\\Users\\Administrator\\Desktop\\Report2019";
static String targetPath = "D:/Work/dsMin/RunQianUpdate/XtRpx"; static String targetPath = "C:\\Users\\Administrator\\Desktop\\Report2019XT";
/** /**
* jsonrpx * jsonrpx
*/ */
public static void Convert(File f1, File f2) throws Exception { public static void Convert(File f1, File f2) throws Exception {
FileInputStream fis = new FileInputStream(f1); FileInputStream fis = new FileInputStream(f1);
System.out.println(f1.getName());
IReport report = ReportUtils.read(fis); IReport report = ReportUtils.read(fis);
fis.close(); fis.close();
String json = JsonUtil.getJSONString(report); String json = JsonUtil.getJSONString(report);
@ -61,9 +62,22 @@ public class RplaceChuangChunRpx {
File[] fs = file.listFiles(); File[] fs = file.listFiles();
for (File f : fs) { for (File f : fs) {
if (!f.isDirectory()) { if (!f.isDirectory()) {
Convert(f, new File(targetPath + "/" + getFileNameNoEx(f.getName()) + ".rpx")); Convert(f, new File(targetPath + "/" + getFileNameNoEx(f.getName()) + ".rpx"));
} }
} }
file = new File(sourcePath+"/县区");
File t=new File(targetPath + "/县区/");
if(!t.exists()) t.mkdir();
fs = file.listFiles();
for (File f : fs) {
if (!f.isDirectory()){
Convert(f, new File(targetPath + "/县区/" + getFileNameNoEx(f.getName()) + ".rpx"));
}
}
System.out.println("保存成功!"); System.out.println("保存成功!");
} }
} }

Loading…
Cancel
Save