|
@@ -287,25 +287,23 @@ public class GoodsDonController {
|
|
|
* h5 银河首页平台展示
|
|
* h5 银河首页平台展示
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/homePage")
|
|
@GetMapping("/get/homePage")
|
|
|
- @Deprecated
|
|
|
|
|
public Result<? extends Object> getGoodsHomePage(String customId) {
|
|
public Result<? extends Object> getGoodsHomePage(String customId) {
|
|
|
if (StrUtil.isNotBlank(customId)) {
|
|
if (StrUtil.isNotBlank(customId)) {
|
|
|
Result<List<YhShopGoodsFrontView>> shopGoods = getShopGoods(yhShopFrontService.getYhsIdByCustomId(customId));
|
|
Result<List<YhShopGoodsFrontView>> shopGoods = getShopGoods(yhShopFrontService.getYhsIdByCustomId(customId));
|
|
|
return shopGoods;
|
|
return shopGoods;
|
|
|
}
|
|
}
|
|
|
- //List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
|
|
- List<Long> filter_goodsIds = null;
|
|
|
|
|
|
|
+ Long fUid = StpUserUtil.getUserIdAfterLogin();
|
|
|
|
|
+ Boolean filterGoodsIds = isFilterGoodsIds(fUid);
|
|
|
String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "H5";
|
|
String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "H5";
|
|
|
- if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
|
|
|
- h5CacheKey += ":hz-ip";
|
|
|
|
|
|
|
+ if (filterGoodsIds) {
|
|
|
|
|
+ h5CacheKey += ":filter-ip";
|
|
|
}
|
|
}
|
|
|
- Long fUid = StpUserUtil.getUserIdAfterLogin();
|
|
|
|
|
Object o = redisService.get(h5CacheKey);
|
|
Object o = redisService.get(h5CacheKey);
|
|
|
List<GoodsFrontListView> list = null;
|
|
List<GoodsFrontListView> list = null;
|
|
|
if (o == null) {
|
|
if (o == null) {
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
- if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
|
|
|
- builder.field(GoodsFrontListView::getId, filter_goodsIds).op(Operator.NotIn);
|
|
|
|
|
|
|
+ if (filterGoodsIds) {
|
|
|
|
|
+ builder.field(GoodsFrontListView::getIsFilter, Boolean.FALSE);
|
|
|
}
|
|
}
|
|
|
list = beanSearcher.searchAll(GoodsFrontListView.class, builder.build());
|
|
list = beanSearcher.searchAll(GoodsFrontListView.class, builder.build());
|
|
|
redisService.setNx(h5CacheKey, list, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
|
|
redisService.setNx(h5CacheKey, list, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
|
|
@@ -1331,9 +1329,18 @@ public class GoodsDonController {
|
|
|
@GetMapping("/get/subsidy")
|
|
@GetMapping("/get/subsidy")
|
|
|
public Result<List<GoodsDonSkuSubsidyFrontView>> getSubsidyGoods() {
|
|
public Result<List<GoodsDonSkuSubsidyFrontView>> getSubsidyGoods() {
|
|
|
String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "subsidy";
|
|
String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "subsidy";
|
|
|
|
|
+ Long fUid = StpUserUtil.getUserIdAfterLogin();
|
|
|
|
|
+ Boolean filterGoodsIds = isFilterGoodsIds(fUid);
|
|
|
|
|
+ if (filterGoodsIds) {
|
|
|
|
|
+ key += ":filter-ip";
|
|
|
|
|
+ }
|
|
|
Object o = redisService.get(key);
|
|
Object o = redisService.get(key);
|
|
|
if (o == null) {
|
|
if (o == null) {
|
|
|
- List<GoodsDonSkuSubsidyFrontView> subsidyList = beanSearcher.searchAll(GoodsDonSkuSubsidyFrontView.class, MapUtils.builder().build());
|
|
|
|
|
|
|
+ MapBuilder builder = MapUtils.builder();
|
|
|
|
|
+ if (filterGoodsIds) {
|
|
|
|
|
+ builder.field(GoodsDonSkuSubsidyFrontView::getIsFilter, Boolean.FALSE);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<GoodsDonSkuSubsidyFrontView> subsidyList = beanSearcher.searchAll(GoodsDonSkuSubsidyFrontView.class, builder.build());
|
|
|
subsidyList.forEach(e -> {
|
|
subsidyList.forEach(e -> {
|
|
|
Optional.ofNullable(beanSearcher.searchFirst(GoodsDonSkuSubsidyDetailView.class, MapUtils.builder().field(GoodsDonSkuSubsidyDetailView::getGoodsId, e.getId()).field(GoodsDonSkuSubsidyDetailView::getPrice, e.getPrice()).build())).ifPresent(sku -> {
|
|
Optional.ofNullable(beanSearcher.searchFirst(GoodsDonSkuSubsidyDetailView.class, MapUtils.builder().field(GoodsDonSkuSubsidyDetailView::getGoodsId, e.getId()).field(GoodsDonSkuSubsidyDetailView::getPrice, e.getPrice()).build())).ifPresent(sku -> {
|
|
|
e.setOriPrice(sku.getOriPrice());
|
|
e.setOriPrice(sku.getOriPrice());
|