2025-11-03 16:47:35 +08:00
|
|
|
|
package com.gunshi.project.hsz.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
|
import com.gunshi.core.result.R;
|
|
|
|
|
|
|
|
|
|
|
|
import com.gunshi.project.hsz.entity.dto.ArtificialJcskSyDeleteDto;
|
|
|
|
|
|
import com.gunshi.project.hsz.entity.so.JcskSyRPageSo;
|
|
|
|
|
|
import com.gunshi.project.hsz.entity.so.OsmoticDetailQuerySo;
|
|
|
|
|
|
import com.gunshi.project.hsz.entity.so.OsmoticQuerySo;
|
|
|
|
|
|
import com.gunshi.project.hsz.entity.vo.*;
|
|
|
|
|
|
import com.gunshi.project.hsz.model.JcskSyR;
|
|
|
|
|
|
import com.gunshi.project.hsz.service.JcskSyRService;
|
2025-11-04 16:14:38 +08:00
|
|
|
|
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
|
|
|
|
|
import com.gunshi.project.hsz.common.validate.markers.Update;
|
2025-11-03 16:47:35 +08:00
|
|
|
|
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.util.List;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
@Tag(name = "渗流压力水位")
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
@RequestMapping(value="/osmoticPressR")
|
|
|
|
|
|
public class JcskSyRController {
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
private JcskSyRService service;
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "获取dvcd")
|
|
|
|
|
|
@GetMapping("/list/dvcd")
|
|
|
|
|
|
public R<List<DmDvcdVo>> listDvcd(){
|
|
|
|
|
|
List<DmDvcdVo> res = service.listDvcd();
|
|
|
|
|
|
return R.ok(res);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "获取测站编码和测站编号")
|
|
|
|
|
|
@GetMapping("/list/stcdMpcd")
|
|
|
|
|
|
public R<List<SyStcdMpcdVo>> listStcdMpcd(){
|
|
|
|
|
|
return R.ok(service.listStcdMpcd());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "分页")
|
|
|
|
|
|
@PostMapping("/page")
|
|
|
|
|
|
public R<Page<JcskSyR>> page(@RequestBody @Validated JcskSyRPageSo page) {
|
|
|
|
|
|
return R.ok(service.pageQuery(page));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "人工分页")
|
|
|
|
|
|
@PostMapping("/artificial/page")
|
|
|
|
|
|
public R<Page<JcskSyR>> artificialPage(@RequestBody @Validated JcskSyRPageSo page) {
|
|
|
|
|
|
return R.ok(service.artificialPage(page));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "人工分页-导出")
|
|
|
|
|
|
@PostMapping("/artificial/export")
|
|
|
|
|
|
public void artificialExport(@RequestBody @Validated JcskSyRPageSo page,HttpServletResponse response){
|
|
|
|
|
|
service.artificialExport(page,response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "历史")
|
|
|
|
|
|
@PostMapping("/history")
|
|
|
|
|
|
public R<Page<JcskSyRHisVo>> historyPage(@RequestBody @Validated JcskSyRPageSo page) {
|
|
|
|
|
|
return R.ok(service.historyPage(page));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "新增")
|
|
|
|
|
|
@PostMapping("/artificial/insert")
|
|
|
|
|
|
public R<JcskSyR> insert(@Validated(Insert.class) @RequestBody JcskSyR dto) {
|
|
|
|
|
|
// // 通过时间戳去除毫秒
|
|
|
|
|
|
// long currentTime = System.currentTimeMillis();
|
|
|
|
|
|
// long seconds = currentTime / 1000; // 去掉毫秒部分
|
|
|
|
|
|
// Date dateWithoutMillis = new Date(seconds * 1000); // 转回毫秒时间戳
|
|
|
|
|
|
// dto.setTm(dateWithoutMillis);
|
|
|
|
|
|
boolean result = service.saveData(dto);
|
|
|
|
|
|
return R.ok(result ? dto : null);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "修改")
|
|
|
|
|
|
@PostMapping("/artificial/update")
|
|
|
|
|
|
public R<JcskSyR> update(@Validated(Update.class) @RequestBody JcskSyR dto) {
|
|
|
|
|
|
boolean update = service.updateData(dto);
|
|
|
|
|
|
return R.ok(update ? dto : null);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "删除")
|
|
|
|
|
|
@PostMapping("/artificial/delete")
|
|
|
|
|
|
public R<Boolean> del(@RequestBody @Validated ArtificialJcskSyDeleteDto dto) {
|
|
|
|
|
|
boolean delete = service.deleteData(dto);
|
|
|
|
|
|
return R.ok(delete);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "大屏-大坝安全监测统计")
|
|
|
|
|
|
@GetMapping("/stat")
|
|
|
|
|
|
public R<Map<Integer,Integer>> stat() {
|
|
|
|
|
|
return R.ok(service.stat());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "列表")
|
|
|
|
|
|
@PostMapping("/list")
|
|
|
|
|
|
public R<List<JcskSyR>> list() {
|
|
|
|
|
|
return R.ok(service.lambdaQuery().list());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "布置图-渗压/渗流监测")
|
|
|
|
|
|
@GetMapping("/list/value")
|
|
|
|
|
|
public R<List<JcskSyRVo>> 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<OsmoticStationVo2>> queryValue(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
|
|
|
|
|
return R.ok(service.queryValue(osmoticQuerySo,null));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "测值查询(多图单表)")
|
|
|
|
|
|
@PostMapping("/query/chart")
|
|
|
|
|
|
public R<List<OsmoticChartVo2>> queryChart(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
|
|
|
|
|
return R.ok(service.queryChart(osmoticQuerySo,null));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "浸润线查询")
|
|
|
|
|
|
@PostMapping("/infiltra/line")
|
|
|
|
|
|
public R<List<OsmoticStationVo2>> 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<OsmoticStationVo2>> yearStat(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
|
|
|
|
|
return R.ok(service.yearStat(osmoticQuerySo));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "年度渗压/渗流统计(全年度特征值统计)")
|
|
|
|
|
|
@PostMapping("/year/stat/value")
|
|
|
|
|
|
public R<List<OsmoticChartVo2>> 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);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|