新版仿ok交易所-后端
C2C
zyy
2025-10-23 a81d07227a9aa1033b70dc488575dad9830d5852
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiC2cOrderController.java
@@ -172,10 +172,13 @@
                throw new YamiShopBindException("广告不存在");
            }
            C2cPaymentMethod method =c2cPaymentMethodService.get(payment_method_id);
            if (null == method) {
                throw new YamiShopBindException("支付方式不存在");
            if (C2cAdvert.DIRECTION_SELL.equals(c2cAdvert.getDirection())) {
                C2cPaymentMethod method =c2cPaymentMethodService.get(payment_method_id);
                if (null == method) {
                    throw new YamiShopBindException("支付方式不存在");
                }
            }
            if (StringUtils.isEmptyString(order_type) || !Arrays.asList("by_amount", "by_num").contains(order_type)) {
                throw new YamiShopBindException("订单类型不正确");
@@ -238,6 +241,7 @@
    public Object pay_finish(HttpServletRequest request) {
        String order_no = request.getParameter("order_no");
        String safe_password = request.getParameter("safe_password");
        String img = request.getParameter("img");
        Result resultObject = new Result();
@@ -268,6 +272,10 @@
                throw new BusinessException("订单不存在");
            }
            if (img == null || img.isEmpty()) {
                throw new BusinessException("请先上传支付凭证");
            }
            if (partyId.equals(order.getPartyId())) {
                // 用户操作
                if (!"buy".equals(order.getDirection())) {
@@ -294,6 +302,7 @@
            order.setState("1");
            order.setPayTime(new Date());
            order.setImg(img);
            this.c2cOrderService.updateById(order);
            if (Arrays.asList("0", "1").contains(order.getState())) {
@@ -385,7 +394,9 @@
                throw new BusinessException("待付款的订单无法放行");
            }
            if ("3".equals(order.getState())) {
                throw new BusinessException("订单已完成,无法放行");
                resultObject.setCode(0);
                return resultObject;
                //throw new BusinessException("订单已完成,无法放行");
            }
            if ("4".equals(order.getState())) {
                throw new BusinessException("订单已取消,无法放行");