Quellcode durchsuchen

fix:ocr不识别报告日期

wangzaijun vor 3 Wochen
Ursprung
Commit
8b648150bf

+ 0 - 5
mo-daq/src/main/java/com/smppw/modaq/application/components/OCRReportParser.java

@@ -22,7 +22,6 @@ public class OCRReportParser {
     static {
         RESULT_SCHEMA_MAP.put("基金名称", "");
         RESULT_SCHEMA_MAP.put("产品代码", "");
-        RESULT_SCHEMA_MAP.put("报告日期", "");
         RESULT_SCHEMA_MAP.put("是否有红色印章", "");
         RESULT_SCHEMA_MAP.put("是否有电话", "");
         RESULT_SCHEMA_MAP.put("是否有地址", "");
@@ -42,15 +41,11 @@ public class OCRReportParser {
             JSONObject jsonObject = JSONUtil.parseObj(aiParserContent);
             String fundName = this.cleanData(jsonObject.getStr("基金名称"));
             String fundCode = this.cleanData(jsonObject.getStr("产品代码"));
-            String reportDate = this.cleanData(jsonObject.getStr("报告日期"));
             String seals = this.cleanData(jsonObject.getStr("是否有红色印章"));
             String phone = this.cleanData(jsonObject.getStr("是否有电话"));
             String addr = this.cleanData(jsonObject.getStr("是否有地址"));
             String withme = this.cleanData(jsonObject.getStr("是否有关注我们"));
             OCRParseData res = new OCRParseData();
-            if (StrUtil.isNotBlank(reportDate)) {
-                res.setReportDate(reportDate);
-            }
             if (StrUtil.isNotBlank(fundName) && fundName.contains("基金") && !fundName.contains("公司")) {
                 res.setFundName(fundName);
             }

+ 4 - 4
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/OCRParseData.java

@@ -14,10 +14,10 @@ public class OCRParseData {
      * 产品代码(报告首页才能识别)
      */
     private String fundCode;
-    /**
-     * 报告日期
-     */
-    private String reportDate;
+//    /**
+//     * 报告日期
+//     */
+//    private String reportDate;
     /**
      * 报告是否用印(报告尾页识别)
      */

+ 0 - 10
mo-daq/src/main/java/com/smppw/modaq/domain/service/EmailParseService.java

@@ -530,10 +530,6 @@ public class EmailParseService {
             // ocr识别尾页是否包含印章和联系人信息
             if (parseRes != null) {
                 if (reportData.getBaseInfo() != null) {
-                    Date reportDate = DateUtils.toDate(parseRes.getReportDate());
-                    if (reportData.getBaseInfo().getReportDate() == null && reportDate != null) {
-                        reportData.getBaseInfo().setReportDate(reportDate);
-                    }
                     reportData.getBaseInfo().setWithSeals(parseRes.getWithSeals());
                     reportData.getBaseInfo().setWithContacts(parseRes.getWithContacts());
                     if (fileName.contains("用印") && !Objects.equals(true, reportData.getBaseInfo().getWithSeals())) {
@@ -554,12 +550,6 @@ public class EmailParseService {
                     log.error("报告{} OCR识别首页基金名称和报告日期出错:{}", fileName, ExceptionUtil.stacktraceToString(e));
                 }
             }
-            if (reportData.getBaseInfo() != null && parseRes != null) {
-                Date reportDate = DateUtils.toDate(parseRes.getReportDate());
-                if (reportDate != null && reportData.getBaseInfo().getReportDate() == null) {
-                    reportData.getBaseInfo().setReportDate(reportDate);
-                }
-            }
             // ocr 识别的结果优先级更高
             if (reportData.getFundInfo() != null && parseRes != null) {
                 if (StrUtil.isBlank(reportData.getFundInfo().getFundName())

+ 2 - 2
mo-daq/src/test/java/com/smppw/modaq/MoDaqApplicationTests.java

@@ -38,8 +38,8 @@ public class MoDaqApplicationTests {
     @Test
     public void reportTest() {
         MailboxInfoDTO emailInfoDTO = this.buildMailbox("***@simuwang.com", "***");
-        Date startDate = DateUtil.parse("2025-06-03 17:40:00", DateConst.YYYY_MM_DD_HH_MM_SS);
-        Date endDate = DateUtil.parse("2025-06-04 17:58:00", DateConst.YYYY_MM_DD_HH_MM_SS);
+        Date startDate = DateUtil.parse("2025-06-05 09:00:00", DateConst.YYYY_MM_DD_HH_MM_SS);
+        Date endDate = DateUtil.parse("2025-06-05 17:58:00", DateConst.YYYY_MM_DD_HH_MM_SS);
         try {
             List<String> folderNames = ListUtil.list(false);
 //            folderNames.add("其他文件夹/报告公告");