瀏覽代碼

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

chenjianhua 4 月之前
父節點
當前提交
f0a722aa13
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      service-daq/src/main/java/com/simuwang/daq/service/EmailParseService.java

+ 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));