|
@@ -79,15 +79,19 @@ public class InitStockListRedisServiceImpl implements InitStockListService {
|
|
|
}
|
|
|
Iterator<StockVO> iterator = stockVOList.iterator();
|
|
|
while (iterator.hasNext()) {
|
|
|
+ int codeId = 0;
|
|
|
StockVO stock = iterator.next();
|
|
|
Iterator<StockVO> iteratorRedis = stockRedisList.iterator();
|
|
|
while (iteratorRedis.hasNext()) {
|
|
|
StockVO stockRedis = iteratorRedis.next();
|
|
|
- if(stock.getCode().equals(stockRedis.getCode())){
|
|
|
+ if(stock.getCode().equals(stockRedis.getCode())&&(codeId!=stockRedis.getId()||codeId==0)){
|
|
|
+ codeId++;
|
|
|
stockRedis.setNowPrice(stock.getNowPrice());
|
|
|
stockRedis.setHcrate(stock.getHcrate().multiply(new BigDecimal(100)));
|
|
|
stockRedis.setChange(stock.getChange());
|
|
|
- break;
|
|
|
+ if(codeId==5){ // 假设最多5次相同
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|