无关风月
2 天以前 9411a5a1eec19f3460eca9a6c82ebb46dc4e2f0d
ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/WithdrawController.java
@@ -66,24 +66,39 @@
        }
        return withdrawClient.withdrawDetailByUser(orderId);
    }
    @GetMapping("/confirmMoney")
    @ApiOperation(value = "确认收款", tags = {"用户端-个人中心-提现"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "提现记录id", name = "id", dataType = "String", required = true)
    })
    public  R<String> confirmMoney(@RequestParam("id") String id) {
        return withdrawClient.confirmMoney(id);
    }
    @GetMapping("/confirmWithdraw")
    @ApiOperation(value = "确认提现", tags = {"用户端-个人中心-提现"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true)
    })
    public synchronized R<Boolean> confirmWithdraw(@RequestParam String orderId) {
        LoginUserInfo loginUser = tokenService.getLoginUserByUser();
        if (null == loginUser) {
            return R.loginExpire("登录失效!");
        }
        if (redisService.hasKey(orderId)) {
            return R.repeatedSubmission("请勿重复提交!");
            return R.fail("该笔订单已申请提现");
//            return R.repeatedSubmission("请勿重复提交!");
        }
        redisService.setCacheObject(orderId, "1", 10L, TimeUnit.SECONDS);
        Boolean b = withdrawService.confirmWithdraw(orderId, loginUser.getUserid());
        return R.ok(withdrawService.confirmWithdraw(orderId, loginUser.getUserid()));
        if (b){
            return R.ok();
        }else {
            return R.fail("该笔订单已申请提现");
        }
    }
    @GetMapping("/withdrawRecord")