瀏覽代碼

清理缓存提交

wangb 2 年之前
父節點
當前提交
9b6689689b

+ 1 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/config/CacheContext.java

@@ -231,7 +231,7 @@ public class CacheContext implements CommandLineRunner {
     }
 
     /**
-     * 初始化线路数据
+     * 初始化风机数据
      */
     public void initEquipmentList(){
         //清理集合数据

+ 5 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicCompanyController.java

@@ -3,11 +3,13 @@ package com.gyee.backconfig.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.CacheContext;
 import com.gyee.backconfig.config.R;
 import com.gyee.backconfig.model.auto.ProBasicCompany;
 import com.gyee.backconfig.service.auto.IProBasicCompanyService;
 import com.gyee.common.model.StringUtils;
 import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -28,7 +30,8 @@ import java.util.List;
 public class ProBasicCompanyController {
     @Resource
     private IProBasicCompanyService proBasicCompanyService;
-
+    @Autowired
+    private CacheContext cacheContext;
     /**
      * 查询
      *
@@ -96,6 +99,7 @@ public class ProBasicCompanyController {
 
         boolean b = proBasicCompanyService.saveOrUpdate(company);
         if (b) {
+            cacheContext.initCompanyList();
             return R.ok().data(b);
         } else {
             return R.error().data("保存失败!");

+ 5 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicEquipmentController.java

@@ -2,11 +2,13 @@ package com.gyee.backconfig.controller;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.CacheContext;
 import com.gyee.backconfig.config.R;
 import com.gyee.backconfig.model.auto.ProBasicEquipment;
 import com.gyee.backconfig.service.auto.IProBasicEquipmentService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -26,7 +28,8 @@ import java.util.Arrays;
 public class ProBasicEquipmentController {
     @Resource
     private IProBasicEquipmentService proBasicWindturbineService;
-
+    @Autowired
+    private CacheContext cacheContext;
     /**
      * 查询
      * @param id
@@ -73,6 +76,7 @@ public class ProBasicEquipmentController {
 
         boolean b = proBasicWindturbineService.saveOrUpdate(proBasicWindpowerstation);
         if (b) {
+            cacheContext.initEquipmentList();
             return R.ok().data(b);
         } else {
             return R.error().data("保存失败!");

+ 5 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicLineController.java

@@ -2,11 +2,13 @@ package com.gyee.backconfig.controller;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.CacheContext;
 import com.gyee.backconfig.config.R;
 import com.gyee.backconfig.model.auto.ProBasicLine;
 import com.gyee.backconfig.service.auto.IProBasicLineService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -26,7 +28,8 @@ import java.util.Arrays;
 public class ProBasicLineController {
     @Resource
     private IProBasicLineService proBasicLineService;
-
+    @Autowired
+    private CacheContext cacheContext;
     /**
      * 查询
      * @param id
@@ -65,6 +68,7 @@ public class ProBasicLineController {
     public R addModifyProjectPlan(@RequestBody ProBasicLine proBasicLine){
         boolean saveOrUpdate = proBasicLineService.saveOrUpdate(proBasicLine);
         if (saveOrUpdate) {
+            cacheContext.initLineList();
             return R.ok().data("保存或更新成功");
         }else{
             return R.error().message("保存失败");

+ 5 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicPowerstationController.java

@@ -2,12 +2,14 @@ package com.gyee.backconfig.controller;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.CacheContext;
 import com.gyee.backconfig.config.R;
 import com.gyee.backconfig.model.auto.ProBasicPowerstation;
 import com.gyee.backconfig.service.auto.IProBasicPowerstationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -27,7 +29,8 @@ import java.util.Arrays;
 public class ProBasicPowerstationController {
     @Resource
     private IProBasicPowerstationService proBasicWindpowerstationService;
-
+    @Autowired
+    private CacheContext cacheContext;
     /**
      * 查询
      *
@@ -70,6 +73,7 @@ public class ProBasicPowerstationController {
 
         boolean b = proBasicWindpowerstationService.saveOrUpdate(proBasicWindpowerstation);
         if (b) {
+            cacheContext.initPowerstationList();
             return R.ok().data(b);
         } else {
             return R.error().data("保存失败!");

+ 5 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicProjectController.java

@@ -2,11 +2,13 @@ package com.gyee.backconfig.controller;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.CacheContext;
 import com.gyee.backconfig.config.R;
 import com.gyee.backconfig.model.auto.ProBasicProject;
 import com.gyee.backconfig.service.auto.IProBasicProjectService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -26,7 +28,8 @@ import java.util.Arrays;
 public class ProBasicProjectController {
     @Resource
     private IProBasicProjectService proBasicProjectService;
-
+    @Autowired
+    private CacheContext cacheContext;
     /**
      * 查询
      * @param id
@@ -66,6 +69,7 @@ public class ProBasicProjectController {
 
         boolean b = proBasicProjectService.saveOrUpdate(proBasicProject);
         if (b){
+            cacheContext.initProjectList();
             return R.ok().data(b);
         }else {
             return R.error().data("保存失败!");

+ 5 - 1
web/backmanagerconfig-xktj/src/main/java/com/gyee/backconfig/controller/ProBasicRegionController.java

@@ -2,11 +2,13 @@ package com.gyee.backconfig.controller;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gyee.backconfig.config.CacheContext;
 import com.gyee.backconfig.config.R;
 import com.gyee.backconfig.model.auto.ProBasicRegion;
 import com.gyee.backconfig.service.auto.IProBasicRegionService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -26,7 +28,8 @@ import java.util.Arrays;
 public class ProBasicRegionController {
     @Resource
     private IProBasicRegionService proBasicRegionService;
-
+    @Autowired
+    private CacheContext cacheContext;
     /**
      * 查询
      *
@@ -67,6 +70,7 @@ public class ProBasicRegionController {
 
         boolean b = proBasicRegionService.saveOrUpdate(proBasicRegion);
         if (b) {
+            cacheContext.initSegionList();
             return R.ok().data(b);
         } else {
             return R.error().data("保存失败!");