| | |
| | | throw new GlobalException("低于最低限额"); |
| | | } |
| | | |
| | | if (orderAddDto.getUsdtAmount().compareTo(entrustOrder.getLimitMaxAmount()) > 0) { |
| | | if (orderAddDto.getCnyAmount().compareTo(entrustOrder.getLimitMaxAmount()) > 0) { |
| | | throw new GlobalException("高于最高限额"); |
| | | } |
| | | |
| | | if (orderAddDto.getCnyAmount().compareTo(entrustOrder.getRemainCoinAmount()) > 0) { |
| | | throw new GlobalException("剩余数量不足"); |
| | | } |
| | | |
| | | BigDecimal cny = orderAddDto.getUsdtAmount().multiply(entrustOrder.getUnitPrice()); |
| | |
| | | throw new GlobalException("无法出售"); |
| | | } |
| | | |
| | | if (orderAddDto.getUsdtAmount().compareTo(entrustOrder.getLimitMinAmount()) < 0) { |
| | | if (orderAddDto.getCnyAmount().compareTo(entrustOrder.getLimitMinAmount()) < 0) { |
| | | throw new GlobalException("低于最低限额"); |
| | | } |
| | | |
| | | if (orderAddDto.getUsdtAmount().compareTo(entrustOrder.getLimitMaxAmount()) > 0) { |
| | | if (orderAddDto.getCnyAmount().compareTo(entrustOrder.getLimitMaxAmount()) > 0) { |
| | | throw new GlobalException("高于最高限额"); |
| | | } |
| | | |
| | | if (orderAddDto.getUsdtAmount().compareTo(entrustOrder.getRemainCoinAmount()) > 0) { |
| | | throw new GlobalException("剩余数量不足"); |
| | | } |
| | | |
| | | if (StrUtil.isBlank(orderAddDto.getPassword())) { |
| | | throw new GlobalException("资金密码不能为空"); |
| | | } |