1
zyy3
2025-11-06 00f42b535ae2001903ef18168f16fbe477e59a23
trading-order-admin/src/main/java/com/yami/trading/api/controller/RealtimeController.java
@@ -54,6 +54,9 @@
   @GetMapping("api/hobi!getRealtime.action")
   public Result<List<Realtime>> getRealtime(@RequestParam String symbol) {
      try {
         if (symbol == null || symbol.isEmpty()){
            return Result.succeed();
         }
         List<Realtime> data = this.dataService.realtime(symbol);
         data.forEach(d->{
            Item bySymbol = itemService.findBySymbol(d.getSymbol());
@@ -289,6 +292,9 @@
         List<Item> items = new ArrayList<>();
         //按字符串排序
         List<Item> itemList = itemService.cacheGetAll().stream().sorted(Comparator.comparing(Item::getSorted).reversed()).collect(Collectors.toList());
         if (type != null && type.equalsIgnoreCase(Item.US_STOCKS)) {
            category = null;
         }
         //按数字排序
//         List<Item> itemList = itemService.cacheGetAll().stream().sorted(Comparator.comparing(Item::getSorted, (x,y)->{
//            int xInt = 0;
@@ -303,13 +309,14 @@
//         })).collect(Collectors.toList());
         if (null != type && null != category) {
            String finalCategory = category;
            // 知名类 需要模糊查询
            if ("prominent".equals(category)) {
               itemsTotal = new ArrayList<>(itemList).stream().filter(item -> item.getType().equals(type)
                     && item.getCategory().contains(category)).collect(Collectors.toList());
                     && item.getCategory().contains(finalCategory)).collect(Collectors.toList());
            } else {
               itemsTotal = new ArrayList<>(itemList).stream().filter(item -> item.getType().equals(type)
                     && item.getCategory().equals(category)).collect(Collectors.toList());
                     && item.getCategory().equals(finalCategory)).collect(Collectors.toList());
            }
            if (pageNo * pageSize - pageSize < itemsTotal.size()) {
               int pages = itemsTotal.size() % pageSize == 0 ? itemsTotal.size() / pageSize : itemsTotal.size() / pageSize + 1;