|
|
@@ -15,10 +15,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;
|
|
|
@@ -56,7 +56,7 @@ public class CmsGoodsDonSkuController {
|
|
|
|
|
|
private final HttpServletRequest request;
|
|
|
|
|
|
- private final RedisService redisService;
|
|
|
+ private final RefreshCacheService refreshCacheService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -66,8 +66,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();
|
|
|
}
|
|
|
|
|
|
@@ -77,8 +76,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();
|
|
|
}
|
|
|
|
|
|
@@ -97,8 +95,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();
|
|
|
}
|
|
|
|
|
|
@@ -163,8 +160,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();
|
|
|
}
|
|
|
|
|
|
@@ -181,8 +177,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();
|
|
|
}
|
|
|
|
|
|
@@ -240,8 +235,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();
|
|
|
}
|