|
@@ -1,81 +0,0 @@
|
|
|
-package com.zksy.web.controller.basic;
|
|
|
|
|
-
|
|
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
-import com.zksy.base.domain.PipeNetworkBase;
|
|
|
|
|
-import com.zksy.base.dto.PipeNetworkPageInDTO;
|
|
|
|
|
-import com.zksy.base.service.PipeNetworkBaseService;
|
|
|
|
|
-import com.zksy.common.annotation.Anonymous;
|
|
|
|
|
-import com.zksy.common.annotation.Log;
|
|
|
|
|
-import com.zksy.common.core.domain.AjaxResult;
|
|
|
|
|
-import com.zksy.common.enums.BusinessType;
|
|
|
|
|
-import io.swagger.annotations.Api;
|
|
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
-
|
|
|
|
|
-@Slf4j
|
|
|
|
|
-@RestController
|
|
|
|
|
-@RequestMapping("/api/pipe-network")
|
|
|
|
|
-@Api(tags = "燃气管网基础数据")
|
|
|
|
|
-public class PipeNetworkController {
|
|
|
|
|
-
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private PipeNetworkBaseService service;
|
|
|
|
|
-
|
|
|
|
|
- @GetMapping("/findByPage")
|
|
|
|
|
- @ApiOperation("管网分页查询")
|
|
|
|
|
- @Anonymous
|
|
|
|
|
- public AjaxResult findByPage(PipeNetworkPageInDTO dto) {
|
|
|
|
|
- Page<PipeNetworkBase> page = service.queryByPage(dto);
|
|
|
|
|
- return AjaxResult.success(page);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @GetMapping("/getById/{id}")
|
|
|
|
|
- @ApiOperation("根据ID查询管网")
|
|
|
|
|
- @Anonymous
|
|
|
|
|
- public AjaxResult getById(@PathVariable String id) {
|
|
|
|
|
- PipeNetworkBase entity = service.getById(id);
|
|
|
|
|
- return entity != null ? AjaxResult.success(entity) : AjaxResult.error("管网信息不存在");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @GetMapping("/options")
|
|
|
|
|
- @ApiOperation("管网下拉选项")
|
|
|
|
|
- @Anonymous
|
|
|
|
|
- public AjaxResult options() {
|
|
|
|
|
- return AjaxResult.success(service.getOptions());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @PostMapping("/save")
|
|
|
|
|
- @ApiOperation("新增管网")
|
|
|
|
|
- @Log(title = "新增管网基础数据", businessType = BusinessType.INSERT)
|
|
|
|
|
- public AjaxResult save(@RequestBody PipeNetworkBase entity) {
|
|
|
|
|
- boolean saved = service.save(entity);
|
|
|
|
|
- return saved ? AjaxResult.success("新增成功", saved) : AjaxResult.error("新增失败");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @PutMapping("/updateById")
|
|
|
|
|
- @ApiOperation("修改管网")
|
|
|
|
|
- @Log(title = "修改管网基础数据", businessType = BusinessType.UPDATE)
|
|
|
|
|
- public AjaxResult updateById(@RequestBody PipeNetworkBase entity) {
|
|
|
|
|
- boolean updated = service.updateById(entity);
|
|
|
|
|
- return updated ? AjaxResult.success("修改成功", updated) : AjaxResult.error("修改失败");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @DeleteMapping("/deleteById")
|
|
|
|
|
- @ApiOperation("删除管网")
|
|
|
|
|
- @Log(title = "删除管网基础数据", businessType = BusinessType.DELETE)
|
|
|
|
|
- public AjaxResult deleteById(@RequestParam String id) {
|
|
|
|
|
- boolean deleted = service.removeById(id);
|
|
|
|
|
- return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @GetMapping("/export")
|
|
|
|
|
- @ApiOperation("导出Excel")
|
|
|
|
|
- @Anonymous
|
|
|
|
|
- public AjaxResult exportData(@RequestParam(required = false) String networkName,
|
|
|
|
|
- @RequestParam(required = false) String status) {
|
|
|
|
|
- // TODO: 实现Excel导出
|
|
|
|
|
- return AjaxResult.success("导出功能待实现");
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|