Переглянути джерело

fix:解析失败的方法优化

wangzaijun 1 місяць тому
батько
коміт
e2900cb469

+ 1 - 1
mo-daq/src/main/java/com/smppw/modaq/application/components/report/parser/pdf/AbstractPDReportParser.java

@@ -91,7 +91,7 @@ public abstract class AbstractPDReportParser<T extends ReportData> extends Abstr
             this.initTableInfo(tables);
         }
         T reportData = this.buildReportData(params, filename);
-        if (!reportData.wasSuccessful()) {
+        if (reportData.wasFailed()) {
             // 抛出异常方便ai解析
             throw new ReportParseException(ReportParseStatus.PARSE_CORE_INFO_FAIL, filename);
         }

+ 6 - 6
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/LetterReportData.java

@@ -21,16 +21,16 @@ public class LetterReportData extends ReportData {
     }
 
     @Override
-    public boolean wasSuccessful() {
-        boolean superFlag = super.wasSuccessful();
+    public boolean wasFailed() {
+        boolean superFlag = !super.wasFailed();
         if (!superFlag) {
-            return false;
+            return true;
         }
         if (this.investorInfo == null || fundTransaction == null) {
-            return false;
+            return true;
         }
-        return !StrUtil.isBlank(this.investorInfo.getInvestorName())
-                && !StrUtil.isBlank(this.fundTransaction.getFundName());
+        return StrUtil.isBlank(this.investorInfo.getInvestorName())
+                || StrUtil.isBlank(this.fundTransaction.getFundName());
     }
 
     @Override

+ 6 - 6
mo-daq/src/main/java/com/smppw/modaq/domain/dto/report/ReportData.java

@@ -46,16 +46,16 @@ public abstract class ReportData implements Serializable {
     public abstract ReportType getReportType();
 
     /**
-     * 判断当前数据文件数据是否解析成功
+     * 判断当前数据文件数据是否解析失败
      *
-     * @return /
+     * @return true-解析失败,false-解析成功
      */
-    public boolean wasSuccessful() {
+    public boolean wasFailed() {
         if (this.baseInfo == null || this.fundInfo == null) {
-            return false;
+            return true;
         }
-        return !StrUtil.isBlank(this.baseInfo.getReportName())
-                && StrUtil.isAllNotBlank(this.fundInfo.getFundName(), this.fundInfo.getFundCode());
+        return StrUtil.isBlank(this.baseInfo.getReportName())
+                || StrUtil.isAllBlank(this.fundInfo.getFundName(), this.fundInfo.getFundCode());
     }
 
     @Override