From ef1765cfa8a1d9ab65b35143eeb762a8c62e652c Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Mon, 20 Oct 2025 16:30:52 +0800
Subject: [PATCH] C2C

---
 trading-order-service/src/main/java/com/yami/trading/service/item/ItemService.java |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/trading-order-service/src/main/java/com/yami/trading/service/item/ItemService.java b/trading-order-service/src/main/java/com/yami/trading/service/item/ItemService.java
index 5498355..5e626e4 100644
--- a/trading-order-service/src/main/java/com/yami/trading/service/item/ItemService.java
+++ b/trading-order-service/src/main/java/com/yami/trading/service/item/ItemService.java
@@ -16,15 +16,12 @@
 import com.yami.trading.bean.item.domain.Item;
 import com.yami.trading.bean.item.dto.ItemDTO;
 import com.yami.trading.bean.item.dto.ItemLeverageDTO;
-import com.yami.trading.common.exception.YamiShopBindException;
 import com.yami.trading.common.util.ApplicationContextUtils;
 import com.yami.trading.common.util.MarketOpenChecker;
 import com.yami.trading.common.util.StringUtils;
 import com.yami.trading.dao.item.ItemMapper;
 import lombok.extern.slf4j.Slf4j;
-import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -44,8 +41,8 @@
 @Transactional
 @Slf4j
 public class ItemService extends ServiceImpl<ItemMapper, Item> {
-    public static final String ITEM_CACHE = "itemCache";
-    public static final String ALL = "all";
+    public static final String ITEM_CACHE = "syItemCache";
+    public static final String ALL = "syAll";
 
     @Autowired
     private ItemLeverageService itemLeverageService;
@@ -161,7 +158,7 @@
         return baseMapper.findList(page, queryWrapper);
     }
 
-    @Cached(name = ITEM_CACHE, key = "'all'", expire = 3600)
+    @Cached(name = ITEM_CACHE, key = "'syAll'", expire = 3600)
     @Override
     public List<Item> list() {
         List<Item> list = super.list(new LambdaQueryWrapper<>(Item.class).eq(Item::getType,Item.cryptos));
@@ -255,6 +252,7 @@
      * @return
      */
     public boolean isContractTrading(Item item) {
+        item = findBySymbol(item.getSymbol());
         //虚拟币新币才判断
         if (item.getType().equals(Item.cryptos) && (item.getCurrencyType() != null && item.getCurrencyType() == 1)) {
             if (item.getTradeType() != null && item.getTradeType().equals("0")) {
@@ -266,14 +264,18 @@
 
     /**
      * 是否停牌状态
-     * @param item
      * @return
      */
-    public boolean isSuspended(Item item) {
-        //虚拟币新币才判断
-        if (item.getType().equals(Item.cryptos) && (item.getCurrencyType() != null && item.getCurrencyType() == 1)) {
-            if (item.getStatus() != null && item.getStatus() == 0) {
-                return true;
+    public boolean isSuspended(String symbol) {
+        //Item item = findBySymbol(symbol);
+        Item item = getOne(new LambdaQueryWrapper<Item>().eq(Item::getSymbol, symbol));
+        if (item != null) {
+            //虚拟币新币才判断
+            if (item.getType().equals(Item.cryptos) /*&& (item.getCurrencyType() != null && item.getCurrencyType() == 1)*/) {
+                //item = getById(item.getUuid());
+                if (item.getStatus() != null && item.getStatus() == 0) {
+                    return true;
+                }
             }
         }
         return false;

--
Gitblit v1.9.3