| | |
| | | |
| | | boolean orderOpen = this.sysparaService.find("order_open").getBoolean(); |
| | | if (!orderOpen) { |
| | | throw new YamiShopBindException("不在交易时段"); |
| | | throw new YamiShopBindException("Outside trading hours"); |
| | | } |
| | | |
| | | Item item = this.itemService.findBySymbol(order.getSymbol()); |
| | |
| | | Item item = this.itemService.findBySymbol(order.getSymbol()); |
| | | //虚拟币新币 |
| | | if (!itemService.isContractTrading(item)) { |
| | | throw new YamiShopBindException("未开放合约交易"); |
| | | throw new YamiShopBindException("Contract trading is not enabled"); |
| | | } |
| | | /*if (itemService.isSuspended(item.getSymbol())) { |
| | | throw new YamiShopBindException("停牌禁止交易"); |
| | | throw new YamiShopBindException("Trading suspended"); |
| | | }*/ |
| | | |
| | | List<ItemLeverageDTO> levers = itemLeverageService.findByItemId(item.getUuid()); |
| | | log.info("{} --- order --- {} --- {}", order.getSymbol(), item.getUuid(), levers.size()); |
| | | checkLever(order, levers); |
| | | //checkLever(order, levers); |
| | | |
| | | order.setOrderNo(DateUtil.getToday("yyMMddHHmmss") + RandomUtil.getRandomNum(8)); |
| | | |
| | |
| | | volume = volume.subtract(applyOrderSubmittedList.get(i).getVolume()); |
| | | } |
| | | if (order.getVolume().compareTo(volume) > 0) { |
| | | throw new YamiShopBindException("可平仓合约数量不足"); |
| | | throw new YamiShopBindException("Insufficient closable contract quantity"); |
| | | } |
| | | save(order); |
| | | |
| | |
| | | } |
| | | } |
| | | if (!findlevers) { |
| | | throw new YamiShopBindException("杠杠倍数不存在"); |
| | | throw new YamiShopBindException("Leverage multiplier does not exist"); |
| | | } |
| | | } |
| | | } |