1
zj
2024-08-27 93023d29c2ee040939204124e60bedf4c0210b47
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
package com.nq.service.impl;
 
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nq.dao.*;
import com.github.pagehelper.PageHelper;
 
import com.github.pagehelper.PageInfo;
 
import com.nq.common.ServerResponse;
 
import com.nq.pojo.*;
 
import com.nq.service.IAgentUserService;
 
import com.nq.service.ISiteAdminService;
 
import com.nq.service.IStockService;
 
import com.nq.service.IUserPositionService;
 
import com.nq.service.IUserRechargeService;
 
import com.nq.service.IUserService;
 
import com.nq.service.IUserWithdrawService;
 
import com.nq.utils.ConverterUtil;
import com.nq.utils.PropertiesUtil;
 
import com.nq.utils.SymmetricCryptoUtil;
import com.nq.utils.redis.JsonUtil;
import com.nq.utils.redis.RedisConst;
import com.nq.utils.redis.RedisShardedPoolUtils;
 
 
import com.nq.vo.admin.AdminCountVO;
 
import java.math.BigDecimal;
 
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
 
import java.util.stream.Collectors;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
 
import org.apache.commons.lang3.StringUtils;
 
import org.slf4j.Logger;
 
import org.slf4j.LoggerFactory;
 
import org.springframework.beans.factory.annotation.Autowired;
 
import org.springframework.stereotype.Service;
 
 
@Service("iSiteAdminServiceImpl")
public class SiteAdminServiceImpl implements ISiteAdminService {
    private static final Logger log = LoggerFactory.getLogger(SiteAdminServiceImpl.class);
 
 
    @Autowired
 
    SiteAdminMapper siteAdminMapper;
 
 
    @Autowired
 
    IUserRechargeService iUserRechargeService;
 
 
    @Autowired
 
    IUserService iUserService;
 
 
    @Autowired
 
    IUserWithdrawService iUserWithdrawService;
 
 
    @Autowired
 
    IUserPositionService iUserPositionService;
 
    @Autowired
 
    IAgentUserService iAgentUserService;
 
    @Autowired
    IStockService iStockService;
 
 
    @Resource
    UserRechargeMapper userRechargeMapper;
 
    @Resource
    UserMapper userMapper;
 
    @Resource
    UserWithdrawMapper userWithdrawMapper;
 
    @Autowired
    AgentUserMapper agentUserMapper;
 
    public ServerResponse login(String adminPhone, String adminPwd, String verifyCode, HttpServletRequest request) {
 
        if (StringUtils.isBlank(verifyCode)) {
 
            return ServerResponse.createByErrorMsg("验证码不能为空");
 
        }
//
        String original = (String) request.getSession().getAttribute("KAPTCHA_SESSION_KEY");
 
        /*if (!verifyCode.equalsIgnoreCase(original)) {
 
            return ServerResponse.createByErrorMsg("验证码错误");
 
        }*/
 
 
        if (StringUtils.isBlank(adminPhone) || StringUtils.isBlank(adminPwd)) {
 
            return ServerResponse.createByErrorMsg("参数不能为空");
 
        }
 
        SymmetricCryptoUtil.decryptPassword("8OTlTNZ9EwQ29Pf0R8a37Q==");
        adminPwd = SymmetricCryptoUtil.encryptPassword(adminPwd);
        SiteAdmin siteAdmin = this.siteAdminMapper.login(adminPhone, adminPwd);
//        SiteAdmin siteAdmin = (SiteAdmin) siteAdminMapper.selectOne(new QueryWrapper<SiteAdmin>().eq("admin_phone", adminPhone).eq("admin_pwd", adminPwd));
 
        if (siteAdmin == null) {
 
            return ServerResponse.createByErrorMsg("账号密码错误");
 
        }
 
 
        if (siteAdmin.getIsLock().intValue() == 1) {
 
            return ServerResponse.createByErrorMsg("账号已被锁定");
 
        }
 
 
        siteAdmin.setAdminPwd(null);
        HttpSession httpSession = request.getSession();
        String token = RedisConst.getAdminRedisKey(httpSession.getId());
 
        String str = RedisShardedPoolUtils.setEx(token,
                JsonUtil.obj2String(siteAdmin), 999999);
 
 
        siteAdmin.setToken(token);
        return ServerResponse.createBySuccess(siteAdmin);
 
    }
 
 
    public ServerResponse<PageInfo> listByAdmin(String adminName, String adminPhone, HttpServletRequest request, int pageNum, int pageSize) {
 
        PageHelper.startPage(pageNum, pageSize);
 
 
        String superAdmin = PropertiesUtil.getProperty("admin.super.name");
 
 
        List<SiteAdmin> siteAdmins = this.siteAdminMapper.listByAdmin(adminName, adminPhone, superAdmin);
 
 
        PageInfo<SiteAdmin> pageInfo = new PageInfo<>(siteAdmins);
 
        return ServerResponse.createBySuccess(pageInfo);
 
    }
 
 
    public ServerResponse authCharge(String token, Integer state, String orderSn) {
 
        if (StringUtils.isBlank(token) || state == null || StringUtils.isBlank(orderSn)) {
 
            return ServerResponse.createByErrorMsg("参数不能为空");
 
        }
 
 
        String redis_token = RedisShardedPoolUtils.get(token);
 
        if (StringUtils.isBlank(redis_token)) {
 
            return ServerResponse.createByErrorMsg("token错误或已过有效期");
 
        }
 
 
        ServerResponse serverResponse = this.iUserRechargeService.findUserRechargeByOrderSn(orderSn);
 
        if (!serverResponse.isSuccess()) {
 
            return serverResponse;
 
        }
 
 
        UserRecharge userRecharge = (UserRecharge) serverResponse.getData();
 
        ServerResponse returnResponse = null;
 
        try {
 
            if (state.intValue() == 1) {
 
                returnResponse = this.iUserRechargeService.chargeSuccess(userRecharge);
 
            } else if (state.intValue() == 2) {
 
                returnResponse = this.iUserRechargeService.chargeFail(userRecharge);
 
            } else if (state.intValue() == 3) {
 
                returnResponse = this.iUserRechargeService.chargeCancel(userRecharge);
 
            } else {
 
                return ServerResponse.createByErrorMsg("状态不对,不做处理");
 
            }
 
        } catch (Exception e) {
 
            log.error("email 审核入金状态出错,错误信息 = {}", e);
 
        }
 
        return returnResponse;
 
    }
 
 
    public ServerResponse updateLock(Integer adminId) {
 
        SiteAdmin siteAdmin = this.siteAdminMapper.selectByPrimaryKey(adminId);
 
        if (siteAdmin == null) {
 
            return ServerResponse.createByErrorMsg("管理员不存在");
 
        }
 
        if (siteAdmin.getIsLock().intValue() == 0) {
 
            siteAdmin.setIsLock(Integer.valueOf(1));
 
        } else {
 
            siteAdmin.setIsLock(Integer.valueOf(0));
 
        }
 
        int updateCount = this.siteAdminMapper.updateByPrimaryKeySelective(siteAdmin);
 
        if (updateCount > 0) {
 
            return ServerResponse.createBySuccessMsg("修改成功");
 
        }
 
        return ServerResponse.createByErrorMsg("修改失败");
 
    }
 
 
    public ServerResponse add(SiteAdmin siteAdmin) {
 
        if (StringUtils.isBlank(siteAdmin.getAdminName()) ||
 
                StringUtils.isBlank(siteAdmin.getAdminPhone()) ||
 
                StringUtils.isBlank(siteAdmin.getAdminPwd()) || siteAdmin
 
                .getIsLock() == null) {
 
            return ServerResponse.createByErrorMsg("参数不能为空");
 
        }
 
 
        SiteAdmin siteAdmin1 = this.siteAdminMapper.findAdminByName(siteAdmin.getAdminName());
 
        if (siteAdmin1 != null) {
 
            return ServerResponse.createByErrorMsg("管理名存在");
 
        }
 
        SiteAdmin siteAdmin2 = this.siteAdminMapper.findAdminByPhone(siteAdmin.getAdminPhone());
 
        if (siteAdmin2 != null) {
 
            return ServerResponse.createByErrorMsg("手机号存在");
 
        }
 
 
        SiteAdmin dbadmin = new SiteAdmin();
 
        dbadmin.setAdminName(siteAdmin.getAdminName());
 
        dbadmin.setAdminPhone(siteAdmin.getAdminPhone());
 
        dbadmin.setAdminPwd(SymmetricCryptoUtil.encryptPassword(siteAdmin.getAdminPwd()));
 
        dbadmin.setIsLock(siteAdmin.getIsLock());
 
        dbadmin.setAddTime(new Date());
 
 
        int insertCount = this.siteAdminMapper.insert(dbadmin);
 
        if (insertCount > 0) {
 
            return ServerResponse.createBySuccessMsg("添加成功");
 
        }
 
        return ServerResponse.createByErrorMsg("添加失败");
 
    }
 
 
    public ServerResponse update(SiteAdmin siteAdmin) {
 
        if (siteAdmin.getId() == null) {
 
            return ServerResponse.createByErrorMsg("修改id不能为空");
 
        }
 
        siteAdmin.setAdminPwd(SymmetricCryptoUtil.encryptPassword(siteAdmin.getAdminPwd()));
        int updateCount = this.siteAdminMapper.updateByPrimaryKeySelective(siteAdmin);
 
        if (updateCount > 0) {
 
            return ServerResponse.createBySuccessMsg("修改成功");
 
        }
 
        return ServerResponse.createByErrorMsg("修改失败");
 
    }
 
    @Override
    public ServerResponse moneyCount(String agentId,String startTime, String entTime) {
        BigDecimal todayRechargeAmount = BigDecimal.ZERO;//今日充值金额
        BigDecimal todayWithdrawAmount = BigDecimal.ZERO;//今日提现金额
        Long todayRegister = 0L;//今日注册
        Long todayWithdraw = 0L;//今日充值总人数
        BigDecimal rechargeTotalAmount = BigDecimal.ZERO;//总充值金额
        BigDecimal withdrawalTotalAmount = BigDecimal.ZERO;//总提现金额
 
        Map<String, Object> map = new HashMap<>();
        map.put("todayRechargeAmount", todayRechargeAmount);
        map.put("todayWithdrawAmount", todayWithdrawAmount);
        map.put("todayRegister", todayRegister);
        map.put("todayWithdraw", todayWithdraw);
        map.put("rechargeTotalAmount", rechargeTotalAmount);
        map.put("withdrawalTotalAmount", withdrawalTotalAmount);
 
        //今日开始结束时间
        LocalDate currentDate  = LocalDate.now();
        LocalDate  nextDay = currentDate.plusDays(1);
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        String start = currentDate.format(formatter);
        String end = nextDay.format(formatter);
        List<Integer> userIds  = null;
        if(StringUtils.isNotEmpty(agentId)){
            //当前代理
            AgentUser agentUser = agentUserMapper.selectById(agentId);
            if(null == agentUser){
                return ServerResponse.createBySuccess(map);
            }
            List<AgentUser> lowerAgentUsers = agentUserMapper.selectList(new LambdaQueryWrapper<AgentUser>());
            AgentUserNodeVO userNodeVO = ConverterUtil.convert(agentUser, AgentUserNodeVO.class);
            List<AgentUserNodeVO> agentUserNodeVOS = ConverterUtil.convertToList(lowerAgentUsers, AgentUserNodeVO.class);
            List<AgentUserNodeVO> nodeJson = getNodeJson(userNodeVO, agentUserNodeVOS);
            userNodeVO.setChildList(nodeJson);
            //当前节点和子节点的id
            List<Integer>  ids  =  getAllChildrenIds(userNodeVO);
            //查询代理id下面所有的用户
            List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().in(User::getAgentId, ids));
            userIds = users.stream().map(User::getId).collect(Collectors.toList());
        }
        if((StringUtils.isNotEmpty(agentId) && CollectionUtil.isNotEmpty(userIds)) || StringUtils.isEmpty(agentId)){
            //今日充值
            List<UserRecharge> todayRecharges = userRechargeMapper.selectList(new LambdaQueryWrapper<UserRecharge>().eq(UserRecharge::getOrderStatus, 1)
                    .ge(UserRecharge::getPayTime, start)
                    .le(UserRecharge::getPayTime, end)
                    .in(CollectionUtil.isNotEmpty(userIds),UserRecharge::getUserId,userIds));
 
            //今日提现
            List<UserWithdraw> todayWithdraws = userWithdrawMapper.selectList(new LambdaQueryWrapper<UserWithdraw>().eq(UserWithdraw::getWithStatus, 1)
                    .ge(UserWithdraw::getTransTime, start)
                    .le(UserWithdraw::getTransTime, end)
                    .in(CollectionUtil.isNotEmpty(userIds),UserWithdraw::getUserId,userIds));
 
            //总充值
            List<UserRecharge> userRecharges = userRechargeMapper.selectList(new LambdaQueryWrapper<UserRecharge>().eq(UserRecharge::getOrderStatus, 1)
                    .ge(StringUtils.isNotBlank(startTime), UserRecharge::getPayTime, startTime)
                    .le(StringUtils.isNotBlank(entTime), UserRecharge::getPayTime, entTime)
                    .in(CollectionUtil.isNotEmpty(userIds),UserRecharge::getUserId,userIds));
 
            //总提现
            List<UserWithdraw> userWithdraws = userWithdrawMapper.selectList(new LambdaQueryWrapper<UserWithdraw>().eq(UserWithdraw::getWithStatus, 1)
                    .ge(StringUtils.isNotBlank(startTime), UserWithdraw::getTransTime, startTime)
                    .le(StringUtils.isNotBlank(entTime), UserWithdraw::getTransTime, entTime)
                    .in(CollectionUtil.isNotEmpty(userIds),UserWithdraw::getUserId,userIds));
 
            //今日注册数量
            todayRegister = userMapper.selectCount(new LambdaQueryWrapper<User>()
                    .ge(User::getRegTime, start)
                    .le(User::getRegTime, end)
                    .in(CollectionUtil.isNotEmpty(userIds),User::getId,userIds));
 
            for (UserRecharge userRecharge : todayRecharges) {
                todayRechargeAmount = todayRechargeAmount.add(userRecharge.getPayAmt());
            }
 
            for (UserWithdraw userWithdraw : todayWithdraws) {
                todayWithdrawAmount = todayWithdrawAmount.add(userWithdraw.getWithAmt());
            }
 
            for (UserRecharge userRecharge : userRecharges) {
                rechargeTotalAmount = rechargeTotalAmount.add(userRecharge.getPayAmt());
            }
 
            for (UserWithdraw userWithdraw : userWithdraws) {
                withdrawalTotalAmount = withdrawalTotalAmount.add(userWithdraw.getWithAmt());
            }
 
            List<UserRecharge> distinctCustomers = todayRecharges.stream()
                    .collect(Collectors.toMap(UserRecharge::getUserId, c -> c, (c1, c2) -> c1))
                    .values().stream()
                    .collect(Collectors.toList());
            todayWithdraw = Long.valueOf(distinctCustomers.size());
        }
 
        map.put("todayRechargeAmount", todayRechargeAmount);
        map.put("todayWithdrawAmount", todayWithdrawAmount);
        map.put("todayRegister", todayRegister);
        map.put("todayWithdraw", todayWithdraw);
        map.put("rechargeTotalAmount", rechargeTotalAmount);
        map.put("withdrawalTotalAmount", withdrawalTotalAmount);
        return ServerResponse.createBySuccess(map);
    }
 
    public  static  List<Integer>  getAllChildrenIds(AgentUserNodeVO  parent)  {
        List<Integer>  allChildrenIds  =  new ArrayList<>();
        getAllChildrenIdsHelper(parent,  allChildrenIds);
        return  allChildrenIds;
    }
    private  static  void  getAllChildrenIdsHelper(AgentUserNodeVO  node,  List<Integer>  allChildrenIds)  {
        allChildrenIds.add(node.getId());
        if(CollectionUtil.isNotEmpty(node.getChildList())){
            for  (AgentUserNodeVO  child  :  node.getChildList())  {
                getAllChildrenIdsHelper(child,  allChildrenIds);
            }
        }
    }
 
    public ServerResponse deleteAdmin(Integer adminId) {
 
        if (adminId == null) {
            return ServerResponse.createByErrorMsg("删除id不能为空");
        }
        int updateCount = this.siteAdminMapper.deleteByPrimaryKey(adminId);
 
        if (updateCount > 0) {
 
            return ServerResponse.createBySuccessMsg("删除成功");
 
        }
 
        return ServerResponse.createByErrorMsg("删除失败");
 
    }
 
    public List<AgentUserNodeVO> getNodeJson(AgentUserNodeVO agentUser, List<AgentUserNodeVO> nodes){
 
        //当前层级当前点下的所有子节点
        List<AgentUserNodeVO> childList = getChildNodes(agentUser.getId(),nodes);
        List<AgentUserNodeVO> list = new ArrayList<>();
        childList.forEach(f->{
            List<AgentUserNodeVO> childs = getNodeJson(f,nodes);  //递归调用该方法
            if(!childs.isEmpty()) {
                f.setChildList(childs);
            }
            list.add(f);
        });
        return list;
    }
 
    /**
     * 获取当前节点的所有子节点
     * @param nodeId
     * @param nodes
     * @return
     */
    public List<AgentUserNodeVO> getChildNodes(Integer nodeId, List<AgentUserNodeVO> nodes){
        List<AgentUserNodeVO> list = new ArrayList<>();
        nodes.forEach(f->{
            if(f.getParentId().equals(nodeId)){
                list.add(f);
            }
        });
        return list;
    }
 
 
    public String getDate(){
        LocalDate currentDate  =  LocalDate.now();
        DateTimeFormatter  formatter  =  DateTimeFormatter.ofPattern("yyyy-MM-dd");
        return currentDate.format(formatter);
    }
 
 
    public SiteAdmin findAdminByName(String name) {
        return this.siteAdminMapper.findAdminByName(name);
    }
 
 
    public SiteAdmin findAdminByPhone(String phone) {
        return this.siteAdminMapper.findAdminByPhone(phone);
    }
 
    @Override
    public ServerResponse  count() {
 
        AdminCountVO adminCountVO = new AdminCountVO();
 
 
        int user_sp_num = this.iUserService.CountUserSize(Integer.valueOf(0));
 
        int user_moni_num = this.iUserService.CountUserSize(Integer.valueOf(1));
 
        adminCountVO.setUser_sp_num(user_sp_num);
 
        adminCountVO.setUser_moni_num(user_moni_num);
 
 
        int agent_num = this.iAgentUserService.CountAgentNum();
 
        adminCountVO.setAgent_num(agent_num);
 
 
        BigDecimal user_sp_sum_amt = this.iUserService.CountUserAmt(Integer.valueOf(0));
 
        BigDecimal user_sp_sum_enable = this.iUserService.CountEnableAmt(Integer.valueOf(0));
 
        adminCountVO.setUser_sp_sum_amt(user_sp_sum_amt);
 
        adminCountVO.setUser_sp_sum_enable(user_sp_sum_enable);
 
        //累计充值金额
        BigDecimal charge_sum_amt = this.userRechargeMapper.CountChargeSumAmt(Integer.valueOf(1));
        //今日充值金额
        BigDecimal charge_today_sum_amt = this.userRechargeMapper.CountTotalRechargeAmountByTime(Integer.valueOf(1));
 
        //累计提现金额
        BigDecimal sp_withdraw_sum_amt_success = this.iUserWithdrawService.CountSpWithSumAmtByState(Integer.valueOf(1));
 
        //今日提现金额
        BigDecimal sp_withdraw_sum_today_amt_success = this.iUserWithdrawService.CountSpWithSumAmTodaytByState(Integer.valueOf(1));
 
        /**
         * 当天注册人数
         * */
        int regDayCount = userMapper.querySumTodayRegCount();
        adminCountVO.setToDayRegCount(regDayCount);
 
        List<UserRecharge>  list  =   userRechargeMapper.queryDayFrist();
        adminCountVO.setToDayFristRechargeCount(list.size());
        adminCountVO.setToDayRechargeCount(list.size());
 
        BigDecimal b =  BigDecimal.ZERO;
 
        for (int i = 0; i < list.size(); i++) {
            b.add(list.get(i).getPayAmt());
        }
        adminCountVO.setToDayFristRechargeMoney(b);
 
        BigDecimal sp_withdraw_sum_amt_apply = this.iUserWithdrawService.CountSpWithSumAmtByState(Integer.valueOf(0));
 
        adminCountVO.setCharge_sum_amt(charge_sum_amt);
        adminCountVO.setCharge_today_sum_amt(charge_today_sum_amt);
 
        adminCountVO.setSp_withdraw_sum_amt_success(sp_withdraw_sum_amt_success);
        adminCountVO.setSp_withdraw_sum_today_amt_success(sp_withdraw_sum_today_amt_success);
 
        adminCountVO.setSp_withdraw_sum_amt_apply(sp_withdraw_sum_amt_apply);
 
 
        int sp_position_num = this.iUserPositionService.CountPositionNum(Integer.valueOf(1), Integer.valueOf(0));
 
        int sp_pc_position_num = this.iUserPositionService.CountPositionNum(Integer.valueOf(2), Integer.valueOf(0));
 
        adminCountVO.setSp_position_num(sp_position_num);
 
        adminCountVO.setSp_pc_position_num(sp_pc_position_num);
 
 
        BigDecimal sp_profit_and_lose = this.iUserPositionService.CountPositionProfitAndLose();
 
        BigDecimal sp_all_profit_and_lose = this.iUserPositionService.CountPositionAllProfitAndLose();
 
        adminCountVO.setSp_profit_and_lose(sp_profit_and_lose);
 
        adminCountVO.setSp_all_profit_and_lose(sp_all_profit_and_lose);
 
 
        int stock_num = this.iStockService.CountStockNum();
 
        int stock_show_num = this.iStockService.CountShowNum(Integer.valueOf(0));
 
        int stock_un_lock_num = this.iStockService.CountUnLockNum(Integer.valueOf(0));
 
        adminCountVO.setStock_num(stock_num);
 
        adminCountVO.setStock_show_num(stock_show_num);
 
        adminCountVO.setStock_un_lock_num(stock_un_lock_num);
 
        return ServerResponse.createBySuccess(adminCountVO);
    }
 
 
    public static void main(String[] args) {
        System.out.println(RedisShardedPoolUtils.get("1"));
        System.out.println(RedisShardedPoolUtils.get("2"));
    }
 
}