yujian
2020-04-10 469bba3a544b3beef0c170f6fce5804c9e8a9676
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
package com.yeshi.fanli.service.inter.count;
 
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
 
import com.yeshi.fanli.dto.ChartTDO;
import com.yeshi.fanli.vo.order.HongBaoV2VO;
 
public interface HongBaoV2CountService {
 
    /**
     * 统计历史总到账金额
     * 
     * @param uid
     * @param state
     * @return
     */
    public BigDecimal countMoneyByUidAndState(Long uid, Integer state);
 
    /**
     * 统计历史红包数量
     * 
     * @param uid
     * @param state
     * @return
     */
    public Integer countNumberByUidAndState(Long uid, Integer state);
 
    /**
     * 统计用户红包数量
     * 
     * @param uid
     * @return
     */
    public Integer countNumberByUid(Long uid);
 
    /**
     * 统计总金额
     * 
     * @param channel
     *            渠道
     * @param dateType
     *            日期格式 日-1 月-2 年-3
     * @param state
     *            状态
     * @param years
     *            年份
     * @param startTime
     *            开始时间
     * @param endTime
     *            结束时间
     * @return
     */
    public List<ChartTDO> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
            String startTime, String endTime) throws Exception;
 
    /**
     * 统计总金额
     * 
     * @param channel
     *            渠道
     * @param dateType
     *            日期格式 日-1 月-2 年-3
     * @param state
     *            状态
     * @param years
     *            年份
     * @param startTime
     *            开始时间
     * @param endTime
     *            结束时间
     * @return
     */
    public List<ChartTDO> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
            String startTime, String endTime) throws Exception;
 
    /**
     * 分类型订单数与比例
     * 
     * @param dateType
     * @param type
     * @param year
     * @param startTime
     * @param endTime
     * @return
     * @throws Exception
     */
    public List<ChartTDO> getProportionByType(Integer dateType, Integer type, String year, String startTime,
            String endTime) throws Exception;
 
    /**
     * 统计提成订单数量
     * 
     * @param uid
     * @return
     */
    public int getTotalTiChengCount(Long uid);
 
    /**
     * 统计未失效订单数量
     * 
     * @param uid
     * @param dateType
     * @return
     */
    public long countValidNumberByUid(Long uid, Integer dateType);
 
    /**
     * 统计未到账金额
     * 
     * @param uid
     * @param dateType
     * @return
     */
    public BigDecimal countWillGetMoneyByUid(Long uid);
 
    /**
     * 最后一次下单时间
     * 
     * @param uid
     * @return
     */
    public Date getLastHongBaoTime(Long uid);
 
    public List<ChartTDO> count24HOderByChannel(String channel, Integer type, String years, String startTime,
            String endTime) throws Exception;
 
    /**
     * 统计所有类型订单数量
     * 
     * @param dateType
     * @param type
     * @param year
     * @param startTime
     * @param endTime
     * @return
     * @throws Exception
     */
    public List<ChartTDO> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
            String endTime) throws Exception;
 
    /**
     * 查询邀请=分享奖金
     * 
     * @param start
     * @param count
     * @param date
     * @return
     */
    public List<HongBaoV2VO> listShareAndInviteMoney(long start, int count, String date);
 
    /**
     * 奖励券金额
     * 
     * @return
     */
    public BigDecimal countRebateCouponMoney();
 
    /**
     * 统计返利订单
     * @param uid
     * @return
     */
    public long countRebateOrder(Long uid);
 
    /**
     * 统计分享+ 邀请订单
     * @param uid
     * @return
     */
    public long countShareOrInviteOrder(Long uid);
    
    /**
     * 统计已到账
     * 
     * @param uid
     * @param typeList
     * @param minGetTime
     * @param maxGetTime
     * @return
     */
    public BigDecimal sumAlreadyGetMoneyByUid(Long uid, List<Integer> typeList, Date minGetTime, Date maxGetTime);
 
    public long countAlreadyGetMoneyByUid(Long uid, List<Integer> typeList, Date minGetTime, Date maxGetTime);
 
    /**
     * 查询来源该下级成功分享 + 自购订单 
     * @param uid
     * @param teamUid
     * @param endTime
     * @return
     */
    public BigDecimal getOrderRewardByTeamUid(Long uid, Long teamUid, Date endTime);
 
    /**
     * 统计该下级成功分享 + 自购订单 
     * @param uid
     * @param teamUid 下级id
     * @return
     */
    public BigDecimal getOrderRewardByTeamUidTheMonth(Long uid, Long teamUid);
 
    /**
     * 自购返利到账金额
     * @param uid
     * @return
     */
    public BigDecimal getRewardMoneyBySelf(Long uid);
 
    /**
     * 分享奖励到账金额
     * @param uid
     * @return
     */
    public BigDecimal getRewardMoneyByShare(Long uid);
 
    /**
     * 下级产生奖励到账金额
     * @param uid
     * @return
     */
    public BigDecimal getRewardMoneyByInvite(Long uid);
 
    /**
     * 有效一级队员定义:2019年1月1日起(date),自购或分享1笔且付款总金额不小于 payment 元(退款为失效
     * @param uid
     * @param date
     * @param payment
     * @return
     */
    public long countValidOrderByUidAndTime(Long uid, Long time, BigDecimal payment);
 
    /**
     * 统计不同时间:奖励
     * @param uid
     * @param dateType
     * @param hbType
     * @return
     */
    public BigDecimal getRewardMoneyToCount(Long uid, Integer dateType, Integer hbType, List<Integer> listSource);
 
    /**
     * 统计红包个数
     * @param uid
     * @param type 红包类型
     * @return
     */
    public long getHongBaoCount(Long uid, Integer type);
 
    /**
     * 筛选结果页顶部统计
     * @param uid
     * @param dateType
     * @param hbType
     * @param orderState
     * @param orderNo
     * @param source
     * @param startTime
     * @param endTime
     * @return
     */
    public BigDecimal getRewardMoneyByToSearch(Long uid, Integer dateType, Integer hbType, Integer orderState, String orderNo,
             Integer moneyState, String startTime, String endTime, List<Integer> listSource);
 
    
    public Long countOrderByTypeAndDate(Integer orderType, String preDay);
 
    /**
     * 统计订单数量
     * @param uid
     * @param time 下单开始时间
     * @param payment 付款金额
     * @param type 订单类型
     * @return
     */
    public long counOrderByUidAndOrderType(Long uid, BigDecimal payment, int type);
 
    /**
     * 统计已结算
     * @param uid
     * @param time
     * @param payment
     * @return
     */
    public long countOrderByUidAndSettled(Long uid, Long time, BigDecimal payment);
 
    public BigDecimal geBonusByuid(Long uid, Integer dateType, Integer hbType, Integer moneyState);
 
}