127 lines
4.9 KiB
Java
127 lines
4.9 KiB
Java
package com.gunshi.project.xyt.controller;
|
||
|
||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||
import com.gunshi.core.result.R;
|
||
import com.gunshi.project.xyt.entity.so.OsmoticDetailQuerySo;
|
||
import com.gunshi.project.xyt.entity.so.OsmoticQueryPageSo;
|
||
import com.gunshi.project.xyt.entity.so.OsmoticQuerySo;
|
||
import com.gunshi.project.xyt.entity.vo.OsmoticChartVo;
|
||
import com.gunshi.project.xyt.entity.vo.OsmoticPressDetailVo;
|
||
import com.gunshi.project.xyt.entity.vo.OsmoticPressVo;
|
||
import com.gunshi.project.xyt.entity.vo.OsmoticStationVo;
|
||
import com.gunshi.project.xyt.model.OsmoticPressR;
|
||
import com.gunshi.project.xyt.service.OsmoticPressRService;
|
||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||
import com.gunshi.project.xyt.validate.markers.Update;
|
||
import io.swagger.v3.oas.annotations.Operation;
|
||
import io.swagger.v3.oas.annotations.media.Schema;
|
||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||
import jakarta.servlet.http.HttpServletResponse;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
import org.springframework.validation.annotation.Validated;
|
||
import org.springframework.web.bind.annotation.*;
|
||
|
||
import java.io.Serializable;
|
||
import java.util.List;
|
||
|
||
/**
|
||
* 描述: 渗压监测记录表
|
||
* author: xusan
|
||
* date: 2024-07-08 17:40:37
|
||
*/
|
||
@Tag(name = "渗压监测记录表")
|
||
@RestController
|
||
@RequestMapping(value="/osmoticPressR")
|
||
public class OsmoticPressRController {
|
||
|
||
@Autowired
|
||
private OsmoticPressRService service;
|
||
|
||
|
||
@Operation(summary = "新增")
|
||
@PostMapping("/insert")
|
||
public R<OsmoticPressR> insert(@Validated(Insert.class) @RequestBody OsmoticPressR dto) {
|
||
boolean result = service.save(dto);
|
||
return R.ok(result ? dto : null);
|
||
}
|
||
|
||
@Operation(summary = "修改")
|
||
@PostMapping("/update")
|
||
public R<OsmoticPressR> update(@Validated(Update.class) @RequestBody OsmoticPressR dto) {
|
||
boolean result = service.updateById(dto);
|
||
return R.ok(result ? dto : null);
|
||
}
|
||
|
||
@Operation(summary = "删除")
|
||
@GetMapping("/del/{id}")
|
||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||
return R.ok(service.removeById(id));
|
||
}
|
||
|
||
@Operation(summary = "列表")
|
||
@PostMapping("/list")
|
||
public R<List<OsmoticPressR>> list() {
|
||
return R.ok(service.lambdaQuery().list());
|
||
}
|
||
|
||
@Operation(summary = "分页")
|
||
@PostMapping("/page")
|
||
public R<Page<OsmoticPressR>> page(@RequestBody OsmoticQueryPageSo osmoticQueryPageSo) {
|
||
return R.ok(service.queryPage(osmoticQueryPageSo));
|
||
}
|
||
|
||
@Operation(summary = "布置图-渗压/渗流监测")
|
||
@GetMapping("/list/value")
|
||
public R<List<OsmoticPressVo>> listValue(@Schema(name = "type",description = "类型(1渗压 2渗流)") @RequestParam("type") Integer type) {
|
||
return R.ok(service.listValue(type));
|
||
}
|
||
|
||
@Operation(summary = "布置图-按测站查询渗压/渗流监测数据")
|
||
@PostMapping("/detail/value")
|
||
public R<List<OsmoticPressDetailVo>> detailValue(@RequestBody @Validated OsmoticDetailQuerySo so) {
|
||
return R.ok(service.detailValue(so));
|
||
}
|
||
|
||
@Operation(summary = "测值查询(数据表)")
|
||
@PostMapping("/query/value")
|
||
public R<List<OsmoticStationVo>> queryValue(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||
return R.ok(service.queryValue(osmoticQuerySo,null));
|
||
}
|
||
|
||
@Operation(summary = "测值查询(多图单表)")
|
||
@PostMapping("/query/chart")
|
||
public R<List<OsmoticChartVo>> queryChart(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||
return R.ok(service.queryChart(osmoticQuerySo,null));
|
||
}
|
||
|
||
@Operation(summary = "浸润线查询")
|
||
@PostMapping("/infiltra/line")
|
||
public R<List<OsmoticStationVo>> infiltraLine(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||
return R.ok(service.infiltraLine(osmoticQuerySo));
|
||
}
|
||
|
||
@Operation(summary = "浸润线导出")
|
||
@PostMapping( "/export")
|
||
public void export(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo, HttpServletResponse response) {
|
||
service.export(osmoticQuerySo,response);
|
||
}
|
||
|
||
@Operation(summary = "年度渗压/渗流统计(表格)")
|
||
@PostMapping("/year/stat")
|
||
public R<List<OsmoticStationVo>> yearStat(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||
return R.ok(service.yearStat(osmoticQuerySo));
|
||
}
|
||
|
||
@Operation(summary = "年度渗压/渗流统计(全年度特征值统计)")
|
||
@PostMapping("/year/stat/value")
|
||
public R<List<OsmoticChartVo>> yearStatValue(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||
return R.ok(service.yearStatValue(osmoticQuerySo));
|
||
}
|
||
|
||
@Operation(summary = "年度渗压/渗流统计导出")
|
||
@PostMapping( "/year/stat/export")
|
||
public void yearStatExport(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo, HttpServletResponse response) {
|
||
service.yearStatExport(osmoticQuerySo,response);
|
||
}
|
||
|
||
} |