From 513e5442723f501525bf9ca6210b16561e5d3a2b Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Tue, 24 Mar 2026 11:41:07 +0800
Subject: [PATCH] 1
---
trading-order-service/src/main/java/com/yami/trading/service/item/ItemService.java | 31 +++++++++++++++++++++++--------
1 files changed, 23 insertions(+), 8 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 cdb02e8..50d8aef 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,14 +16,14 @@
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.bean.robot.domain.Robot;
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;
@@ -129,6 +129,13 @@
return super.baseMapper.selectOne(queryWrapper);
}
+ public Item findCurrBySymbol(String symbol) {
+ LambdaQueryWrapper<Item> queryWrapper = new LambdaQueryWrapper<Item>()
+ .eq(Item::getSymbol, symbol)
+ .last("LIMIT 1");
+ return super.baseMapper.selectOne(queryWrapper);
+ }
+
/**
* 根据id查询
@@ -181,6 +188,9 @@
return super.removeById(id);
}
+ public void reloadListAndCache() {
+ init();
+ }
/**
* 获取品种精度
@@ -237,6 +247,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")) {
@@ -248,14 +259,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