|
@@ -0,0 +1,215 @@
|
|
|
|
+package com.ruoyi.system.controller;
|
|
|
|
+
|
|
|
|
+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.ruoyi.system.domain.CenterdataTReserve;
|
|
|
|
+import com.ruoyi.system.service.ICenterdataTReserveService;
|
|
|
|
+import com.ruoyi.system.utils.ExcelUtil;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
+
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 应急预案Controller
|
|
|
|
+ *
|
|
|
|
+ * @author ruoyi
|
|
|
|
+ * @date 2022-05-04
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/reserve")
|
|
|
|
+@Api(tags = "数据中心应急预案控制器")
|
|
|
|
+public class CenterdataTReserveController extends BaseController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICenterdataTReserveService centerdataTReserveService;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询应急预案列表
|
|
|
|
+ * 数据中心应急预案调用
|
|
|
|
+ */
|
|
|
|
+ @RequiresPermissions("system:reserve:list")
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
+ @ApiOperation(value = "查询应急预案列表", notes = "查询应急预案列表")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "主键id", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "resTitle", value = "标题", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "resIntroduction", value = "简介", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "deptId", value = "部门id", dataType = "Long", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "deptName", value = "部门名称", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "attachId", value = "附件id", dataType = "String", required = false)
|
|
|
|
+ })
|
|
|
|
+ public TableDataInfo list(CenterdataTReserve centerdataTReserve) {
|
|
|
|
+ startPage();
|
|
|
|
+ List<CenterdataTReserve> list = centerdataTReserveService.selectCenterdataTReserveList(centerdataTReserve);
|
|
|
|
+ return getDataTable(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询应急预案列表远程手机端调用
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/listapp")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "主键id", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "resTitle", value = "标题", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "resIntroduction", value = "简介", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "deptId", value = "部门id", dataType = "Long", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "deptName", value = "部门名称", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "attachId", value = "附件id", dataType = "String", required = false)
|
|
|
|
+ })
|
|
|
|
+ @ApiOperation(value = "手机端远端调用", notes = "手机端远端调用")
|
|
|
|
+ public TableDataInfo listapp(CenterdataTReserve centerdataTReserve) {
|
|
|
|
+ startPage();
|
|
|
|
+ return getDataTable(centerdataTReserveService.selectCenterdataTReserveListRemoteCall(centerdataTReserve));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询应急预案下拉
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/listYuAn")
|
|
|
|
+ @ApiOperation(value = "查询应急预案下拉列表公用", notes = "查询应急预案下拉列表公用")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "主键id", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "resTitle", value = "标题", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "resIntroduction", value = "简介", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "deptId", value = "部门id", dataType = "Long", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "deptName", value = "部门名称", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "attachId", value = "附件id", dataType = "String", required = false)
|
|
|
|
+ })
|
|
|
|
+ public AjaxResult listYuAn(CenterdataTReserve centerdataTReserve) {
|
|
|
|
+ return AjaxResult.success(centerdataTReserveService.selectCenterdataTReserveListRemoteCall(centerdataTReserve));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询应急预案下拉
|
|
|
|
+ * 数字农业远端调用
|
|
|
|
+ * 数字林业远端调用
|
|
|
|
+ * 数字环保远端调用
|
|
|
|
+ * 数字消防远端调用
|
|
|
|
+ * 乡村振兴远端调用
|
|
|
|
+ * 数字交通远端调用
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/listYuAnFegin")
|
|
|
|
+ @ApiOperation(value = "查询应急预案下拉列表公用远程调用", notes = "查询应急预案下拉列表公用远程调用")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "主键id", dataType = "String", required = false, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "resTitle", value = "标题", dataType = "String", required = false, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "resIntroduction", value = "简介", dataType = "String", required = false, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "deptId", value = "部门id", dataType = "Long", required = false, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "deptName", value = "部门名称", dataType = "String", required = false, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "attachId", value = "附件id", dataType = "String", required = false, paramType = "body"),
|
|
|
|
+ })
|
|
|
|
+ public AjaxResult listYuAnFegin(@ApiIgnore @RequestBody CenterdataTReserve centerdataTReserve) {
|
|
|
|
+ List<CenterdataTReserve> list = centerdataTReserveService.selectCenterdataTReserveListRemoteCall(centerdataTReserve);
|
|
|
|
+ return AjaxResult.success(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出应急预案列表
|
|
|
|
+ * 数据中心应急预案导出调用
|
|
|
|
+ */
|
|
|
|
+ @RequiresPermissions("system:reserve:export")
|
|
|
|
+ @Log(title = "应急预案", businessType = BusinessType.EXPORT)
|
|
|
|
+ @ApiOperation(value = "导出应急预案列表", notes = "导出应急预案列表")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "主键id", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "resTitle", value = "标题", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "resIntroduction", value = "简介", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "deptId", value = "部门id", dataType = "Long", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "deptName", value = "部门名称", dataType = "String", required = false),
|
|
|
|
+ @ApiImplicitParam(name = "attachId", value = "附件id", dataType = "String", required = false)
|
|
|
|
+ })
|
|
|
|
+ @PostMapping("/export")
|
|
|
|
+ public void export(HttpServletResponse response, CenterdataTReserve centerdataTReserve) {
|
|
|
|
+ List<CenterdataTReserve> list = centerdataTReserveService.selectCenterdataTReserveList(centerdataTReserve);
|
|
|
|
+ ExcelUtil<CenterdataTReserve> util = new ExcelUtil<>(CenterdataTReserve.class);
|
|
|
|
+ util.exportExcel(response, list, "应急预案数据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取应急预案详细信息
|
|
|
|
+ * 数据中心应急预案详情调用
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "获取应急预案详细信息", notes = "获取应急预案详细信息")
|
|
|
|
+ @ApiImplicitParams(value =
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "主键id", dataType = "String", required = true))
|
|
|
|
+ @RequiresPermissions("system:reserve:query")
|
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") String id) {
|
|
|
|
+ return AjaxResult.success(centerdataTReserveService.selectCenterdataTReserveById(id));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 新增应急预案
|
|
|
|
+ * 数据中心应急预案新增調用
|
|
|
|
+ */
|
|
|
|
+ @RequiresPermissions("system:reserve:add")
|
|
|
|
+ @ApiOperation(value = "新增应急预案", notes = "新增应急预案")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "主键id", dataType = "String", required = false, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "resTitle", value = "标题", dataType = "String", required = true, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "resIntroduction", value = "简介", dataType = "String", required = false, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "deptId", value = "部门id", dataType = "Long", required = true, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "deptName", value = "部门名称", dataType = "String", required = true, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "attachId", value = "附件id", dataType = "String", required = false, paramType = "body")
|
|
|
|
+ })
|
|
|
|
+ @Log(title = "应急预案", businessType = BusinessType.INSERT)
|
|
|
|
+ @PostMapping
|
|
|
|
+ public AjaxResult add(@ApiIgnore @Validated @RequestBody CenterdataTReserve centerdataTReserve) {
|
|
|
|
+ return toAjax(centerdataTReserveService.insertCenterdataTReserve(centerdataTReserve));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改应急预案
|
|
|
|
+ * 数据中心应急预修改调用
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "修改应急预案", notes = "修改应急预案")
|
|
|
|
+ @RequiresPermissions("system:reserve:edit")
|
|
|
|
+ @Log(title = "应急预案", businessType = BusinessType.UPDATE)
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "主键id", dataType = "String", required = true, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "resTitle", value = "标题", dataType = "String", required = true, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "resIntroduction", value = "简介", dataType = "String", required = false, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "deptId", value = "部门id", dataType = "Long", required = true, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "deptName", value = "部门名称", dataType = "String", required = true, paramType = "body"),
|
|
|
|
+ @ApiImplicitParam(name = "attachId", value = "附件id", dataType = "String", required = false, paramType = "body")
|
|
|
|
+ })
|
|
|
|
+ @PutMapping
|
|
|
|
+ public AjaxResult edit(@ApiIgnore @Validated @RequestBody CenterdataTReserve centerdataTReserve) {
|
|
|
|
+ return toAjax(centerdataTReserveService.updateCenterdataTReserve(centerdataTReserve));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除应急预案
|
|
|
|
+ * 数据中心应急预案删除调用
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "删除应急预案", notes = "删除应急预案")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "ids", value = "主键id", dataType = "String[]", required = true)
|
|
|
|
+ })
|
|
|
|
+ @RequiresPermissions("system:reserve:remove")
|
|
|
|
+ @Log(title = "应急预案", businessType = BusinessType.DELETE)
|
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
|
+ public AjaxResult remove(@PathVariable String[] ids) {
|
|
|
|
+ return toAjax(centerdataTReserveService.deleteCenterdataTReserveByIds(ids));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "发布/撤销应急预案", notes = "发布/撤销应急预案")
|
|
|
|
+ @PostMapping("/handlePublish")
|
|
|
|
+ public AjaxResult handlePublish(@RequestBody CenterdataTReserve centerdataTReserve){
|
|
|
|
+ return toAjax(centerdataTReserveService.handlePublish(centerdataTReserve));
|
|
|
|
+ }
|
|
|
|
+}
|