Helius
2021-05-20 dbee929294fc8b3bb8ff7c721023de4f57c89996
modify
2 files modified
16 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/otc/dto/OrderAddDto.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java 14 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/otc/dto/OrderAddDto.java
@@ -9,7 +9,7 @@
import java.math.BigDecimal;
@Data
@ApiModel(value = "OrderAddDto", description = "提交订单接口参数接收类")
@ApiModel(value = "OtcOrderAddDto", description = "提交订单接口参数接收类")
public class OrderAddDto {
    @NotNull
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java
@@ -73,8 +73,12 @@
            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());
@@ -116,14 +120,18 @@
            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("资金密码不能为空");
        }