|
|
@@ -2,12 +2,10 @@ package com.zksy.web.controller.warning;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import com.zksy.base.warning.domain.EarlyWarning;
|
|
|
import com.zksy.base.warning.domain.WarningArchive;
|
|
|
import com.zksy.base.warning.domain.WarningDisposal;
|
|
|
import com.zksy.base.warning.domain.WarningSaveDTO;
|
|
|
import com.zksy.base.warning.service.EarlyWarningService;
|
|
|
-import com.zksy.common.annotation.Anonymous;
|
|
|
import com.zksy.common.annotation.Log;
|
|
|
import com.zksy.common.core.domain.AjaxResult;
|
|
|
import com.zksy.common.enums.BusinessType;
|
|
|
@@ -17,8 +15,8 @@ import io.swagger.annotations.ApiParam;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
@@ -35,7 +33,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperation("分页查询预警列表")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:list')")
|
|
|
public AjaxResult getWarningList(
|
|
|
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
@ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
@@ -50,7 +48,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/todo/list")
|
|
|
@ApiOperation("待办预警列表")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:list')")
|
|
|
public AjaxResult getTodoList(
|
|
|
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
@ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
@@ -64,7 +62,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/detail/{warningId}")
|
|
|
@ApiOperation("预警详情")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getWarningDetail(@PathVariable String warningId) {
|
|
|
Map<String, Object> detail = earlyWarningService.getWarningDetail(warningId);
|
|
|
if (detail == null) {
|
|
|
@@ -76,6 +74,7 @@ public class EarlyWarningController {
|
|
|
@PostMapping("/save")
|
|
|
@ApiOperation("保存预警信息")
|
|
|
@Log(title = "保存预警信息", businessType = BusinessType.INSERT)
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:add')")
|
|
|
public AjaxResult saveWarning(WarningSaveDTO entity) {
|
|
|
boolean result = earlyWarningService.saveWarning(entity.getWarning(), entity.getAlarmIds(), entity.getFiles());
|
|
|
return result ? AjaxResult.success("保存成功", entity.getWarning().getWarningId()) : AjaxResult.error("保存失败");
|
|
|
@@ -84,14 +83,16 @@ public class EarlyWarningController {
|
|
|
@PutMapping("/update")
|
|
|
@ApiOperation("修改预警信息")
|
|
|
@Log(title = "修改预警信息", businessType = BusinessType.UPDATE)
|
|
|
- public AjaxResult updateWarning(EarlyWarning warning, List<MultipartFile> files) {
|
|
|
- boolean result = earlyWarningService.updateWarning(warning, files);
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:edit')")
|
|
|
+ public AjaxResult updateWarning(WarningSaveDTO entity) {
|
|
|
+ boolean result = earlyWarningService.updateWarning(entity.getWarning(), entity.getAlarmIds(), entity.getFiles());
|
|
|
return result ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
|
|
|
}
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
@ApiOperation("删除预警信息")
|
|
|
@Log(title = "删除预警信息", businessType = BusinessType.DELETE)
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:remove')")
|
|
|
public AjaxResult deleteWarning(@RequestParam String warningId) {
|
|
|
boolean result = earlyWarningService.deleteWarning(warningId);
|
|
|
return result ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
|
|
|
@@ -100,6 +101,7 @@ public class EarlyWarningController {
|
|
|
@DeleteMapping("/delete/batch")
|
|
|
@ApiOperation("批量删除预警信息")
|
|
|
@Log(title = "批量删除预警信息", businessType = BusinessType.DELETE)
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:remove')")
|
|
|
public AjaxResult deleteBatchWarning(@RequestParam List<String> warningIds) {
|
|
|
boolean result = earlyWarningService.deleteBatchWarning(warningIds);
|
|
|
return result ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
|
|
|
@@ -108,50 +110,50 @@ public class EarlyWarningController {
|
|
|
@PostMapping("/publish/{warningId}")
|
|
|
@ApiOperation("发布预警")
|
|
|
@Log(title = "发布预警", businessType = BusinessType.UPDATE)
|
|
|
- public AjaxResult publishWarning(
|
|
|
- @PathVariable String warningId,
|
|
|
- @ApiParam("处置人") @RequestParam(required = false, defaultValue = "system") String disposalUser) {
|
|
|
- boolean result = earlyWarningService.publishWarning(warningId, disposalUser);
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:publish')")
|
|
|
+ public AjaxResult publishWarning(@PathVariable String warningId) {
|
|
|
+ boolean result = earlyWarningService.publishWarning(warningId);
|
|
|
return result ? AjaxResult.success("发布成功") : AjaxResult.error("发布失败");
|
|
|
}
|
|
|
|
|
|
@PostMapping("/upgrade")
|
|
|
@ApiOperation("预警升级")
|
|
|
@Log(title = "预警升级", businessType = BusinessType.UPDATE)
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:handle')")
|
|
|
public AjaxResult upgradeWarning(
|
|
|
@ApiParam("预警ID") @RequestParam String warningId,
|
|
|
@ApiParam("新预警级别") @RequestParam String newLevel,
|
|
|
- @ApiParam("处置人") @RequestParam(required = false, defaultValue = "system") String disposalUser,
|
|
|
@ApiParam("处置说明") @RequestParam String disposalContent) {
|
|
|
- boolean result = earlyWarningService.upgradeWarning(warningId, newLevel, disposalUser, disposalContent);
|
|
|
+ boolean result = earlyWarningService.upgradeWarning(warningId, newLevel, disposalContent);
|
|
|
return result ? AjaxResult.success("升级成功") : AjaxResult.error("升级失败");
|
|
|
}
|
|
|
|
|
|
@PostMapping("/resolve")
|
|
|
@ApiOperation("解除预警")
|
|
|
@Log(title = "解除预警", businessType = BusinessType.UPDATE)
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:handle')")
|
|
|
public AjaxResult resolveWarning(
|
|
|
@ApiParam("预警ID") @RequestParam String warningId,
|
|
|
- @ApiParam("处置人") @RequestParam(required = false, defaultValue = "system") String disposalUser,
|
|
|
@ApiParam("处置说明") @RequestParam String disposalContent) {
|
|
|
- boolean result = earlyWarningService.resolveWarning(warningId, disposalUser, disposalContent);
|
|
|
+ boolean result = earlyWarningService.resolveWarning(warningId, disposalContent);
|
|
|
return result ? AjaxResult.success("解除成功") : AjaxResult.error("解除失败");
|
|
|
}
|
|
|
|
|
|
@PostMapping("/return")
|
|
|
@ApiOperation("退回重办")
|
|
|
@Log(title = "退回重办", businessType = BusinessType.UPDATE)
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:handle')")
|
|
|
public AjaxResult returnWarning(
|
|
|
@ApiParam("预警ID") @RequestParam String warningId,
|
|
|
- @ApiParam("处置人") @RequestParam(required = false, defaultValue = "system") String disposalUser,
|
|
|
@ApiParam("退回说明") @RequestParam String disposalContent) {
|
|
|
- boolean result = earlyWarningService.returnWarning(warningId, disposalUser, disposalContent);
|
|
|
+ boolean result = earlyWarningService.returnWarning(warningId, disposalContent);
|
|
|
return result ? AjaxResult.success("退回成功") : AjaxResult.error("退回失败");
|
|
|
}
|
|
|
|
|
|
@PostMapping("/supervision")
|
|
|
@ApiOperation("预警督办")
|
|
|
@Log(title = "预警督办", businessType = BusinessType.OTHER)
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:supervision')")
|
|
|
public AjaxResult supervisionWarning(
|
|
|
@ApiParam("预警ID") @RequestParam String warningId,
|
|
|
@ApiParam("督办人员") @RequestParam String supervisionUser,
|
|
|
@@ -166,6 +168,7 @@ public class EarlyWarningController {
|
|
|
@PostMapping("/instruction")
|
|
|
@ApiOperation("领导批示")
|
|
|
@Log(title = "领导批示", businessType = BusinessType.OTHER)
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:instruction')")
|
|
|
public AjaxResult addLeaderInstruction(
|
|
|
@ApiParam("预警ID") @RequestParam String warningId,
|
|
|
@ApiParam("领导姓名") @RequestParam String leaderName,
|
|
|
@@ -177,6 +180,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@PostMapping("/link/alarms")
|
|
|
@ApiOperation("关联报警信息")
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:edit')")
|
|
|
public AjaxResult linkAlarms(
|
|
|
@ApiParam("预警ID") @RequestParam String warningId,
|
|
|
@ApiParam("报警ID列表") @RequestParam List<String> alarmIds) {
|
|
|
@@ -186,6 +190,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/link/alarms/{warningId}")
|
|
|
@ApiOperation("获取关联的报警列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getLinkedAlarms(@PathVariable String warningId) {
|
|
|
List<Map<String, Object>> result = earlyWarningService.getLinkedAlarms(warningId);
|
|
|
return AjaxResult.success(result);
|
|
|
@@ -193,6 +198,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/disposal/{warningId}")
|
|
|
@ApiOperation("获取处置记录列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getDisposalList(@PathVariable String warningId) {
|
|
|
List<Map<String, Object>> result = earlyWarningService.getDisposalList(warningId);
|
|
|
return AjaxResult.success(result);
|
|
|
@@ -200,7 +206,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/statistics")
|
|
|
@ApiOperation("获取统计数据")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getStatistics() {
|
|
|
Map<String, Object> result = earlyWarningService.getStatistics();
|
|
|
return AjaxResult.success(result);
|
|
|
@@ -215,7 +221,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/search")
|
|
|
@ApiOperation("综合搜索预警信息")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:list')")
|
|
|
public AjaxResult searchWarnings(
|
|
|
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
@ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
@@ -236,7 +242,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/detail/full/{warningId}")
|
|
|
@ApiOperation("获取预警完整详情(含GIS定位和电子存档)")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getWarningFullDetail(@PathVariable String warningId) {
|
|
|
Map<String, Object> detail = earlyWarningService.getWarningFullDetail(warningId);
|
|
|
if (detail == null) {
|
|
|
@@ -247,7 +253,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/processing/list")
|
|
|
@ApiOperation("获取处置过程跟踪 - 进行中的预警")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:list')")
|
|
|
public AjaxResult getProcessingWarnings(
|
|
|
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
@ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
@@ -260,7 +266,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/completed/list")
|
|
|
@ApiOperation("获取处置过程跟踪 - 已完成的预警")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:list')")
|
|
|
public AjaxResult getCompletedWarnings(
|
|
|
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
@ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
@@ -275,7 +281,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/disposal/history/{warningId}")
|
|
|
@ApiOperation("获取预警处置历史记录")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getDisposalHistory(@PathVariable String warningId) {
|
|
|
List<Map<String, Object>> result = earlyWarningService.getDisposalHistory(warningId);
|
|
|
return AjaxResult.success(result);
|
|
|
@@ -283,7 +289,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/attachments/{warningId}")
|
|
|
@ApiOperation("获取预警附件列表")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getAttachments(@PathVariable String warningId) {
|
|
|
List<Map<String, Object>> result = earlyWarningService.getAttachments(warningId);
|
|
|
return AjaxResult.success(result);
|
|
|
@@ -291,7 +297,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/dashboard/statistics")
|
|
|
@ApiOperation("获取仪表盘统计数据")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getDashboardStatistics() {
|
|
|
Map<String, Object> result = earlyWarningService.getDashboardStatistics();
|
|
|
return AjaxResult.success(result);
|
|
|
@@ -299,7 +305,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/archive/{warningId}")
|
|
|
@ApiOperation("获取预警归档信息")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getArchive(@PathVariable String warningId) {
|
|
|
WarningArchive archive = earlyWarningService.getArchiveByWarningId(warningId);
|
|
|
if (archive == null) {
|
|
|
@@ -310,7 +316,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/archive/list")
|
|
|
@ApiOperation("获取归档列表")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:list')")
|
|
|
public AjaxResult getArchiveList(
|
|
|
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
@ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize,
|
|
|
@@ -326,7 +332,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/process/{warningId}")
|
|
|
@ApiOperation("获取预警处置过程记录(完整流程)")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getDisposalProcess(@PathVariable String warningId) {
|
|
|
List<WarningDisposal> result = earlyWarningService.getDisposalProcess(warningId);
|
|
|
return AjaxResult.success(result);
|
|
|
@@ -334,7 +340,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/diagram/{warningId}")
|
|
|
@ApiOperation("获取预警流程可视化数据(路线图)")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getProcessDiagram(@PathVariable String warningId) {
|
|
|
Map<String, Object> result = earlyWarningService.getProcessDiagram(warningId);
|
|
|
if (result != null && result.containsKey("error")) {
|
|
|
@@ -345,7 +351,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/disposal/detail/{disposalId}")
|
|
|
@ApiOperation("获取预警处置详情")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getDisposalDetail(@PathVariable String disposalId) {
|
|
|
Map<String, Object> result = earlyWarningService.getDisposalDetail(disposalId);
|
|
|
if (result == null) {
|
|
|
@@ -356,7 +362,7 @@ public class EarlyWarningController {
|
|
|
|
|
|
@GetMapping("/process/statistics/{warningId}")
|
|
|
@ApiOperation("获取预警流程统计信息")
|
|
|
- @Anonymous
|
|
|
+ @PreAuthorize("@ss.hasPermi('warning:warning:query')")
|
|
|
public AjaxResult getProcessStatistics(@PathVariable String warningId) {
|
|
|
Map<String, Object> result = earlyWarningService.getProcessStatistics(warningId);
|
|
|
return AjaxResult.success(result);
|