新版仿ok交易所-后端
C2C
zyy3
2025-10-25 44b1ab0125f865e68cc5dbdb473ea600b412571d
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiBankCardController.java
@@ -83,7 +83,7 @@
        String partyId = SecurityUtils.getUser().getUserId();
        String session_token = this.sessionTokenService.savePut(partyId);
//        Map<String, C2cPaymentMethod> cpmMap = this.c2cPaymentMethodService.getByPartyId("2c948a8282920a9f01829270bcac0000");
        Map<String, C2cPaymentMethod> cpmMap = this.c2cPaymentMethodService.getByPartyId(partyId);
        /*Map<String, C2cPaymentMethod> cpmMap = this.c2cPaymentMethodService.getByPartyId(partyId);
        if (null == cpmMap || 0 == cpmMap.size()) {
            // TODO: 2023/4/16
@@ -92,10 +92,10 @@
        List<String> cpmList = new ArrayList<String>();
        for (String key : cpmMap.keySet()) {
            cpmList.add(key);
        }
        }*/
        Map<String, Object> data = new HashMap<String, Object>();
        data.put("session_token", session_token);
        data.put("gf_payment_method_id", cpmList.get(0));
        //data.put("gf_payment_method_id", cpmList.get(0));
        return Result.succeed(data);
    }
@@ -470,7 +470,7 @@
        order.setRemark(remark);
        // 用户不能取消提现
        if (SecurityUtils.getUser().getUserId().equals(order.getPartyId())) {
            if ("withdraw".equals(order.getDirection())) {
            if ("sell".equals(order.getDirection())) {
                throw new YamiShopBindException("用户不能取消提现");
            }
            this.c2cOrderService.saveOrderCancel(order, "user");
@@ -509,10 +509,19 @@
        long nowTimestamp = (new Date()).getTime();
        long createTimestamp = c2cOrder.getCreateTime().getTime();
        long autoCancelSeconds = 0;
        long remainSeconds = 0;
        if ("0".equals(c2cOrder.getState())) {
            autoCancelSeconds = c2cOrder.getExpireTime() * 60 * 1000 - (nowTimestamp - createTimestamp);
            remainSeconds = c2cOrder.getExpireTime() * 60 * 1000 * 2 - (nowTimestamp - createTimestamp);
        } else if ("1".equals(c2cOrder.getState())) {
            long payTimestamp = c2cOrder.getPayTime().getTime();
            autoCancelSeconds = c2cOrder.getExpireTime() * 60 * 1000 - (nowTimestamp - createTimestamp);
            remainSeconds = c2cOrder.getExpireTime() * 60 * 1000 - (nowTimestamp - payTimestamp);
        }
        c2cOrder.setAutoCancelTimeRemain((int) (autoCancelSeconds <= 0 ? 0 : autoCancelSeconds / 1000));
        c2cOrder.setExpireTimeRemain((int) (remainSeconds <= 0 ? 0 : remainSeconds / 1000));
        if (c2cOrder.getC2cUserHeadImg() != null) {
            c2cOrder.setC2cUserHeadImg(Constants.IMAGES_HTTP + c2cOrder.getC2cUserHeadImg());
        }
@@ -564,12 +573,12 @@
            throw new YamiShopBindException("页码不能小于等于0");
        }
        int page_no_int = Integer.valueOf(page_no).intValue();
        if (StringUtils.isNotEmpty(direction) && !Arrays.asList("recharge", "withdraw").contains(direction)) {
        /*if (StringUtils.isNotEmpty(direction) && !Arrays.asList("recharge", "withdraw").contains(direction)) {
            throw new YamiShopBindException("充值或提现不正确");
        }
        if (StringUtils.isNotEmpty(state) && !Arrays.asList("0", "3", "4").contains(state)) {
            throw new YamiShopBindException("订单状态不正确");
        }
        }*/
        Page page = this.c2cOrderService.pagedQuery(page_no_int, 20, direction, state, partyId);
        if (null == page) {
            return Result.succeed(new ArrayList<Map<String, Object>>());