From 31c5d4ee9e7235f355661c85bc07918278ccb486 Mon Sep 17 00:00:00 2001 From: luolx Date: Fri, 21 Mar 2025 20:01:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E4=BF=A1=E6=81=AF=E5=A4=84?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DklWarningInformationController.java | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 Dkl-Vue-master/dkl-large/src/main/java/com/dkl/large/controller/DklWarningInformationController.java diff --git a/Dkl-Vue-master/dkl-large/src/main/java/com/dkl/large/controller/DklWarningInformationController.java b/Dkl-Vue-master/dkl-large/src/main/java/com/dkl/large/controller/DklWarningInformationController.java new file mode 100644 index 0000000..fbc19ca --- /dev/null +++ b/Dkl-Vue-master/dkl-large/src/main/java/com/dkl/large/controller/DklWarningInformationController.java @@ -0,0 +1,124 @@ +package com.dkl.large.controller; + +import java.util.Date; +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.dkl.common.annotation.DataScope; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.dkl.common.annotation.Log; +import com.dkl.common.core.controller.BaseController; +import com.dkl.common.core.domain.AjaxResult; +import com.dkl.common.enums.BusinessType; +import com.dkl.large.domain.DklWarningInformation; +import com.dkl.large.service.IDklWarningInformationService; +import com.dkl.common.utils.poi.ExcelUtil; +import com.dkl.common.core.page.TableDataInfo; + +/** + * 预警信息Controller + * + * @author Dkl + * @date 2025-06-16 + */ +@RestController +@RequestMapping("/large/information") +public class DklWarningInformationController extends BaseController +{ + @Autowired + private IDklWarningInformationService dklWarningInformationService; + + /** + * 查询预警信息列表 + */ + @GetMapping("/list") + @DataScope(deptAlias = "d") + @PreAuthorize("@ss.hasPermi('large:information:list')") + public TableDataInfo list(DklWarningInformation dklWarningInformation) + { + startPage(); + List list = dklWarningInformationService.selectDklWarningInformationList(dklWarningInformation); + return getDataTable(list); + } + /** + * 查询预警信息列表 + */ + @GetMapping("/listAll") + public TableDataInfo listAll(DklWarningInformation dklWarningInformation) + { + startPage(); + List list = dklWarningInformationService.selectDklWarningInformationList(dklWarningInformation); + return getDataTable(list); + } + /** + * 导出预警信息列表 + */ + @Log(title = "预警信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DklWarningInformation dklWarningInformation) + { + List list = dklWarningInformationService.selectDklWarningInformationList(dklWarningInformation); + ExcelUtil util = new ExcelUtil(DklWarningInformation.class); + util.exportExcel(response, list, "预警信息数据"); + } + + /** + * 获取预警信息详细信息 + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(dklWarningInformationService.selectDklWarningInformationById(id)); + } + + /** + * 新增预警信息 + */ + @Log(title = "预警信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DklWarningInformation dklWarningInformation) + { + //添加系统信息 + dklWarningInformation.setDelFlag("0"); + dklWarningInformation.setCreateTime(new Date()); + dklWarningInformation.setCreateBy(getUsername()); + dklWarningInformation.setDeptId(getDeptId()); + dklWarningInformation.setUpdateTime(new Date()); + dklWarningInformation.setUpdateBy(getUsername()); + //默认案件为待分配 + dklWarningInformation.setEventStatus("1"); + return toAjax(dklWarningInformationService.insertDklWarningInformation(dklWarningInformation)); + } + + /** + * 修改预警信息 + */ + @Log(title = "预警信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DklWarningInformation dklWarningInformation) + { + //添加系统信息 + dklWarningInformation.setUpdateTime(new Date()); + dklWarningInformation.setUpdateBy(getUsername()); + return toAjax(dklWarningInformationService.updateDklWarningInformation(dklWarningInformation)); + } + + /** + * 删除预警信息 + */ + @Log(title = "预警信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable int[] ids) + { + return toAjax(dklWarningInformationService.deleteDklWarningInformationByIds(ids)); + } +}