Browse Source

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

chenjianhua 5 months ago
parent
commit
ba5fa2efde

+ 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 - 0
service-deploy/src/test/java/com/simuwang/ApplicationTest.java

@@ -7,6 +7,7 @@ import com.simuwang.base.common.util.DateUtils;
 import com.simuwang.base.pojo.dto.MailboxInfoDTO;
 import com.simuwang.daq.service.EmailParseApiService;
 import com.simuwang.daq.service.EmailParseService;
+import org.jasypt.util.text.BasicTextEncryptor;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;