|
@@ -0,0 +1,113 @@
|
|
|
+package com.ruoyi.gas.controller;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
+
|
|
|
+import com.ruoyi.gas.domain.bo.GRegulatorBoxRelationBo;
|
|
|
+import com.ruoyi.gas.domain.vo.GRegulatorBoxRelationVo;
|
|
|
+import com.ruoyi.gas.service.IGRegulatorBoxRelationService;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import javax.validation.constraints.*;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import com.ruoyi.common.annotation.RepeatSubmit;
|
|
|
+import com.ruoyi.common.annotation.Log;
|
|
|
+import com.ruoyi.common.core.controller.BaseController;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.validate.AddGroup;
|
|
|
+import com.ruoyi.common.core.validate.EditGroup;
|
|
|
+import com.ruoyi.common.core.validate.QueryGroup;
|
|
|
+import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 调压箱目录中间Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2024-05-24
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@Api(value = "调压箱目录中间控制器", tags = {"调压箱目录中间管理"})
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
+@RestController
|
|
|
+@RequestMapping("/gas/regulatorBoxRelation")
|
|
|
+public class GRegulatorBoxRelationController extends BaseController {
|
|
|
+
|
|
|
+ private final IGRegulatorBoxRelationService iGRegulatorBoxRelationService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询调压箱目录中间列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询调压箱目录中间列表")
|
|
|
+// @PreAuthorize("@ss.hasPermi('gas:regulatorBoxRelation:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo<GRegulatorBoxRelationVo> list(@Validated(QueryGroup.class) GRegulatorBoxRelationBo bo) {
|
|
|
+ return iGRegulatorBoxRelationService.queryPageList(bo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出调压箱目录中间列表
|
|
|
+ */
|
|
|
+ @ApiOperation("导出调压箱目录中间列表")
|
|
|
+// @PreAuthorize("@ss.hasPermi('gas:regulatorBoxRelation:export')")
|
|
|
+ @Log(title = "调压箱目录中间", businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ public void export(@Validated GRegulatorBoxRelationBo bo, HttpServletResponse response) {
|
|
|
+ List<GRegulatorBoxRelationVo> list = iGRegulatorBoxRelationService.queryList(bo);
|
|
|
+ ExcelUtil.exportExcel(list, "调压箱目录中间", GRegulatorBoxRelationVo.class, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取调压箱目录中间详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获取调压箱目录中间详细信息")
|
|
|
+// @PreAuthorize("@ss.hasPermi('gas:regulatorBoxRelation:query')")
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ public AjaxResult<GRegulatorBoxRelationVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
+ @PathVariable("id") Long id) {
|
|
|
+ return AjaxResult.success(iGRegulatorBoxRelationService.queryById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增调压箱目录中间
|
|
|
+ */
|
|
|
+ @ApiOperation("新增调压箱目录中间")
|
|
|
+// @PreAuthorize("@ss.hasPermi('gas:regulatorBoxRelation:add')")
|
|
|
+ @Log(title = "调压箱目录中间", businessType = BusinessType.INSERT)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PostMapping()
|
|
|
+ public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody GRegulatorBoxRelationBo bo) {
|
|
|
+ return toAjax(iGRegulatorBoxRelationService.insertByBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改调压箱目录中间
|
|
|
+ */
|
|
|
+ @ApiOperation("修改调压箱目录中间")
|
|
|
+// @PreAuthorize("@ss.hasPermi('gas:regulatorBoxRelation:edit')")
|
|
|
+ @Log(title = "调压箱目录中间", businessType = BusinessType.UPDATE)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PutMapping()
|
|
|
+ public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody GRegulatorBoxRelationBo bo) {
|
|
|
+ return toAjax(iGRegulatorBoxRelationService.updateByBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除调压箱目录中间
|
|
|
+ */
|
|
|
+ @ApiOperation("删除调压箱目录中间")
|
|
|
+// @PreAuthorize("@ss.hasPermi('gas:regulatorBoxRelation:remove')")
|
|
|
+ @Log(title = "调压箱目录中间" , businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
+ @PathVariable Long[] ids) {
|
|
|
+ return toAjax(iGRegulatorBoxRelationService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|