|
|
@@ -16,10 +16,10 @@ import com.cyksj.model.entity.GoodsDonSku;
|
|
|
import com.cyksj.model.manage.request.ReqGoodsSkuInsert;
|
|
|
import com.cyksj.model.request.CombinationSkuReq;
|
|
|
import com.cyksj.model.views.DistributeSearchView;
|
|
|
-import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.mange.CmsGoodsDonService;
|
|
|
import com.cyksj.service.mange.CmsGoodsDonSkuService;
|
|
|
import com.cyksj.service.mange.CmsGoodsDonSpecService;
|
|
|
+import com.cyksj.service.mange.RefreshCacheService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
import com.ejlchina.searcher.param.Operator;
|
|
|
@@ -57,7 +57,7 @@ public class CmsGoodsDonSkuController {
|
|
|
|
|
|
private final HttpServletRequest request;
|
|
|
|
|
|
- private final RedisService redisService;
|
|
|
+ private final RefreshCacheService refreshCacheService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -67,8 +67,7 @@ public class CmsGoodsDonSkuController {
|
|
|
@Log(module = "平台管理/新增商品sku&spec", businessType = BusinessType.POST, isSaveRequestData = true)
|
|
|
public Result<String> skuInsert(@Validated @RequestBody ReqGoodsSkuInsert insert) throws Exception{
|
|
|
goodsDonSpecService.insertOrUpdateSkuSpec(insert, false);
|
|
|
- Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "*");
|
|
|
- redisService.del(keys.toArray(String[]::new));
|
|
|
+ refreshCacheService.refreshYhHomePageCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@@ -78,8 +77,7 @@ public class CmsGoodsDonSkuController {
|
|
|
@PutMapping("/update/spec")
|
|
|
public Result<String> updateGoodsSpec(@Validated @RequestBody ReqGoodsSkuInsert insert) throws Exception {
|
|
|
goodsDonSpecService.insertOrUpdateSkuSpec(insert, true);
|
|
|
- Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "*");
|
|
|
- redisService.del(keys.toArray(String[]::new));
|
|
|
+ refreshCacheService.refreshYhHomePageCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@@ -98,8 +96,7 @@ public class CmsGoodsDonSkuController {
|
|
|
goodsDonSpecService.skuAppend(insert, goods);
|
|
|
//给平台更新额外属性
|
|
|
goodsDonService.updateGoodsSkuPrice(goods.getId(), goods);
|
|
|
- Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "*");
|
|
|
- redisService.del(keys.toArray(String[]::new));
|
|
|
+ refreshCacheService.refreshYhHomePageCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@@ -164,8 +161,7 @@ public class CmsGoodsDonSkuController {
|
|
|
goodsDonSkuService.saveOrUpdate(sku);
|
|
|
//给平台更新额外属性
|
|
|
goodsDonService.updateGoodsSkuPrice(sku.getGoodsId(), null);
|
|
|
- Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "*");
|
|
|
- redisService.del(keys.toArray(String[]::new));
|
|
|
+ refreshCacheService.refreshYhHomePageCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@@ -182,8 +178,7 @@ public class CmsGoodsDonSkuController {
|
|
|
goodsDonSkuService.handleDiscountPurchaseGoods(sku, null);
|
|
|
goodsDonSkuService.removeById(skuId);
|
|
|
goodsDonService.updateGoodsSkuPrice(sku.getGoodsId(), null);
|
|
|
- Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "*");
|
|
|
- redisService.del(keys.toArray(String[]::new));
|
|
|
+ refreshCacheService.refreshYhHomePageCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@@ -241,8 +236,7 @@ public class CmsGoodsDonSkuController {
|
|
|
.eq(GoodsDonSku::getStatus, false));
|
|
|
if (update) {
|
|
|
goodsDonService.updateGoodsSkuPrice(goodsId, null);
|
|
|
- Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "*");
|
|
|
- redisService.del(keys.toArray(String[]::new));
|
|
|
+ refreshCacheService.refreshYhHomePageCache();
|
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|