|
|
@@ -103,6 +103,11 @@ public class GoodsDonController {
|
|
|
if (yhsId != null) {
|
|
|
key += ":yhShop:" + yhsId;
|
|
|
}
|
|
|
+ Long fUid = StpUserUtil.getUserIdAfterLogin();
|
|
|
+ Boolean filterGoodsIds = isFilterGoodsIds(fUid);
|
|
|
+ if (filterGoodsIds) {
|
|
|
+ key += ":filter-ip";
|
|
|
+ }
|
|
|
String lang = request.getHeader("lang");
|
|
|
AtomicBoolean language = new AtomicBoolean(false);
|
|
|
if (lang != null && !StrUtil.equals(UserPageLanguage.Language.zh_CN.name(), lang)) {
|
|
|
@@ -111,15 +116,20 @@ public class GoodsDonController {
|
|
|
}
|
|
|
Object o = redisService.get(key);
|
|
|
List<GoodsDonCategoryFrontView> list;
|
|
|
- MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
- String condition = " and (select count(*) from goods_don_category_relate gcr inner join goods_don g on g.id = gcr.goods_id %s where gcr.category = gc.id and g.deleted and g.status) > 0";
|
|
|
- if (yhsId != null) {
|
|
|
- condition = String.format(condition, String.format(" and (select count(*) from yh_shop_goods_sku ys where ys.goods_id = g.id and ys.status is true and ys.deleted is true and g.is_distribute is true and ys.yhs_id = %s) > 0", yhsId));
|
|
|
- } else {
|
|
|
- condition = String.format(condition, StrUtil.EMPTY);
|
|
|
- }
|
|
|
- mapBuilder.put("condition", condition);
|
|
|
if (o == null) {
|
|
|
+ MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
+ String condition = " and (select count(*) from goods_don_category_relate gcr inner join goods_don g on g.id = gcr.goods_id %s where gcr.category = gc.id and g.deleted and g.status) > 0";
|
|
|
+ String extraSql;
|
|
|
+ if (yhsId != null) {
|
|
|
+ extraSql = String.format(" and (select count(*) from yh_shop_goods_sku ys where ys.goods_id = g.id and ys.status is true and ys.deleted is true and g.is_distribute is true and ys.yhs_id = %s) > 0", yhsId);
|
|
|
+ } else {
|
|
|
+ extraSql = StrUtil.EMPTY;
|
|
|
+ }
|
|
|
+ if (filterGoodsIds) {
|
|
|
+ extraSql += " and g.is_filter = false";
|
|
|
+ }
|
|
|
+ condition = String.format(condition, extraSql);
|
|
|
+ mapBuilder.put("condition", condition);
|
|
|
list = beanSearcher.searchAll(GoodsDonCategoryFrontView.class, mapBuilder
|
|
|
.build());
|
|
|
//多语言
|
|
|
@@ -135,7 +145,7 @@ public class GoodsDonController {
|
|
|
List<GoodsDonCategoryGoodsView> goodsDonCategoryGoodsViews = beanSearcher.searchAll(GoodsDonCategoryGoodsView.class, MapUtils.builder().field(GoodsDonCategoryGoodsView::getCategory, data.getId()).field(GoodsDonCategoryGoodsView::getStatus, 1).onlySelect(GoodsDonCategoryGoodsView::getGoodsId).build());
|
|
|
List<Long> collect = goodsDonCategoryGoodsViews.stream().map(GoodsDonCategoryGoodsView::getGoodsId).distinct().collect(Collectors.toList());
|
|
|
if (CollUtil.isNotEmpty(gptBuyGids) && gptBuyGids.containsAll(collect)) {
|
|
|
- data.setIsGptGift(true);
|
|
|
+ data.setIsGptGift(true);
|
|
|
}
|
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(list);
|