Memory_LG 6 months ago
parent
commit
495fa2ac4d

+ 15 - 3
src/main/java/com/sooka/sponest/data/digitalenvironment/controller/CenterdataTEnvironmentBiggasController.java

@@ -1,14 +1,18 @@
 package com.sooka.sponest.data.digitalenvironment.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.digitalenvironment.domain.CenterdataTEnvironmentBiggas;
 import com.sooka.sponest.data.digitalenvironment.service.ICenterdataTEnvironmentBiggasService;
 import com.sooka.sponest.data.utils.DataConstants;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import com.sooka.sponest.data.utils.ExcelUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -19,6 +23,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -87,7 +92,9 @@ public class CenterdataTEnvironmentBiggasController extends BaseController {
         if(!centerdataTEnvironmentBiggasService.uniqueCheck(tableName, keys, values)){
             return AjaxResult.error(DataConstants.ERROR_MSG);
         }
-        return toAjax(centerdataTEnvironmentBiggasService.insertCenterdataTEnvironmentBiggas(centerdataTEnvironmentBiggas));
+        int result = centerdataTEnvironmentBiggasService.insertCenterdataTEnvironmentBiggas(centerdataTEnvironmentBiggas);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.ENVIRONMENT_BIGGAS1,BusinessType.INSERT, JSON.toJSONString(centerdataTEnvironmentBiggas)));
+        return toAjax(result);
     }
 
     /**
@@ -104,7 +111,9 @@ public class CenterdataTEnvironmentBiggasController extends BaseController {
         if(!centerdataTEnvironmentBiggasService.uniqueCheck(tableName, keys, values)){
             return AjaxResult.error(DataConstants.ERROR_MSG);
         }
-        return toAjax(centerdataTEnvironmentBiggasService.updateCenterdataTEnvironmentBiggas(centerdataTEnvironmentBiggas));
+        int result = centerdataTEnvironmentBiggasService.updateCenterdataTEnvironmentBiggas(centerdataTEnvironmentBiggas);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.ENVIRONMENT_BIGGAS1,BusinessType.UPDATE, JSON.toJSONString(centerdataTEnvironmentBiggas)));
+        return toAjax(result);
     }
 
     /**
@@ -118,6 +127,9 @@ public class CenterdataTEnvironmentBiggasController extends BaseController {
             @ApiImplicitParam(name = "ids", value = "主键id", dataType = "String[]", required = true)
     })
     public AjaxResult remove(@PathVariable String[] ids) {
-        return toAjax(centerdataTEnvironmentBiggasService.deleteCenterdataTEnvironmentBiggasByIds(ids));
+        int result = centerdataTEnvironmentBiggasService.deleteCenterdataTEnvironmentBiggasByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.ENVIRONMENT_BIGGAS1,BusinessType.DELETE, JSON.toJSONString(idList)));
+        return toAjax(result);
     }
 }

+ 15 - 3
src/main/java/com/sooka/sponest/data/other/checkpoint/controller/CenterdataTForestCheckpointController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.data.other.checkpoint.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -7,9 +9,11 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.other.checkpoint.domain.CenterdataTForestCheckpoint;
 import com.sooka.sponest.data.other.checkpoint.service.ICenterdataTForestCheckpointService;
 import com.sooka.sponest.data.utils.DataConstants;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import com.sooka.sponest.data.utils.ExcelUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -21,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -110,7 +115,9 @@ public class CenterdataTForestCheckpointController extends BaseController {
         if(!centerdataTForestCheckpointService.uniqueCheck(tableName, keys, values)){
             return AjaxResult.error(DataConstants.ERROR_MSG);
         }
-        return toAjax(centerdataTForestCheckpointService.insertCenterdataTForestCheckpoint(centerdataTForestCheckpoint));
+        int result = centerdataTForestCheckpointService.insertCenterdataTForestCheckpoint(centerdataTForestCheckpoint);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FOREST_CHECKPOINT,BusinessType.INSERT, JSON.toJSONString(centerdataTForestCheckpoint)));
+        return toAjax(result);
     }
 
     /**
@@ -127,7 +134,9 @@ public class CenterdataTForestCheckpointController extends BaseController {
         if(!centerdataTForestCheckpointService.uniqueCheck(tableName, keys, values)){
             return AjaxResult.error(DataConstants.ERROR_MSG);
         }
-        return toAjax(centerdataTForestCheckpointService.updateCenterdataTForestCheckpoint(centerdataTForestCheckpoint));
+        int result = centerdataTForestCheckpointService.updateCenterdataTForestCheckpoint(centerdataTForestCheckpoint);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FOREST_CHECKPOINT,BusinessType.UPDATE, JSON.toJSONString(centerdataTForestCheckpoint)));
+        return toAjax(result);
     }
 
     /**
@@ -138,6 +147,9 @@ public class CenterdataTForestCheckpointController extends BaseController {
     @Log(title = "防火检查站信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable String[] ids) {
-        return toAjax(centerdataTForestCheckpointService.deleteCenterdataTForestCheckpointByIds(ids));
+        int result = centerdataTForestCheckpointService.deleteCenterdataTForestCheckpointByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FOREST_CHECKPOINT,BusinessType.DELETE, JSON.toJSONString(idList)));
+        return toAjax(result);
     }
 }

+ 30 - 26
src/main/java/com/sooka/sponest/data/other/forest/controller/CenterdataTResourcesForestController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.data.other.forest.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
@@ -8,8 +10,10 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.other.forest.domain.CenterdataTResourcesForest;
 import com.sooka.sponest.data.other.forest.service.ICenterdataTResourcesForestService;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -28,19 +33,17 @@ import java.util.List;
 @Api(tags = "数据中心森林资源管理信息控制器")
 @RestController
 @RequestMapping("/forest")
-public class CenterdataTResourcesForestController extends BaseController
-{
+public class CenterdataTResourcesForestController extends BaseController {
     @Autowired
     private ICenterdataTResourcesForestService centerdataTResourcesForestService;
 
-/**
- * 查询森林资源管理信息列表
- */
-@ApiOperation(value = "数据中心查询森林资源管理信息列表", notes = "数据中心查询森林资源管理信息列表")
-@RequiresPermissions("resources:forest:list")
-@GetMapping("/list")
-    public TableDataInfo list(CenterdataTResourcesForest centerdataTResourcesForest)
-    {
+    /**
+     * 查询森林资源管理信息列表
+     */
+    @ApiOperation(value = "数据中心查询森林资源管理信息列表", notes = "数据中心查询森林资源管理信息列表")
+    @RequiresPermissions("resources:forest:list")
+    @GetMapping("/list")
+    public TableDataInfo list(CenterdataTResourcesForest centerdataTResourcesForest) {
         startPage();
         List<CenterdataTResourcesForest> list = centerdataTResourcesForestService.selectCenterdataTResourcesForestList(centerdataTResourcesForest);
         return getDataTable(list);
@@ -53,8 +56,7 @@ public class CenterdataTResourcesForestController extends BaseController
     @RequiresPermissions("resources:forest:export")
     @Log(title = "森林资源管理信息", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, CenterdataTResourcesForest centerdataTResourcesForest)
-    {
+    public void export(HttpServletResponse response, CenterdataTResourcesForest centerdataTResourcesForest) {
         List<CenterdataTResourcesForest> list = centerdataTResourcesForestService.selectCenterdataTResourcesForestList(centerdataTResourcesForest);
         ExcelUtil<CenterdataTResourcesForest> util = new ExcelUtil<>(CenterdataTResourcesForest.class);
         util.exportExcel(response, list, "森林资源管理信息数据");
@@ -66,8 +68,7 @@ public class CenterdataTResourcesForestController extends BaseController
     @ApiOperation(value = "数据中心获取森林资源管理信息详细信息", notes = "数据中心获取森林资源管理信息详细信息")
     @RequiresPermissions("resources:forest:query")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") String id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") String id) {
         return AjaxResult.success(centerdataTResourcesForestService.selectCenterdataTResourcesForestById(id));
     }
 
@@ -78,9 +79,10 @@ public class CenterdataTResourcesForestController extends BaseController
     @RequiresPermissions("resources:forest:add")
     @Log(title = "森林资源管理信息", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@Validated @RequestBody CenterdataTResourcesForest centerdataTResourcesForest)
-    {
-        return toAjax(centerdataTResourcesForestService.insertCenterdataTResourcesForest(centerdataTResourcesForest));
+    public AjaxResult add(@Validated @RequestBody CenterdataTResourcesForest centerdataTResourcesForest) {
+        int result = centerdataTResourcesForestService.insertCenterdataTResourcesForest(centerdataTResourcesForest);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.RESOURCES_FOREST,BusinessType.INSERT, JSON.toJSONString(centerdataTResourcesForest)));
+        return toAjax(result);
     }
 
     /**
@@ -90,9 +92,10 @@ public class CenterdataTResourcesForestController extends BaseController
     @RequiresPermissions("resources:forest:edit")
     @Log(title = "森林资源管理信息", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@Validated @RequestBody CenterdataTResourcesForest centerdataTResourcesForest)
-    {
-        return toAjax(centerdataTResourcesForestService.updateCenterdataTResourcesForest(centerdataTResourcesForest));
+    public AjaxResult edit(@Validated @RequestBody CenterdataTResourcesForest centerdataTResourcesForest) {
+        int result = centerdataTResourcesForestService.updateCenterdataTResourcesForest(centerdataTResourcesForest);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.RESOURCES_FOREST,BusinessType.UPDATE, JSON.toJSONString(centerdataTResourcesForest)));
+        return toAjax(result);
     }
 
     /**
@@ -102,17 +105,18 @@ public class CenterdataTResourcesForestController extends BaseController
     @RequiresPermissions("resources:forest:remove")
     @Log(title = "森林资源管理信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable String[] ids)
-    {
-        return toAjax(centerdataTResourcesForestService.deleteCenterdataTResourcesForestByIds(ids));
+    public AjaxResult remove(@PathVariable String[] ids) {
+        int result = centerdataTResourcesForestService.deleteCenterdataTResourcesForestByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.RESOURCES_FOREST,BusinessType.DELETE, JSON.toJSONString(idList)));
+        return toAjax(result);
     }
 
     //远端调用
     //数字资源远端调用
     @ApiOperation(value = "远端调用查询森林资源管理信息", notes = "远端调用查询森林资源管理信息")
     @PostMapping("/listForest")
-    public R<List<CenterdataTResourcesForest>> listForest(CenterdataTResourcesForest centerdataTResourcesForest)
-    {
+    public R<List<CenterdataTResourcesForest>> listForest(CenterdataTResourcesForest centerdataTResourcesForest) {
         List<CenterdataTResourcesForest> list = centerdataTResourcesForestService.selectCenterdataTResourcesForestList(centerdataTResourcesForest);
         return R.ok(list);
     }
@@ -120,7 +124,7 @@ public class CenterdataTResourcesForestController extends BaseController
     //水利工程统计图--柱状图
     @ApiOperation(value = "远端调用查询水利工程资源按部门分组", notes = "远端调用查询排污口资源按部门分组")
     @PostMapping("/selectForestResourcesCount")
-    public R selectForestResourcesCount(){
+    public R selectForestResourcesCount() {
         CenterdataTResourcesForest centerdataTResourcesForest = new CenterdataTResourcesForest();
         return R.ok(centerdataTResourcesForestService.selectForestResourcesCount(centerdataTResourcesForest));
     }

+ 15 - 3
src/main/java/com/sooka/sponest/data/other/hydroenergy/controller/CenterdataTResourcesHydroenergyController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.data.other.hydroenergy.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -7,8 +9,10 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.other.hydroenergy.domain.CenterdataTResourcesHydroenergy;
 import com.sooka.sponest.data.other.hydroenergy.service.ICenterdataTResourcesHydroenergyService;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import com.sooka.sponest.data.utils.ExcelUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -17,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -75,7 +80,9 @@ public class CenterdataTResourcesHydroenergyController extends BaseController {
     @Log(title = "水能资源", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@Validated @RequestBody CenterdataTResourcesHydroenergy centerdataTResourcesHydroenergy) {
-        return toAjax(centerdataTResourcesHydroenergyService.insertCenterdataTResourcesHydroenergy(centerdataTResourcesHydroenergy));
+        int result = centerdataTResourcesHydroenergyService.insertCenterdataTResourcesHydroenergy(centerdataTResourcesHydroenergy);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.RESOURCES_HYDROENERGY,BusinessType.INSERT, JSON.toJSONString(centerdataTResourcesHydroenergy)));
+        return toAjax(result);
     }
 
     /**
@@ -86,7 +93,9 @@ public class CenterdataTResourcesHydroenergyController extends BaseController {
     @Log(title = "水能资源", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody CenterdataTResourcesHydroenergy centerdataTResourcesHydroenergy) {
-        return toAjax(centerdataTResourcesHydroenergyService.updateCenterdataTResourcesHydroenergy(centerdataTResourcesHydroenergy));
+        int result = centerdataTResourcesHydroenergyService.updateCenterdataTResourcesHydroenergy(centerdataTResourcesHydroenergy);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.RESOURCES_HYDROENERGY,BusinessType.UPDATE, JSON.toJSONString(centerdataTResourcesHydroenergy)));
+        return toAjax(result);
     }
 
     /**
@@ -97,7 +106,10 @@ public class CenterdataTResourcesHydroenergyController extends BaseController {
     @Log(title = "水能资源", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable String[] ids) {
-        return toAjax(centerdataTResourcesHydroenergyService.deleteCenterdataTResourcesHydroenergyByIds(ids));
+        int result = centerdataTResourcesHydroenergyService.deleteCenterdataTResourcesHydroenergyByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.RESOURCES_HYDROENERGY,BusinessType.DELETE, JSON.toJSONString(idList)));
+        return toAjax(result);
     }
 
     //远端调用

+ 31 - 26
src/main/java/com/sooka/sponest/data/other/land/controller/CenterdataTResourcesLandController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.data.other.land.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -7,8 +9,10 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.other.land.domain.CenterdataTResourcesLand;
 import com.sooka.sponest.data.other.land.service.ICenterdataTResourcesLandService;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import com.sooka.sponest.data.utils.ExcelUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -17,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -28,19 +33,17 @@ import java.util.List;
 @Api(tags = "数据中心土地资源管理信息控制器")
 @RestController
 @RequestMapping("/land")
-public class CenterdataTResourcesLandController extends BaseController
-{
+public class CenterdataTResourcesLandController extends BaseController {
     @Autowired
     private ICenterdataTResourcesLandService centerdataTResourcesLandService;
 
-/**
- * 查询土地资源管理信息列表
- */
-@ApiOperation(value = "数据中心查询土地资源管理信息列表", notes = "数据中心查询土地资源管理信息列表")
-@RequiresPermissions("resources:land:list")
-@GetMapping("/list")
-    public TableDataInfo list(CenterdataTResourcesLand centerdataTResourcesLand)
-    {
+    /**
+     * 查询土地资源管理信息列表
+     */
+    @ApiOperation(value = "数据中心查询土地资源管理信息列表", notes = "数据中心查询土地资源管理信息列表")
+    @RequiresPermissions("resources:land:list")
+    @GetMapping("/list")
+    public TableDataInfo list(CenterdataTResourcesLand centerdataTResourcesLand) {
         startPage();
         List<CenterdataTResourcesLand> list = centerdataTResourcesLandService.selectCenterdataTResourcesLandList(centerdataTResourcesLand);
         return getDataTable(list);
@@ -53,8 +56,7 @@ public class CenterdataTResourcesLandController extends BaseController
     @RequiresPermissions("resources:land:export")
     @Log(title = "土地资源管理信息", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, CenterdataTResourcesLand centerdataTResourcesLand)
-    {
+    public void export(HttpServletResponse response, CenterdataTResourcesLand centerdataTResourcesLand) {
         List<CenterdataTResourcesLand> list = centerdataTResourcesLandService.selectCenterdataTResourcesLandList(centerdataTResourcesLand);
         ExcelUtil<CenterdataTResourcesLand> util = new ExcelUtil<>(CenterdataTResourcesLand.class);
         util.exportExcel(response, list, "土地资源管理信息数据");
@@ -66,8 +68,7 @@ public class CenterdataTResourcesLandController extends BaseController
     @ApiOperation(value = "数据中心获取土地资源管理信息详细信息", notes = "数据中心获取土地资源管理信息详细信息")
     @RequiresPermissions("resources:land:query")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") String id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") String id) {
         return AjaxResult.success(centerdataTResourcesLandService.selectCenterdataTResourcesLandById(id));
     }
 
@@ -78,9 +79,10 @@ public class CenterdataTResourcesLandController extends BaseController
     @RequiresPermissions("resources:land:add")
     @Log(title = "土地资源管理信息", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@Validated @RequestBody CenterdataTResourcesLand centerdataTResourcesLand)
-    {
-        return toAjax(centerdataTResourcesLandService.insertCenterdataTResourcesLand(centerdataTResourcesLand));
+    public AjaxResult add(@Validated @RequestBody CenterdataTResourcesLand centerdataTResourcesLand) {
+        int result = centerdataTResourcesLandService.insertCenterdataTResourcesLand(centerdataTResourcesLand);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.RESOURCES_LAND,BusinessType.INSERT, JSON.toJSONString(centerdataTResourcesLand)));
+        return toAjax(result);
     }
 
     /**
@@ -90,9 +92,10 @@ public class CenterdataTResourcesLandController extends BaseController
     @RequiresPermissions("resources:land:edit")
     @Log(title = "土地资源管理信息", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@Validated @RequestBody CenterdataTResourcesLand centerdataTResourcesLand)
-    {
-        return toAjax(centerdataTResourcesLandService.updateCenterdataTResourcesLand(centerdataTResourcesLand));
+    public AjaxResult edit(@Validated @RequestBody CenterdataTResourcesLand centerdataTResourcesLand) {
+        int result = centerdataTResourcesLandService.updateCenterdataTResourcesLand(centerdataTResourcesLand);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.RESOURCES_LAND,BusinessType.UPDATE, JSON.toJSONString(centerdataTResourcesLand)));
+        return toAjax(result);
     }
 
     /**
@@ -102,24 +105,26 @@ public class CenterdataTResourcesLandController extends BaseController
     @RequiresPermissions("resources:land:remove")
     @Log(title = "土地资源管理信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable String[] ids)
-    {
-        return toAjax(centerdataTResourcesLandService.deleteCenterdataTResourcesLandByIds(ids));
+    public AjaxResult remove(@PathVariable String[] ids) {
+        int result = centerdataTResourcesLandService.deleteCenterdataTResourcesLandByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.RESOURCES_LAND,BusinessType.DELETE, JSON.toJSONString(idList)));
+        return toAjax(result);
     }
 
     //远端调用
     //数字资源远端调用
     @ApiOperation(value = "远端调用查询土地资源管理信息", notes = "远端调用查询土地资源管理信息")
     @PostMapping("/listLand")
-    public R<List<CenterdataTResourcesLand>> listLand(CenterdataTResourcesLand centerdataTResourcesLand)
-    {
+    public R<List<CenterdataTResourcesLand>> listLand(CenterdataTResourcesLand centerdataTResourcesLand) {
         List<CenterdataTResourcesLand> list = centerdataTResourcesLandService.selectCenterdataTResourcesLandList(centerdataTResourcesLand);
         return R.ok(list);
     }
+
     //数字资源可视化统计图--柱状图
     @ApiOperation("土地资源管理信息统计")
     @PostMapping("/getLandGroupByResources")
-    public R getLandGroupByResources(){
+    public R getLandGroupByResources() {
         CenterdataTResourcesLand centerdataTResourcesLand = new CenterdataTResourcesLand();
         return R.ok(centerdataTResourcesLandService.getLandGroupByResources(centerdataTResourcesLand));
     }

+ 16 - 3
src/main/java/com/sooka/sponest/data/other/patrolpoint/controller/CenterdataTEmergencyPatrolpointController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.data.other.patrolpoint.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
@@ -8,10 +10,12 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.digitalemergency.domain.vo.CenterdataTEmergencyEarlywarning;
 import com.sooka.sponest.data.other.patrolpoint.domain.CenterdataTEmergencyPatrolpoint;
 import com.sooka.sponest.data.other.patrolpoint.service.ICenterdataTEmergencyPatrolpointService;
 import com.sooka.sponest.data.utils.DataConstants;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,6 +23,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -83,7 +88,9 @@ public class CenterdataTEmergencyPatrolpointController extends BaseController {
         if (!centerdataTEmergencyPatrolpointService.uniqueCheck("centerdata_t_emergency_patrolpoint", keys, values)) {
             return AjaxResult.error(DataConstants.ERROR_MSG);
         }
-        return toAjax(centerdataTEmergencyPatrolpointService.insertCenterdataTEmergencyPatrolpoint(centerdataTEmergencyPatrolpoint));
+        int result = centerdataTEmergencyPatrolpointService.insertCenterdataTEmergencyPatrolpoint(centerdataTEmergencyPatrolpoint);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.EMERGENCY_PATROLPOINT,BusinessType.INSERT, JSON.toJSONString(centerdataTEmergencyPatrolpoint)));
+        return toAjax(result);
     }
 
 
@@ -100,7 +107,10 @@ public class CenterdataTEmergencyPatrolpointController extends BaseController {
         if (!centerdataTEmergencyPatrolpointService.uniqueCheck("centerdata_t_emergency_patrolpoint", keys, values)) {
             return AjaxResult.error(DataConstants.ERROR_MSG);
         }
-        return toAjax(centerdataTEmergencyPatrolpointService.updateCenterdataTEmergencyPatrolpoint(centerdataTEmergencyPatrolpoint));
+
+        int result = centerdataTEmergencyPatrolpointService.updateCenterdataTEmergencyPatrolpoint(centerdataTEmergencyPatrolpoint);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.EMERGENCY_PATROLPOINT,BusinessType.UPDATE, JSON.toJSONString(centerdataTEmergencyPatrolpoint)));
+        return toAjax(result);
     }
 
     @ApiOperation(value = "手机端添加巡更点", notes = "手机端添加巡更点")
@@ -123,7 +133,10 @@ public class CenterdataTEmergencyPatrolpointController extends BaseController {
     @Log(title = "巡更点", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable String[] ids) {
-        return toAjax(centerdataTEmergencyPatrolpointService.deleteCenterdataTEmergencyPatrolpointByIds(ids));
+        int result = centerdataTEmergencyPatrolpointService.deleteCenterdataTEmergencyPatrolpointByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.EMERGENCY_PATROLPOINT,BusinessType.DELETE, JSON.toJSONString(idList)));
+        return toAjax(result);
     }
 
     /**

+ 15 - 3
src/main/java/com/sooka/sponest/data/other/prohibitionarea/controller/CenterdataTEnvironmentProhibitionAreaController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.data.other.prohibitionarea.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.web.controller.BaseController;
@@ -8,8 +10,10 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.other.prohibitionarea.domain.CenterdataTEnvironmentProhibitionArea;
 import com.sooka.sponest.data.other.prohibitionarea.service.ICenterdataTEnvironmentProhibitionAreaService;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -85,7 +90,9 @@ public class CenterdataTEnvironmentProhibitionAreaController extends BaseControl
     @Log(title = "禁烧区管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@Validated @RequestBody CenterdataTEnvironmentProhibitionArea centerdataTEnvironmentProhibitionArea) {
-        return toAjax(centerdataTEnvironmentProhibitionAreaService.insertCenterdataTEnvironmentProhibitionArea(centerdataTEnvironmentProhibitionArea));
+        int result = centerdataTEnvironmentProhibitionAreaService.insertCenterdataTEnvironmentProhibitionArea(centerdataTEnvironmentProhibitionArea);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.ENVIRONMENT_PROHIBITION_AREA,BusinessType.INSERT, JSON.toJSONString(centerdataTEnvironmentProhibitionArea)));
+        return toAjax(result);
     }
 
     /**
@@ -96,7 +103,9 @@ public class CenterdataTEnvironmentProhibitionAreaController extends BaseControl
     @Log(title = "禁烧区管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@Validated @RequestBody CenterdataTEnvironmentProhibitionArea centerdataTEnvironmentProhibitionArea) {
-        return toAjax(centerdataTEnvironmentProhibitionAreaService.updateCenterdataTEnvironmentProhibitionArea(centerdataTEnvironmentProhibitionArea));
+        int result = centerdataTEnvironmentProhibitionAreaService.updateCenterdataTEnvironmentProhibitionArea(centerdataTEnvironmentProhibitionArea);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.ENVIRONMENT_PROHIBITION_AREA,BusinessType.UPDATE, JSON.toJSONString(centerdataTEnvironmentProhibitionArea)));
+        return toAjax(result);
     }
 
     /**
@@ -107,7 +116,10 @@ public class CenterdataTEnvironmentProhibitionAreaController extends BaseControl
     @Log(title = "禁烧区管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable String[] ids) {
-        return toAjax(centerdataTEnvironmentProhibitionAreaService.deleteCenterdataTEnvironmentProhibitionAreaByIds(ids));
+        int result = centerdataTEnvironmentProhibitionAreaService.deleteCenterdataTEnvironmentProhibitionAreaByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.ENVIRONMENT_PROHIBITION_AREA,BusinessType.DELETE, JSON.toJSONString(idList)));
+        return toAjax(result);
     }
 
 

+ 16 - 3
src/main/java/com/sooka/sponest/data/other/weatherstation/controller/CenterdataTForestWeatherstationController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.data.other.weatherstation.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.core.constant.DocumentNameConstants;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -7,9 +9,11 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.data.base.domain.ESVo;
 import com.sooka.sponest.data.other.weatherstation.domain.CenterdataTForestWeatherstation;
 import com.sooka.sponest.data.other.weatherstation.service.ICenterdataTForestWeatherstationService;
 import com.sooka.sponest.data.utils.DataConstants;
+import com.sooka.sponest.data.utils.DataProducerUtil;
 import com.sooka.sponest.data.utils.ExcelUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -21,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -142,7 +147,9 @@ public class CenterdataTForestWeatherstationController extends BaseController {
         if(!centerdataTForestWeatherstationService.uniqueCheck(tableName, keys, values)){
             return AjaxResult.error(DataConstants.ERROR_MSG);
         }
-        return toAjax(centerdataTForestWeatherstationService.insertCenterdataTForestWeatherstation(centerdataTForestWeatherstation));
+        int i = centerdataTForestWeatherstationService.insertCenterdataTForestWeatherstation(centerdataTForestWeatherstation);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FOREST_WEATHERSTATION,BusinessType.INSERT, JSON.toJSONString(centerdataTForestWeatherstation)));
+        return toAjax(i);
     }
 
     /**
@@ -172,7 +179,10 @@ public class CenterdataTForestWeatherstationController extends BaseController {
         if(!centerdataTForestWeatherstationService.uniqueCheck(tableName, keys, values)){
             return AjaxResult.error(DataConstants.ERROR_MSG);
         }
-        return toAjax(centerdataTForestWeatherstationService.updateCenterdataTForestWeatherstation(centerdataTForestWeatherstation));
+
+        int result = centerdataTForestWeatherstationService.updateCenterdataTForestWeatherstation(centerdataTForestWeatherstation);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FOREST_WEATHERSTATION,BusinessType.UPDATE, JSON.toJSONString(centerdataTForestWeatherstation)));
+        return toAjax(result);
     }
 
     /**
@@ -187,7 +197,10 @@ public class CenterdataTForestWeatherstationController extends BaseController {
     @Log(title = "气象站", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable String[] ids) {
-        return toAjax(centerdataTForestWeatherstationService.deleteCenterdataTForestWeatherstationByIds(ids));
+        int result = centerdataTForestWeatherstationService.deleteCenterdataTForestWeatherstationByIds(ids);
+        List<String> idList = Arrays.asList(ids);
+        DataProducerUtil.getInstance().publish(new ESVo(DocumentNameConstants.FOREST_WEATHERSTATION,BusinessType.DELETE, JSON.toJSONString(idList)));
+        return toAjax(result);
     }
 
     /**