package com.sooka.sponest.data.digitalemergency.controller; import com.ruoyi.common.core.utils.poi.ExcelUtil; import com.ruoyi.common.core.web.controller.BaseController; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; import com.ruoyi.common.security.annotation.RequiresPermissions; import com.sooka.sponest.data.digitalemergency.domain.CentereventTEmergencyDangerdeptmap; import com.sooka.sponest.data.digitalemergency.service.ICentereventTEmergencyDangerdeptmapService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 隐患对应部门Controller * * @author ruoyi * @date 2022-07-20 */ @RestController @RequestMapping("/dangerdeptmap") public class CentereventTEmergencyDangerdeptmapController extends BaseController { @Autowired private ICentereventTEmergencyDangerdeptmapService centereventTEmergencyDangerdeptmapService; /** * 查询隐患对应部门列表 */ @RequiresPermissions("dangerdeptmap:dangerdeptmap:list") @GetMapping("/list") public TableDataInfo list(CentereventTEmergencyDangerdeptmap centereventTEmergencyDangerdeptmap) { startPage(); List list = centereventTEmergencyDangerdeptmapService.selectCentereventTEmergencyDangerdeptmapList(centereventTEmergencyDangerdeptmap); return getDataTable(list); } /** * 导出隐患对应部门列表 */ @RequiresPermissions("dangerdeptmap:dangerdeptmap:export") @Log(title = "隐患对应部门", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, CentereventTEmergencyDangerdeptmap centereventTEmergencyDangerdeptmap) { List list = centereventTEmergencyDangerdeptmapService.selectCentereventTEmergencyDangerdeptmapList(centereventTEmergencyDangerdeptmap); ExcelUtil util = new ExcelUtil<>(CentereventTEmergencyDangerdeptmap.class); util.exportExcel(response, list, "隐患对应部门数据"); } /** * 获取隐患对应部门详细信息 */ @RequiresPermissions("dangerdeptmap:dangerdeptmap:query") @GetMapping(value = "/{pkId}") public AjaxResult getInfo(@PathVariable("pkId") String pkId) { return AjaxResult.success(centereventTEmergencyDangerdeptmapService.selectCentereventTEmergencyDangerdeptmapByPkId(pkId)); } /** * 新增隐患对应部门 */ @RequiresPermissions("dangerdeptmap:dangerdeptmap:add") @Log(title = "隐患对应部门", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody CentereventTEmergencyDangerdeptmap centereventTEmergencyDangerdeptmap) { return toAjax(centereventTEmergencyDangerdeptmapService.insertCentereventTEmergencyDangerdeptmap(centereventTEmergencyDangerdeptmap)); } /** * 修改隐患对应部门 */ @RequiresPermissions("dangerdeptmap:dangerdeptmap:edit") @Log(title = "隐患对应部门", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody CentereventTEmergencyDangerdeptmap centereventTEmergencyDangerdeptmap) { return toAjax(centereventTEmergencyDangerdeptmapService.updateCentereventTEmergencyDangerdeptmap(centereventTEmergencyDangerdeptmap)); } /** * 删除隐患对应部门 */ @RequiresPermissions("dangerdeptmap:dangerdeptmap:remove") @Log(title = "隐患对应部门", businessType = BusinessType.DELETE) @DeleteMapping("/{pkIds}") public AjaxResult remove(@PathVariable String[] pkIds) { return toAjax(centereventTEmergencyDangerdeptmapService.deleteCentereventTEmergencyDangerdeptmapByPkIds(pkIds)); } }