Prechádzať zdrojové kódy

fix: 基金匹配顺序调整,匹配基金放在最后

chenjianhua 7 mesiacov pred
rodič
commit
eaf4b15f9c

+ 15 - 17
service-daq/src/main/java/com/simuwang/daq/service/EmailParseService.java

@@ -458,8 +458,21 @@ public class EmailParseService {
             fundNavDTO.setParseStatus(NavParseStatusConst.NAV_DEFICIENCY);
             return;
         }
-
-        // 2.匹配基金(考虑到解析估值表时已经匹配上基金的情况)
+        // 考虑单独规模文件时 -> 无单位净值和累计净值
+        // 2.单位净值或累计净值不大于0
+        if (!emailTitle.contains("规模")) {
+            if (StrUtil.isBlank(fundNavDTO.getNav()) || StrUtil.isBlank(fundNavDTO.getCumulativeNavWithdrawal())
+                    || (fundNavDTO.getNav().compareTo("0") <= 0 || fundNavDTO.getCumulativeNavWithdrawal().compareTo("0") <= 0)) {
+                fundNavDTO.setParseStatus(NavParseStatusConst.NAV_NEGATIVE);
+                return;
+            }
+        }
+        // 3.资产净值不大于0
+        if (StrUtil.isNotBlank(fundNavDTO.getAssetNet()) && fundNavDTO.getAssetNet().compareTo("0") <= 0) {
+            fundNavDTO.setParseStatus(NavParseStatusConst.ASSET_NET_NEGATIVE);
+            return;
+        }
+        // 4.匹配基金(考虑到解析估值表时已经匹配上基金的情况)
         List<String> fundIdList = fundNavDTO.getFundIdList();
         if (CollUtil.isEmpty(fundIdList)) {
             fundIdList = fundService.getFundIdByNamesAndCode(fundNavDTO.getFundName(), fundNavDTO.getRegisterNumber());
@@ -474,21 +487,6 @@ public class EmailParseService {
             return;
         }
 
-        // 考虑单独规模文件时 -> 无单位净值和累计净值
-        // 3.单位净值或累计净值不大于0
-        if (!emailTitle.contains("规模")) {
-            if (StrUtil.isBlank(fundNavDTO.getNav()) || StrUtil.isBlank(fundNavDTO.getCumulativeNavWithdrawal())
-                    || (fundNavDTO.getNav().compareTo("0") <= 0 || fundNavDTO.getCumulativeNavWithdrawal().compareTo("0") <= 0)) {
-                fundNavDTO.setParseStatus(NavParseStatusConst.NAV_NEGATIVE);
-                return;
-            }
-        }
-
-        // 4.资产净值不大于0
-        if (StrUtil.isNotBlank(fundNavDTO.getAssetNet()) && fundNavDTO.getAssetNet().compareTo("0") <= 0) {
-            fundNavDTO.setParseStatus(NavParseStatusConst.ASSET_NET_NEGATIVE);
-            return;
-        }
         fundNavDTO.setParseStatus(NavParseStatusConst.SUCCESS);
     }