package com.odcc.cpzidc.web.controller.bis; import java.util.List; import javax.servlet.http.HttpServletResponse; 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.odcc.cpzidc.common.annotation.Log; import com.odcc.cpzidc.common.core.controller.BaseController; import com.odcc.cpzidc.common.core.domain.AjaxResult; import com.odcc.cpzidc.common.enums.BusinessType; import com.odcc.cpzidc.bis.domain.IdcUseGreen; import com.odcc.cpzidc.bis.service.IIdcUseGreenService; import com.odcc.cpzidc.common.utils.poi.ExcelUtil; import com.odcc.cpzidc.common.core.page.TableDataInfo; /** * 绿色运行指标信息Controller * * @author ruoyi * @date 2024-10-10 */ @RestController @RequestMapping("/bis/useGreen") public class IdcUseGreenController extends BaseController { @Autowired private IIdcUseGreenService idcUseGreenService; /** * 查询绿色运行指标信息列表 */ @PreAuthorize("@ss.hasPermi('bis:useGreen:list')") @GetMapping("/list") public TableDataInfo list(IdcUseGreen idcUseGreen) { startPage(); List list = idcUseGreenService.selectIdcUseGreenList(idcUseGreen); return getDataTable(list); } /** * 导出绿色运行指标信息列表 */ @PreAuthorize("@ss.hasPermi('bis:useGreen:export')") @Log(title = "绿色运行指标信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, IdcUseGreen idcUseGreen) { List list = idcUseGreenService.selectIdcUseGreenList(idcUseGreen); ExcelUtil util = new ExcelUtil(IdcUseGreen.class); util.exportExcel(response, list, "绿色运行指标信息数据"); } /** * 获取绿色运行指标信息详细信息 */ @PreAuthorize("@ss.hasPermi('bis:useGreen:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(idcUseGreenService.selectIdcUseGreenById(id)); } /** * 新增绿色运行指标信息 */ @PreAuthorize("@ss.hasPermi('bis:useGreen:add')") @Log(title = "绿色运行指标信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody IdcUseGreen idcUseGreen) { return toAjax(idcUseGreenService.insertIdcUseGreen(idcUseGreen)); } /** * 修改绿色运行指标信息 */ @PreAuthorize("@ss.hasPermi('bis:useGreen:edit')") @Log(title = "绿色运行指标信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody IdcUseGreen idcUseGreen) { return toAjax(idcUseGreenService.updateIdcUseGreen(idcUseGreen)); } /** * 删除绿色运行指标信息 */ @PreAuthorize("@ss.hasPermi('bis:useGreen:remove')") @Log(title = "绿色运行指标信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(idcUseGreenService.deleteIdcUseGreenByIds(ids)); } }