diff --git a/Dkl-Vue-master/dkl-large/src/main/java/com/dkl/large/controller/DklWarningThresholdController.java b/Dkl-Vue-master/dkl-large/src/main/java/com/dkl/large/controller/DklWarningThresholdController.java new file mode 100644 index 0000000..fe9651f --- /dev/null +++ b/Dkl-Vue-master/dkl-large/src/main/java/com/dkl/large/controller/DklWarningThresholdController.java @@ -0,0 +1,109 @@ +package com.dkl.large.controller; + +import java.util.Date; +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.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.DklWarningThreshold; +import com.dkl.large.service.IDklWarningThresholdService; +import com.dkl.common.utils.poi.ExcelUtil; +import com.dkl.common.core.page.TableDataInfo; + +/** + * 容量阀值Controller + * + * @author Dkl + * @date 2025-06-07 + */ +@RestController +@RequestMapping("/large/threshold") +public class DklWarningThresholdController extends BaseController +{ + @Autowired + private IDklWarningThresholdService dklWarningThresholdService; + + /** + * 查询容量阀值列表 + */ + @GetMapping("/list") + public TableDataInfo list(DklWarningThreshold dklWarningThreshold) + { + startPage(); + List list = dklWarningThresholdService.selectDklWarningThresholdList(dklWarningThreshold); + return getDataTable(list); + } + + /** + * 导出容量阀值列表 + */ + @Log(title = "容量阀值", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DklWarningThreshold dklWarningThreshold) + { + List list = dklWarningThresholdService.selectDklWarningThresholdList(dklWarningThreshold); + ExcelUtil util = new ExcelUtil(DklWarningThreshold.class); + util.exportExcel(response, list, "容量阀值数据"); + } + + /** + * 获取容量阀值详细信息 + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) + { + return success(dklWarningThresholdService.selectDklWarningThresholdById(id)); + } + + /** + * 新增容量阀值 + */ + @Log(title = "容量阀值", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DklWarningThreshold dklWarningThreshold) + { + //添加系统信息 + dklWarningThreshold.setDelFlag("0"); + dklWarningThreshold.setCreateTime(new Date()); + dklWarningThreshold.setCreateBy(getUsername()); + dklWarningThreshold.setDeptId(getDeptId()); + dklWarningThreshold.setUpdateTime(new Date()); + dklWarningThreshold.setUpdateBy(getUsername()); + return toAjax(dklWarningThresholdService.insertDklWarningThreshold(dklWarningThreshold)); + } + + /** + * 修改容量阀值 + */ + @Log(title = "容量阀值", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DklWarningThreshold dklWarningThreshold) + { + //添加系统信息 + dklWarningThreshold.setUpdateTime(new Date()); + dklWarningThreshold.setUpdateBy(getUsername()); + return toAjax(dklWarningThresholdService.updateDklWarningThreshold(dklWarningThreshold)); + } + + /** + * 删除容量阀值 + */ + @Log(title = "容量阀值", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable int[] ids) + { + return toAjax(dklWarningThresholdService.deleteDklWarningThresholdByIds(ids)); + } +}