| | |
| | | throw new GlobalException("无足够的USDT"); |
| | | } |
| | | |
| | | if (orderAddDto.getUsdtAmount().compareTo(entrustOrder.getLimitMinAmount()) < 0) { |
| | | throw new GlobalException("低于最低限额"); |
| | | } |
| | | |
| | | if (orderAddDto.getUsdtAmount().compareTo(entrustOrder.getLimitMaxAmount()) > 0) { |
| | | throw new GlobalException("高于最高限额"); |
| | | } |
| | | |
| | | BigDecimal cny = orderAddDto.getUsdtAmount().multiply(entrustOrder.getUnitPrice()); |
| | | log.info("--->{}", cny); |
| | | if (cny.compareTo(orderAddDto.getCnyAmount()) != 0) { |
| | | throw new GlobalException("数量与金额不符"); |
| | | } |
| | |
| | | throw new GlobalException("无法出售"); |
| | | } |
| | | |
| | | if (orderAddDto.getUsdtAmount().compareTo(entrustOrder.getLimitMinAmount()) < 0) { |
| | | throw new GlobalException("低于最低限额"); |
| | | } |
| | | |
| | | if (orderAddDto.getUsdtAmount().compareTo(entrustOrder.getLimitMaxAmount()) > 0) { |
| | | throw new GlobalException("高于最高限额"); |
| | | } |
| | | |
| | | if (StrUtil.isBlank(orderAddDto.getPassword())) { |
| | | throw new GlobalException("资金密码不能为空"); |
| | | } |