zoujiajian 1 rok pred
rodič
commit
04304b6ba6

+ 2 - 0
netflix-service/src/main/java/com/cyksj/service/mange/RefreshCacheService.java

@@ -32,4 +32,6 @@ public interface RefreshCacheService {
 	void refreshUserShopMangeCache(String customId);
 
 	void goodsQuestionCache();
+
+	void refreshWholesaleGoods();
 }

+ 6 - 0
netflix-service/src/main/java/com/cyksj/service/mange/impl/RefreshCacheServiceImpl.java

@@ -60,4 +60,10 @@ public class RefreshCacheServiceImpl implements RefreshCacheService {
 		//售后缓存
 		redisService.del(redisService.keys(RedisService.key.YH_GOODS_QUESTIONS_DETAIL.name().toLowerCase() + "*").toArray(String[]::new));
 	}
+
+	@Override
+	public void refreshWholesaleGoods() {
+		Set<String> keys = redisService.keys(RedisService.key.GOODS_WHOLESALE_KEY.getName() + "*");
+		redisService.del(keys.toArray(String[]::new));
+	}
 }

+ 7 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonWholeSaleController.java

@@ -16,6 +16,7 @@ import com.cyksj.model.entity.GoodsWholesaleUserDeposit;
 import com.cyksj.model.views.GoodsWholesaleOrderView;
 import com.cyksj.model.views.GoodsWholesaleView;
 import com.cyksj.service.goods.GoodsWholesaleService;
+import com.cyksj.service.mange.RefreshCacheService;
 import com.cyksj.service.user.UserBindRelationService;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.SearchResult;
@@ -54,6 +55,8 @@ public class CmsGoodsDonWholeSaleController {
 
 	private final GoodsWholesaleOrderDonMapper goodsWholesaleOrderDonMapper;
 
+	private final RefreshCacheService refreshCacheService;
+
 	/**
 	 * 新增批发平台
 	 */
@@ -70,6 +73,7 @@ public class CmsGoodsDonWholeSaleController {
 	@PutMapping("/update")
 	public Result<String> updateWholesale(@RequestBody GoodsWholesale wholesale) throws Exception {
 		goodsWholesaleService.saveOrUpdateWholesale(wholesale);
+		refreshCacheService.refreshWholesaleGoods();
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
 
@@ -84,6 +88,7 @@ public class CmsGoodsDonWholeSaleController {
 		if (byId != null) {
 			byId.setSorted(sorted);
 			goodsWholesaleService.updateById(byId);
+			refreshCacheService.refreshWholesaleGoods();
 		}
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
@@ -97,6 +102,7 @@ public class CmsGoodsDonWholeSaleController {
 		if (byId != null) {
 			byId.setDeleted(false);
 			goodsWholesaleService.updateById(byId);
+			refreshCacheService.refreshWholesaleGoods();
 		}
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
@@ -125,6 +131,7 @@ public class CmsGoodsDonWholeSaleController {
 		if (byId != null) {
 			byId.setStatus(!byId.getStatus());
 			goodsWholesaleService.updateById(byId);
+			refreshCacheService.refreshWholesaleGoods();
 		}
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}