From a8e83d12274b776b215895273e7021c4eb2ba789 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期四, 05 六月 2025 09:54:07 +0800
Subject: [PATCH] 小程序接口 发布优化 首页放行

---
 ruoyi-applet/src/main/java/com/ruoyi/web/controller/system/UserAccountController.java |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/system/UserAccountController.java b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/system/UserAccountController.java
index fde4c58..e6123fb 100644
--- a/ruoyi-applet/src/main/java/com/ruoyi/web/controller/system/UserAccountController.java
+++ b/ruoyi-applet/src/main/java/com/ruoyi/web/controller/system/UserAccountController.java
@@ -12,6 +12,7 @@
 import com.ruoyi.system.model.*;
 import com.ruoyi.system.query.UserAccountDetailQuery;
 import com.ruoyi.system.service.*;
+import com.ruoyi.system.vo.GetWithdrawalDetailVo;
 import com.ruoyi.system.vo.RegionVo;
 import com.ruoyi.system.vo.UserAccountVo;
 import io.swagger.annotations.Api;
@@ -49,7 +50,6 @@
 
 
 
-    // TODO 需要订单来查看其他金额
     @ApiOperation(value = "获取用户钱包信息",tags = {"用户钱包模块"})
     @GetMapping("/getUserAccount")
     public R<UserAccountVo> getUserAccount() {
@@ -58,8 +58,15 @@
         TbUser user = userService.getById(loginUser.getUserId());
         userAccountVo.setBalance(user.getBalance());
 
+        List<TbAccountDetail> list = accountDetailService.list(new LambdaQueryWrapper<TbAccountDetail>().eq(TbAccountDetail::getCategory, 1).eq(TbAccountDetail::getUserId, user.getId()));
+        BigDecimal reduce = list.stream().filter(e->e.getStatus()==2).map(TbAccountDetail::getMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
+        userAccountVo.setWithdrawalBalance(reduce);
 
-
+        BigDecimal reduce1 = list.stream().filter(e->e.getStatus()==1).map(TbAccountDetail::getMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
+        userAccountVo.setAuditBalance(reduce1);
+        List<TbAccountDetail> list1 = accountDetailService.list(new LambdaQueryWrapper<TbAccountDetail>().eq(TbAccountDetail::getCategory, 2).eq(TbAccountDetail::getStatus, 1).eq(TbAccountDetail::getUserId, user.getId()));
+        BigDecimal reduce2 = list1.stream().map(TbAccountDetail::getMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
+        userAccountVo.setEntryBalance(reduce2);
 
         return R.ok(userAccountVo);
     }
@@ -118,6 +125,7 @@
         accountDetail.setCategory(1);
         accountDetail.setStatus(1);
         accountDetail.setMoney(new BigDecimal(dto.getAmount()));
+        accountDetail.setSourceId(withdrawal.getId());
         accountDetailService.save(accountDetail);
         return R.ok();
     }
@@ -154,6 +162,18 @@
     }
 
 
+    @ApiOperation(value = "提现说明需求",tags = {"用户钱包模块"})
+    @GetMapping("/getWithdrawalDetail")
+    public R<GetWithdrawalDetailVo> getWithdrawalDetail(@RequestParam String sourceId) {
+        TbWithdrawal withdrawal =  withdrawalService.getById(sourceId);
+        GetWithdrawalDetailVo vo = new GetWithdrawalDetailVo();
+        vo.setImg(withdrawal.getImg());
+        vo.setRemark(withdrawal.getRemark());
+        return R.ok(vo);
+    }
+
+
+
 
 
 

--
Gitblit v1.7.1