Pārlūkot izejas kodu

fix: 主页解析异常原因概述优化

chenjianhua 4 mēneši atpakaļ
vecāks
revīzija
f0a722aa13

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

@@ -266,7 +266,9 @@ public class EmailParseService {
                 emailFundNavCollectionVOList = emailFundNavCollectionVOList.stream().filter(e -> (StringUtil.isNotEmpty(e.getNav())||
                         StringUtil.isNotEmpty(e.getCumulativeNavWithdrawal()) ||  StringUtil.isNotEmpty(e.getPriceDate()) ||  StringUtil.isNotEmpty(e.getFundName()) || StringUtil.isNotEmpty(e.getRegisterNumber()))).collect(Collectors.toList());
                 try{
-                    emailFundNavCollectionMapper.batchInsert(emailFundNavCollectionVOList);
+                    if(emailFundNavCollectionVOList.size() > 0){
+                        emailFundNavCollectionMapper.batchInsert(emailFundNavCollectionVOList);
+                    }
                 }catch (Exception ex){
                     //如果批量插入报错,可能是因为解析的数据超过限制长度,这种情况基本是垃圾数据,直接跳过
                     emailFundNavCollectionVOList.forEach(e -> saveEmailFundNavCollection(e));