|
@@ -96,7 +96,7 @@ public class GoodsDonController {
|
|
|
if (StrUtil.isNotBlank(customId)) {
|
|
if (StrUtil.isNotBlank(customId)) {
|
|
|
yhsId = yhShopFrontService.getYhsIdByCustomId(customId);
|
|
yhsId = yhShopFrontService.getYhsIdByCustomId(customId);
|
|
|
}
|
|
}
|
|
|
- String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "category";
|
|
|
|
|
|
|
+ String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "category";
|
|
|
if (yhsId != null) {
|
|
if (yhsId != null) {
|
|
|
key += ":yhShop:" + yhsId;
|
|
key += ":yhShop:" + yhsId;
|
|
|
}
|
|
}
|
|
@@ -231,7 +231,7 @@ public class GoodsDonController {
|
|
|
}
|
|
}
|
|
|
//List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
//List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
List<Long> filter_goodsIds = null;
|
|
List<Long> filter_goodsIds = null;
|
|
|
- String pcCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "PC";
|
|
|
|
|
|
|
+ String pcCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "PC";
|
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
|
pcCacheKey += ":hz-ip";
|
|
pcCacheKey += ":hz-ip";
|
|
|
}
|
|
}
|
|
@@ -274,7 +274,7 @@ public class GoodsDonController {
|
|
|
}
|
|
}
|
|
|
//List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
//List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
List<Long> filter_goodsIds = null;
|
|
List<Long> filter_goodsIds = null;
|
|
|
- String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "H5";
|
|
|
|
|
|
|
+ String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "H5";
|
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
|
h5CacheKey += ":hz-ip";
|
|
h5CacheKey += ":hz-ip";
|
|
|
}
|
|
}
|
|
@@ -310,7 +310,7 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/register")
|
|
@GetMapping("/get/register")
|
|
|
public Result<List<RegisterGoodsDonView>> getRegisterGoodsDon() {
|
|
public Result<List<RegisterGoodsDonView>> getRegisterGoodsDon() {
|
|
|
- String registerCacheKey = RedisService.key.REGISTER_HOME_PAGE_CACHE.getEnvName();
|
|
|
|
|
|
|
+ String registerCacheKey = RedisService.key.REGISTER_HOME_PAGE_CACHE.getName();
|
|
|
Object value = redisService.get(registerCacheKey);
|
|
Object value = redisService.get(registerCacheKey);
|
|
|
if (value != null) {
|
|
if (value != null) {
|
|
|
try {
|
|
try {
|
|
@@ -344,7 +344,7 @@ public class GoodsDonController {
|
|
|
Result<YhShopGoodsFrontView> yhShopGoodsDetail = getGoodsDetailByYhsId(yhShopFrontService.getYhsIdByCustomId(customId), id);
|
|
Result<YhShopGoodsFrontView> yhShopGoodsDetail = getGoodsDetailByYhsId(yhShopFrontService.getYhsIdByCustomId(customId), id);
|
|
|
return yhShopGoodsDetail;
|
|
return yhShopGoodsDetail;
|
|
|
}
|
|
}
|
|
|
- String goodsDetailKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "goods_detail:" + id;
|
|
|
|
|
|
|
+ String goodsDetailKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "goods_detail:" + id;
|
|
|
//List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
//List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
List<Long> filter_goodsIds = null;
|
|
List<Long> filter_goodsIds = null;
|
|
|
//存在过滤平台 商品详情不返回
|
|
//存在过滤平台 商品详情不返回
|
|
@@ -450,11 +450,11 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/recommend/{id}")
|
|
@GetMapping("/get/recommend/{id}")
|
|
|
public Result<List<GoodsFrontListView>> getRecommendGoodsByGid(@PathVariable Long id, String customId, String dsCode) throws Exception {
|
|
public Result<List<GoodsFrontListView>> getRecommendGoodsByGid(@PathVariable Long id, String customId, String dsCode) throws Exception {
|
|
|
- String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "recommend:" + id;
|
|
|
|
|
|
|
+ String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "recommend:" + id;
|
|
|
Long yhsId = null;
|
|
Long yhsId = null;
|
|
|
if (StrUtil.isNotBlank(customId)) {
|
|
if (StrUtil.isNotBlank(customId)) {
|
|
|
yhsId = yhShopFrontService.getYhsIdByCustomId(customId);
|
|
yhsId = yhShopFrontService.getYhsIdByCustomId(customId);
|
|
|
- key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhsId + ":recommend:" + id;
|
|
|
|
|
|
|
+ key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId + ":recommend:" + id;
|
|
|
}
|
|
}
|
|
|
Object o = redisService.get(key);
|
|
Object o = redisService.get(key);
|
|
|
Long fUid = StpUserUtil.getUserIdAfterLogin();
|
|
Long fUid = StpUserUtil.getUserIdAfterLogin();
|
|
@@ -554,11 +554,11 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/homeManage")
|
|
@GetMapping("/get/homeManage")
|
|
|
public Result<Map<String, List<HomeManagementFrontView>>> getHomeManagementFrontPage(String customId, String dsCode) {
|
|
public Result<Map<String, List<HomeManagementFrontView>>> getHomeManagementFrontPage(String customId, String dsCode) {
|
|
|
- String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "homeManage";
|
|
|
|
|
|
|
+ String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "homeManage";
|
|
|
Long yhsId = null;
|
|
Long yhsId = null;
|
|
|
if (StrUtil.isNotBlank(customId)) {
|
|
if (StrUtil.isNotBlank(customId)) {
|
|
|
yhsId = yhShopFrontService.getYhsIdByCustomId(customId);
|
|
yhsId = yhShopFrontService.getYhsIdByCustomId(customId);
|
|
|
- key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhsId + ":homeManage";
|
|
|
|
|
|
|
+ key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId + ":homeManage";
|
|
|
}
|
|
}
|
|
|
// List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
// List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
List<Long> filter_goodsIds = null;
|
|
List<Long> filter_goodsIds = null;
|
|
@@ -733,7 +733,7 @@ public class GoodsDonController {
|
|
|
if (fUid != null) {
|
|
if (fUid != null) {
|
|
|
if (data.getIsSp()) {
|
|
if (data.getIsSp()) {
|
|
|
//查找所有特定规格最小价格 满足条件
|
|
//查找所有特定规格最小价格 满足条件
|
|
|
- String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "specific:" + data.getId();
|
|
|
|
|
|
|
+ String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "specific:" + data.getId();
|
|
|
Object speciObj = redisService.get(specificGoodsKey);
|
|
Object speciObj = redisService.get(specificGoodsKey);
|
|
|
List<GoodsDonSku> specificSkus = null;
|
|
List<GoodsDonSku> specificSkus = null;
|
|
|
if (speciObj != null) {
|
|
if (speciObj != null) {
|
|
@@ -785,7 +785,7 @@ public class GoodsDonController {
|
|
|
if (fUid != null) {
|
|
if (fUid != null) {
|
|
|
if (data.getIsSp()) {
|
|
if (data.getIsSp()) {
|
|
|
//查找所有特定规格最小价格 满足条件
|
|
//查找所有特定规格最小价格 满足条件
|
|
|
- String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "specific:" + data.getId();
|
|
|
|
|
|
|
+ String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "specific:" + data.getId();
|
|
|
Object speciObj = redisService.get(specificGoodsKey);
|
|
Object speciObj = redisService.get(specificGoodsKey);
|
|
|
List<GoodsDonSku> specificSkus = null;
|
|
List<GoodsDonSku> specificSkus = null;
|
|
|
if (speciObj != null) {
|
|
if (speciObj != null) {
|
|
@@ -835,7 +835,7 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
public List<GoodsDonSku> getSpecificSku(Long goodsId) {
|
|
public List<GoodsDonSku> getSpecificSku(Long goodsId) {
|
|
|
//查找所有特定规格最小价格 满足条件
|
|
//查找所有特定规格最小价格 满足条件
|
|
|
- String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "specific:" + goodsId;
|
|
|
|
|
|
|
+ String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "specific:" + goodsId;
|
|
|
Object speciObj = redisService.get(specificGoodsKey);
|
|
Object speciObj = redisService.get(specificGoodsKey);
|
|
|
List<GoodsDonSku> specificSkus = null;
|
|
List<GoodsDonSku> specificSkus = null;
|
|
|
if (speciObj != null) {
|
|
if (speciObj != null) {
|
|
@@ -917,7 +917,7 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/shop/goods/{yhsId}")
|
|
@GetMapping("/get/shop/goods/{yhsId}")
|
|
|
public Result<List<YhShopGoodsFrontView>> getShopGoods(@PathVariable Long yhsId) {
|
|
public Result<List<YhShopGoodsFrontView>> getShopGoods(@PathVariable Long yhsId) {
|
|
|
- String yhShopCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhsId;
|
|
|
|
|
|
|
+ String yhShopCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId;
|
|
|
Object value = redisService.get(yhShopCacheKey);
|
|
Object value = redisService.get(yhShopCacheKey);
|
|
|
List<YhShopGoodsFrontView> list = null;
|
|
List<YhShopGoodsFrontView> list = null;
|
|
|
if (value != null) {
|
|
if (value != null) {
|
|
@@ -945,22 +945,29 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/shop/goods/detail/{yhsId}/{goodsId}")
|
|
@GetMapping("/get/shop/goods/detail/{yhsId}/{goodsId}")
|
|
|
public Result<YhShopGoodsFrontView> getGoodsDetailByYhsId(@PathVariable Long yhsId, @PathVariable Long goodsId) {
|
|
public Result<YhShopGoodsFrontView> getGoodsDetailByYhsId(@PathVariable Long yhsId, @PathVariable Long goodsId) {
|
|
|
- MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
|
|
- String condition = String.format("and yhs_id = %s and ys.goods_id = %s", yhsId, goodsId);
|
|
|
|
|
- builder.put("condition", condition);
|
|
|
|
|
- YhShopGoodsFrontView goodsDetailView = beanSearcher.searchFirst(YhShopGoodsFrontView.class, builder.build());
|
|
|
|
|
- if (goodsDetailView == null) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("该平台不存在或已下架,请刷新页面");
|
|
|
|
|
- }
|
|
|
|
|
- goodsDetailView.setSkuList(beanSearcher.searchAll(YhShopGoodsSkuFrontView.class, MapUtils.builder().put("condition", condition).orderBy(YhShopGoodsSkuFrontView::getSorted).asc().build()));
|
|
|
|
|
- goodsDetailView.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, goodsDetailView.getId()).build()));
|
|
|
|
|
- OrderCommentFrontView comments = beanSearcher.searchFirst(OrderCommentFrontView.class, MapUtils.builder()
|
|
|
|
|
- .field(OrderCommentFrontView::getGoodsId, goodsDetailView.getId())
|
|
|
|
|
- .orderBy(OrderCommentFrontView::getCommentTime).desc()
|
|
|
|
|
- .orderBy(OrderCommentFrontView::getId).desc()
|
|
|
|
|
- .build());
|
|
|
|
|
- goodsDetailView.setComments(comments);
|
|
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDetailView);
|
|
|
|
|
|
|
+ String yhShopDetailCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId + ":goodsId:" + goodsId;
|
|
|
|
|
+ Object value = redisService.get(yhShopDetailCacheKey);
|
|
|
|
|
+ if (value == null) {
|
|
|
|
|
+ MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
|
|
+ String condition = String.format("and yhs_id = %s and ys.goods_id = %s", yhsId, goodsId);
|
|
|
|
|
+ builder.put("condition", condition);
|
|
|
|
|
+ YhShopGoodsFrontView goodsDetailView = beanSearcher.searchFirst(YhShopGoodsFrontView.class, builder.build());
|
|
|
|
|
+ if (goodsDetailView == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("该平台不存在或已下架,请刷新页面");
|
|
|
|
|
+ }
|
|
|
|
|
+ goodsDetailView.setSkuList(beanSearcher.searchAll(YhShopGoodsSkuFrontView.class, MapUtils.builder().put("condition", condition).orderBy(YhShopGoodsSkuFrontView::getSorted).asc().build()));
|
|
|
|
|
+ goodsDetailView.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, goodsDetailView.getId()).build()));
|
|
|
|
|
+ OrderCommentFrontView comments = beanSearcher.searchFirst(OrderCommentFrontView.class, MapUtils.builder()
|
|
|
|
|
+ .field(OrderCommentFrontView::getGoodsId, goodsDetailView.getId())
|
|
|
|
|
+ .orderBy(OrderCommentFrontView::getCommentTime).desc()
|
|
|
|
|
+ .orderBy(OrderCommentFrontView::getId).desc()
|
|
|
|
|
+ .build());
|
|
|
|
|
+ goodsDetailView.setComments(comments);
|
|
|
|
|
+ redisService.setNx(yhShopDetailCacheKey, goodsDetailView, RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getTimeout() + RandomUtil.randomInt(1000));
|
|
|
|
|
+ value = redisService.get(yhShopDetailCacheKey);
|
|
|
|
|
+ }
|
|
|
|
|
+ YhShopGoodsFrontView goodsDetailView = Jsons.parseObject(value, YhShopGoodsFrontView.class);
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDetailView);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -973,7 +980,7 @@ public class GoodsDonController {
|
|
|
return shopGoods;
|
|
return shopGoods;
|
|
|
}
|
|
}
|
|
|
Long fUid = StpUserUtil.getUserIdAfterLogin();
|
|
Long fUid = StpUserUtil.getUserIdAfterLogin();
|
|
|
- String categoryGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "category:goods";
|
|
|
|
|
|
|
+ String categoryGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "category:goods";
|
|
|
if (cgy != null) {
|
|
if (cgy != null) {
|
|
|
categoryGoodsKey += ":" + cgy;
|
|
categoryGoodsKey += ":" + cgy;
|
|
|
}
|
|
}
|
|
@@ -1051,7 +1058,7 @@ public class GoodsDonController {
|
|
|
|
|
|
|
|
@GetMapping("/get/shop/categoryGoods/{yhsId}")
|
|
@GetMapping("/get/shop/categoryGoods/{yhsId}")
|
|
|
public Result<List<YhShopGoodsFrontCategoryView>> getShopCategoryGoods(@PathVariable Long yhsId, Long category) {
|
|
public Result<List<YhShopGoodsFrontCategoryView>> getShopCategoryGoods(@PathVariable Long yhsId, Long category) {
|
|
|
- String categoryGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + yhsId + ":category";
|
|
|
|
|
|
|
+ String categoryGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + yhsId + ":category";
|
|
|
if (category != null) {
|
|
if (category != null) {
|
|
|
categoryGoodsKey += ":" + category;
|
|
categoryGoodsKey += ":" + category;
|
|
|
}
|
|
}
|
|
@@ -1101,7 +1108,7 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/deposit")
|
|
@GetMapping("/get/deposit")
|
|
|
public Result<? extends Object> getDepositGoods() {
|
|
public Result<? extends Object> getDepositGoods() {
|
|
|
- String depositGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "deposit";
|
|
|
|
|
|
|
+ String depositGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "deposit";
|
|
|
Object o = redisService.get(depositGoodsKey);
|
|
Object o = redisService.get(depositGoodsKey);
|
|
|
if (o == null) {
|
|
if (o == null) {
|
|
|
List<GoodsDon> depositList = beanSearcher.searchAll(GoodsDon.class, MapUtils.builder()
|
|
List<GoodsDon> depositList = beanSearcher.searchAll(GoodsDon.class, MapUtils.builder()
|
|
@@ -1125,7 +1132,7 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/pc/homeManage")
|
|
@GetMapping("/get/pc/homeManage")
|
|
|
public Result<Map<String, List<HomeManagementFrontView>>> getPcHomeManagementFrontPage() {
|
|
public Result<Map<String, List<HomeManagementFrontView>>> getPcHomeManagementFrontPage() {
|
|
|
- String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "pc:homeManage";
|
|
|
|
|
|
|
+ String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "pc:homeManage";
|
|
|
//移除奈飞客厅 临时
|
|
//移除奈飞客厅 临时
|
|
|
Long filterConfigId = null;
|
|
Long filterConfigId = null;
|
|
|
// if (isHzIp()) {
|
|
// if (isHzIp()) {
|
|
@@ -1153,7 +1160,7 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/pc/realGoodsConfig")
|
|
@GetMapping("/get/pc/realGoodsConfig")
|
|
|
public Result<? extends Object> getPcRealGoodsConfig() throws Exception {
|
|
public Result<? extends Object> getPcRealGoodsConfig() throws Exception {
|
|
|
- String key = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "pc:realHomePage";
|
|
|
|
|
|
|
+ String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "pc:realHomePage";
|
|
|
Object o = redisService.get(key);
|
|
Object o = redisService.get(key);
|
|
|
List<HomeManagementFrontView> list = null;
|
|
List<HomeManagementFrontView> list = null;
|
|
|
if (o == null) {
|
|
if (o == null) {
|
|
@@ -1172,7 +1179,7 @@ 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.getEnvName() + "subsidy";
|
|
|
|
|
|
|
+ String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "subsidy";
|
|
|
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());
|
|
List<GoodsDonSkuSubsidyFrontView> subsidyList = beanSearcher.searchAll(GoodsDonSkuSubsidyFrontView.class, MapUtils.builder().build());
|
|
@@ -1209,7 +1216,7 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/subsidy/detail/{id}")
|
|
@GetMapping("/get/subsidy/detail/{id}")
|
|
|
public Result<GoodsDonSubsidyDetailView> getSubsidyDetailById(@PathVariable Long id) throws Exception {
|
|
public Result<GoodsDonSubsidyDetailView> getSubsidyDetailById(@PathVariable Long id) throws Exception {
|
|
|
- String goodsDetailKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "subsidy:detail:" + id;
|
|
|
|
|
|
|
+ String goodsDetailKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "subsidy:detail:" + id;
|
|
|
Object o = redisService.get(goodsDetailKey);
|
|
Object o = redisService.get(goodsDetailKey);
|
|
|
GoodsDonSubsidyDetailView subsidyDetail = null;
|
|
GoodsDonSubsidyDetailView subsidyDetail = null;
|
|
|
if (o == null) {
|
|
if (o == null) {
|
|
@@ -1238,7 +1245,17 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/available/subsidy/sku/{goodsId}")
|
|
@GetMapping("/get/available/subsidy/sku/{goodsId}")
|
|
|
public Result<List<GoodsDonSkuSubsidyAvailableView>> getAvailableSubsidySku(@PathVariable Long goodsId) {
|
|
public Result<List<GoodsDonSkuSubsidyAvailableView>> getAvailableSubsidySku(@PathVariable Long goodsId) {
|
|
|
- List<GoodsDonSkuSubsidyAvailableView> goodsDonSkuSubsidyAvailableViews = beanSearcher.searchAll(GoodsDonSkuSubsidyAvailableView.class, MapUtils.builder().put("gid", String.format(" and goods_id = %s", goodsId)).build());
|
|
|
|
|
|
|
+ String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "subsidy:" + goodsId;
|
|
|
|
|
+ Object o = redisService.get(key);
|
|
|
|
|
+ if (o == null) {
|
|
|
|
|
+ List<GoodsDonSkuSubsidyAvailableView> goodsDonSkuSubsidyAvailableViews = beanSearcher.searchAll(GoodsDonSkuSubsidyAvailableView.class, MapUtils.builder().put("gid", String.format(" and goods_id = %s", goodsId)).build());
|
|
|
|
|
+ if (CollUtil.isEmpty(goodsDonSkuSubsidyAvailableViews)) {
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
|
|
+ }
|
|
|
|
|
+ redisService.set(key, goodsDonSkuSubsidyAvailableViews, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout() + RandomUtil.randomInt(10000));
|
|
|
|
|
+ o = redisService.get(key);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<GoodsDonSkuSubsidyAvailableView> goodsDonSkuSubsidyAvailableViews = Jsons.parseList(o, GoodsDonSkuSubsidyAvailableView.class);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDonSkuSubsidyAvailableViews);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDonSkuSubsidyAvailableViews);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1248,7 +1265,7 @@ public class GoodsDonController {
|
|
|
@GetMapping("/get/shop/homeManage")
|
|
@GetMapping("/get/shop/homeManage")
|
|
|
public Result<Map<String, List<HomeManagementFrontView>>> getShopHomeManageConfig(String customId) {
|
|
public Result<Map<String, List<HomeManagementFrontView>>> getShopHomeManageConfig(String customId) {
|
|
|
//是否同意展示对应首页广告位
|
|
//是否同意展示对应首页广告位
|
|
|
- String key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getEnvName() + customId + ":homeManage";
|
|
|
|
|
|
|
+ String key = RedisService.key.YH_HOME_PAGHE_CACHE_SHOP.getName() + customId + ":homeManage";
|
|
|
Object o = redisService.get(key);
|
|
Object o = redisService.get(key);
|
|
|
if (o == null) {
|
|
if (o == null) {
|
|
|
MapBuilder builder = MapUtils.builder()
|
|
MapBuilder builder = MapUtils.builder()
|
|
@@ -1272,7 +1289,8 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/upgradePackage")
|
|
@GetMapping("/get/upgradePackage")
|
|
|
public Result<SearchResult<UpgradePackageView>> list(Long skuId) {
|
|
public Result<SearchResult<UpgradePackageView>> list(Long skuId) {
|
|
|
- log.info("获取套餐列表");
|
|
|
|
|
|
|
+ long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
|
|
+ log.info("userId:{}获取套餐列表", userId);
|
|
|
Map<String, Object> build = MapUtils.flatBuilder(request.getParameterMap()).build();
|
|
Map<String, Object> build = MapUtils.flatBuilder(request.getParameterMap()).build();
|
|
|
if (skuId != null) {
|
|
if (skuId != null) {
|
|
|
build.put("sku", String.format(" and JSON_CONTAINS(up.sku_ids,'\"%s\"')", skuId));
|
|
build.put("sku", String.format(" and JSON_CONTAINS(up.sku_ids,'\"%s\"')", skuId));
|