Helius
2021-05-20 d0554a924f99ca74feb0144341c53ab2893afb5a
src/main/java/com/xcong/excoin/modules/otc/service/impl/OtcOrderServiceImpl.java
@@ -330,4 +330,17 @@
        return Result.ok(saleDetail);
    }
    @Override
    public void cancelOrder(Long id) {
        OtcOrder otcOrder = this.baseMapper.selectById(id);
        if (otcOrder == null) {
            throw new GlobalException("订单不存在");
        }
        if (!OtcOrder.STATUS_SUBMIT.equals(otcOrder.getStatus())) {
            throw new GlobalException("不能取消");
        }
        this.baseMapper.updateOrderStatusByOrderNo(OtcOrder.STATUS_CANCEL, null, otcOrder.getOrderNo());
    }
}