package com.ruoyi.dl.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import com.ruoyi.task.DataAssembleUtil; 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.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.dl.domain.DlShebeixxCd; import com.ruoyi.dl.service.IDlShebeixxCdService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 设备测点Controller * * @author ruoyi * @date 2023-09-13 */ @RestController @RequestMapping("/dl/cd") public class DlShebeixxCdController extends BaseController { @Autowired private IDlShebeixxCdService dlShebeixxCdService; /** * 查询设备测点列表 */ @PreAuthorize("@ss.hasPermi('dl:cd:list')") @GetMapping("/list") public TableDataInfo list(DlShebeixxCd dlShebeixxCd) { startPage(); List list = dlShebeixxCdService.selectDlShebeixxCdList(dlShebeixxCd); return getDataTable(list); } /** * 发送测点详细信息 */ @PreAuthorize("@ss.hasPermi('dl:cd:query')") @GetMapping(value = "/faSong") public AjaxResult faSong(){ DataAssembleUtil.AssembleBDZSBJCSJ();//测点信息 return success(); } /** * 导出设备测点列表 */ @PreAuthorize("@ss.hasPermi('dl:cd:export')") @Log(title = "设备测点", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DlShebeixxCd dlShebeixxCd) { List list = dlShebeixxCdService.selectDlShebeixxCdList(dlShebeixxCd); ExcelUtil util = new ExcelUtil(DlShebeixxCd.class); util.exportExcel(response, list, "设备测点数据"); } /** * 获取设备测点详细信息 */ @PreAuthorize("@ss.hasPermi('dl:cd:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(dlShebeixxCdService.selectDlShebeixxCdById(id)); } /** * 新增设备测点 */ @PreAuthorize("@ss.hasPermi('dl:cd:add')") @Log(title = "设备测点", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DlShebeixxCd dlShebeixxCd) { return toAjax(dlShebeixxCdService.insertDlShebeixxCd(dlShebeixxCd)); } /** * 修改设备测点 */ @PreAuthorize("@ss.hasPermi('dl:cd:edit')") @Log(title = "设备测点", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DlShebeixxCd dlShebeixxCd) { return toAjax(dlShebeixxCdService.updateDlShebeixxCd(dlShebeixxCd)); } /** * 删除设备测点 */ @PreAuthorize("@ss.hasPermi('dl:cd:remove')") @Log(title = "设备测点", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(dlShebeixxCdService.deleteDlShebeixxCdByIds(ids)); } }