无关风月
1 天以前 3044a637a15e09d50ad733fd482c6e64e90df2f9
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WxChatPayCallBack.java
@@ -111,16 +111,16 @@
                withdrawDetail.setStatus("SUCCESS");
                withdrawDetailService.updateById(withdrawDetail);
                orderService.updateById(order);
            }else if ("CANCELLED".equals(state)){
            }else if ("CANCELLED".equals(state)||"CANCELING".equals(state)||"FAIL".equals(state)){
                // 校验提现
                List<Withdraw> list = withdrawService.lambdaQuery().eq(Withdraw::getUserId, order.getUserId())
                        .eq(Withdraw::getOrderId, order.getId()).list();
                List<Integer> stateList = list.stream().map(Withdraw::getState).collect(Collectors.toList());
                if (stateList.contains(Constants.ONE)) {
                    throw new GlobalException("当前订单提现申请已通过!");
                }
//                List<Withdraw> list = withdrawService.lambdaQuery().eq(Withdraw::getUserId, order.getUserId())
//                        .eq(Withdraw::getOrderId, order.getId()).list();
//                List<Integer> stateList = list.stream().map(Withdraw::getState).collect(Collectors.toList());
//                if (stateList.contains(Constants.ONE)) {
//                    throw new GlobalException("当前订单提现申请已通过!");
//                }
                // 超时未收款 撤销 重新发起转账 更新packageInfo
                weChatPay(order.getOrderMoney(), data.getOpenId(),list.get(0).getId(),order.getServeName());
                 weChatPay(order.getOrderMoney(), data.getOpenId(),withdraw.getId(),order.getServeName());
            }
            map.put("code", "SUCCESS");
            map.put("message", "成功");
@@ -183,7 +183,7 @@
                WithdrawDetail one = withdrawDetailService.lambdaQuery().eq(WithdrawDetail::getWithdrawId, withdrawId).last("limit 1").one();
                if (one!=null){
                    one.setOutBatchNo(s);
                    one.setStatus("FAIL");
                    one.setStatus("PENDING");
                    withdrawDetailService.updateById(one);
                    Order order = orderService.getById(withdraw.getOrderId());
                    order.setPackageInfo(string);
@@ -200,4 +200,16 @@
        return allTransfersSuccessful;
    }
    public static void main(String[] args) {
        String s = "e965efcc225b4250864658d2fa969a18";
        String s1 = HttpUtil.queryTransBatRequest(WechatConstants.WE_CHAT_PAY_QUERY_URL_PRE + s,
                "7EEA04429B006E12AAA421C002EC48BBEED5BE94",
                "1665330417",
                "D:\\apiclient_key.pem", WechatConstants.WE_CHAT_QUERY_URL_SUF + s);
        System.err.println(s1);
        JSONObject jsonObject = JSONObject.parseObject(s1);
        String string = jsonObject.getString("state");
        System.err.println(string);
    }
}