|
@@ -1062,7 +1062,7 @@ public class GoodsDonController {
|
|
|
.orderBy(OrderCommentFrontView::getId).desc()
|
|
.orderBy(OrderCommentFrontView::getId).desc()
|
|
|
.build());
|
|
.build());
|
|
|
goodsDetailView.setComments(comments);
|
|
goodsDetailView.setComments(comments);
|
|
|
- redisService.setNx(yhShopDetailCacheKey, goodsDetailView, RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getTimeout() + RandomUtil.randomInt(1000));
|
|
|
|
|
|
|
+ redisService.setNx(yhShopDetailCacheKey, goodsDetailView, 60 * 60 * 24L);
|
|
|
value = redisService.get(yhShopDetailCacheKey);
|
|
value = redisService.get(yhShopDetailCacheKey);
|
|
|
}
|
|
}
|
|
|
YhShopGoodsFrontView goodsDetailView = Jsons.parseObject(value, YhShopGoodsFrontView.class);
|
|
YhShopGoodsFrontView goodsDetailView = Jsons.parseObject(value, YhShopGoodsFrontView.class);
|
|
@@ -1278,15 +1278,20 @@ public class GoodsDonController {
|
|
|
// }
|
|
// }
|
|
|
Object o = redisService.get(key);
|
|
Object o = redisService.get(key);
|
|
|
if (o == null) {
|
|
if (o == null) {
|
|
|
- MapBuilder builder = MapUtils.builder()
|
|
|
|
|
- .field(HomeManagementFrontView::getAdType, List.of(HomeManagementConfig.AdType.pc.name(), HomeManagementConfig.AdType.pcBanner.name(), HomeManagementConfig.AdType.pcSec.name(), HomeManagementConfig.AdType.pcDis.name())).op(Operator.InList);
|
|
|
|
|
- if (filterConfigId != null) {
|
|
|
|
|
- builder.field(HomeManagementFrontView::getHomeManageConfigId, filterConfigId).op(Operator.NotEqual);
|
|
|
|
|
- }
|
|
|
|
|
- List<HomeManagementFrontView> homeManagementFrontViews = beanSearcher.searchAll(HomeManagementFrontView.class, builder.build());
|
|
|
|
|
- Map<HomeManagementConfig.AdType, List<HomeManagementFrontView>> map = homeManagementFrontViews.stream().collect(Collectors.groupingBy(HomeManagementFrontView::getAdType));
|
|
|
|
|
- redisService.setNx(key, map, 50 * 60l);
|
|
|
|
|
- o = redisService.get(key);
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ MapBuilder builder = MapUtils.builder()
|
|
|
|
|
+ .field(HomeManagementFrontView::getAdType, List.of(HomeManagementConfig.AdType.pc.name(), HomeManagementConfig.AdType.pcBanner.name(), HomeManagementConfig.AdType.pcSec.name(), HomeManagementConfig.AdType.pcDis.name())).op(Operator.InList);
|
|
|
|
|
+ if (filterConfigId != null) {
|
|
|
|
|
+ builder.field(HomeManagementFrontView::getHomeManageConfigId, filterConfigId).op(Operator.NotEqual);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<HomeManagementFrontView> homeManagementFrontViews = beanSearcher.searchAll(HomeManagementFrontView.class, builder.build());
|
|
|
|
|
+ Map<HomeManagementConfig.AdType, List<HomeManagementFrontView>> map = homeManagementFrontViews.stream().collect(Collectors.groupingBy(HomeManagementFrontView::getAdType));
|
|
|
|
|
+ redisService.setNx(key, map, 60 * 60l * 24 * 7);
|
|
|
|
|
+ o = redisService.get(key);
|
|
|
|
|
+ }catch (Exception e) {
|
|
|
|
|
+ redisService.setNx(key, new HashMap<HomeManagementConfig.AdType, List<HomeManagementFrontView>>(), 10L);
|
|
|
|
|
+ o = redisService.get(key);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
Map<String, List<HomeManagementFrontView>> map = Jsons.parseObject(o, Map.class);
|
|
Map<String, List<HomeManagementFrontView>> map = Jsons.parseObject(o, Map.class);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(map);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(map);
|
|
@@ -1329,7 +1334,7 @@ public class GoodsDonController {
|
|
|
e.setPicture(sku.getSubsidyPicture());
|
|
e.setPicture(sku.getSubsidyPicture());
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
- redisService.setNx(key, subsidyList, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout() + 60 * RandomUtil.randomInt(10));
|
|
|
|
|
|
|
+ redisService.setNx(key, subsidyList, 60 * 60 * 24 * 7L);
|
|
|
o = redisService.get(key);
|
|
o = redisService.get(key);
|
|
|
}
|
|
}
|
|
|
List<GoodsDonSkuSubsidyFrontView> subsidyList = Jsons.parseList(o, GoodsDonSkuSubsidyFrontView.class);
|
|
List<GoodsDonSkuSubsidyFrontView> subsidyList = Jsons.parseList(o, GoodsDonSkuSubsidyFrontView.class);
|