From 1442f149019ee0590389abd7a88a79c4d9b59034 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期二, 27 五月 2025 18:23:34 +0800 Subject: [PATCH] bug修改 --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WithdrawController.java | 47 ++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 38 insertions(+), 9 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WithdrawController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WithdrawController.java index 8221b9b..10f202a 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WithdrawController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WithdrawController.java @@ -68,10 +68,21 @@ @RequestParam(value = "applyForTime", required = false) String applyForTime, @RequestParam(value = "state", required = false) Integer state, @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { - return R.ok(withdrawService.withdrawPage(nickname, userPhone, applyForTime, state, Page.of(pageNum, pageSize))); + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "userIds") List<Integer> userIds) { + return R.ok(withdrawService.withdrawPage(userIds,nickname, userPhone, applyForTime, state, Page.of(pageNum, pageSize))); } - + @GetMapping(value = "/withdrawPage1") + public R<Page<UserWithdrawRecordVO>> withdrawPage1(@RequestParam(value = "cityList", required = false)List<String> cityList,@RequestParam(value = "nickname", required = false) String nickname, + @RequestParam(value = "userPhone", required = false) String userPhone, + @RequestParam(value = "applyForTime", required = false) String applyForTime, + @RequestParam(value = "state", required = false) Integer state, + @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(name = "userIds") List<Integer> userIds, + @RequestParam("siteIds") List<String> siteIds) { + return R.ok(withdrawService.withdrawPage1(cityList,userIds,nickname, userPhone, applyForTime, state, Page.of(pageNum, pageSize),siteIds)); + } /** * 查看提现记录详情 * @@ -82,7 +93,7 @@ @ApiImplicitParams({ @ApiImplicitParam(value = "提现记录id", name = "id", dataType = "Integer", required = true) }) - public R<Withdraw> withdrawRecordDetail(@RequestParam("id") Integer id) { + public R<Withdraw> withdrawRecordDetail(@RequestParam("id") Long id) { Withdraw withdraw = withdrawService.lambdaQuery().eq(Withdraw::getId, id) .eq(Withdraw::getIsDelete, 0).one(); return R.ok(withdraw); @@ -102,7 +113,7 @@ @ApiImplicitParam(value = "审批意见", name = "opinion", dataType = "String"), @ApiImplicitParam(value = "审批同意/不同意(1同意;2驳回)", name = "state", dataType = "Integer", required = true) }) - public R<Boolean> withdrawExamine(@RequestParam("id") Integer id, @RequestParam("state") Integer state, + public R<Boolean> withdrawExamine(@RequestParam("id") Long id, @RequestParam("state") Integer state, @RequestParam(value = "opinion", required = false) String opinion, @RequestParam(value = "openId") String openId, @RequestParam(value = "userId") Integer userId) { @@ -127,9 +138,18 @@ throw new GlobalException("订单信息异常!"); } Boolean b = withdrawService.confirmWithdraw(openId, userId, order); - if (!b) { - throw new GlobalException("提现失败!"); +// if (!b) { +// throw new GlobalException("提现失败!"); +// } + }else { + Order order = orderService.lambdaQuery() + .eq(Order::getId, withdraw.getOrderId()) + .eq(Order::getIsDelete, 0).one(); + if (null == order) { + throw new GlobalException("订单信息异常!"); } + order.setIsWithdrawal(0); + orderService.updateById(order); } update = update && withdrawService.updateById(withdraw); return R.ok(update); @@ -227,6 +247,14 @@ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { return R.ok(withdrawService.withdrawList(userId, Page.of(pageNum, pageSize))); } + @GetMapping(value = "/withdrawList1") + public R<Page<UserWithdrawRecordVO>> withdrawList1(@RequestParam("cityList") List<String> cityList,@RequestParam("userId") Integer userId, + @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam("siteIds") List<String> siteIds) { + return R.ok(withdrawService.withdrawList1(cityList,userId, Page.of(pageNum, pageSize),siteIds)); + } + /************************************* 用户端 **************************************************/ @@ -246,7 +274,7 @@ */ @ApiOperation(value = "用户提交提现申请", tags = {"用户端"}) @GetMapping(value = "/confirmWithdrawByUser") - public R<Boolean> confirmWithdrawByUser(@RequestParam("orderId") String orderId, + public synchronized R<Boolean> confirmWithdrawByUser(@RequestParam("orderId") String orderId, @RequestParam("userId") Integer userId, @RequestParam("openId") String openId, @RequestParam("userPhone") String userPhone) { @@ -259,7 +287,7 @@ @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { return R.ok(orderService.lambdaQuery().eq(Order::getUserId, userId) - .eq(Order::getState, 3).eq(Order::getIsDelete, 0).page(Page.of(pageNum, pageSize))); + .eq(Order::getState, 3).page(Page.of(pageNum, pageSize))); } @GetMapping("/withdrawRecordList") @@ -312,6 +340,7 @@ withdrawDetailVO.setWithdrawalState(withdraw.getState()); withdrawDetailVO.setWithdrawalTime(withdraw.getCreateTime()); } + withdrawDetailVO.setPackageInfo(order.getPackageInfo()); withdrawDetailVO.setAddress(order.getAddress()); if (null != serveRecord) { withdrawDetailVO.setPhoto(serveRecord.getPhoto()); -- Gitblit v1.7.1