| | |
| | | |
| | | boolean order_open = sysparaService.find("exchange_order_open").getBoolean(); |
| | | if (!order_open) { |
| | | throw new YamiShopBindException("不在交易时段"); |
| | | throw new YamiShopBindException("Outside trading hours"); |
| | | } |
| | | Item item = itemService.findBySymbol(order.getSymbol()); |
| | | if (item == null) { |
| | | throw new YamiShopBindException("参数错误"); |
| | | throw new YamiShopBindException("Invalid parameters"); |
| | | } |
| | | /*if (itemService.isSuspended(order.getSymbol())) { |
| | | throw new YamiShopBindException("停牌禁止交易"); |
| | | throw new YamiShopBindException("Trading suspended"); |
| | | }*/ |
| | | |
| | | |
| | |
| | | System.out.println("-----userIdWallet---------:"+userIdWallet.getMoney().doubleValue()); |
| | | System.out.println("-----order---------:"+order.getVolume().doubleValue()); |
| | | if (userIdWallet.getMoney().doubleValue() < order.getVolume().doubleValue()) { |
| | | throw new YamiShopBindException("余额不足"); |
| | | throw new YamiShopBindException("Insufficient balance"); |
| | | } |
| | | // this.walletService.update(userIdWallet.getUserId().toString(), Arith.sub(0, order.getVolume())); |
| | | capitaltWalletService.update(userIdWallet, Arith.sub(0, order.getVolume())); |
| | |
| | | } |
| | | if (!order.isTriggerOrder()) { |
| | | if (order.getVolume() > walletExtend.getAmount()) { |
| | | throw new YamiShopBindException("仓位不足"); |
| | | throw new YamiShopBindException("Insufficient position"); |
| | | } |
| | | walletService.updateExtend(walletExtend.getPartyId().toString(), walletExtend.getWallettype(), |
| | | Arith.sub(0, order.getVolume())); |