|
@@ -0,0 +1,89 @@
|
|
|
+package com.hjy.modlue.gather;
|
|
|
+
|
|
|
+import com.hjy.common.annotation.Log;
|
|
|
+import com.hjy.common.core.controller.BaseController;
|
|
|
+import com.hjy.common.core.domain.AjaxResult;
|
|
|
+import com.hjy.common.enums.BusinessType;
|
|
|
+import com.hjy.common.utils.poi.ExcelUtil;
|
|
|
+import com.hjy.module.service.gather.ICbGatherWarningService;
|
|
|
+import com.hjy.module.vo.gather.CbGatherWarningVo;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import com.hjy.common.core.page.TableDataInfo;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 数据采集预警Controller
|
|
|
+ *
|
|
|
+ * @author Tellsea
|
|
|
+ * @date 2023-08-30
|
|
|
+ */
|
|
|
+@Api(tags = "数据采集预警Controller")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/gather/WARNING")
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
+public class CbGatherWarningController extends BaseController {
|
|
|
+
|
|
|
+ private final ICbGatherWarningService cbGatherWarningService;
|
|
|
+
|
|
|
+ @ApiOperation("查询数据采集预警列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('gather:GATHERWARNING:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo<CbGatherWarningVo> list(CbGatherWarningVo entity) {
|
|
|
+ return cbGatherWarningService.queryList(entity);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("查询数据采集预警所有列表")
|
|
|
+ @GetMapping("/listAll")
|
|
|
+ public AjaxResult listAll(CbGatherWarningVo entity) {
|
|
|
+ return AjaxResult.success("查询成功", cbGatherWarningService.queryAll(entity));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("导出数据采集预警列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('gather:GATHERWARNING:export')")
|
|
|
+ @Log(title = "数据采集预警", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, CbGatherWarningVo entity) {
|
|
|
+ List<CbGatherWarningVo> list = cbGatherWarningService.queryAll(entity);
|
|
|
+ ExcelUtil<CbGatherWarningVo> util = new ExcelUtil<>(CbGatherWarningVo.class);
|
|
|
+ util.exportExcel(response, list, "数据采集预警数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("获取数据采集预警详细信息")
|
|
|
+ @PreAuthorize("@ss.hasPermi('gather:GATHERWARNING:query')")
|
|
|
+ @GetMapping(value = "/getInfo/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") String id) {
|
|
|
+ return AjaxResult.success("查询成功", cbGatherWarningService.queryById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("新增数据采集预警")
|
|
|
+ @PreAuthorize("@ss.hasPermi('gather:GATHERWARNING:add')")
|
|
|
+ @Log(title = "数据采集预警", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping("add")
|
|
|
+ public AjaxResult add(@RequestBody CbGatherWarningVo entity) {
|
|
|
+ return toAjax(cbGatherWarningService.save(entity));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("修改数据采集预警")
|
|
|
+ @PreAuthorize("@ss.hasPermi('gather:GATHERWARNING:edit')")
|
|
|
+ @Log(title = "数据采集预警", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("edit")
|
|
|
+ public AjaxResult edit(@RequestBody CbGatherWarningVo entity) {
|
|
|
+ return toAjax(cbGatherWarningService.updateById(entity));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("删除数据采集预警")
|
|
|
+ @PreAuthorize("@ss.hasPermi('gather:GATHERWARNING:remove')")
|
|
|
+ @Log(title = "数据采集预警", businessType = BusinessType.DELETE)
|
|
|
+ @GetMapping("/remove/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable String[] ids) {
|
|
|
+ return toAjax(cbGatherWarningService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|