| | |
| | | } |
| | | |
| | | /** |
| | | * 通过 symbol 找去缓存对象 |
| | | * |
| | | * @param symbol |
| | | * @return |
| | | */ |
| | | @Transactional(propagation = Propagation.NOT_SUPPORTED) |
| | | public Item findCaCheBySymbol(String symbol) { |
| | | Item item; |
| | | if (CollectionUtil.isNotEmpty(symbolItem)) { |
| | | item = symbolItem.get(symbol); |
| | | if (item != null) { |
| | | return item; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 基于 remarks 字段去缓存提取 item 对象,特性是基于 remarks 映射 symbol,从缓存中提取 item; |
| | | * 如果缓存中没有数据,则直接去数据库查询返回。 |
| | | * |
| | |
| | | remarksSymbol.put(item.getRemarks(), item.getSymbol()); |
| | | remarksSymbol.put(item.getSymbol(), item.getSymbol()); |
| | | remarksSymbol.put(item.getRemarks().replace("usdt", ""), item.getSymbol()); |
| | | }else if(item.getType().equals(Item.US_STOCKS) && item.getSymbol() != null){ |
| | | remarksSymbol.put(item.getRemarks(), item.getSymbol()); |
| | | remarksSymbol.put(item.getSymbol(), item.getSymbol()); |
| | | } |
| | | } |
| | | return list; |
| | |
| | | if (item.getRemarks() != null) { |
| | | symbolDecimal.put(item.getRemarks(), item.getDecimals()); |
| | | symbolDecimal.put(item.getRemarks().replace("usdt", ""), item.getDecimals()); |
| | | }else if(item.getType().equals(Item.US_STOCKS) && item.getSymbol() != null){ |
| | | remarksSymbol.put(item.getSymbol(), item.getSymbol()); |
| | | } |
| | | } |
| | | symbolItem = list.stream() |