Просмотр исходного кода

历史数据导入逻辑修改

Zhangbw 1 месяц назад
Родитель
Сommit
6d1c24bad3

+ 6 - 8
ruoyi-modules/yp-stock/src/main/java/com/yingpai/stock/service/impl/StockPoolServiceImpl.java

@@ -384,14 +384,12 @@ public class StockPoolServiceImpl implements IStockPoolService {
         for (StockPool currentPool : currentDayData) {
             StockPoolHistory history = historyMap.get(currentPool.getStockCode());
             if (history != null && history.getClosePrice() != null) {
-                if (currentPool.getClosePrice() == null) {
-                    currentPool.setClosePrice(history.getClosePrice());
-                    currentPool.setUpdateTime(LocalDateTime.now());
-                    baseMapper.updateById(currentPool);
-                    currentDayUpdated++;
-                    log.debug("[补全历史数据] 股票 {} 当天收盘价补全: {}",
-                        currentPool.getStockCode(), history.getClosePrice());
-                }
+                currentPool.setClosePrice(history.getClosePrice());
+                currentPool.setUpdateTime(LocalDateTime.now());
+                baseMapper.updateById(currentPool);
+                currentDayUpdated++;
+                log.debug("[补全历史数据] 股票 {} 当天收盘价补全: {}",
+                    currentPool.getStockCode(), history.getClosePrice());
             }
         }