diff --git a/Dkl-Vue-master/dkl-large/src/main/java/com/dkl/large/controller/DklWarningInformationHandleController.java b/Dkl-Vue-master/dkl-large/src/main/java/com/dkl/large/controller/DklWarningInformationHandleController.java new file mode 100644 index 0000000..d3eed9b --- /dev/null +++ b/Dkl-Vue-master/dkl-large/src/main/java/com/dkl/large/controller/DklWarningInformationHandleController.java @@ -0,0 +1,119 @@ +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.DklWarningInformationHandle; +import com.dkl.large.service.IDklWarningInformationHandleService; +import com.dkl.common.utils.poi.ExcelUtil; +import com.dkl.common.core.page.TableDataInfo; + +/** + * 预警信息处置Controller + * + * @author Dkl + * @date 2025-06-16 + */ +@RestController +@RequestMapping("/large/handle") +public class DklWarningInformationHandleController extends BaseController +{ + @Autowired + private IDklWarningInformationHandleService dklWarningInformationHandleService; + + /** + * 查询预警信息处置列表 + */ + @PreAuthorize("@ss.hasPermi('large:handle:list')") + @GetMapping("/list") + @DataScope(deptAlias = "d") + public TableDataInfo list(DklWarningInformationHandle dklWarningInformationHandle) + { + startPage(); + List list = dklWarningInformationHandleService.selectDklWarningInformationHandleList(dklWarningInformationHandle); + return getDataTable(list); + } + @GetMapping("/listAll") + public TableDataInfo listAll(DklWarningInformationHandle dklWarningInformationHandle) + { + dklWarningInformationHandle.setDelFlag("0"); + List list = dklWarningInformationHandleService.selectDklWarningInformationHandleList(dklWarningInformationHandle); + return getDataTable(list); + } + + /** + * 导出预警信息处置列表 + */ + @Log(title = "预警信息处置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DklWarningInformationHandle dklWarningInformationHandle) + { + List list = dklWarningInformationHandleService.selectDklWarningInformationHandleList(dklWarningInformationHandle); + ExcelUtil util = new ExcelUtil(DklWarningInformationHandle.class); + util.exportExcel(response, list, "预警信息处置数据"); + } + + /** + * 获取预警信息处置详细信息 + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(dklWarningInformationHandleService.selectDklWarningInformationHandleById(id)); + } + + /** + * 新增预警信息处置 + */ + @Log(title = "预警信息处置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DklWarningInformationHandle dklWarningInformationHandle) + { + //添加系统信息 + dklWarningInformationHandle.setDelFlag("0"); + dklWarningInformationHandle.setCreateTime(new Date()); + dklWarningInformationHandle.setCreateBy(getUsername()); + dklWarningInformationHandle.setUpdateTime(new Date()); + dklWarningInformationHandle.setUpdateBy(getUsername()); + return toAjax(dklWarningInformationHandleService.insertDklWarningInformationHandle(dklWarningInformationHandle)); + } + + /** + * 修改预警信息处置 + */ + @Log(title = "预警信息处置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DklWarningInformationHandle dklWarningInformationHandle) + { + //添加系统信息 + dklWarningInformationHandle.setUpdateTime(new Date()); + dklWarningInformationHandle.setUpdateBy(getUsername()); + return toAjax(dklWarningInformationHandleService.updateDklWarningInformationHandle(dklWarningInformationHandle)); + } + + /** + * 删除预警信息处置 + */ + @Log(title = "预警信息处置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dklWarningInformationHandleService.deleteDklWarningInformationHandleByIds(ids)); + } +}