| | |
| | | if (icoList == null || icoList.isEmpty()) { |
| | | return; |
| | | } |
| | | List<String> symbolList = icoList.stream().map(Ico::getSymbol).collect(Collectors.toList()); |
| | | |
| | | QueryWrapper<Item> iQuery = new QueryWrapper<>(); |
| | | iQuery.in("SYMBOL", symbolList); |
| | | iQuery.eq("currency_type", 1); |
| | | List<Item> itemList = itemService.list(iQuery); |
| | | |
| | | List<Item> addItemList = new ArrayList<>(); |
| | | for (Ico ico : icoList) { |
| | | //如何不存在添加 |
| | | Item item = itemList.stream().filter(x -> x.getSymbol().equals(ico.getSymbol())).findFirst().orElse(null); |
| | | //是否已存在币 |
| | | QueryWrapper<Item> iQuery = new QueryWrapper<>(); |
| | | iQuery.eq("SYMBOL", ico.getSymbol()); |
| | | iQuery.eq("SYMBOL_DATA", ico.getSymbolData()); |
| | | Item item = itemService.getOne(iQuery); |
| | | if (item == null) { |
| | | item = new Item(); |
| | | item =icoService.icoToItem(item, ico); |