1
zj
2026-01-14 63394ae0cff04dc25a1e97170a9775767028d056
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.nq.controller.backend;
 
import com.nq.common.ServerResponse;
import com.nq.service.IUserRechargeService;
import com.nq.service.IUserService;
import com.nq.service.IUserWithdrawService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
 
@Controller
@RequestMapping({"/admin/notification/"})
public class AdminNotificationController {
    private static final Logger log = LoggerFactory.getLogger(AdminNotificationController.class);
 
    @Autowired
    IUserRechargeService iUserRechargeService;
 
    @Autowired
    IUserWithdrawService iUserWithdrawService;
 
    @Autowired
    IUserService iUserService;
 
    @RequestMapping({"pendingCount.do"})
    @ResponseBody
    public ServerResponse<Map<String, Integer>> getPendingCount(HttpServletRequest request) {
        try {
            Map<String, Integer> result = new HashMap<>();
            // 充值待处理数量(状态为0)
            int rechargeCount = iUserRechargeService.countPendingRecharge();
            // 提现待处理数量(状态为0)
            int withdrawCount = iUserWithdrawService.countPendingWithdraw();
            // 实名认证待处理数量(isActive为1)
            int authCount = iUserService.countPendingAuth();
            
            result.put("rechargeCount", rechargeCount);
            result.put("withdrawCount", withdrawCount);
            result.put("authCount", authCount);
            result.put("totalCount", rechargeCount + withdrawCount + authCount);
            
            return ServerResponse.createBySuccess(result);
        } catch (Exception e) {
            log.error("获取待处理数量失败", e);
            return ServerResponse.createByErrorMsg("获取待处理数量失败");
        }
    }
}