|
@@ -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));
|
|
|
}
|