|
@@ -0,0 +1,105 @@
|
|
|
+package com.ruoyi.web.controller.mobile;
|
|
|
+
|
|
|
+import com.ruoyi.common.annotation.Log;
|
|
|
+import com.ruoyi.common.annotation.RepeatSubmit;
|
|
|
+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.gas.domain.bo.GValveWellInspectionBo;
|
|
|
+import com.ruoyi.gas.domain.vo.GValveWellInspectionVo;
|
|
|
+import com.ruoyi.gas.service.IGValveWellInspectionService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import javax.validation.constraints.NotEmpty;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 阀井巡查Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2024-03-18
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@Api(value = "阀井巡查控制器", tags = {"阀井巡查管理"})
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
+@RestController
|
|
|
+@RequestMapping("/mobile/valveWellInspection")
|
|
|
+public class MValveWellInspectionController extends BaseController {
|
|
|
+
|
|
|
+ private final IGValveWellInspectionService iGValveWellInspectionService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询阀井巡查列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询阀井巡查列表")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public AjaxResult<?> list(@Validated(QueryGroup.class) GValveWellInspectionBo bo) {
|
|
|
+ return AjaxResult.success(iGValveWellInspectionService.queryPageList(bo).getRows());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出阀井巡查列表
|
|
|
+ */
|
|
|
+ @ApiOperation("导出阀井巡查列表")
|
|
|
+ @Log(title = "阀井巡查", businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ public void export(@Validated GValveWellInspectionBo bo, HttpServletResponse response) {
|
|
|
+ List<GValveWellInspectionVo> list = iGValveWellInspectionService.queryList(bo);
|
|
|
+ ExcelUtil.exportExcel(list, "阀井巡查", GValveWellInspectionVo.class, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取阀井巡查详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获取阀井巡查详细信息")
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ public AjaxResult<GValveWellInspectionVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
+ @PathVariable("id") Long id) {
|
|
|
+ return AjaxResult.success(iGValveWellInspectionService.queryById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增阀井巡查
|
|
|
+ */
|
|
|
+ @ApiOperation("新增阀井巡查")
|
|
|
+ @Log(title = "阀井巡查", businessType = BusinessType.INSERT)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PostMapping()
|
|
|
+ public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody GValveWellInspectionBo bo) {
|
|
|
+ return toAjax(iGValveWellInspectionService.insertByBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改阀井巡查
|
|
|
+ */
|
|
|
+ @ApiOperation("修改阀井巡查")
|
|
|
+ @Log(title = "阀井巡查", businessType = BusinessType.UPDATE)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PutMapping()
|
|
|
+ public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody GValveWellInspectionBo bo) {
|
|
|
+ return toAjax(iGValveWellInspectionService.updateByBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除阀井巡查
|
|
|
+ */
|
|
|
+ @ApiOperation("删除阀井巡查")
|
|
|
+ @Log(title = "阀井巡查" , businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
+ @PathVariable Long[] ids) {
|
|
|
+ return toAjax(iGValveWellInspectionService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|