zj
2024-06-03 81a29edf665881828e4ca1f0e444bfcbc6ab6f24
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package com.nq.controller.agent;
 
import com.nq.common.BaseController;
import com.nq.common.ServerResponse;
import com.nq.pojo.User;
import com.nq.pojo.UserBank;
import com.nq.pojo.UserLeverApply;
import com.nq.service.IAgentUserService;
import com.nq.service.IUserBankService;
import com.nq.service.IUserLeverApplyService;
import com.nq.service.IUserService;
import com.nq.vo.user.UserApplyEditParamVo;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.servlet.http.HttpServletRequest;
 
@Controller
@RequestMapping({"/agent/user/"})
public class AgentUserController  extends BaseController {
    private static final Logger log = LoggerFactory.getLogger(AgentUserController.class);
 
    @Autowired
    IUserService iUserService;
 
    @Autowired
    IAgentUserService iAgentUserService;
 
 
    @Autowired
    IUserBankService iUserBankService;
 
    @Autowired
    private IUserLeverApplyService userLeverApplyService;
 
    //分页查询用户管理信息及模糊查询
    @RequestMapping({"list.do"})
    @ResponseBody
    public ServerResponse list(@RequestParam(value = "realName", required = false) String realName, @RequestParam(value = "phone", required = false) String phone, @RequestParam(value = "agentId", required = false) Integer agentId, @RequestParam(value = "accountType", required = false) Integer accountType, @RequestParam(value = "pageNum", defaultValue = "1") int pageNum, @RequestParam(value = "pageSize", defaultValue = "12") int pageSize, HttpServletRequest request) {
        return this.iUserService.listByAgent(realName, phone, agentId, accountType, pageNum, pageSize, request);
    }
 
 
    //修改用户列表 用户信息
    @RequestMapping({"update.do"})
    @ResponseBody
    public ServerResponse update(User user) {
        return this.iUserService.update(user);
    }
 
 
 
    //修改用户列表 银行卡信息
    @RequestMapping({"updateBank.do"})
    @ResponseBody
    public ServerResponse updateBank(UserBank userBank) {
        return this.iUserBankService.updateBankByAdmin(userBank);
    }
 
    //添加用户列表 用户信息
    @RequestMapping({"addSimulatedAccount.do"})
    @ResponseBody
    public ServerResponse addSimulatedAccount(HttpServletRequest request,User user ) {
        return this.iUserService.addSimulatedAccount(user, request);
    }
 
    @RequestMapping({"authByAdmin.do"})
    @ResponseBody
    public ServerResponse authByAdmin(Integer userId, Integer state, String authMsg) {
        return this.iUserService.authByAdmin(userId, state, authMsg);
    }
 
    //查看指定 用户列表的用户信息
    @RequestMapping({"getBank.do"})
    @ResponseBody
    public ServerResponse getBank(Integer userId) {
        return this.iUserBankService.getBank(userId);
    }
 
 
    @RequestMapping("/userLeverageApplyList")
    @ResponseBody
    public ServerResponse list(UserLeverApply userLeverApply)
    {
        startPage();
        return iUserService.userLeverageApplyList(userLeverApply);
    }
 
    @RequestMapping("/applyUserLever")
    @ResponseBody
    public ServerResponse add( UserLeverApply userLeverApply)
    {
        int code = userLeverApplyService.insertUserLeverApply(userLeverApply);
        if (code > 0) {
            return ServerResponse.createBySuccessMsg("Success");
        }
        return ServerResponse.createByErrorMsg("User addition failure");
    }
 
    @RequestMapping("/editUserLever")
    @ResponseBody
    public ServerResponse editUserLever(UserApplyEditParamVo paramVo)
    {
        int code = userLeverApplyService.editUserLever(paramVo);
        if (code > 0) {
            return ServerResponse.createBySuccessMsg("Success");
        }
        return ServerResponse.createByErrorMsg("User addition failure");
    }
 
    @RequestMapping("/checkUserLever")
    @ResponseBody
    public ServerResponse edit(UserLeverApply userLeverApply)
    {
        int code = userLeverApplyService.updateUserLeverApply(userLeverApply);
        if (code > 0) {
            return ServerResponse.createBySuccessMsg("Success");
        }
        return ServerResponse.createByErrorMsg("User addition failure");
    }
 
    @RequestMapping("/{ids}")
    @ResponseBody
    public ServerResponse remove(@PathVariable Long[] ids)
    {
        int code = userLeverApplyService.deleteUserLeverApplyByIds(ids);
        if (code > 0) {
            return ServerResponse.createBySuccessMsg("Success");
        }
        return ServerResponse.createByErrorMsg("User addition failure");
    }
 
}