新版仿ok交易所-后端
zyy
2025-09-01 69b5fdc593fa73424448df0c911c5177f7497e7c
trading-order-service/src/main/java/com/yami/trading/service/item/ItemService.java
@@ -16,6 +16,7 @@
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;
@@ -229,4 +230,35 @@
        Item bySymbol = findBySymbol(symbol);
        return MarketOpenChecker.isMarketOpenByItemCloseType(bySymbol.getOpenCloseType());
    }
    /**
     * 是否开放合约
     * @param item
     * @return
     */
    public boolean isContractTrading(Item item) {
        //虚拟币新币才判断
        if (item.getType().equals(Item.cryptos) && (item.getCurrencyType() != null && item.getCurrencyType() == 1)) {
            if (item.getTradeType() != null && item.getTradeType().equals("0")) {
                return false;
            }
        }
        return true;
    }
    /**
     * 是否停牌状态
     * @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;
            }
        }
        return false;
    }
}