gunshi-project-ss/src/main/java/com/gunshi/project/xyt/controller/OsmoticPressRController.java

94 lines
3.3 KiB
Java
Raw Normal View History

2024-07-08 17:47:02 +08:00
package com.gunshi.project.xyt.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
2024-07-08 17:47:02 +08:00
import com.gunshi.core.result.R;
2024-07-11 10:58:35 +08:00
import com.gunshi.project.xyt.entity.so.InfiltraLineSo;
import com.gunshi.project.xyt.entity.so.OsmoticQueryPageSo;
2024-07-10 16:28:20 +08:00
import com.gunshi.project.xyt.entity.so.OsmoticQuerySo;
import com.gunshi.project.xyt.entity.vo.OsmoticChartVo;
import com.gunshi.project.xyt.entity.vo.OsmoticStationVo;
2024-07-08 17:47:02 +08:00
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;
2024-07-11 13:36:44 +08:00
import jakarta.servlet.http.HttpServletResponse;
2024-07-08 17:47:02 +08:00
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));
2024-07-08 17:47:02 +08:00
}
2024-07-10 16:28:20 +08:00
@Operation(summary = "测值查询(数据表)")
@PostMapping("/query/value")
public R<List<OsmoticStationVo>> queryValue(@RequestBody OsmoticQuerySo osmoticQuerySo) {
return R.ok(service.queryValue(osmoticQuerySo));
}
@Operation(summary = "测值查询(多图单表)")
@PostMapping("/query/chart")
public R<List<OsmoticChartVo>> queryChart(@RequestBody OsmoticQuerySo osmoticQuerySo) {
return R.ok(service.queryChart(osmoticQuerySo));
}
2024-07-11 10:58:35 +08:00
@Operation(summary = "浸润线查询")
@PostMapping("/infiltra/line")
public R<List<OsmoticStationVo>> infiltraLine(@RequestBody InfiltraLineSo infiltraLineSo) {
return R.ok(service.infiltraLine(infiltraLineSo));
}
2024-07-11 13:36:44 +08:00
@Operation(summary = "浸润线导出")
@PostMapping( "/export")
public void export(@RequestBody InfiltraLineSo infiltraLineSo, HttpServletResponse response) {
service.export(infiltraLineSo,response);
}
2024-07-08 17:47:02 +08:00
}