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 insert(@Validated(Insert.class) @RequestBody OsmoticPressR dto) { boolean result = service.save(dto); return R.ok(result ? dto : null); } @Operation(summary = "修改") @PostMapping("/update") public R 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 del(@Schema(name = "id") @PathVariable("id") Serializable id) { return R.ok(service.removeById(id)); } @Operation(summary = "列表") @PostMapping("/list") public R> list() { return R.ok(service.lambdaQuery().list()); } @Operation(summary = "分页") @PostMapping("/page") public R> page(@RequestBody OsmoticQueryPageSo osmoticQueryPageSo) { return R.ok(service.queryPage(osmoticQueryPageSo)); } @Operation(summary = "布置图-渗压/渗流监测") @GetMapping("/list/value") public R> listValue(@Schema(name = "type",description = "类型(1渗压 2渗流)") @RequestParam("type") Integer type) { return R.ok(service.listValue(type)); } @Operation(summary = "布置图-按测站查询渗压/渗流监测数据") @PostMapping("/detail/value") public R> detailValue(@RequestBody @Validated OsmoticDetailQuerySo so) { return R.ok(service.detailValue(so)); } @Operation(summary = "测值查询(数据表)") @PostMapping("/query/value") public R> queryValue(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) { return R.ok(service.queryValue(osmoticQuerySo,null)); } @Operation(summary = "测值查询(多图单表)") @PostMapping("/query/chart") public R> queryChart(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) { return R.ok(service.queryChart(osmoticQuerySo,null)); } @Operation(summary = "浸润线查询") @PostMapping("/infiltra/line") public R> 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> yearStat(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) { return R.ok(service.yearStat(osmoticQuerySo)); } @Operation(summary = "年度渗压/渗流统计(全年度特征值统计)") @PostMapping("/year/stat/value") public R> 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); } }