|
|
|
@@ -118,9 +118,23 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { |
|
|
|
record.setUpdateDate(new Date()); |
|
|
|
wxCouponChannelMapper.updateByPrimaryKeySelective(record); |
|
|
|
} |
|
|
|
|
|
|
|
//清除缓存 |
|
|
|
clearCache(record.getTenantId()); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 清除c端首页卷列表缓存 |
|
|
|
* @param tenantId |
|
|
|
*/ |
|
|
|
public void clearCache(String tenantId){ |
|
|
|
for (int i = 1; i <=20 ; i++) { |
|
|
|
String key = "couponChannelList_"+tenantId+"_" + i + ":"; |
|
|
|
cdRedisTemplate.delete(key); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData addBatch(String[] ids, String[] channelId, String tanantId, Date beginTime, Date endTime) { |
|
|
|
List<WxCouponChannelAddVo> errorList = new ArrayList<>(); |
|
|
|
@@ -293,14 +307,14 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { |
|
|
|
public PageInfo<WxCouponChannelVo> listPageCVo(WxCouponChannel record, Integer pageIndex, Integer pageSize) { |
|
|
|
PageInfo<WxCouponChannelVo> pageInfo; |
|
|
|
//首页走缓存 |
|
|
|
if(EnumTargetAd.LIST.getCode().equals(record.getTargetAd()) && new Integer(6).equals(pageSize)) { |
|
|
|
//logger.info("---------chache"); |
|
|
|
String key = "couponChannelList_" + pageIndex + ":"; |
|
|
|
if(EnumTargetAd.LIST.getCode().equals(record.getTargetAd()) && new Integer(6).equals(pageSize) && pageIndex.intValue() <=20 ) { |
|
|
|
logger.info("---------chache"); |
|
|
|
String key = "couponChannelList_"+record.getTenantId()+"_" + pageIndex + ":"; |
|
|
|
ValueOperations<String, PageInfo<WxCouponChannelVo>> operations = cdRedisTemplate.opsForValue(); |
|
|
|
boolean hasKey = cdRedisTemplate.hasKey(key); |
|
|
|
if (hasKey) { |
|
|
|
pageInfo = operations.get(key); |
|
|
|
//logger.info("---------get:{}",pageInfo.getList().size()); |
|
|
|
logger.info("---------get:{}",pageInfo.getList().size()); |
|
|
|
}else{ |
|
|
|
pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponChannelMapper.findVoList(record)); |
|
|
|
} |
|
|
|
|