zx 6 päivää sitten
vanhempi
commit
ca9d4554ec

+ 12 - 1
fs-admin/src/main/java/com/fs/his/controller/FsIntegralGoodsController.java

@@ -8,6 +8,7 @@ import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.his.domain.FsIntegralGoods;
 import com.fs.his.service.IFsIntegralGoodsService;
+import com.fs.his.utils.RedisCacheUtil;
 import com.fs.his.vo.FsIntegralGoodsListVO;
 import com.fs.his.vo.FsStoreProductExcelVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,7 +30,8 @@ public class FsIntegralGoodsController extends BaseController
 {
     @Autowired
     private IFsIntegralGoodsService fsIntegralGoodsService;
-
+    @Autowired
+    RedisCacheUtil redisCacheUtil;
     /**
      * 查询积分商品列表
      */
@@ -70,6 +72,8 @@ public class FsIntegralGoodsController extends BaseController
     @PostMapping("/importData")
     public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
     {
+        redisCacheUtil.delRedisKey("getIntegralGoodsList");
+        redisCacheUtil.delRedisKey("getIntegralGoodsById");
         ExcelUtil<FsIntegralGoods> util = new ExcelUtil<>(FsIntegralGoods.class);
         List<FsIntegralGoods> list = util.importExcel(file.getInputStream());
         String message = fsIntegralGoodsService.importIntegralGoodsService(list);
@@ -92,6 +96,8 @@ public class FsIntegralGoodsController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody FsIntegralGoods fsIntegralGoods)
     {
+        redisCacheUtil.delRedisKey("getIntegralGoodsList");
+        redisCacheUtil.delRedisKey("getIntegralGoodsById");
         return toAjax(fsIntegralGoodsService.insertFsIntegralGoods(fsIntegralGoods));
     }
 
@@ -103,6 +109,9 @@ public class FsIntegralGoodsController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody FsIntegralGoods fsIntegralGoods)
     {
+
+        redisCacheUtil.delRedisKey("getIntegralGoodsList");
+        redisCacheUtil.delRedisKey("getIntegralGoodsById");
         return toAjax(fsIntegralGoodsService.updateFsIntegralGoods(fsIntegralGoods));
     }
 
@@ -114,6 +123,8 @@ public class FsIntegralGoodsController extends BaseController
 	@DeleteMapping("/{goodsIds}")
     public AjaxResult remove(@PathVariable Long[] goodsIds)
     {
+        redisCacheUtil.delRedisKey("getIntegralGoodsList");
+        redisCacheUtil.delRedisKey("getIntegralGoodsById");
         return toAjax(fsIntegralGoodsService.deleteFsIntegralGoodsByGoodsIds(goodsIds));
     }
 }