|
@@ -282,26 +282,40 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -282,26 +282,40 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
282
|
@Override
|
282
|
@Override
|
283
|
public List<UnionShareSettlement> querySettlementRecord(UnionShareOrderReqBO unionShareOrderReqBO) {
|
283
|
public List<UnionShareSettlement> querySettlementRecord(UnionShareOrderReqBO unionShareOrderReqBO) {
|
284
|
//先从缓存获取
|
284
|
//先从缓存获取
|
285
|
- String key = "orderDetail";
|
285
|
+ String key = "settlementRecord";
|
286
|
UnionShareSettlementListBO cacheResult = getFromRedis(ShareOrdersKeyEnum.SETTLEMENT_LIST, unionShareOrderReqBO.getUid(),
|
286
|
UnionShareSettlementListBO cacheResult = getFromRedis(ShareOrdersKeyEnum.SETTLEMENT_LIST, unionShareOrderReqBO.getUid(),
|
287
|
UnionShareSettlementListBO.class, key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
287
|
UnionShareSettlementListBO.class, key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
288
|
if (cacheResult != null) {
|
288
|
if (cacheResult != null) {
|
289
|
- logger.info("UnionShareServiceImpl :: queryOrderDetail get redis cache ,uid is {},cacheResult is {}",unionShareOrderReqBO.getUid(),cacheResult);
|
289
|
+ logger.info("UnionShareServiceImpl :: querySettlementRecord get redis cache ,uid is {},cacheResult is {}",unionShareOrderReqBO.getUid(),cacheResult);
|
290
|
return cacheResult.getList();
|
290
|
return cacheResult.getList();
|
291
|
}
|
291
|
}
|
|
|
292
|
+ //数据库获取
|
292
|
List<UnionShareSettlement> unionShareSettlement = unionShareSettlementMapper.selectSettlementRecordByUid(unionShareOrderReqBO.getUid(),
|
293
|
List<UnionShareSettlement> unionShareSettlement = unionShareSettlementMapper.selectSettlementRecordByUid(unionShareOrderReqBO.getUid(),
|
293
|
unionShareOrderReqBO.getPage()*unionShareOrderReqBO.getSize(), unionShareOrderReqBO.getSize());
|
294
|
unionShareOrderReqBO.getPage()*unionShareOrderReqBO.getSize(), unionShareOrderReqBO.getSize());
|
294
|
//设置缓存
|
295
|
//设置缓存
|
295
|
UnionShareSettlementListBO unionShareSettlementListBO = new UnionShareSettlementListBO();
|
296
|
UnionShareSettlementListBO unionShareSettlementListBO = new UnionShareSettlementListBO();
|
296
|
unionShareSettlementListBO.setList(unionShareSettlement);
|
297
|
unionShareSettlementListBO.setList(unionShareSettlement);
|
297
|
- addToRedis(ShareOrdersKeyEnum.ORDER_INFO,unionShareOrderReqBO.getUid(),unionShareSettlementListBO,key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
298
|
+ addToRedis(ShareOrdersKeyEnum.SETTLEMENT_LIST,unionShareOrderReqBO.getUid(),unionShareSettlementListBO,key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
298
|
return unionShareSettlement;
|
299
|
return unionShareSettlement;
|
299
|
}
|
300
|
}
|
300
|
|
301
|
|
301
|
@Override
|
302
|
@Override
|
302
|
public List<UnionShareOrders> queryOrderList(UnionShareOrderReqBO unionShareOrderReqBO) {
|
303
|
public List<UnionShareOrders> queryOrderList(UnionShareOrderReqBO unionShareOrderReqBO) {
|
|
|
304
|
+ //先从缓存获取
|
|
|
305
|
+ UnionShareOrdersListBO cacheResult = getFromRedis(ShareOrdersKeyEnum.ORDER_LIST, unionShareOrderReqBO.getUid(),UnionShareOrdersListBO.class, unionShareOrderReqBO.getTab1().toString(),
|
|
|
306
|
+ unionShareOrderReqBO.getTab2().toString(), String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
|
|
307
|
+ if (cacheResult != null) {
|
|
|
308
|
+ logger.info("UnionShareServiceImpl :: queryOrderList get redis cache ,uid is {},cacheResult is {}",unionShareOrderReqBO.getUid(),cacheResult);
|
|
|
309
|
+ return cacheResult.getList();
|
|
|
310
|
+ }
|
|
|
311
|
+ //数据库获取
|
303
|
//tab1表示1、全部订单;2、有效订单;3、无效订单 tab2表示1、已付款;2、待结算;3、结算中
|
312
|
//tab1表示1、全部订单;2、有效订单;3、无效订单 tab2表示1、已付款;2、待结算;3、结算中
|
304
|
List<UnionShareOrders> unionShareOrdersList = unionShareOrdersMapper.selectOrderList(unionShareOrderReqBO);
|
313
|
List<UnionShareOrders> unionShareOrdersList = unionShareOrdersMapper.selectOrderList(unionShareOrderReqBO);
|
|
|
314
|
+ //设置缓存
|
|
|
315
|
+ UnionShareOrdersListBO unionShareOrdersListBO = new UnionShareOrdersListBO();
|
|
|
316
|
+ unionShareOrdersListBO.setList(unionShareOrdersList);
|
|
|
317
|
+ addToRedis(ShareOrdersKeyEnum.ORDER_LIST,unionShareOrderReqBO.getUid(),unionShareOrdersListBO,unionShareOrderReqBO.getTab1().toString(), unionShareOrderReqBO.getTab2().toString(),
|
|
|
318
|
+ String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
305
|
return unionShareOrdersList;
|
319
|
return unionShareOrdersList;
|
306
|
}
|
320
|
}
|
307
|
|
321
|
|
|
@@ -669,6 +683,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -669,6 +683,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
669
|
redisHashCache.delete(ShareOrdersKeyEnum.ORDER_LIST.getPreKey(),uid);
|
683
|
redisHashCache.delete(ShareOrdersKeyEnum.ORDER_LIST.getPreKey(),uid);
|
670
|
redisHashCache.delete(ShareOrdersKeyEnum.SETTLEMENT_LIST.getPreKey(),uid);
|
684
|
redisHashCache.delete(ShareOrdersKeyEnum.SETTLEMENT_LIST.getPreKey(),uid);
|
671
|
redisHashCache.delete(ShareOrdersKeyEnum.USER_SETTLEMENT.getPreKey(),uid);
|
685
|
redisHashCache.delete(ShareOrdersKeyEnum.USER_SETTLEMENT.getPreKey(),uid);
|
|
|
686
|
+ redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),uid);
|
|
|
687
|
+ redisHashCache.delete(ShareOrdersKeyEnum.RECENTLY_ORDER_LIMIT_TEN.getPreKey(),uid);
|
672
|
}
|
688
|
}
|
673
|
|
689
|
|
674
|
@Override
|
690
|
@Override
|