| | |
| | | Map<String, Object> data = new HashMap<>(); |
| | | Item bySymbol = itemService.findBySymbol(symbol); |
| | | if(bySymbol == null){ |
| | | throw new YamiShopBindException("当前币对不存在"); |
| | | throw new YamiShopBindException("Trading pair does not exist"); |
| | | } |
| | | List<Map<String,Object>> futuresParas = new ArrayList<>(); |
| | | for (FuturesPara para : this.futuresParaService.getBySymbolSort(symbol)) { |
| | |
| | | public Result<Map<String, String>> open(FutureOpenAction futureOpenAction) { |
| | | Item bySymbol = itemService.findBySymbol(futureOpenAction.getSymbol()); |
| | | if(bySymbol == null){ |
| | | throw new YamiShopBindException("当前币对不存在"); |
| | | throw new YamiShopBindException("Trading pair does not exist"); |
| | | } |
| | | if (!itemService.isContractTrading(bySymbol)) { |
| | | throw new YamiShopBindException("未开放合约交易"); |
| | | throw new YamiShopBindException("Contract trading is not enabled"); |
| | | } |
| | | /*if (itemService.isSuspended(bySymbol.getSymbol())) { |
| | | throw new YamiShopBindException("停牌禁止交易"); |
| | | throw new YamiShopBindException("Trading suspended"); |
| | | }*/ |
| | | |
| | | |
| | | boolean isOpen = MarketOpenChecker.isMarketOpenByItemCloseType(bySymbol.getOpenCloseType()); |
| | | if(!isOpen){ |
| | | throw new YamiShopBindException("当前已经休市"); |
| | | throw new YamiShopBindException("Market is currently closed"); |
| | | } |
| | | String partyId = SecurityUtils.getUser().getUserId(); |
| | | boolean lock = false; |
| | |
| | | Map<String, String> data = new HashMap<String, String>(); |
| | | |
| | | if (!FuturesLock.add(partyId)) { |
| | | throw new YamiShopBindException("请稍后再试"); |
| | | throw new YamiShopBindException("Please try again later"); |
| | | } |
| | | |
| | | lock = true; |
| | |
| | | FuturesOrder order = this.futuresOrderService.cacheByOrderNo(order_no); |
| | | if (null == order) { |
| | | log.info("futuresOrder!get order_no:" + order_no + ", order null"); |
| | | throw new YamiShopBindException("订单不存在"); |
| | | throw new YamiShopBindException("Order does not exist"); |
| | | } |
| | | return Result.succeed(this.futuresOrderService.bulidOne(order)); |
| | | } |