task61-告警保护方案增删改查

This commit is contained in:
2025-10-24 19:08:57 +08:00
parent 4a0075b606
commit 0108b4f108
10 changed files with 657 additions and 8 deletions

View File

@ -0,0 +1,105 @@
package com.xzzn.web.controller.ems;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.xzzn.ems.service.IEmsFaultProtectionPlanService;
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.xzzn.common.annotation.Log;
import com.xzzn.common.core.controller.BaseController;
import com.xzzn.common.core.domain.AjaxResult;
import com.xzzn.common.enums.BusinessType;
import com.xzzn.ems.domain.EmsFaultProtectionPlan;
import com.xzzn.common.utils.poi.ExcelUtil;
import com.xzzn.common.core.page.TableDataInfo;
/**
* 故障告警保护方案Controller
*
* @author xzzn
* @date 2025-10-22
*/
@RestController
@RequestMapping("/ems/protectPlan")
public class EmsFaultProtectionPlanController extends BaseController
{
@Autowired
private IEmsFaultProtectionPlanService emsFaultProtectionPlanService;
/**
* 查询故障告警保护方案列表
*/
@PreAuthorize("@ss.hasPermi('system:plan:list')")
@GetMapping("/list")
public TableDataInfo list(EmsFaultProtectionPlan emsFaultProtectionPlan)
{
startPage();
List<EmsFaultProtectionPlan> list = emsFaultProtectionPlanService.selectEmsFaultProtectionPlanList(emsFaultProtectionPlan);
return getDataTable(list);
}
/**
* 导出故障告警保护方案列表
*/
@PreAuthorize("@ss.hasPermi('system:plan:export')")
@Log(title = "故障告警保护方案", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EmsFaultProtectionPlan emsFaultProtectionPlan)
{
List<EmsFaultProtectionPlan> list = emsFaultProtectionPlanService.selectEmsFaultProtectionPlanList(emsFaultProtectionPlan);
ExcelUtil<EmsFaultProtectionPlan> util = new ExcelUtil<EmsFaultProtectionPlan>(EmsFaultProtectionPlan.class);
util.exportExcel(response, list, "故障告警保护方案数据");
}
/**
* 获取故障告警保护方案详细信息
*/
@PreAuthorize("@ss.hasPermi('system:plan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(emsFaultProtectionPlanService.selectEmsFaultProtectionPlanById(id));
}
/**
* 新增故障告警保护方案
*/
@PreAuthorize("@ss.hasPermi('system:plan:add')")
@Log(title = "故障告警保护方案", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EmsFaultProtectionPlan emsFaultProtectionPlan)
{
return toAjax(emsFaultProtectionPlanService.insertEmsFaultProtectionPlan(emsFaultProtectionPlan));
}
/**
* 修改故障告警保护方案
*/
@PreAuthorize("@ss.hasPermi('system:plan:edit')")
@Log(title = "故障告警保护方案", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EmsFaultProtectionPlan emsFaultProtectionPlan)
{
return toAjax(emsFaultProtectionPlanService.updateEmsFaultProtectionPlan(emsFaultProtectionPlan));
}
/**
* 删除故障告警保护方案
*/
@PreAuthorize("@ss.hasPermi('system:plan:remove')")
@Log(title = "故障告警保护方案", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(emsFaultProtectionPlanService.deleteEmsFaultProtectionPlanByIds(ids));
}
}