trading-order-admin/src/main/java/com/yami/trading/admin/controller/ico/AdminIcoController.java
@@ -65,7 +65,12 @@ if (ico.getId() == null) { //新增校验 count = icoService.count(new LambdaQueryWrapper<Ico>() .eq(Ico::getSymbol, ico.getSymbol()).or().eq(Ico::getSymbolData, ico.getSymbolData())); //产品表 long iCount = itemService.count(new LambdaQueryWrapper<Item>() .eq(Item::getSymbol, ico.getSymbol()).or().eq(Item::getSymbolData, ico.getSymbolData())); if(iCount > 0){ throw new YamiShopBindException("产品表已存在数据"); } } else { Ico model = icoService.getById(ico.getId()); if (model == null) { @@ -73,19 +78,13 @@ } Date now = Date.from(Instant.now()); if (model.getMarketDate() != null && model.getMarketDate().before(now)){ throw new YamiShopBindException("已上市不能修改"); } if (!model.getSymbol().equalsIgnoreCase(ico.getSymbol()) || !model.getSymbolData().equalsIgnoreCase(ico.getSymbolData())) { //修改编码判断是否有人购买 QueryWrapper<UserSubscription> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("ico_project_id", ico.getId()); long uCount = userSubscriptionService.count(queryWrapper); if (uCount > 0) { throw new YamiShopBindException("已有申购,禁止修改代币符号,数据源编码"); throw new YamiShopBindException("已上市,禁止修改代币符号,数据源编码"); } } count = icoService.count(new LambdaQueryWrapper<Ico>() .ne(Ico::getId, ico.getId()) .and(wrapper -> wrapper @@ -95,12 +94,6 @@ } if(count > 0){ throw new YamiShopBindException("代币符号或数据源编码已存在"); } //产品表 long iCount = itemService.count(new LambdaQueryWrapper<Item>() .eq(Item::getSymbol, ico.getSymbol()).or().eq(Item::getSymbolData, ico.getSymbolData())); if(iCount > 0){ throw new YamiShopBindException("产品表已存在数据"); } //新增或编辑表单保存 icoService.saveOrUpdate(ico); trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiFuturesOrderController.java
@@ -137,9 +137,9 @@ if (!itemService.isContractTrading(bySymbol)) { throw new YamiShopBindException("未开放合约交易"); } if (itemService.isSuspended(bySymbol.getSymbol())) { /*if (itemService.isSuspended(bySymbol.getSymbol())) { throw new YamiShopBindException("停牌禁止交易"); } }*/ boolean isOpen = MarketOpenChecker.isMarketOpenByItemCloseType(bySymbol.getOpenCloseType()); trading-order-bean/src/main/java/com/yami/trading/bean/ico/domain/Ico.java
@@ -105,6 +105,9 @@ @ApiModelProperty("是否预支付 0:否 1 :是") private Integer isPayDown; @ApiModelProperty("进度") private BigDecimal progressRate; @ApiModelProperty("创建时间") private String createdAt; trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java
@@ -205,9 +205,9 @@ if (!itemService.isContractTrading(item)) { throw new YamiShopBindException("未开放合约交易"); } if (itemService.isSuspended(item.getSymbol())) { /*if (itemService.isSuspended(item.getSymbol())) { throw new YamiShopBindException("停牌禁止交易"); } }*/ List<ItemLeverageDTO> levers = itemLeverageService.findByItemId(item.getUuid()); log.info("{} --- order --- {} --- {}", order.getSymbol(), item.getUuid(), levers.size()); trading-order-service/src/main/java/com/yami/trading/service/exchange/impl/ExchangeApplyOrderServiceImpl.java
@@ -148,9 +148,9 @@ if (item == null) { throw new YamiShopBindException("参数错误"); } if (itemService.isSuspended(order.getSymbol())) { /*if (itemService.isSuspended(order.getSymbol())) { throw new YamiShopBindException("停牌禁止交易"); } }*/ List<Realtime> realtimes = dataService.realtime(order.getSymbol()); trading-order-service/src/main/java/com/yami/trading/service/item/ItemService.java
@@ -23,6 +23,7 @@ import com.yami.trading.dao.item.ItemMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheEvict; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -180,22 +181,8 @@ return super.removeById(id); } // 清除 list() 方法的缓存(关键:与@Cached的name和key一致) /*@CacheEvict(cacheNames = ITEM_CACHE, key = "'itemAll'") public void clearListCache() { log.info("已清除 list() 方法的缓存"); }*/ public void reloadListAndCache() { // 步骤1:清除 list() 方法的原有缓存(确保重新查询) //clearListCache(); // 步骤2:重新调用 list() 方法,此时会执行数据库查询,且@Cached会自动更新缓存 //List<Item> freshList = list(); // 步骤3(可选):如果需要同步更新 init() 方法中的 itemCache,重新调用 init() init(); log.info("初始化init()"); } /**