admin
2019-07-17 25dbf262113aaf404af00259efcfaae285d3a352
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
package com.yeshi.fanli.service.inter.order;
 
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
 
import org.apache.ibatis.annotations.Param;
 
import com.yeshi.fanli.entity.jd.JDOrder;
import com.yeshi.fanli.entity.order.CommonOrder;
import com.yeshi.fanli.entity.pdd.PDDOrder;
import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
import com.yeshi.fanli.exception.order.CommonOrderException;
import com.yeshi.fanli.vo.order.CommonOrderVO;
 
import net.sf.json.JSONObject;
 
public interface CommonOrderService {
 
    public int insert(CommonOrder record);
 
    public int insertSelective(CommonOrder record);
 
    public int updateByPrimaryKey(CommonOrder record);
 
    public int updateByPrimaryKeySelective(CommonOrder record);
 
    public int deleteByPrimaryKey(Long id);
 
    public CommonOrder selectByPrimaryKey(Long id);
 
    /**
     * 查询用户订单 并订单号分组
     * 
     * @param start
     * @param count
     * @param uid
     * @param state
     * @param type
     * @param orderNo
     *            订单号
     * @param startTime
     *            起始系统录入时间
     * @param endTime
     *            结束系统录入时间
     * @return
     * @throws CommonOrderException
     */
    public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state, Integer type,
            Integer orderState, String orderNo, String startTime, String endTime, Integer dateType)
            throws CommonOrderException;
 
    /**
     * 统计查询
     * 
     * @param uid
     * @param state
     * @param type
     * @param orderNo
     * @param startTime
     * @param endTime
     * @return
     * @throws CommonOrderException
     */
    long countGroupOrderNoByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo,
            String startTime, String endTime, Integer dateType) throws CommonOrderException;
 
    /**
     * 移动段订单列表
     * 
     * @param start
     * @param count
     * @param uid
     *            用户id
     * @param type
     *            到账状态
     * @return
     */
    public List<CommonOrderVO> getOrderByUid(Integer page, Long uid, Integer state, Integer type, Integer orderState,
            String orderNo, String startTime, String endTime, Integer dateType) throws CommonOrderException;
 
    /**
     * 统计订单-根据红包类型 自购 邀请 分享
     * 
     * @param uid
     * @return
     */
    public Map<String, BigDecimal> countHistoryOrder(Long uid, Integer day);
 
    /**
     * 统计订单
     * 
     * @param uid
     * @return
     */
    public long countBonusOrderNumber(Long uid, Integer type, Integer isToday, String startTime, String endTime);
 
    /**
     * 统计订单
     * 
     * @param uid
     * @return
     */
    public BigDecimal countBonusOrderMoney(Long uid, Integer type, Integer isToday, String startTime, String endTime);
 
    /**
     * 统计奖金订单数量、金额
     * 
     * @param uid
     * @param type
     * @param day
     * @param startTime
     * @param endTime
     * @return
     */
    public Map<String, Object> countBonusOrderMoneyAndNumber(Long uid, Integer type, Integer day, String startTime,
            String endTime);
 
    /**
     * 根据条件统计
     * 
     * @param uid
     * @param type
     * @param startTime
     * @param endTime
     * @return
     */
    public Map<String, BigDecimal> countByUidAndOrderState(Long uid, Integer type, String startTime, String endTime,
            Integer day);
 
    /**
     * 根据订单号与订单类型查询订单
     * 
     * @param sourceType
     * @param orderId
     * @return
     */
    public List<CommonOrder> listBySourceTypeAndOrderId(int sourceType, String orderId);
 
    /**
     * 缓存淘宝类普通订单
     * 
     * @param taoBaoOrder
     * @param uid
     * @return
     * @throws CommonOrderException
     */
    public List<CommonOrder> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrder, Long uid) throws CommonOrderException;
 
    /**
     * 缓存拼多多类普通订单
     * 
     * @param pddOrderList
     * @param uid
     * @return
     * @throws CommonOrderException
     */
    public List<CommonOrder> addPDDOrder(List<PDDOrder> pddOrderList, Long uid) throws CommonOrderException;
 
    /**
     * 缓存京东普通订单
     * 
     * @param jdOrderList
     * @param uid
     * @return
     * @throws CommonOrderException
     */
    public List<CommonOrder> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException;
 
    /**
     * 根据用户ID,订单状态,结算时间统计订单数量
     * 
     * @param uid
     * @param state
     * @param minDate
     * @param maxDate
     * @return
     */
    public long countByUidAndOrderStateWithOrderBalanceTime(Long uid, int state, Date minDate, Date maxDate);
 
    /**
     * 后端查询订单列表
     * 
     * @param start
     * @param count
     * @param uid
     * @param state
     * @param type
     * @param orderState
     * @param orderNo
     * @param startTime
     * @param endTime
     * @param dateType
     *            1昨天 2今天 3本月 4 上月
     * @return
     * @throws CommonOrderException
     */
    public List<CommonOrderVO> listQueryByUid(long start, int count, Long uid, Integer state, Integer type,
            Integer orderState, String orderNo, String startTime, String endTime, Integer dateType)
            throws CommonOrderException;
 
    public long countQueryByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo,
            String startTime, String endTime, Integer dateType) throws CommonOrderException;
 
    /**
     * 查询所有用户订单
     * 
     * @param start
     * @param count
     * @param keyType
     * @param key
     * @param state
     * @param type
     * @param orderState
     * @param startTime
     * @param endTime
     * @return
     * @throws CommonOrderException
     */
 
    public List<CommonOrderVO> listQuery(long start, int count, Integer keyType, String key, Integer state,
            Integer type, Integer orderState, String startTime, String endTime) throws CommonOrderException;
 
    public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
            String startTime, String endTime) throws CommonOrderException;
 
    /**
     * 根据订单号获取信息
     * 
     * @param orderNo
     * @return
     * @throws CommonOrderException
     */
    public CommonOrderVO getInfoByOrderNo(Long uid, String orderNo) throws CommonOrderException;
 
    /**
     * 查询券奖励金额以及订单信息
     * 
     * @param uid
     * @param state
     * @param orderNo
     * @return
     * @throws CommonOrderException
     */
    public List<CommonOrderVO> getCouponHongbaoByOrderNo(Long uid, Integer state, String orderNo)
            throws CommonOrderException;
 
    /**
     * 查询订单
     * 
     * @param uid
     * @param orderNo
     * @return
     * @throws CommonOrderException
     */
    public CommonOrderVO getCommonOrderByOrderNo(Long uid, String orderNo, Integer orderState)
            throws CommonOrderException;
 
    /**
     * 使用奖励券成功后跳转 修改
     * 
     * @param orderNo
     * @return
     */
    public JSONObject getRewardJumpInfo(String orderNo);
 
    /**
     * 根据交易号获取订单详情
     * 
     * @param sourceType
     * @param tradeId
     * @return
     */
    public CommonOrder selectBySourceTypeAndTradeId(int sourceType, String tradeId);
 
    /**
     * 删除错误订单
     * 
     * @param coId
     */
    public void deleteErrorCommonOrder(Long coId);
 
    /**
     * 根据订单类型与交易ID查询
     * 
     * @param sourceType
     * @param tradeId
     * @return
     */
    public List<CommonOrder> listBySourceTypeAndTradeId(int sourceType, String tradeId);
 
    /**
     * 根据条件查询订单
     * 
     * @param sourceType
     * @param state
     * @param minTime
     * @param maxTime
     * @param page
     * @param pageSize
     * @return
     */
    List<CommonOrder> listBySourceTypeAndStateAndThirdCrateTime(int sourceType, Integer state, Long minTime,
            Long maxTime, int page, int pageSize);
 
}