Browse Source

fix: 数据净值小于等于0不入库

chenjianhua 5 months ago
parent
commit
a554bea658

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

@@ -604,7 +604,7 @@ public class EmailParseService {
         BigDecimal nav = StrUtil.isNotBlank(fundNavDTO.getNav()) ? new BigDecimal(fundNavDTO.getNav()) : null;
         BigDecimal cumulativeNavWithdrawal = StrUtil.isNotBlank(fundNavDTO.getCumulativeNavWithdrawal()) ? new BigDecimal(fundNavDTO.getCumulativeNavWithdrawal()) : null;
         Integer isStored = fundNavDTO.getParseStatus() != null && !fundNavDTO.getParseStatus().equals(NavParseStatusConst.NAV_DEFICIENCY)
-                && !fundNavDTO.getParseStatus().equals(NavParseStatusConst.NOT_MATCH) ? 1 : 0;
+                && !fundNavDTO.getParseStatus().equals(NavParseStatusConst.NOT_MATCH) && !fundNavDTO.getParseStatus().equals(NavParseStatusConst.NAV_NEGATIVE) && !fundNavDTO.getParseStatus().equals(NavParseStatusConst.ASSET_NET_NEGATIVE) ? 1 : 0;
         if (CollUtil.isNotEmpty(fundNavDTO.getFundIdList())) {
             for (String fundId : fundNavDTO.getFundIdList()) {
                 EmailFundNavDO emailFundNavDO = new EmailFundNavDO();
@@ -635,7 +635,7 @@ public class EmailParseService {
             emailFundNavDO.setRegisterNumber(fundNavDTO.getRegisterNumber());
             emailFundNavDO.setExceptionStatus(fundNavDTO.getParseStatus());
             emailFundNavDO.setTemplateId(fundNavDTO.getTemplateId());
-            emailFundNavDO.setIsStored(isStored);
+            emailFundNavDO.setIsStored(0);//无法识别基金ID的统一不入库
             emailFundNavDO.setIsvalid(1);
             emailFundNavDO.setCreatorId(0);
             emailFundNavDO.setCreateTime(parseDate);

+ 1 - 1
service-deploy/src/test/java/com/simuwang/ApplicationTest.java

@@ -67,7 +67,7 @@ public class ApplicationTest {
 
     @Test
     public void testDateFormat() {
-        String input = "IXO6gLlmQgiuvHZ";
+        String input = "IXO6gLlm4QgiuvHZ";
         BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
         textEncryptor.setPassword("qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm12"); // 用您自己的密钥替换"yourSecretKey"
         String encryptedString = textEncryptor.encrypt(input);