puzhibing
2023-11-25 53e7558400dcacecdce70e39ebfe1727740f9296
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
package com.dsh.account.controller;
 
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.account.entity.CoachType;
import com.dsh.account.entity.RechargeRecords;
import com.dsh.account.entity.TAppUser;
import com.dsh.account.entity.VipPayment;
import com.dsh.account.model.IncomeQuery;
import com.dsh.account.model.query.RechargeRecordsQuery;
import com.dsh.account.model.query.coachQuery.CoachQuery;
import com.dsh.account.model.vo.CoachSerchVO;
import com.dsh.account.model.vo.RechargeRecordsVO;
import com.dsh.account.service.*;
import net.bytebuddy.asm.Advice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
 
/**
 * 充值记录控制器
 */
@RestController
@RequestMapping("")
public class FinanceController {
    @Autowired
    private RechargeRecordsService rechargeRecordsService;
    @Autowired
    private IVipPaymentService vipPaymentService;
    @Autowired
    private TAppUserService appUserService;
 
 
    /**
     * 充值记录列表数据
     */
    @ResponseBody
    @RequestMapping("/finance/rechargeList")
    public List<RechargeRecordsVO> rechargeList(@RequestBody RechargeRecordsQuery query) {
        List<RechargeRecordsVO> rechargeRecordsVOS = rechargeRecordsService.rechargeList(query);
        for (RechargeRecordsVO rechargeRecordsVO : rechargeRecordsVOS) {
            TAppUser byId = appUserService.getById(rechargeRecordsVO.getAppUserId());
            if (byId == null) continue;
            Date vipEndTime = byId.getVipEndTime();
            if (vipEndTime == null) {
                rechargeRecordsVO.setType(2);
                continue;
            }
            if (rechargeRecordsVO.getPayTime().after(vipEndTime)) {
                rechargeRecordsVO.setType(2);
            } else {
                rechargeRecordsVO.setType(1);
            }
        }
        return rechargeRecordsVOS;
    }
 
    /**
     * 数据统计-充值记录列表数据
     */
    @ResponseBody
    @RequestMapping("/finance/rechargeList1")
    public List<RechargeRecords> rechargeList1(@RequestBody RechargeRecordsQuery query) {
        List<RechargeRecords> payStatus = rechargeRecordsService.list(new QueryWrapper<RechargeRecords>().eq("payStatus", 2));
        for (RechargeRecords list : payStatus) {
            TAppUser byId = appUserService.getById(list.getAppUserId());
            Integer addUserId = byId.getAddUserId();
 
        }
        return payStatus;
    }
 
    /**
     * 加入会员列表数据
     */
    @ResponseBody
    @RequestMapping("/finance/vipPaymentList")
    public List<VipPayment> registrationList(@RequestBody IncomeQuery query) {
        return rechargeRecordsService.listAll(query);
    }
}