|
|
@@ -115,10 +115,12 @@ public class App extends Application {
|
|
|
* 代码块初始化OCR使用的对象
|
|
|
*/
|
|
|
this.tesseract = new Tesseract();
|
|
|
- String workDir = System.getProperty("user.dir") + "/tessdata";
|
|
|
- this.tesseract.setDatapath(workDir);
|
|
|
+ String workDir = System.getProperty("user.dir") + "\\tessdata";
|
|
|
+ System.setProperty("TESSDATA_PREFIX",workDir);
|
|
|
+ //this.tesseract.setDatapath(workDir);
|
|
|
log.info("tessdata路径:{}",workDir);
|
|
|
//this.tesseract.setDatapath("D:\\tools\\tessdata\\fast");
|
|
|
+ this.tesseract.setDatapath("tessdata/");
|
|
|
//设置识别语言为中文简体,(如果要设置为英文可改为"eng")
|
|
|
this.tesseract.setLanguage("chi_sim");
|
|
|
}
|
|
|
@@ -227,7 +229,7 @@ public class App extends Application {
|
|
|
alert.setHeaderText("金额验证工具");
|
|
|
alert.setContentText("作者: 杨逸\n" +
|
|
|
"联系方式: huanglve2004@163.com\n\n" +
|
|
|
- "版本: 1.0.1\n" +
|
|
|
+ "版本: 1.0.2\n" +
|
|
|
"描述: 用于金额验证的桌面应用程序");
|
|
|
|
|
|
alert.showAndWait();
|
|
|
@@ -390,6 +392,14 @@ public class App extends Application {
|
|
|
log.info("开始对账工单:{}",fileKey);
|
|
|
//找到对应工单文件的路径
|
|
|
File workOrderFile = workOrderFileMap.getOrDefault(fileKey, null);
|
|
|
+ if (Objects.isNull(workOrderFile)) {
|
|
|
+ //拼接字符可能是 _
|
|
|
+ log.warn("未找到{}对应的工单文件",fileKey);
|
|
|
+ log.info("开始对账工单:{}",fileKey);
|
|
|
+ fileKey = workOrderNumber + "_" + imei;
|
|
|
+ fileKey = fileKey.toUpperCase(Locale.ROOT);
|
|
|
+ workOrderFile = workOrderFileMap.getOrDefault(fileKey, null);
|
|
|
+ }
|
|
|
if (Objects.isNull(workOrderFile)) {
|
|
|
log.warn("未找到{}对应的工单文件",fileKey);
|
|
|
errorImeiList.add(new OutputErrorModel(imei,workOrderNumber));
|
|
|
@@ -514,7 +524,7 @@ public class App extends Application {
|
|
|
if (workOrderFile.isDirectory()) {
|
|
|
continue;
|
|
|
}
|
|
|
- if (workOrderFile.getName().contains("工单照片")) {
|
|
|
+ if (workOrderFile.getName().contains("工单照片") || workOrderFile.getName().contains("工单资料")) {
|
|
|
if (workOrderFileMap.containsKey(fileKey)) {
|
|
|
log.error("出现重复的工单文件夹: {}", fileKey);
|
|
|
//出现重复的imei
|