|
|
@@ -25,6 +25,7 @@ import com.cyksj.model.views.*;
|
|
|
import com.cyksj.service.mange.CmsGoodsDonSkuService;
|
|
|
import com.cyksj.service.mange.CmsYhShopCommonService;
|
|
|
import com.cyksj.service.mange.CmsYhShopGoodsRateService;
|
|
|
+import com.cyksj.service.mange.RefreshCacheService;
|
|
|
import com.cyksj.service.mange.business.UserBusinessRateService;
|
|
|
import com.cyksj.service.mange.statistics.StatisticsDataService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
@@ -80,6 +81,8 @@ public class CmsYhShopGoodsController {
|
|
|
|
|
|
private final CmsGoodsDonSkuService goodsDonSkuService;
|
|
|
|
|
|
+ private final RefreshCacheService refreshCacheService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取店铺平台价格
|
|
|
@@ -121,6 +124,7 @@ public class CmsYhShopGoodsController {
|
|
|
//下架店铺低于这个规格价格的品
|
|
|
goodsDonSkuService.setBelowPriceShopSkuDown(e.getSkuId(), sku.getPrice());
|
|
|
});
|
|
|
+ refreshCacheService.refreshYhHomePageCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@@ -128,6 +132,7 @@ public class CmsYhShopGoodsController {
|
|
|
* 一键设置 店铺平台通用浮动比例
|
|
|
*/
|
|
|
@PutMapping("/oneKey/set/goods/rate")
|
|
|
+ @Transactional(rollbackFor = Throwable.class)
|
|
|
public Result<Void> setShopGoodsGeneralRate(@RequestBody GoodsDonShopRateReq req) {
|
|
|
Integer rate = Optional.ofNullable(req.getRate()).orElse(0);
|
|
|
if (rate < 0 && rate > 100) {
|
|
|
@@ -140,7 +145,15 @@ public class CmsYhShopGoodsController {
|
|
|
data.setRate(rate);
|
|
|
});
|
|
|
yhShopGoodsRateService.saveOrUpdateBatch(yhShopGoodsRates);
|
|
|
+
|
|
|
+ List<GoodsDonSku> goodsDonSkus = goodsDonSkuService.list(Wrappers.lambdaQuery(GoodsDonSku.class)
|
|
|
+ .eq(GoodsDonSku::getGoodsId, goodsId));
|
|
|
+ goodsDonSkus.forEach(sku -> {
|
|
|
+ //下架店铺低于这个规格价格的品
|
|
|
+ goodsDonSkuService.setBelowPriceShopSkuDown(sku.getId(), sku.getPrice());
|
|
|
+ });
|
|
|
});
|
|
|
+ refreshCacheService.refreshYhHomePageCache();
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|