...
|
...
|
@@ -282,26 +282,40 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
@Override
|
|
|
public List<UnionShareSettlement> querySettlementRecord(UnionShareOrderReqBO unionShareOrderReqBO) {
|
|
|
//先从缓存获取
|
|
|
String key = "orderDetail";
|
|
|
String key = "settlementRecord";
|
|
|
UnionShareSettlementListBO cacheResult = getFromRedis(ShareOrdersKeyEnum.SETTLEMENT_LIST, unionShareOrderReqBO.getUid(),
|
|
|
UnionShareSettlementListBO.class, key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
|
|
if (cacheResult != null) {
|
|
|
logger.info("UnionShareServiceImpl :: queryOrderDetail get redis cache ,uid is {},cacheResult is {}",unionShareOrderReqBO.getUid(),cacheResult);
|
|
|
logger.info("UnionShareServiceImpl :: querySettlementRecord get redis cache ,uid is {},cacheResult is {}",unionShareOrderReqBO.getUid(),cacheResult);
|
|
|
return cacheResult.getList();
|
|
|
}
|
|
|
//数据库获取
|
|
|
List<UnionShareSettlement> unionShareSettlement = unionShareSettlementMapper.selectSettlementRecordByUid(unionShareOrderReqBO.getUid(),
|
|
|
unionShareOrderReqBO.getPage()*unionShareOrderReqBO.getSize(), unionShareOrderReqBO.getSize());
|
|
|
//设置缓存
|
|
|
UnionShareSettlementListBO unionShareSettlementListBO = new UnionShareSettlementListBO();
|
|
|
unionShareSettlementListBO.setList(unionShareSettlement);
|
|
|
addToRedis(ShareOrdersKeyEnum.ORDER_INFO,unionShareOrderReqBO.getUid(),unionShareSettlementListBO,key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
|
|
addToRedis(ShareOrdersKeyEnum.SETTLEMENT_LIST,unionShareOrderReqBO.getUid(),unionShareSettlementListBO,key, String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
|
|
return unionShareSettlement;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<UnionShareOrders> queryOrderList(UnionShareOrderReqBO unionShareOrderReqBO) {
|
|
|
//先从缓存获取
|
|
|
UnionShareOrdersListBO cacheResult = getFromRedis(ShareOrdersKeyEnum.ORDER_LIST, unionShareOrderReqBO.getUid(),UnionShareOrdersListBO.class, unionShareOrderReqBO.getTab1().toString(),
|
|
|
unionShareOrderReqBO.getTab2().toString(), String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
|
|
if (cacheResult != null) {
|
|
|
logger.info("UnionShareServiceImpl :: queryOrderList get redis cache ,uid is {},cacheResult is {}",unionShareOrderReqBO.getUid(),cacheResult);
|
|
|
return cacheResult.getList();
|
|
|
}
|
|
|
//数据库获取
|
|
|
//tab1表示1、全部订单;2、有效订单;3、无效订单 tab2表示1、已付款;2、待结算;3、结算中
|
|
|
List<UnionShareOrders> unionShareOrdersList = unionShareOrdersMapper.selectOrderList(unionShareOrderReqBO);
|
|
|
//设置缓存
|
|
|
UnionShareOrdersListBO unionShareOrdersListBO = new UnionShareOrdersListBO();
|
|
|
unionShareOrdersListBO.setList(unionShareOrdersList);
|
|
|
addToRedis(ShareOrdersKeyEnum.ORDER_LIST,unionShareOrderReqBO.getUid(),unionShareOrdersListBO,unionShareOrderReqBO.getTab1().toString(), unionShareOrderReqBO.getTab2().toString(),
|
|
|
String.valueOf(unionShareOrderReqBO.getPage()), String.valueOf(unionShareOrderReqBO.getSize()));
|
|
|
return unionShareOrdersList;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -669,6 +683,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
redisHashCache.delete(ShareOrdersKeyEnum.ORDER_LIST.getPreKey(),uid);
|
|
|
redisHashCache.delete(ShareOrdersKeyEnum.SETTLEMENT_LIST.getPreKey(),uid);
|
|
|
redisHashCache.delete(ShareOrdersKeyEnum.USER_SETTLEMENT.getPreKey(),uid);
|
|
|
redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),uid);
|
|
|
redisHashCache.delete(ShareOrdersKeyEnum.RECENTLY_ORDER_LIMIT_TEN.getPreKey(),uid);
|
|
|
}
|
|
|
|
|
|
@Override
|
...
|
...
|
|