预警信息处置

This commit is contained in:
luolx 2025-03-21 20:01:11 +08:00
parent f647709845
commit 31c5d4ee9e
1 changed files with 124 additions and 0 deletions

View File

@ -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<DklWarningInformation> list = dklWarningInformationService.selectDklWarningInformationList(dklWarningInformation);
return getDataTable(list);
}
/**
* 查询预警信息列表
*/
@GetMapping("/listAll")
public TableDataInfo listAll(DklWarningInformation dklWarningInformation)
{
startPage();
List<DklWarningInformation> list = dklWarningInformationService.selectDklWarningInformationList(dklWarningInformation);
return getDataTable(list);
}
/**
* 导出预警信息列表
*/
@Log(title = "预警信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DklWarningInformation dklWarningInformation)
{
List<DklWarningInformation> list = dklWarningInformationService.selectDklWarningInformationList(dklWarningInformation);
ExcelUtil<DklWarningInformation> util = new ExcelUtil<DklWarningInformation>(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));
}
}