parent
c45a372266
commit
88a5b794fb
|
|
@ -4,8 +4,8 @@ networks:
|
||||||
external: true
|
external: true
|
||||||
driver: bridge
|
driver: bridge
|
||||||
services:
|
services:
|
||||||
hsz-redis:
|
ss-redis:
|
||||||
container_name: hsz-redis
|
container_name: ss-redis
|
||||||
image: redis:latest
|
image: redis:latest
|
||||||
privileged: true
|
privileged: true
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -15,36 +15,36 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- tsg_tsg-bridge
|
- tsg_tsg-bridge
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/hsz/redis/conf/redis.conf:/usr/local/etc/redis/conf/redis.conf
|
- /opt/ss/redis/conf/redis.conf:/usr/local/etc/redis/conf/redis.conf
|
||||||
- /opt/hsz/redis/data:/data
|
- /opt/ss/redis/data:/data
|
||||||
command: redis-server /usr/local/etc/redis/conf/redis.conf
|
command: redis-server /usr/local/etc/redis/conf/redis.conf
|
||||||
|
|
||||||
hsz-proj:
|
ss-proj:
|
||||||
container_name: hsz-proj
|
container_name: ss-proj
|
||||||
image: openjdk:21
|
image: openjdk:21
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
networks:
|
networks:
|
||||||
- tsg_tsg-bridge
|
- tsg_tsg-bridge
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/hsz/java:/app
|
- /opt/ss/java:/app
|
||||||
ports:
|
ports:
|
||||||
- "24305:24305"
|
- "24305:24305"
|
||||||
environment:
|
environment:
|
||||||
- SPRING_PROFILES_ACTIVE=prod
|
- SPRING_PROFILES_ACTIVE=prod
|
||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
depends_on:
|
depends_on:
|
||||||
- hsz-redis
|
- ss-redis
|
||||||
entrypoint: java -cp "gunshi-project-hsz-1.0-SNAPSHOT.jar:./lib/*" com.gunshi.project.hsz.Main
|
entrypoint: java -cp "gunshi-project-ss-1.0-SNAPSHOT.jar:./lib/*" com.gunshi.project.ss.Main
|
||||||
|
|
||||||
hsz-datasync:
|
ss-datasync:
|
||||||
container_name: hsz-datasync
|
container_name: ss-datasync
|
||||||
image: openjdk:21
|
image: openjdk:21
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
networks:
|
networks:
|
||||||
- tsg_tsg-bridge
|
- tsg_tsg-bridge
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/hsz/datasync:/app
|
- /opt/ss/datasync:/app
|
||||||
environment:
|
environment:
|
||||||
- SPRING_PROFILES_ACTIVE=prod
|
- SPRING_PROFILES_ACTIVE=prod
|
||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
entrypoint: java -cp "gunshi-project-hsz-datasync-1.0-SNAPSHOT.jar:./lib/*" com.gunshi.project.hsz.datasync.Main
|
entrypoint: java -cp "gunshi-project-ss-datasync-1.0-SNAPSHOT.jar:./lib/*" com.gunshi.project.ss.datasync.Main
|
||||||
|
|
@ -32,4 +32,20 @@ public interface StStbprpBMapper extends BaseMapper<StStbprpB> {
|
||||||
""")
|
""")
|
||||||
List<StStbprpB> getRsvrStations();
|
List<StStbprpB> getRsvrStations();
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
select * from public.st_stbprp_b b
|
||||||
|
join public.st_stbprp_b_elem e
|
||||||
|
on b.stcd =e.stcd
|
||||||
|
where e.elem = 'z'
|
||||||
|
""")
|
||||||
|
List<StStbprpB> getRiverStations();
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
select * from public.st_stbprp_b b
|
||||||
|
join public.st_stbprp_b_elem e
|
||||||
|
on b.stcd =e.stcd
|
||||||
|
where e.elem = 'flow'
|
||||||
|
""")
|
||||||
|
List<StStbprpB> getFlowStations();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,178 +0,0 @@
|
||||||
//package com.gunshi.project.hsz.controller;
|
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
//import com.gunshi.core.result.R;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticDetailQuerySo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticQueryPageSo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticQuerySo;
|
|
||||||
//import com.gunshi.project.hsz.entity.vo.OsmoticChartVo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.vo.OsmoticPressDetailVo;
|
|
||||||
//import com.gunshi.project.hsz.entity.vo.OsmoticPressVo;
|
|
||||||
//import com.gunshi.project.hsz.entity.vo.OsmoticStationVo;
|
|
||||||
//import com.gunshi.project.hsz.model.OsmoticPressDevice;
|
|
||||||
//import com.gunshi.project.hsz.model.OsmoticPressR;
|
|
||||||
//import com.gunshi.project.hsz.service.OsmoticPressDeviceService;
|
|
||||||
//import com.gunshi.project.hsz.service.OsmoticPressRService;
|
|
||||||
//import com.gunshi.project.hsz.common.validate.markers.Insert;
|
|
||||||
//import com.gunshi.project.hsz.common.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.apache.commons.collections4.CollectionUtils;
|
|
||||||
//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;
|
|
||||||
//import java.util.Map;
|
|
||||||
//import java.util.Objects;
|
|
||||||
//import java.util.stream.Collectors;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * 描述: 渗压监测记录表
|
|
||||||
// * author: xusan
|
|
||||||
// * date: 2024-07-08 17:40:37
|
|
||||||
// */
|
|
||||||
////@Tag(name = "渗压监测记录表")
|
|
||||||
////@RestController
|
|
||||||
////@RequestMapping(value="/osmoticPressR")
|
|
||||||
//public class OsmoticPressRController {
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private OsmoticPressRService service;
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private OsmoticPressDeviceService osmoticPressDeviceService;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// @Operation(summary = "新增")
|
|
||||||
// @PostMapping("/insert")
|
|
||||||
// public R<OsmoticPressR> insert(@Validated(Insert.class) @RequestBody OsmoticPressR dto) {
|
|
||||||
//// // 通过时间戳去除毫秒
|
|
||||||
//// long currentTime = System.currentTimeMillis();
|
|
||||||
//// long seconds = currentTime / 1000; // 去掉毫秒部分
|
|
||||||
//// Date dateWithoutMillis = new Date(seconds * 1000); // 转回毫秒时间戳
|
|
||||||
//// dto.setTm(dateWithoutMillis);
|
|
||||||
// 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) {
|
|
||||||
// LambdaUpdateWrapper<OsmoticPressR> wrapper = new LambdaUpdateWrapper<>();
|
|
||||||
// wrapper.eq(OsmoticPressR::getTm, dto.getTm())
|
|
||||||
// .eq(OsmoticPressR::getStationCode, dto.getStationCode())
|
|
||||||
// .set(OsmoticPressR::getPress, dto.getPress())
|
|
||||||
// .set(OsmoticPressR::getVib, dto.getVib())
|
|
||||||
// .set(OsmoticPressR::getTemp, dto.getTemp())
|
|
||||||
// .set(OsmoticPressR::getValue, dto.getValue())
|
|
||||||
// .set(OsmoticPressR::getChan, dto.getChan());
|
|
||||||
// boolean update = service.update(null, wrapper);
|
|
||||||
// return R.ok(update ? dto : null);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Operation(summary = "删除")
|
|
||||||
// @GetMapping("/del/{id}/{tm}")
|
|
||||||
// public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id,@Schema(name = "tm") @PathVariable("tm") Serializable tm) {
|
|
||||||
// if(Objects.isNull(id) || Objects.isNull(tm)){
|
|
||||||
// return R.ok(false);
|
|
||||||
// }
|
|
||||||
// QueryWrapper<OsmoticPressR> wrapper = new QueryWrapper<>();
|
|
||||||
// wrapper.eq("station_code", id).eq("tm", tm);
|
|
||||||
// return R.ok(service.remove(wrapper));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @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) {
|
|
||||||
// Page<OsmoticPressR> osmoticPressRPage = service.queryPage(osmoticQueryPageSo);
|
|
||||||
// List<OsmoticPressR> records = osmoticPressRPage.getRecords();
|
|
||||||
// if(CollectionUtils.isEmpty(records)){
|
|
||||||
// return R.ok(osmoticPressRPage);
|
|
||||||
// }
|
|
||||||
// List<OsmoticPressR> collect = records.stream().peek(e -> {
|
|
||||||
// LambdaQueryWrapper<OsmoticPressDevice> wq = new LambdaQueryWrapper();
|
|
||||||
// wq.eq(OsmoticPressDevice::getStationCode, e.getStationCode());
|
|
||||||
// List<OsmoticPressDevice> list = osmoticPressDeviceService.list(wq);
|
|
||||||
// if (CollectionUtils.isNotEmpty(list)) {
|
|
||||||
// OsmoticPressDevice osmoticPressDevice = list.stream().findFirst().orElse(null);
|
|
||||||
// e.setProfileCode(osmoticPressDevice.getProfileCode());
|
|
||||||
// }
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// osmoticPressRPage.setRecords(collect);
|
|
||||||
// return R.ok(osmoticPressRPage);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Operation(summary = "大屏-大坝安全监测统计")
|
|
||||||
// @GetMapping("/stat")
|
|
||||||
// public R<Map<Integer,Integer>> stat() {
|
|
||||||
// return R.ok(service.stat());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @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);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
|
|
@ -1,116 +0,0 @@
|
||||||
//package com.gunshi.project.hsz.controller;
|
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
//import com.gunshi.core.result.R;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticDetailQuerySo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticQueryPageSo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticQuerySo;
|
|
||||||
//import com.gunshi.project.hsz.entity.vo.*;
|
|
||||||
//import com.gunshi.project.hsz.model.OsmoticShiftR;
|
|
||||||
//import com.gunshi.project.hsz.service.OsmoticShiftRService;
|
|
||||||
//import com.gunshi.project.hsz.common.validate.markers.Insert;
|
|
||||||
//import com.gunshi.project.hsz.common.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;
|
|
||||||
//import java.util.Objects;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * 描述: 位移监测记录表
|
|
||||||
// * author: xusan
|
|
||||||
// * date: 2024-07-08 17:40:37
|
|
||||||
// */
|
|
||||||
////@Tag(name = "位移监测记录表")
|
|
||||||
////@RestController
|
|
||||||
////@RequestMapping(value="/osmoticShiftR")
|
|
||||||
//public class OsmoticShiftRController {
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private OsmoticShiftRService service;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// @Operation(summary = "新增")
|
|
||||||
// @PostMapping("/insert")
|
|
||||||
// public R<OsmoticShiftR> insert(@Validated(Insert.class) @RequestBody OsmoticShiftR dto) {
|
|
||||||
// // dto.setTm(new Date());
|
|
||||||
// boolean result = service.save(dto);
|
|
||||||
// return R.ok(result ? dto : null);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Operation(summary = "修改")
|
|
||||||
// @PostMapping("/update")
|
|
||||||
// public R<OsmoticShiftR> update(@Validated(Update.class) @RequestBody OsmoticShiftR dto) {
|
|
||||||
// LambdaUpdateWrapper<OsmoticShiftR> wrapper = new LambdaUpdateWrapper<>();
|
|
||||||
// wrapper.eq(OsmoticShiftR::getStationCode, dto.getStationCode())
|
|
||||||
// .eq(OsmoticShiftR::getTm, dto.getTm())
|
|
||||||
// .set(OsmoticShiftR::getX, dto.getX())
|
|
||||||
// .set(OsmoticShiftR::getY, dto.getY())
|
|
||||||
// .set(OsmoticShiftR::getH, dto.getH());
|
|
||||||
// boolean update = service.update(null, wrapper);
|
|
||||||
// return R.ok(update ? dto : null);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Operation(summary = "删除")
|
|
||||||
// @GetMapping("/del/{id}/{tm}")
|
|
||||||
// public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id,@Schema(name = "tm") @PathVariable("tm") Serializable tm) {
|
|
||||||
//
|
|
||||||
// if(Objects.isNull(id) || Objects.isNull(tm)){
|
|
||||||
// return R.ok(false);
|
|
||||||
// }
|
|
||||||
// QueryWrapper<OsmoticShiftR> wrapper = new QueryWrapper<>();
|
|
||||||
// wrapper.eq("station_code", id).eq("tm", tm);
|
|
||||||
// return R.ok(service.remove(wrapper));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Operation(summary = "列表")
|
|
||||||
// @PostMapping("/list")
|
|
||||||
// public R<List<OsmoticShiftR>> list() {
|
|
||||||
// return R.ok(service.lambdaQuery().list());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Operation(summary = "分页")
|
|
||||||
// @PostMapping("/page")
|
|
||||||
// public R<Page<OsmoticShiftR>> page(@RequestBody OsmoticQueryPageSo osmoticQueryPageSo) {
|
|
||||||
// return R.ok(service.queryPage(osmoticQueryPageSo));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Operation(summary = "年度位移统计(表格)")
|
|
||||||
// @PostMapping("/year/stat")
|
|
||||||
// public R<List<OsmoticShiftVo>> 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);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Operation(summary = "布置图-位移监测")
|
|
||||||
// @GetMapping("/list/value")
|
|
||||||
// public R<List<OsmoticShiftListVo>> listValue() {
|
|
||||||
// return R.ok(service.listValue());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Operation(summary = "布置图-按测站查询位移监测数据")
|
|
||||||
// @PostMapping("/detail/value")
|
|
||||||
// public R<List<OsmoticShiftValueVo>> detailValue(@RequestBody @Validated OsmoticDetailQuerySo so) {
|
|
||||||
// return R.ok(service.detailValue(so));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.gunshi.project.ss.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.ss.common.model.StStbprpB;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ProfilePressTreeVo;
|
||||||
|
import com.gunshi.project.ss.model.AttCctvBase;
|
||||||
|
import com.gunshi.project.ss.service.AttCctvBaseService;
|
||||||
|
import com.gunshi.project.ss.service.AttDamProfileService;
|
||||||
|
import com.gunshi.project.ss.service.StStbprpBService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/station")
|
||||||
|
public class StationController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StStbprpBService stStbprpBService;//基本站点信息 雨量,水位,流量,水库
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AttCctvBaseService attCctvBaseService;//视频点
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AttDamProfileService attDamProfileService;//渗压断面
|
||||||
|
|
||||||
|
|
||||||
|
//获取雨量站信息
|
||||||
|
@GetMapping("/rainList")
|
||||||
|
public R<List<StStbprpB>> rainList(){
|
||||||
|
List<StStbprpB> stStbprpBList = stStbprpBService.getPptnStations();
|
||||||
|
return R.ok(stStbprpBList);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取水库水位站信息
|
||||||
|
@GetMapping("/rzList")
|
||||||
|
public R<List<StStbprpB>> rzList(){
|
||||||
|
List<StStbprpB> stStbprpBList = stStbprpBService.getRsvrStations();
|
||||||
|
return R.ok(stStbprpBList);
|
||||||
|
}
|
||||||
|
|
||||||
|
// //获取河道水位站信息
|
||||||
|
// @GetMapping("/riverList")
|
||||||
|
// public R<List<StStbprpB>> riverList(){
|
||||||
|
// List<StStbprpB> stStbprpBList = stStbprpBService.getRiverStations();
|
||||||
|
// return R.ok(stStbprpBList);
|
||||||
|
// }
|
||||||
|
|
||||||
|
//获取流量站信息
|
||||||
|
@GetMapping("/flowList")
|
||||||
|
public R<List<StStbprpB>> flowList(){
|
||||||
|
List<StStbprpB> stStbprpBList = stStbprpBService.getFlowStations();
|
||||||
|
return R.ok(stStbprpBList);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取视频站信息
|
||||||
|
@GetMapping("/cctvList")
|
||||||
|
public R<List<AttCctvBase>> cctvList(){
|
||||||
|
List<AttCctvBase> cctvBases = attCctvBaseService.queryList();
|
||||||
|
return R.ok(cctvBases);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取渗压监测断面与对应测点
|
||||||
|
@GetMapping("/syDmList")
|
||||||
|
public R<List<ProfilePressTreeVo>> syDmList(){
|
||||||
|
List<ProfilePressTreeVo> tree = attDamProfileService.tree();
|
||||||
|
return R.ok(tree);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ package com.gunshi.project.ss.controller;
|
||||||
|
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
import com.gunshi.db.dto.DateRangeSo;
|
import com.gunshi.db.dto.DateRangeSo;
|
||||||
|
import com.gunshi.project.ss.entity.dto.ReportTmSo;
|
||||||
import com.gunshi.project.ss.entity.so.StatisticsQuerySo;
|
import com.gunshi.project.ss.entity.so.StatisticsQuerySo;
|
||||||
import com.gunshi.project.ss.entity.vo.*;
|
import com.gunshi.project.ss.entity.vo.*;
|
||||||
import com.gunshi.project.ss.service.StatisticsService;
|
import com.gunshi.project.ss.service.StatisticsService;
|
||||||
|
|
@ -15,6 +16,9 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -32,26 +36,26 @@ public class StatisticsController{
|
||||||
|
|
||||||
@Operation(summary = "时段降雨日报表")
|
@Operation(summary = "时段降雨日报表")
|
||||||
@PostMapping("/sdJyRb")
|
@PostMapping("/sdJyRb")
|
||||||
public R<List<SdJyRbVo>> sdJyRb(@Validated @RequestBody DateRangeSo dateRangeSo) {
|
public R<List<SdJyRbVo>> sdJyRb(@Validated @RequestBody ReportTmSo reportTmSo) {
|
||||||
return R.ok(service.sdJyRb(dateRangeSo));
|
return R.ok(service.getDailyRain(reportTmSo));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "时段降雨日报表导出")
|
@Operation(summary = "时段降雨日报表导出")
|
||||||
@PostMapping( "/sdJyRb/export")
|
@PostMapping( "/sdJyRb/export")
|
||||||
public void export(@RequestBody @Validated DateRangeSo dateRangeSo, HttpServletResponse response) {
|
public void export(@RequestBody @Validated ReportTmSo reportTmSo, HttpServletResponse response) {
|
||||||
service.sdJyRbExport(dateRangeSo,response);
|
service.sdJyRbExport(reportTmSo,response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "时段水位日报表")
|
@Operation(summary = "时段水位日报表")
|
||||||
@PostMapping("/sdSwRb")
|
@PostMapping("/sdSwRb")
|
||||||
public R<List<SdSwRbVo>> sdSwRb(@Validated @RequestBody DateRangeSo dateRangeSo) {
|
public R<List<SdSwRbVo>> sdSwRb(@Validated @RequestBody ReportTmSo reportTmSo) {
|
||||||
return R.ok(service.sdSwRb(dateRangeSo));
|
return R.ok(service.sdSwRb(reportTmSo));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "时段水位日报表导出")
|
@Operation(summary = "时段水位日报表导出")
|
||||||
@PostMapping("/sdSwRb/export")
|
@PostMapping("/sdSwRb/export")
|
||||||
public void sdSwRbExport(@Validated @RequestBody DateRangeSo dateRangeSo, HttpServletResponse response) {
|
public void sdSwRbExport(@Validated @RequestBody ReportTmSo reportTmSo, HttpServletResponse response) {
|
||||||
service.sdSwRbExport(dateRangeSo,response);
|
service.sdSwRbExport(reportTmSo,response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "日降雨年报表(上方表格)")
|
@Operation(summary = "日降雨年报表(上方表格)")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.gunshi.project.ss.entity.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ReportTmSo {
|
||||||
|
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date date;
|
||||||
|
}
|
||||||
|
|
@ -17,4 +17,6 @@ public class StatisticsQuerySo {
|
||||||
@Schema(description="年份")
|
@Schema(description="年份")
|
||||||
private Integer year;
|
private Integer year;
|
||||||
|
|
||||||
|
@Schema(description = "站点编码")
|
||||||
|
private String stcd;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,11 @@ import java.math.BigDecimal;
|
||||||
public class SdJyRbVo {
|
public class SdJyRbVo {
|
||||||
|
|
||||||
|
|
||||||
|
@ExcelProperty({"${title}","站点名称"})
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期
|
* 日期
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,19 @@ import java.math.BigDecimal;
|
||||||
public class SdSwRbVo {
|
public class SdSwRbVo {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点编码
|
||||||
|
*/
|
||||||
|
@ExcelProperty({"${title}","站点编码"})
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty({"${title}","站点名称"})
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期
|
* 日期
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.gunshi.project.ss.common.model.vo.StRzVo;
|
import com.gunshi.project.ss.common.model.vo.StRzVo;
|
||||||
import com.gunshi.project.ss.model.StPptnRD;
|
import com.gunshi.project.ss.model.StPptnRD;
|
||||||
import com.gunshi.project.ss.model.StPptnRH;
|
import com.gunshi.project.ss.model.StPptnRH;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -17,15 +19,19 @@ import java.util.List;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface StPptnRHMapper extends BaseMapper<StPptnRH> {
|
public interface StPptnRHMapper extends BaseMapper<StPptnRH> {
|
||||||
|
|
||||||
List<StPptnRH> queryList(@Param("start") String start,@Param("end") String end);
|
|
||||||
|
|
||||||
List<StRzVo> queryRzList(@Param("start") String start,@Param("end") String end);
|
List<StRzVo> queryRzListByStcd(@Param("start") String start,@Param("end") String end,@Param("stcd") String stcd);
|
||||||
|
|
||||||
List<StPptnRD> queryDayDrp(@Param("year") Integer year);
|
List<StPptnRD> queryDayDrpByStcd(@Param("year")Integer year,@Param("stcd") String stcd);
|
||||||
|
|
||||||
List<StPptnRH> reorganizePptnRHData(@Param("stcd") String stcd, @Param("maxData") StPptnRH maxData);
|
List<StPptnRH> reorganizePptnRHData(@Param("stcd") String stcd, @Param("maxData") StPptnRH maxData);
|
||||||
|
|
||||||
StPptnRH getMaxData(String stcd);
|
StPptnRH getMaxData(String stcd);
|
||||||
|
|
||||||
List<StPptnRD> queryDayRz(@Param("year") String year);
|
|
||||||
|
List<StPptnRD> queryDayRzByStcd(@Param("year") String year,@Param("stcd") String stcd);
|
||||||
|
|
||||||
|
List<StPptnRH> queryListByStcd(@Param("start") String start, @Param("end") String end, @Param("stcd") String stcd);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,22 +82,6 @@ public interface StbprpBVoMapper {
|
||||||
""")
|
""")
|
||||||
List<StStatusVo> rainList();
|
List<StStatusVo> rainList();
|
||||||
|
|
||||||
// @Select("<script>" +
|
|
||||||
// "SELECT a.stcd AS stcd, a.moditime AS tm, a.z AS waterLevel, " +
|
|
||||||
// "a.q AS flowNum, b.w AS boxNum " +
|
|
||||||
// "FROM st_zqrl_b a " +
|
|
||||||
// "LEFT JOIN st_zvarl_b b ON a.z = b.rz " +
|
|
||||||
// "WHERE 1=1 " +
|
|
||||||
//// "<if test='obj.stcd != null'> " +
|
|
||||||
//// "AND a.stcd = #{obj.stcd} " +
|
|
||||||
//// "</if> " +
|
|
||||||
// "<if test='obj.dateSo != null and obj.dateSo.start != null'> " +
|
|
||||||
// " AND a.moditime >= #{obj.dateSo.start} " +
|
|
||||||
// "</if> " +
|
|
||||||
// "<if test='obj.dateSo != null and obj.dateSo.end != null'> " +
|
|
||||||
// " AND a.moditime <= #{obj.dateSo.end} order by a.moditime desc" +
|
|
||||||
// "</if>" +
|
|
||||||
// "</script>")
|
|
||||||
@Select("""
|
@Select("""
|
||||||
<script>
|
<script>
|
||||||
SELECT a.stcd AS stcd, a.moditime AS tm, a.z AS waterLevel,
|
SELECT a.stcd AS stcd, a.moditime AS tm, a.z AS waterLevel,
|
||||||
|
|
|
||||||
|
|
@ -1,485 +0,0 @@
|
||||||
//package com.gunshi.project.hsz.service;
|
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
||||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
//import com.gunshi.db.dto.DateTimeRangeSo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticDetailQuerySo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticQueryPageSo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticQuerySo;
|
|
||||||
//import com.gunshi.project.hsz.entity.vo.*;
|
|
||||||
//import com.gunshi.project.hsz.mapper.OsmoticPressRMapper;
|
|
||||||
//import com.gunshi.project.hsz.model.OsmoticPressR;
|
|
||||||
//import com.gunshi.project.hsz.util.DataHandleUtil;
|
|
||||||
//import com.gunshi.project.hsz.util.DateUtil;
|
|
||||||
//import com.gunshi.project.hsz.util.ExcelUtil;
|
|
||||||
//import com.gunshi.project.hsz.util.MyBeanUtil;
|
|
||||||
//import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
|
||||||
//import org.springframework.beans.BeanUtils;
|
|
||||||
//import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
//import org.springframework.stereotype.Service;
|
|
||||||
//import org.springframework.transaction.annotation.Transactional;
|
|
||||||
//
|
|
||||||
//import java.math.BigDecimal;
|
|
||||||
//import java.util.*;
|
|
||||||
//import java.util.stream.Collectors;
|
|
||||||
//import java.util.stream.Stream;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * 描述: 渗压监测记录表
|
|
||||||
// * author: xusan
|
|
||||||
// * date: 2024-07-08 17:30:37
|
|
||||||
// */
|
|
||||||
//@Service
|
|
||||||
//@Slf4j
|
|
||||||
//@Transactional(rollbackFor = Exception.class)
|
|
||||||
//public class OsmoticPressRService extends ServiceImpl<OsmoticPressRMapper, OsmoticPressR>
|
|
||||||
//{
|
|
||||||
// @Autowired
|
|
||||||
// private OsmoticShiftRService shiftRService;
|
|
||||||
//
|
|
||||||
// public Page<OsmoticPressR> queryPage(OsmoticQueryPageSo osmoticQueryPageSo) {
|
|
||||||
// return baseMapper.queryPage(osmoticQueryPageSo.getPageSo().toPage(),osmoticQueryPageSo);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 测值查询,管水位和库水位数据固定查询每日早8点
|
|
||||||
// * @param osmoticQuerySo
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// public List<OsmoticStationVo> queryValue(OsmoticQuerySo osmoticQuerySo,Integer year) {
|
|
||||||
// if(osmoticQuerySo.getType() == null) {
|
|
||||||
// osmoticQuerySo.setType(1);
|
|
||||||
// }
|
|
||||||
// List<OsmoticStationVo> resList = new ArrayList<>();
|
|
||||||
// if(CollectionUtils.isEmpty(osmoticQuerySo.getStationCodes())){
|
|
||||||
// return resList;
|
|
||||||
// }
|
|
||||||
// String stcd = shiftRService.getStcd();
|
|
||||||
// Boolean isDesc = true;
|
|
||||||
// //查询测站降雨量
|
|
||||||
// Map<String,BigDecimal> drpMap = new HashMap<>();
|
|
||||||
// if(year != null){
|
|
||||||
// isDesc = false;
|
|
||||||
// List<StRzVo> drpList = baseMapper.queryDrp(year,stcd);
|
|
||||||
// drpMap = drpList.stream().collect(Collectors.toMap(StRzVo::getTm, StRzVo::getRz));
|
|
||||||
// }
|
|
||||||
// List<String> dateList = DateUtil.getDatesBetween(osmoticQuerySo.getDateTimeRangeSo().getStart(), osmoticQuerySo.getDateTimeRangeSo().getEnd(),isDesc);
|
|
||||||
//
|
|
||||||
// //查询库水位
|
|
||||||
// List<StRzVo> list = baseMapper.queryRz(osmoticQuerySo,stcd);
|
|
||||||
// Map<String, BigDecimal> rzMap = list.stream().collect(Collectors.toMap(StRzVo::getTm, StRzVo::getRz));
|
|
||||||
// //查询测站管水位/渗流量
|
|
||||||
// List<OsmoticValueVo> valueList = baseMapper.queryValue(osmoticQuerySo);
|
|
||||||
// //数据处理
|
|
||||||
// for(String str : dateList){
|
|
||||||
// OsmoticStationVo vo = new OsmoticStationVo();
|
|
||||||
// vo.setTm(str);
|
|
||||||
// vo.setRz(rzMap.get(str));
|
|
||||||
// vo.setDrp(drpMap.get(str));
|
|
||||||
// vo.setList(valueList.stream().filter(o->str.equals(o.getTm())).map(t->{
|
|
||||||
// t.setRz(vo.getRz());
|
|
||||||
// return t;
|
|
||||||
// }).collect(Collectors.toList()));
|
|
||||||
// resList.add(vo);
|
|
||||||
// }
|
|
||||||
// return resList;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public List<OsmoticChartVo> queryChart(OsmoticQuerySo osmoticQuerySo,Integer year) {
|
|
||||||
// List<OsmoticChartVo> resList = new ArrayList<>();
|
|
||||||
// List<String> stationCodes = osmoticQuerySo.getStationCodes();
|
|
||||||
// if(CollectionUtils.isEmpty(stationCodes)){
|
|
||||||
// return resList;
|
|
||||||
// }
|
|
||||||
// String stcd = shiftRService.getStcd();
|
|
||||||
// //查询库水位
|
|
||||||
// List<StRzVo> list = baseMapper.queryRz(osmoticQuerySo,stcd);
|
|
||||||
// //查询测站管水位
|
|
||||||
// List<OsmoticValueVo> valueList = baseMapper.queryValue(osmoticQuerySo);
|
|
||||||
// //按测站分组
|
|
||||||
// Map<String, List<OsmoticValueVo>> map = valueList.stream().collect(Collectors.groupingBy(OsmoticValueVo::getStationCode));
|
|
||||||
// for(String code : stationCodes){
|
|
||||||
// OsmoticChartVo vo = new OsmoticChartVo();
|
|
||||||
// vo.setStationCode(code);
|
|
||||||
// if(map.containsKey(code)){
|
|
||||||
// List<OsmoticValueVo> voList = map.get(code);
|
|
||||||
// OsmoticValueVo max = voList.stream().max(Comparator.comparing(OsmoticValueVo::getValue)).get();
|
|
||||||
// OsmoticValueVo min = voList.stream().min(Comparator.comparing(OsmoticValueVo::getValue)).get();
|
|
||||||
// vo.setStationCode(code);
|
|
||||||
// vo.setMaxValue(max.getValue());
|
|
||||||
// vo.setMaxTm(max.getTm());
|
|
||||||
// vo.setMinValue(min.getValue());
|
|
||||||
// vo.setMinTm(min.getTm());
|
|
||||||
// vo.setDiff(max.getValue().subtract(min.getValue()));
|
|
||||||
// if(year == null){
|
|
||||||
// vo.setDetailVos(bindData(MyBeanUtil.collectionCopy(list,OsmoticChartDetailVo.class),MyBeanUtil.collectionCopy(voList,OsmoticChartDetailVo.class)));
|
|
||||||
// }
|
|
||||||
// }else {
|
|
||||||
// vo.setDetailVos(new ArrayList<>());
|
|
||||||
// }
|
|
||||||
// resList.add(vo);
|
|
||||||
// }
|
|
||||||
// //查询测站降雨量
|
|
||||||
// List<StRzVo> drpList;
|
|
||||||
// if(year != null){
|
|
||||||
// drpList = baseMapper.queryDrp(year,stcd);
|
|
||||||
// OsmoticChartVo chartVo = new OsmoticChartVo();
|
|
||||||
// chartVo.setStationCode("rz");
|
|
||||||
// if(CollectionUtils.isNotEmpty(list)){
|
|
||||||
// StRzVo max = list.stream().max(Comparator.comparing(StRzVo::getRz)).get();
|
|
||||||
// StRzVo min = list.stream().min(Comparator.comparing(StRzVo::getRz)).get();
|
|
||||||
// chartVo.setMaxValue(max.getRz());
|
|
||||||
// chartVo.setMaxTm(max.getTm());
|
|
||||||
// chartVo.setMinValue(min.getRz());
|
|
||||||
// chartVo.setMinTm(min.getTm());
|
|
||||||
// chartVo.setDiff(max.getRz().subtract(min.getRz()));
|
|
||||||
// resList.add(chartVo);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if(CollectionUtils.isNotEmpty(drpList)){
|
|
||||||
// OsmoticChartVo drpVo = new OsmoticChartVo();
|
|
||||||
// drpVo.setStationCode("drp");
|
|
||||||
// StRzVo maxDrp = drpList.stream().max(Comparator.comparing(StRzVo::getRz)).get();
|
|
||||||
// StRzVo minDrp = drpList.stream().min(Comparator.comparing(StRzVo::getRz)).get();
|
|
||||||
// drpVo.setMaxValue(maxDrp.getRz());
|
|
||||||
// drpVo.setMaxTm(maxDrp.getTm());
|
|
||||||
// drpVo.setMinValue(minDrp.getRz());
|
|
||||||
// drpVo.setMinTm(minDrp.getTm());
|
|
||||||
// drpVo.setDiff(maxDrp.getRz().subtract(minDrp.getRz()));
|
|
||||||
// resList.add(drpVo);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return resList;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// //根据监测时间合并管水位和库水位数据
|
|
||||||
// private List<OsmoticChartDetailVo> bindData(List<OsmoticChartDetailVo> tmRzList, List<OsmoticChartDetailVo> voList) {
|
|
||||||
// HashSet<String> strings = new HashSet<>();
|
|
||||||
// tmRzList.stream().forEach(v1 -> strings.add(v1.getTm()));
|
|
||||||
// voList.stream().forEach(v1 -> strings.add(v1.getTm()));
|
|
||||||
//
|
|
||||||
// List<OsmoticChartDetailVo> result = new ArrayList<>();
|
|
||||||
// strings.stream().forEach(v1 ->{
|
|
||||||
// OsmoticChartDetailVo v = new OsmoticChartDetailVo();
|
|
||||||
// v.setTm(v1);
|
|
||||||
// result.add(v);
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// List<OsmoticChartDetailVo> list = result.stream().map(v1 -> {
|
|
||||||
// tmRzList.stream().filter(v2 -> v1.getTm().equals(v2.getTm())).forEach(v2 -> {
|
|
||||||
// v1.setRz(v2.getRz());
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// voList.stream().filter(v2 -> v1.getTm().equals(v2.getTm())).forEach(v2 -> {
|
|
||||||
// v1.setValue(v2.getValue());
|
|
||||||
// });
|
|
||||||
// return v1;
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// return list.stream().sorted(Comparator.comparing(OsmoticChartDetailVo::getTm)).collect(Collectors.toList());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public List<OsmoticStationVo> infiltraLine(OsmoticQuerySo osmoticQuerySo) {
|
|
||||||
// List<OsmoticStationVo> resList = new ArrayList<>();
|
|
||||||
// String stcd = shiftRService.getStcd();
|
|
||||||
// //查询库水位
|
|
||||||
// List<StRzVo> list = baseMapper.queryLineRz(osmoticQuerySo,stcd);
|
|
||||||
// Map<String, BigDecimal> rzMap = list.stream().collect(Collectors.toMap(StRzVo::getTm, StRzVo::getRz));
|
|
||||||
// //查询测站管水位
|
|
||||||
// List<OsmoticValueVo> valueList = baseMapper.queryLineValue(osmoticQuerySo);
|
|
||||||
// //查询测站预警信息
|
|
||||||
// List<OsmoticValueVo> warnList = baseMapper.queryWarn(osmoticQuerySo);
|
|
||||||
// valueList.stream().map(vo->{
|
|
||||||
// Boolean b = warnList.stream().filter(o->o.getStationCode().equals(vo.getStationCode()) && o.getTm().equals(vo.getTm())).findAny().isPresent();
|
|
||||||
// if(b){
|
|
||||||
// vo.setStatus(0);
|
|
||||||
// }
|
|
||||||
// return vo;
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// HashSet<String> dateList = new HashSet<>();
|
|
||||||
// list.stream().forEach(v1 -> dateList.add(v1.getTm()));
|
|
||||||
// valueList.stream().forEach(v1 -> dateList.add(v1.getTm()));
|
|
||||||
// for(String str : dateList){
|
|
||||||
// OsmoticStationVo vo = new OsmoticStationVo();
|
|
||||||
// vo.setTm(str);
|
|
||||||
// vo.setRz(rzMap.get(str));
|
|
||||||
// List<OsmoticValueVo> newList = valueList.stream().filter(o->str.equals(o.getTm())).collect(Collectors.toList());
|
|
||||||
// vo.setList(newList);
|
|
||||||
// if(CollectionUtils.isNotEmpty(newList) && newList.stream().filter(o->o.getStatus() == 0).findAny().isPresent()){
|
|
||||||
// vo.setStatus(0);
|
|
||||||
// }
|
|
||||||
// resList.add(vo);
|
|
||||||
// }
|
|
||||||
// return resList.stream().sorted(Comparator.comparing(OsmoticStationVo::getTm)).collect(Collectors.toList());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// public void export(OsmoticQuerySo osmoticQuerySo, HttpServletResponse response) {
|
|
||||||
// //通过断面查询渗压设备
|
|
||||||
// List<String> stationCodes = osmoticQuerySo.getStationCodes();
|
|
||||||
// //表头信息
|
|
||||||
// List<String> heads = new ArrayList<>();
|
|
||||||
// heads.add("序号");
|
|
||||||
// heads.add("时间");
|
|
||||||
// heads.add("库水位(m)");
|
|
||||||
// heads.addAll(stationCodes);
|
|
||||||
// heads.add("结果分析");
|
|
||||||
//
|
|
||||||
// //表格数据
|
|
||||||
// List<OsmoticStationVo> resList = infiltraLine(osmoticQuerySo);
|
|
||||||
// List<Map<String, Object>> list = new ArrayList<>();
|
|
||||||
// for (int j = 0;j < resList.size(); j++) {
|
|
||||||
// OsmoticStationVo vo = resList.get(j);
|
|
||||||
// Map<String, Object> test = new LinkedHashMap<>();
|
|
||||||
// test.put("t0",j+1);
|
|
||||||
// test.put("t1", vo.getTm());
|
|
||||||
// test.put("t2", vo.getRz());
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// OsmoticValueVo valueVo = vo.getList().stream().filter(o->code.equals(o.getStationCode())).findFirst().orElse(null);
|
|
||||||
// test.put(code,valueVo != null ? valueVo.getValue() : "");
|
|
||||||
// }
|
|
||||||
// test.put("t4", vo.getStatus() == 0 ? "异常":"正常");
|
|
||||||
// list.add(test);
|
|
||||||
// }
|
|
||||||
// List<List<String>> hs = new ArrayList<>();
|
|
||||||
// for (String s : heads) {
|
|
||||||
// hs.add(Arrays.asList(s));
|
|
||||||
// }
|
|
||||||
// ExcelUtil.exportExcel(hs, DataHandleUtil.tableData(list), "浸润线", response, "浸润线");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private OsmoticQuerySo commonQueryHandle(OsmoticQuerySo osmoticQuerySo){
|
|
||||||
// Integer year = osmoticQuerySo.getYear();
|
|
||||||
// Date start = DateUtil.convertStringToDate(year + "-01-01 00:00:00");
|
|
||||||
// Date end = DateUtil.convertStringToDate(year + "-12-31 00:00:00");
|
|
||||||
// DateTimeRangeSo so = new DateTimeRangeSo();
|
|
||||||
// so.setStart(start);
|
|
||||||
// so.setEnd(end);
|
|
||||||
// osmoticQuerySo.setDateTimeRangeSo(so);
|
|
||||||
// return osmoticQuerySo;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public List<OsmoticStationVo> yearStat(OsmoticQuerySo osmoticQuerySo) {
|
|
||||||
// commonQueryHandle(osmoticQuerySo);
|
|
||||||
// return queryValue(osmoticQuerySo,osmoticQuerySo.getYear());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public List<OsmoticChartVo> yearStatValue(OsmoticQuerySo osmoticQuerySo) {
|
|
||||||
// commonQueryHandle(osmoticQuerySo);
|
|
||||||
// return queryChart(osmoticQuerySo,osmoticQuerySo.getYear());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void yearStatExport(OsmoticQuerySo osmoticQuerySo, HttpServletResponse response) {
|
|
||||||
// String headName = osmoticQuerySo.getProfileName() + "断面测压管水位(m)";
|
|
||||||
// String fileName = "断面年度渗压统计";
|
|
||||||
// String sheetName = "年度渗压统计";
|
|
||||||
// if(osmoticQuerySo.getType() == 1){
|
|
||||||
// fileName = osmoticQuerySo.getProfileName() + fileName;
|
|
||||||
// }else {
|
|
||||||
// headName = "渗流量(L/s)";
|
|
||||||
// fileName = "年度渗流统计";
|
|
||||||
// sheetName = "年度渗流统计";
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //上方表格数据
|
|
||||||
// List<OsmoticStationVo> resList = yearStat(osmoticQuerySo);
|
|
||||||
// //下方特征值数据
|
|
||||||
// List<OsmoticChartVo> chartList = queryChart(osmoticQuerySo,osmoticQuerySo.getYear());
|
|
||||||
// List<String> stationCodes = osmoticQuerySo.getStationCodes();
|
|
||||||
// //表头信息
|
|
||||||
// List<List<String>> headList = new ArrayList<>();
|
|
||||||
// List<String> heads1 = new ArrayList<>();
|
|
||||||
// heads1.add("序号");
|
|
||||||
// heads1.add("序号");
|
|
||||||
// headList.add(heads1);
|
|
||||||
//
|
|
||||||
// List<String> heads2 = new ArrayList<>();
|
|
||||||
// heads2.add("监测日期");
|
|
||||||
// heads2.add("监测日期");
|
|
||||||
// headList.add(heads2);
|
|
||||||
//
|
|
||||||
// for(String code : stationCodes){
|
|
||||||
// List<String> heads = new ArrayList<>();
|
|
||||||
// heads.add(headName);
|
|
||||||
// heads.add(code);
|
|
||||||
// headList.add(heads);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// List<String> heads3 = new ArrayList<>();
|
|
||||||
// heads3.add("库水位(m)");
|
|
||||||
// heads3.add("库水位(m)");
|
|
||||||
// headList.add(heads3);
|
|
||||||
//
|
|
||||||
// List<String> heads4 = new ArrayList<>();
|
|
||||||
// heads4.add("降雨量(mm)");
|
|
||||||
// heads4.add("降雨量(mm)");
|
|
||||||
// headList.add(heads4);
|
|
||||||
//
|
|
||||||
// List<Map<String, Object>> list = new ArrayList<>();
|
|
||||||
// for (int j = 0;j < resList.size(); j++) {
|
|
||||||
// OsmoticStationVo vo = resList.get(j);
|
|
||||||
// Map<String, Object> test = new LinkedHashMap<>();
|
|
||||||
// test.put("t0",j+1);
|
|
||||||
// test.put("t1", vo.getTm());
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// OsmoticValueVo valueVo = vo.getList().stream().filter(o->code.equals(o.getStationCode())).findFirst().orElse(null);
|
|
||||||
// test.put(code,valueVo != null ? valueVo.getValue() : "");
|
|
||||||
// }
|
|
||||||
// test.put("t2", vo.getRz());
|
|
||||||
// test.put("t3", vo.getDrp());
|
|
||||||
// list.add(test);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, Object> max = new LinkedHashMap<>();
|
|
||||||
// max.put("t0","全年度特征值统计");
|
|
||||||
// max.put("t1", "最大值");
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// max.put(code,chartList.stream().filter(o->code.equals(o.getStationCode())).findFirst().get().getMaxValue());
|
|
||||||
// }
|
|
||||||
// max.put("t2", chartList.stream().filter(o->"rz".equals(o.getStationCode())).findFirst().get().getMaxValue());
|
|
||||||
// max.put("t3", chartList.stream().filter(o->"drp".equals(o.getStationCode())).findFirst().get().getMaxValue());
|
|
||||||
// list.add(max);
|
|
||||||
//
|
|
||||||
// Map<String, Object> maxTm = new LinkedHashMap<>();
|
|
||||||
// maxTm.put("t0","全年度特征值统计");
|
|
||||||
// maxTm.put("t1", "日期");
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// maxTm.put(code,chartList.stream().filter(o->code.equals(o.getStationCode())).findFirst().get().getMaxTm());
|
|
||||||
// }
|
|
||||||
// maxTm.put("t2", chartList.stream().filter(o->"rz".equals(o.getStationCode())).findFirst().get().getMaxTm());
|
|
||||||
// maxTm.put("t3", chartList.stream().filter(o->"drp".equals(o.getStationCode())).findFirst().get().getMaxTm());
|
|
||||||
// list.add(maxTm);
|
|
||||||
//
|
|
||||||
// Map<String, Object> min = new LinkedHashMap<>();
|
|
||||||
// min.put("t0","全年度特征值统计");
|
|
||||||
// min.put("t1", "最小值");
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// min.put(code,chartList.stream().filter(o->code.equals(o.getStationCode())).findFirst().get().getMinValue());
|
|
||||||
// }
|
|
||||||
// min.put("t2", chartList.stream().filter(o->"rz".equals(o.getStationCode())).findFirst().get().getMinValue());
|
|
||||||
// min.put("t3", chartList.stream().filter(o->"drp".equals(o.getStationCode())).findFirst().get().getMinValue());
|
|
||||||
// list.add(min);
|
|
||||||
//
|
|
||||||
// Map<String, Object> minTm = new LinkedHashMap<>();
|
|
||||||
// minTm.put("t0","全年度特征值统计");
|
|
||||||
// minTm.put("t1", "日期");
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// minTm.put(code,chartList.stream().filter(o->code.equals(o.getStationCode())).findFirst().get().getMinTm());
|
|
||||||
// }
|
|
||||||
// minTm.put("t2", chartList.stream().filter(o->"rz".equals(o.getStationCode())).findFirst().get().getMinTm());
|
|
||||||
// minTm.put("t3", chartList.stream().filter(o->"drp".equals(o.getStationCode())).findFirst().get().getMinTm());
|
|
||||||
// list.add(minTm);
|
|
||||||
//
|
|
||||||
// Map<String, Object> diff = new LinkedHashMap<>();
|
|
||||||
// diff.put("t0","全年度特征值统计");
|
|
||||||
// diff.put("t1", "年变幅");
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// diff.put(code,chartList.stream().filter(o->code.equals(o.getStationCode())).findFirst().get().getDiff());
|
|
||||||
// }
|
|
||||||
// diff.put("t2", chartList.stream().filter(o->"rz".equals(o.getStationCode())).findFirst().get().getDiff());
|
|
||||||
// diff.put("t3", chartList.stream().filter(o->"drp".equals(o.getStationCode())).findFirst().get().getDiff());
|
|
||||||
// list.add(diff);
|
|
||||||
//
|
|
||||||
// ExcelUtil.exportExcel(headList, DataHandleUtil.tableData(list),2,new int[]{0},fileName,response,sheetName);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public List<OsmoticPressVo> listValue(Integer type) {
|
|
||||||
// List<OsmoticPressVo> list;
|
|
||||||
// if(type == 1){
|
|
||||||
// list = baseMapper.listValue();
|
|
||||||
// }else {
|
|
||||||
// list = baseMapper.flowListValue();
|
|
||||||
// }
|
|
||||||
// OsmoticQuerySo so = new OsmoticQuerySo();
|
|
||||||
// List<String> stationCodes = list.stream().map(OsmoticPressVo::getStationCode).collect(Collectors.toList());
|
|
||||||
// if(list.stream().filter(o->o.getTm() != null).collect(Collectors.toList()).size() > 0 ){
|
|
||||||
// String maxTm = list.stream().filter(o->o.getTm() != null).max(Comparator.comparing(OsmoticPressVo::getTm)).get().getTm();
|
|
||||||
// String minTm = list.stream().filter(o->o.getTm() != null).min(Comparator.comparing(OsmoticPressVo::getTm)).get().getTm();
|
|
||||||
// so.setStationCodes(stationCodes);
|
|
||||||
// DateTimeRangeSo dateTimeRangeSo = new DateTimeRangeSo();
|
|
||||||
// dateTimeRangeSo.setStart(DateUtil.convertStringToDate(minTm));
|
|
||||||
// dateTimeRangeSo.setEnd(DateUtil.convertStringToDate(maxTm));
|
|
||||||
// so.setDateTimeRangeSo(dateTimeRangeSo);
|
|
||||||
// List<OsmoticValueVo> warnList = baseMapper.queryWarn(so);
|
|
||||||
// list.stream().map(o->{
|
|
||||||
// if(o.getTm() != null && DateUtil.hoursBetweenDate(DateUtil.convertStringToDate(o.getTm()), new Date()) > 48){
|
|
||||||
// o.setFlag(1);
|
|
||||||
// }
|
|
||||||
// Boolean b = warnList.stream().filter(t->t.getStationCode().equals(o.getStationCode()) && t.getTm().equals(o.getTm())).findAny().isPresent();
|
|
||||||
// if(b){
|
|
||||||
// o.setStatus(1);
|
|
||||||
// }
|
|
||||||
// return o;
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// }
|
|
||||||
// return list;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public List<OsmoticPressDetailVo> detailValue(OsmoticDetailQuerySo so) {
|
|
||||||
// List<OsmoticPressDetailVo> list = baseMapper.detailValue(so);
|
|
||||||
// if(so.getType() == 2){
|
|
||||||
// return list;
|
|
||||||
// }
|
|
||||||
// OsmoticQuerySo osmoticQuerySo = new OsmoticQuerySo();
|
|
||||||
// BeanUtils.copyProperties(so,osmoticQuerySo);
|
|
||||||
// List<StRzVo> stRzVos = baseMapper.queryLineRz(osmoticQuerySo,shiftRService.getStcd());
|
|
||||||
// return bindPressDetail(list,stRzVos);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private List<OsmoticPressDetailVo> bindPressDetail(List<OsmoticPressDetailVo> list, List<StRzVo> stRzVos) {
|
|
||||||
// HashSet<String> strings = new HashSet<>();
|
|
||||||
// list.stream().forEach(v1 -> strings.add(v1.getTm()));
|
|
||||||
// stRzVos.stream().forEach(v1 -> strings.add(v1.getTm()));
|
|
||||||
//
|
|
||||||
// List<OsmoticPressDetailVo> result = new ArrayList<>();
|
|
||||||
// strings.stream().forEach(v1 ->{
|
|
||||||
// OsmoticPressDetailVo v = new OsmoticPressDetailVo();
|
|
||||||
// v.setTm(v1);
|
|
||||||
// result.add(v);
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// List<OsmoticPressDetailVo> resList = result.stream().map(v1 -> {
|
|
||||||
// stRzVos.stream().filter(v2 -> v1.getTm().equals(v2.getTm())).forEach(v2 -> {
|
|
||||||
// v1.setRz(v2.getRz());
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// list.stream().filter(v2 -> v1.getTm().equals(v2.getTm())).forEach(v2 -> {
|
|
||||||
// v1.setValue(v2.getValue());
|
|
||||||
// });
|
|
||||||
// return v1;
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// return resList.stream().sorted(Comparator.comparing(OsmoticPressDetailVo::getTm)).collect(Collectors.toList());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public Map<Integer, Integer> stat() {
|
|
||||||
// Map<Integer, Integer> map = new HashMap<>();
|
|
||||||
// List<OsmoticPressVo> press = this.listValue(1);
|
|
||||||
// Integer pressSize = press.size();
|
|
||||||
// Long pressWarn = press.stream().filter(o -> o.getStatus() == 1).collect(Collectors.counting());
|
|
||||||
//
|
|
||||||
// List<OsmoticPressVo> flow = this.listValue(2);
|
|
||||||
// Integer flowSize = flow.size();
|
|
||||||
// Long flowWarn = flow.stream().filter(o -> o.getStatus() == 1).collect(Collectors.counting());
|
|
||||||
//
|
|
||||||
// List<OsmoticShiftListVo> shift = shiftRService.listValue();
|
|
||||||
// Integer shiftSize = shift.size();
|
|
||||||
// Long shiftWarn = shift.stream().filter(o -> o.getXStatus() == 1 || o.getYStatus() ==1 || o.getHStatus() == 1).collect(Collectors.counting());
|
|
||||||
//
|
|
||||||
// Integer size = pressSize + flowSize + shiftSize;
|
|
||||||
// Integer warn = Stream.of(pressWarn, flowWarn, shiftWarn).mapToInt(Long::intValue).sum();
|
|
||||||
// map.put(warn,size);
|
|
||||||
// return map;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
@ -1,333 +0,0 @@
|
||||||
//package com.gunshi.project.hsz.service;
|
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
//import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
||||||
//import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
||||||
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
//import com.gunshi.db.dto.DateTimeRangeSo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticDetailQuerySo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticQueryPageSo;
|
|
||||||
//import com.gunshi.project.hsz.common.model.so.OsmoticQuerySo;
|
|
||||||
//import com.gunshi.project.hsz.entity.vo.*;
|
|
||||||
//import com.gunshi.project.hsz.mapper.AttResBaseMapper;
|
|
||||||
//import com.gunshi.project.hsz.mapper.OsmoticPressRMapper;
|
|
||||||
//import com.gunshi.project.hsz.mapper.OsmoticShiftRMapper;
|
|
||||||
//import com.gunshi.project.hsz.model.OsmoticShiftR;
|
|
||||||
//import com.gunshi.project.hsz.util.DataHandleUtil;
|
|
||||||
//import com.gunshi.project.hsz.util.DateUtil;
|
|
||||||
//import com.gunshi.project.hsz.util.ExcelUtil;
|
|
||||||
//import jakarta.annotation.Resource;
|
|
||||||
//import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
|
||||||
//import org.springframework.beans.BeanUtils;
|
|
||||||
//import org.springframework.stereotype.Service;
|
|
||||||
//import org.springframework.transaction.annotation.Transactional;
|
|
||||||
//
|
|
||||||
//import java.util.*;
|
|
||||||
//import java.util.stream.Collectors;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * 描述: 位移监测记录表
|
|
||||||
// * author: xusan
|
|
||||||
// * date: 2024-07-08 17:30:37
|
|
||||||
// */
|
|
||||||
//@Service
|
|
||||||
//@Slf4j
|
|
||||||
//@Transactional(rollbackFor = Exception.class)
|
|
||||||
//public class OsmoticShiftRService extends ServiceImpl<OsmoticShiftRMapper, OsmoticShiftR>
|
|
||||||
//{
|
|
||||||
//
|
|
||||||
// @Resource
|
|
||||||
// private OsmoticPressRMapper pressRMapper;
|
|
||||||
//
|
|
||||||
// @Resource
|
|
||||||
// private AttResBaseMapper attResBaseMapper;
|
|
||||||
//
|
|
||||||
// private static final String X_PREFIX = "/X";
|
|
||||||
// private static final String Y_PREFIX = "/Y";
|
|
||||||
// private static final String H_PREFIX = "/H";
|
|
||||||
//
|
|
||||||
// public Page<OsmoticShiftR> queryPage(OsmoticQueryPageSo osmoticQueryPageSo) {
|
|
||||||
// LambdaQueryWrapper<OsmoticShiftR> wrapper = Wrappers.lambdaQuery();
|
|
||||||
// if(osmoticQueryPageSo.getDateTimeRangeSo() != null && osmoticQueryPageSo.getDateTimeRangeSo().getStart() != null){
|
|
||||||
// wrapper.ge(OsmoticShiftR::getTm,osmoticQueryPageSo.getDateTimeRangeSo().getStart());
|
|
||||||
// }
|
|
||||||
// if(osmoticQueryPageSo.getDateTimeRangeSo() != null && osmoticQueryPageSo.getDateTimeRangeSo().getEnd() != null){
|
|
||||||
// wrapper.le(OsmoticShiftR::getTm,osmoticQueryPageSo.getDateTimeRangeSo().getEnd());
|
|
||||||
// }
|
|
||||||
// if(StringUtils.isNotEmpty(osmoticQueryPageSo.getStationCode())){
|
|
||||||
// wrapper.eq(OsmoticShiftR::getStationCode,osmoticQueryPageSo.getStationCode());
|
|
||||||
// }
|
|
||||||
// wrapper.orderByDesc(OsmoticShiftR::getTm);
|
|
||||||
// return this.page(osmoticQueryPageSo.getPageSo().toPage(),wrapper);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public List<OsmoticShiftVo> yearStat(OsmoticQuerySo osmoticQuerySo) {
|
|
||||||
// List<OsmoticShiftVo> resList = new ArrayList<>();
|
|
||||||
// commonQueryHandle(osmoticQuerySo);
|
|
||||||
// //查询位移监测记录
|
|
||||||
// List<OsmoticShiftValueVo> valueList = baseMapper.queryValue(osmoticQuerySo);
|
|
||||||
// List<String> dateList = DateUtil.getDatesBetween(osmoticQuerySo.getDateTimeRangeSo().getStart(), osmoticQuerySo.getDateTimeRangeSo().getEnd(), false);
|
|
||||||
// //数据处理
|
|
||||||
// for(String str : dateList){
|
|
||||||
// OsmoticShiftVo vo = new OsmoticShiftVo();
|
|
||||||
// vo.setTm(str);
|
|
||||||
// vo.setList(valueList.stream().filter(o->str.equals(o.getTm())).collect(Collectors.toList()));
|
|
||||||
// resList.add(vo);
|
|
||||||
// }
|
|
||||||
// return resList;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private OsmoticQuerySo commonQueryHandle(OsmoticQuerySo osmoticQuerySo){
|
|
||||||
// Integer year = osmoticQuerySo.getYear();
|
|
||||||
// Date start = DateUtil.convertStringToDate(year + "-01-01 00:00:00");
|
|
||||||
// Date end = DateUtil.convertStringToDate(year + "-12-31 00:00:00");
|
|
||||||
// DateTimeRangeSo so = new DateTimeRangeSo();
|
|
||||||
// so.setStart(start);
|
|
||||||
// so.setEnd(end);
|
|
||||||
// osmoticQuerySo.setDateTimeRangeSo(so);
|
|
||||||
// return osmoticQuerySo;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// public List<OsmoticChartVo> yearStatValue(OsmoticQuerySo osmoticQuerySo) {
|
|
||||||
// List<OsmoticChartVo> resList = new ArrayList<>();
|
|
||||||
// commonQueryHandle(osmoticQuerySo);
|
|
||||||
// //查询位移监测记录
|
|
||||||
// List<OsmoticShiftValueVo> valueList = baseMapper.queryValue(osmoticQuerySo);
|
|
||||||
// //按测站分组
|
|
||||||
// Map<String, List<OsmoticShiftValueVo>> map = valueList.stream().collect(Collectors.groupingBy(OsmoticShiftValueVo::getStationCode));
|
|
||||||
// map.entrySet().forEach(o->{
|
|
||||||
// String key = o.getKey();
|
|
||||||
// List<OsmoticShiftValueVo> value = o.getValue();
|
|
||||||
//
|
|
||||||
// OsmoticChartVo xVo = new OsmoticChartVo();
|
|
||||||
// OsmoticShiftValueVo xMax = value.stream().max(Comparator.comparing(OsmoticShiftValueVo::getX)).get();
|
|
||||||
// OsmoticShiftValueVo xMin = value.stream().min(Comparator.comparing(OsmoticShiftValueVo::getX)).get();
|
|
||||||
// xVo.setStationCode(key + X_PREFIX);
|
|
||||||
// xVo.setMaxValue(xMax.getX());
|
|
||||||
// xVo.setMaxTm(xMax.getTm());
|
|
||||||
// xVo.setMinValue(xMin.getX());
|
|
||||||
// xVo.setMinTm(xMin.getTm());
|
|
||||||
// xVo.setDiff(xMax.getX().subtract(xMin.getX()));
|
|
||||||
// resList.add(xVo);
|
|
||||||
//
|
|
||||||
// OsmoticChartVo yVo = new OsmoticChartVo();
|
|
||||||
// OsmoticShiftValueVo yMax = value.stream().max(Comparator.comparing(OsmoticShiftValueVo::getY)).get();
|
|
||||||
// OsmoticShiftValueVo yMin = value.stream().min(Comparator.comparing(OsmoticShiftValueVo::getY)).get();
|
|
||||||
// yVo.setStationCode(key + Y_PREFIX);
|
|
||||||
// yVo.setMaxValue(yMax.getY());
|
|
||||||
// yVo.setMaxTm(yMax.getTm());
|
|
||||||
// yVo.setMinValue(yMin.getY());
|
|
||||||
// yVo.setMinTm(yMin.getTm());
|
|
||||||
// yVo.setDiff(yMax.getY().subtract(yMin.getY()));
|
|
||||||
// resList.add(yVo);
|
|
||||||
//
|
|
||||||
// OsmoticChartVo hVo = new OsmoticChartVo();
|
|
||||||
// OsmoticShiftValueVo hMax = value.stream().max(Comparator.comparing(OsmoticShiftValueVo::getH)).get();
|
|
||||||
// OsmoticShiftValueVo hMin = value.stream().min(Comparator.comparing(OsmoticShiftValueVo::getH)).get();
|
|
||||||
// hVo.setStationCode(key + H_PREFIX);
|
|
||||||
// hVo.setMaxValue(hMax.getH());
|
|
||||||
// hVo.setMaxTm(hMax.getTm());
|
|
||||||
// hVo.setMinValue(hMin.getH());
|
|
||||||
// hVo.setMinTm(hMin.getTm());
|
|
||||||
// hVo.setDiff(hMax.getH().subtract(hMin.getH()));
|
|
||||||
// resList.add(hVo);
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
// return resList;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void yearStatExport(OsmoticQuerySo osmoticQuerySo, HttpServletResponse response) {
|
|
||||||
// String fileName = "年度位移统计";
|
|
||||||
// String sheetName = "年度位移统计";
|
|
||||||
//
|
|
||||||
// //上方表格数据
|
|
||||||
// List<OsmoticShiftVo> resList = yearStat(osmoticQuerySo);
|
|
||||||
// //下方特征值数据
|
|
||||||
// List<OsmoticChartVo> chartList = yearStatValue(osmoticQuerySo);
|
|
||||||
// List<String> stationCodes = osmoticQuerySo.getStationCodes();
|
|
||||||
// //表头信息
|
|
||||||
// List<List<String>> headList = new ArrayList<>();
|
|
||||||
// List<String> heads1 = new ArrayList<>();
|
|
||||||
// heads1.add("序号");
|
|
||||||
// heads1.add("序号");
|
|
||||||
// headList.add(heads1);
|
|
||||||
//
|
|
||||||
// List<String> heads2 = new ArrayList<>();
|
|
||||||
// heads2.add("监测日期");
|
|
||||||
// heads2.add("监测日期");
|
|
||||||
// headList.add(heads2);
|
|
||||||
//
|
|
||||||
// for(String code : stationCodes){
|
|
||||||
// List<String> headsX = new ArrayList<>();
|
|
||||||
// headsX.add(code);
|
|
||||||
// headsX.add("X");
|
|
||||||
// headList.add(headsX);
|
|
||||||
//
|
|
||||||
// List<String> headsY = new ArrayList<>();
|
|
||||||
// headsY.add(code);
|
|
||||||
// headsY.add("Y");
|
|
||||||
// headList.add(headsY);
|
|
||||||
//
|
|
||||||
// List<String> headsH = new ArrayList<>();
|
|
||||||
// headsH.add(code);
|
|
||||||
// headsH.add("H");
|
|
||||||
// headList.add(headsH);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// List<Map<String, Object>> list = new ArrayList<>();
|
|
||||||
// for (int j = 0;j < resList.size(); j++) {
|
|
||||||
// OsmoticShiftVo vo = resList.get(j);
|
|
||||||
// Map<String, Object> test = new LinkedHashMap<>();
|
|
||||||
// test.put("t0",j+1);
|
|
||||||
// test.put("t1", vo.getTm());
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// OsmoticShiftValueVo valueVo = vo.getList().stream().filter(o->code.equals(o.getStationCode())).findFirst().orElse(null);
|
|
||||||
// test.put(code + X_PREFIX,valueVo != null ? valueVo.getX() : "");
|
|
||||||
// test.put(code + Y_PREFIX,valueVo != null ? valueVo.getY() : "");
|
|
||||||
// test.put(code + H_PREFIX,valueVo != null ? valueVo.getH() : "");
|
|
||||||
// }
|
|
||||||
// list.add(test);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, Object> max = new LinkedHashMap<>();
|
|
||||||
// max.put("t0","全年度特征值统计");
|
|
||||||
// max.put("t1", "最大值");
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// max.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxValue());
|
|
||||||
// max.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxValue());
|
|
||||||
// max.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxValue());
|
|
||||||
// }
|
|
||||||
// list.add(max);
|
|
||||||
//
|
|
||||||
// Map<String, Object> maxTm = new LinkedHashMap<>();
|
|
||||||
// maxTm.put("t0","全年度特征值统计");
|
|
||||||
// maxTm.put("t1", "日期");
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// maxTm.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxTm());
|
|
||||||
// maxTm.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxTm());
|
|
||||||
// maxTm.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMaxTm());
|
|
||||||
// }
|
|
||||||
// list.add(maxTm);
|
|
||||||
//
|
|
||||||
// Map<String, Object> min = new LinkedHashMap<>();
|
|
||||||
// min.put("t0","全年度特征值统计");
|
|
||||||
// min.put("t1", "最小值");
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// min.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinValue());
|
|
||||||
// min.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinValue());
|
|
||||||
// min.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinValue());
|
|
||||||
// }
|
|
||||||
// list.add(min);
|
|
||||||
//
|
|
||||||
// Map<String, Object> minTm = new LinkedHashMap<>();
|
|
||||||
// minTm.put("t0","全年度特征值统计");
|
|
||||||
// minTm.put("t1", "日期");
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// minTm.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinTm());
|
|
||||||
// minTm.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinTm());
|
|
||||||
// minTm.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getMinTm());
|
|
||||||
// }
|
|
||||||
// list.add(minTm);
|
|
||||||
//
|
|
||||||
// Map<String, Object> diff = new LinkedHashMap<>();
|
|
||||||
// diff.put("t0","全年度特征值统计");
|
|
||||||
// diff.put("t1", "年变幅");
|
|
||||||
// for(int i = 0;i < stationCodes.size();i++){
|
|
||||||
// String code = stationCodes.get(i);
|
|
||||||
// diff.put(code+X_PREFIX,chartList.stream().filter(o->(code+X_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getDiff());
|
|
||||||
// diff.put(code+Y_PREFIX,chartList.stream().filter(o->(code+Y_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getDiff());
|
|
||||||
// diff.put(code+H_PREFIX,chartList.stream().filter(o->(code+H_PREFIX).equals(o.getStationCode())).findFirst().orElseGet(OsmoticChartVo::new).getDiff());
|
|
||||||
// }
|
|
||||||
// list.add(diff);
|
|
||||||
//
|
|
||||||
// ExcelUtil.exportExcel(headList, DataHandleUtil.tableData(list),2,new int[]{0},fileName,response,sheetName);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public List<OsmoticShiftListVo> listValue() {
|
|
||||||
// List<OsmoticShiftListVo> list = baseMapper.listValue();
|
|
||||||
// if(CollectionUtils.isEmpty(list)){
|
|
||||||
// return list;
|
|
||||||
// }
|
|
||||||
// OsmoticQuerySo so = new OsmoticQuerySo();
|
|
||||||
// List<String> stationCodes = list.stream().map(OsmoticShiftListVo::getStationCode).collect(Collectors.toList());
|
|
||||||
// String maxTm = list.stream().filter(o->o.getTm() != null).max(Comparator.comparing(OsmoticShiftListVo::getTm)).get().getTm();
|
|
||||||
// String minTm = list.stream().filter(o->o.getTm() != null).min(Comparator.comparing(OsmoticShiftListVo::getTm)).get().getTm();
|
|
||||||
// so.setStationCodes(stationCodes);
|
|
||||||
// DateTimeRangeSo dateTimeRangeSo = new DateTimeRangeSo();
|
|
||||||
// dateTimeRangeSo.setStart(DateUtil.convertStringToDate(minTm));
|
|
||||||
// dateTimeRangeSo.setEnd(DateUtil.convertStringToDate(maxTm));
|
|
||||||
// so.setDateTimeRangeSo(dateTimeRangeSo);
|
|
||||||
// List<OsmoticShiftListVo> warnList = baseMapper.queryWarn(so);
|
|
||||||
// list.stream().map(o->{
|
|
||||||
// if(o.getTm() != null && DateUtil.hoursBetweenDate(DateUtil.convertStringToDate(o.getTm()), new Date()) > 48){
|
|
||||||
// o.setFlag(1);
|
|
||||||
// }
|
|
||||||
// Boolean a = warnList.stream().filter(t->t.getStationCode().equals(o.getStationCode()) && t.getTm().equals(o.getTm()) && t.getDirection().equals("X")).findAny().isPresent();
|
|
||||||
// if(a){
|
|
||||||
// o.setXStatus(1);
|
|
||||||
// }
|
|
||||||
// Boolean b = warnList.stream().filter(t->t.getStationCode().equals(o.getStationCode()) && t.getTm().equals(o.getTm()) && t.getDirection().equals("Y")).findAny().isPresent();
|
|
||||||
// if(b){
|
|
||||||
// o.setYStatus(1);
|
|
||||||
// }
|
|
||||||
// Boolean c = warnList.stream().filter(t->t.getStationCode().equals(o.getStationCode()) && t.getTm().equals(o.getTm()) && t.getDirection().equals("H")).findAny().isPresent();
|
|
||||||
// if(c){
|
|
||||||
// o.setHStatus(1);
|
|
||||||
// }
|
|
||||||
// return o;
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// return list;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public List<OsmoticShiftValueVo> detailValue(OsmoticDetailQuerySo so) {
|
|
||||||
// List<OsmoticShiftValueVo> list = baseMapper.detailValue(so);
|
|
||||||
// OsmoticQuerySo osmoticQuerySo = new OsmoticQuerySo();
|
|
||||||
// BeanUtils.copyProperties(so,osmoticQuerySo);
|
|
||||||
// List<StRzVo> stRzVos = pressRMapper.queryLineRz(osmoticQuerySo,getStcd());
|
|
||||||
// return bindShiftDetail(list,stRzVos);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public String getStcd(){
|
|
||||||
// List<AttResBaseVo> attResBaseVos = attResBaseMapper.queryList();
|
|
||||||
// AttResBaseVo attResBaseVo = attResBaseVos.get(0);
|
|
||||||
// return attResBaseVo == null ? "":attResBaseVo.getStcd();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private List<OsmoticShiftValueVo> bindShiftDetail(List<OsmoticShiftValueVo> list, List<StRzVo> stRzVos) {
|
|
||||||
// HashSet<String> strings = new HashSet<>();
|
|
||||||
// list.stream().forEach(v1 -> strings.add(v1.getTm()));
|
|
||||||
// stRzVos.stream().forEach(v1 -> strings.add(v1.getTm()));
|
|
||||||
//
|
|
||||||
// List<OsmoticShiftValueVo> result = new ArrayList<>();
|
|
||||||
// strings.stream().forEach(v1 ->{
|
|
||||||
// OsmoticShiftValueVo v = new OsmoticShiftValueVo();
|
|
||||||
// v.setTm(v1);
|
|
||||||
// result.add(v);
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// List<OsmoticShiftValueVo> resList = result.stream().map(v1 -> {
|
|
||||||
// stRzVos.stream().filter(v2 -> v1.getTm().equals(v2.getTm())).forEach(v2 -> {
|
|
||||||
// v1.setRz(v2.getRz());
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// list.stream().filter(v2 -> v1.getTm().equals(v2.getTm())).forEach(v2 -> {
|
|
||||||
// v1.setX(v2.getX());
|
|
||||||
// v1.setY(v2.getY());
|
|
||||||
// v1.setH(v2.getH());
|
|
||||||
// });
|
|
||||||
// return v1;
|
|
||||||
// }).collect(Collectors.toList());
|
|
||||||
// return resList.stream().sorted(Comparator.comparing(OsmoticShiftValueVo::getTm)).collect(Collectors.toList());
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
@ -575,6 +575,13 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB> {
|
||||||
return baseMapper.getRsvrStations();
|
return baseMapper.getRsvrStations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<StStbprpB> getRiverStations() {
|
||||||
|
return baseMapper.getRiverStations();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StStbprpB> getFlowStations() {
|
||||||
|
return baseMapper.getFlowStations();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@ package com.gunshi.project.ss.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.gunshi.db.dto.DateRangeSo;
|
import com.gunshi.db.dto.DateRangeSo;
|
||||||
|
import com.gunshi.project.ss.common.model.StStbprpB;
|
||||||
import com.gunshi.project.ss.common.model.vo.StRzVo;
|
import com.gunshi.project.ss.common.model.vo.StRzVo;
|
||||||
|
import com.gunshi.project.ss.entity.dto.ReportTmSo;
|
||||||
import com.gunshi.project.ss.entity.so.StatisticsQuerySo;
|
import com.gunshi.project.ss.entity.so.StatisticsQuerySo;
|
||||||
import com.gunshi.project.ss.entity.vo.*;
|
import com.gunshi.project.ss.entity.vo.*;
|
||||||
import com.gunshi.project.ss.mapper.StPptnRHMapper;
|
import com.gunshi.project.ss.mapper.StPptnRHMapper;
|
||||||
|
|
@ -21,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -37,22 +40,30 @@ public class StatisticsService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private StPptnRHMapper stPptnRHMapper;
|
private StPptnRHMapper stPptnRHMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StStbprpBService stStbprpBService;
|
||||||
|
|
||||||
private static final String TIME_END_PREFIX = " 08:00:00";
|
private static final String TIME_END_PREFIX = " 08:00:00";
|
||||||
|
|
||||||
private static final String ZERO_TIME_END_PREFIX = " 00:00:00";
|
private static final String ZERO_TIME_END_PREFIX = " 00:00:00";
|
||||||
|
|
||||||
public List<SdJyRbVo> sdJyRb(DateRangeSo dateRangeSo) {
|
public List<SdJyRbVo> getDailyRain(ReportTmSo tm) {
|
||||||
List<SdJyRbVo> res = new ArrayList<>();
|
List<SdJyRbVo> res = new ArrayList<>();
|
||||||
String start = DateUtil.convertDateToString(dateRangeSo.getStart()) + TIME_END_PREFIX;
|
List<StStbprpB> stStbprpBList = stStbprpBService.getPptnStations();
|
||||||
String end = DateUtil.getPlusDate(dateRangeSo.getEnd(), 1) + TIME_END_PREFIX;
|
String start = DateUtil.convertDateToString(tm.getDate()) + TIME_END_PREFIX;
|
||||||
List<String> dates = DateUtil.getDatesBetween(dateRangeSo.getStart(), dateRangeSo.getEnd(), false);
|
String end = DateUtil.getPlusDate(tm.getDate(), 1) + TIME_END_PREFIX;
|
||||||
List<StPptnRH> list = stPptnRHMapper.queryList(start, end);
|
for (StStbprpB stStbprpB : stStbprpBList) {
|
||||||
|
List<String> dates = DateUtil.getDatesBetween(tm.getDate(), tm.getDate(), false);
|
||||||
|
List<StPptnRH> list = stPptnRHMapper.queryListByStcd(start, end,stStbprpB.getStcd());
|
||||||
for (String date : dates) {
|
for (String date : dates) {
|
||||||
SdJyRbVo vo = new SdJyRbVo();
|
SdJyRbVo vo = new SdJyRbVo();
|
||||||
vo.setDate(date);
|
vo.setDate(date);
|
||||||
getDrp(vo, list);
|
getDrp(vo, list);
|
||||||
|
vo.setStcd(stStbprpB.getStcd());
|
||||||
|
vo.setStnm(stStbprpB.getStnm());
|
||||||
res.add(vo);
|
res.add(vo);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -153,26 +164,32 @@ public class StatisticsService {
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sdJyRbExport(DateRangeSo dateRangeSo, HttpServletResponse response) {
|
public void sdJyRbExport(ReportTmSo tm, HttpServletResponse response) {
|
||||||
List<SdJyRbVo> list = sdJyRb(dateRangeSo);
|
List<SdJyRbVo> list = getDailyRain(tm);
|
||||||
String start = DateUtil.convertDateToChineseYmd(dateRangeSo.getStart());
|
String start = DateUtil.convertDateToChineseYmd(tm.getDate());
|
||||||
String end = DateUtil.convertDateToChineseYmd(dateRangeSo.getEnd());
|
String end = DateUtil.convertDateToChineseYmd(tm.getDate());
|
||||||
String fileName = start + "-" + end + "小时降雨量日报表";
|
String fileName = start + "-" + end + "小时降雨量日报表";
|
||||||
ExcelUtil.exportExcel(list, fileName, SdJyRbVo.class, response, fileName);
|
ExcelUtil.exportExcel(list, fileName, SdJyRbVo.class, response, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SdSwRbVo> sdSwRb(DateRangeSo dateRangeSo) {
|
public List<SdSwRbVo> sdSwRb(ReportTmSo reportTmSo) {
|
||||||
List<SdSwRbVo> res = new ArrayList<>();
|
List<SdSwRbVo> res = new ArrayList<>();
|
||||||
String start = DateUtil.convertDateToString(dateRangeSo.getStart()) + ZERO_TIME_END_PREFIX;
|
List<StStbprpB> pptnStations = stStbprpBService.getPptnStations();
|
||||||
String end = DateUtil.getPlusDate(dateRangeSo.getEnd(), 1) + ZERO_TIME_END_PREFIX;
|
String start = DateUtil.convertDateToString(reportTmSo.getDate()) + ZERO_TIME_END_PREFIX;
|
||||||
List<String> dates = DateUtil.getDatesBetween(dateRangeSo.getStart(), dateRangeSo.getEnd(), false);
|
String end = DateUtil.getPlusDate(reportTmSo.getDate(), 1) + ZERO_TIME_END_PREFIX;
|
||||||
List<StRzVo> list = stPptnRHMapper.queryRzList(start, end);
|
List<String> dates = DateUtil.getDatesBetween(reportTmSo.getDate(), reportTmSo.getDate(), false);
|
||||||
|
for (StStbprpB pptnStation : pptnStations) {
|
||||||
|
List<StRzVo> list = stPptnRHMapper.queryRzListByStcd(start, end,pptnStation.getStcd());
|
||||||
for (String date : dates) {
|
for (String date : dates) {
|
||||||
SdSwRbVo vo = new SdSwRbVo();
|
SdSwRbVo vo = new SdSwRbVo();
|
||||||
vo.setDate(date);
|
vo.setDate(date);
|
||||||
|
vo.setStcd(pptnStation.getStcd());
|
||||||
|
vo.setStnm(pptnStation.getStnm());
|
||||||
getRz(vo, list);
|
getRz(vo, list);
|
||||||
res.add(vo);
|
res.add(vo);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -277,22 +294,22 @@ public class StatisticsService {
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sdSwRbExport(DateRangeSo dateRangeSo, HttpServletResponse response) {
|
public void sdSwRbExport(ReportTmSo dateRangeSo, HttpServletResponse response) {
|
||||||
List<SdSwRbVo> list = sdSwRb(dateRangeSo);
|
List<SdSwRbVo> list = sdSwRb(dateRangeSo);
|
||||||
String start = DateUtil.convertDateToChineseYmd(dateRangeSo.getStart());
|
String tm = DateUtil.convertDateToChineseYmd(dateRangeSo.getDate());
|
||||||
String end = DateUtil.convertDateToChineseYmd(dateRangeSo.getEnd());
|
String fileName = tm + "时段水位日报表";
|
||||||
String fileName = start + "-" + end + "时段水位日报表";
|
|
||||||
ExcelUtil.exportExcel(list, fileName, SdSwRbVo.class, response, fileName);
|
ExcelUtil.exportExcel(list, fileName, SdSwRbVo.class, response, fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RjyNbVo> rjyNb(StatisticsQuerySo statisticsQuerySo,Integer type) {
|
public List<RjyNbVo> rjyNb(StatisticsQuerySo statisticsQuerySo,Integer type) {
|
||||||
List<RjyNbVo> res = new ArrayList<>();
|
List<RjyNbVo> res = new ArrayList<>();
|
||||||
Integer year = statisticsQuerySo.getYear();
|
Integer year = statisticsQuerySo.getYear();
|
||||||
|
String stcd = statisticsQuerySo.getStcd();
|
||||||
List<StPptnRD> list = new ArrayList<>();
|
List<StPptnRD> list = new ArrayList<>();
|
||||||
if(type != null){
|
if(type != null){
|
||||||
list = stPptnRHMapper.queryDayRz(year.toString());
|
list = stPptnRHMapper.queryDayRzByStcd(year.toString(),stcd);
|
||||||
}else{
|
}else{
|
||||||
list = stPptnRHMapper.queryDayDrp(year);
|
list = stPptnRHMapper.queryDayDrpByStcd(year,stcd);
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
return res;
|
return res;
|
||||||
|
|
@ -364,7 +381,8 @@ public class StatisticsService {
|
||||||
public RjyNbStatVo rjyNbStat(StatisticsQuerySo statisticsQuerySo) {
|
public RjyNbStatVo rjyNbStat(StatisticsQuerySo statisticsQuerySo) {
|
||||||
RjyNbStatVo vo = new RjyNbStatVo();
|
RjyNbStatVo vo = new RjyNbStatVo();
|
||||||
Integer year = statisticsQuerySo.getYear();
|
Integer year = statisticsQuerySo.getYear();
|
||||||
List<StPptnRD> list = stPptnRHMapper.queryDayDrp(year);
|
String stcd = statisticsQuerySo.getStcd();
|
||||||
|
List<StPptnRD> list = stPptnRHMapper.queryDayDrpByStcd(year,stcd);
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
@ -441,6 +459,7 @@ public class StatisticsService {
|
||||||
public void rjyNbExport(StatisticsQuerySo statisticsQuerySo, HttpServletResponse response) {
|
public void rjyNbExport(StatisticsQuerySo statisticsQuerySo, HttpServletResponse response) {
|
||||||
//上方数据
|
//上方数据
|
||||||
List<RjyNbVo> rjyNb = rjyNb(statisticsQuerySo,null);
|
List<RjyNbVo> rjyNb = rjyNb(statisticsQuerySo,null);
|
||||||
|
StStbprpB one = stStbprpBService.lambdaQuery().eq(StStbprpB::getStcd, statisticsQuerySo.getStcd()).one();
|
||||||
//下方统计数据
|
//下方统计数据
|
||||||
RjyNbStatVo vo = rjyNbStat(statisticsQuerySo);
|
RjyNbStatVo vo = rjyNbStat(statisticsQuerySo);
|
||||||
List<RjyNbVo> list = vo.getList();
|
List<RjyNbVo> list = vo.getList();
|
||||||
|
|
@ -462,7 +481,7 @@ public class StatisticsService {
|
||||||
rjyNbVo.setDrpM12(vo.getDayCount().toString());
|
rjyNbVo.setDrpM12(vo.getDayCount().toString());
|
||||||
rjyNb.add(rjyNbVo);
|
rjyNb.add(rjyNbVo);
|
||||||
|
|
||||||
String fileName = "檀树岗水库" + statisticsQuerySo.getYear() + "年日降雨年报表";
|
String fileName = one.getStnm() + statisticsQuerySo.getYear() + "年日降雨年报表";
|
||||||
ExcelUtil.exportExcel(rjyNb, fileName, RjyNbVo.class, response, fileName,1);
|
ExcelUtil.exportExcel(rjyNb, fileName, RjyNbVo.class, response, fileName,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -473,7 +492,8 @@ public class StatisticsService {
|
||||||
public RjswNbStatVo rjswNbStat(StatisticsQuerySo statisticsQuerySo) {
|
public RjswNbStatVo rjswNbStat(StatisticsQuerySo statisticsQuerySo) {
|
||||||
RjswNbStatVo vo = new RjswNbStatVo();
|
RjswNbStatVo vo = new RjswNbStatVo();
|
||||||
Integer year = statisticsQuerySo.getYear();
|
Integer year = statisticsQuerySo.getYear();
|
||||||
List<StPptnRD> list = stPptnRHMapper.queryDayRz(year.toString());
|
String stcd = statisticsQuerySo.getStcd();
|
||||||
|
List<StPptnRD> list = stPptnRHMapper.queryDayRzByStcd(year.toString(),stcd);
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
@ -583,6 +603,7 @@ public class StatisticsService {
|
||||||
List<RjswNbVo> list = statVo.getList();
|
List<RjswNbVo> list = statVo.getList();
|
||||||
rjswNbVos.addAll(list);
|
rjswNbVos.addAll(list);
|
||||||
|
|
||||||
|
StStbprpB one = stStbprpBService.lambdaQuery().eq(StStbprpB::getStcd, statisticsQuerySo.getStcd()).one();
|
||||||
//最下方拼接一条数据
|
//最下方拼接一条数据
|
||||||
RjswNbVo rjswNbVo = new RjswNbVo();
|
RjswNbVo rjswNbVo = new RjswNbVo();
|
||||||
rjswNbVo.setTheme("年统计");
|
rjswNbVo.setTheme("年统计");
|
||||||
|
|
@ -601,7 +622,7 @@ public class StatisticsService {
|
||||||
rjswNbVo.setDrpM12(statVo.getAvg().toString());
|
rjswNbVo.setDrpM12(statVo.getAvg().toString());
|
||||||
rjswNbVos.add(rjswNbVo);
|
rjswNbVos.add(rjswNbVo);
|
||||||
|
|
||||||
String fileName = "檀树岗水库" + statisticsQuerySo.getYear() + "年日平均水位年报表";
|
String fileName = one.getStnm() + statisticsQuerySo.getYear() + "年日平均水位年报表";
|
||||||
ExcelUtil.exportExcel(rjswNbVos, fileName, RjswNbVo.class, response, fileName,2);
|
ExcelUtil.exportExcel(rjswNbVos, fileName, RjswNbVo.class, response, fileName,2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,24 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.gunshi.project.ss.mapper.StPptnRHMapper">
|
<mapper namespace="com.gunshi.project.ss.mapper.StPptnRHMapper">
|
||||||
|
|
||||||
<select id="queryList" resultType="com.gunshi.project.ss.model.StPptnRH">
|
|
||||||
|
<select id="queryListByStcd" resultType="com.gunshi.project.ss.model.StPptnRH">
|
||||||
select tm,drp from public.st_pptn_r_h where tm <![CDATA[>]]> #{start} and tm <![CDATA[<=]]> #{end}
|
select tm,drp from public.st_pptn_r_h where tm <![CDATA[>]]> #{start} and tm <![CDATA[<=]]> #{end}
|
||||||
and stcd = (select stcd from public.att_res_base where res_code = '42118130001')
|
and stcd = #{stcd}
|
||||||
order by tm asc
|
order by tm asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryRzList" resultType="com.gunshi.project.ss.common.model.vo.StRzVo">
|
|
||||||
|
<select id="queryRzListByStcd" resultType="com.gunshi.project.ss.common.model.vo.StRzVo">
|
||||||
select tm,rz from public.st_rsvr_r where tm <![CDATA[>=]]> #{start} and tm <![CDATA[<]]> #{end}
|
select tm,rz from public.st_rsvr_r where tm <![CDATA[>=]]> #{start} and tm <![CDATA[<]]> #{end}
|
||||||
and stcd = (select stcd from public.att_res_base where res_code = '42118130001')
|
and stcd = #{stcd}
|
||||||
order by tm asc
|
order by tm asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryDayDrp" resultType="com.gunshi.project.ss.model.StPptnRD">
|
|
||||||
|
<select id="queryDayDrpByStcd" resultType="com.gunshi.project.ss.model.StPptnRD">
|
||||||
select tm,drp,TO_CHAR(tm, 'DD') as day,TO_CHAR(tm, 'MM') as month from public.st_pptn_r_d where year = #{year}
|
select tm,drp,TO_CHAR(tm, 'DD') as day,TO_CHAR(tm, 'MM') as month from public.st_pptn_r_d where year = #{year}
|
||||||
and stcd = (select stcd from public.att_res_base where res_code = '42118130001')
|
and stcd = #{stcd}
|
||||||
order by tm asc
|
order by tm asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -40,10 +43,11 @@
|
||||||
SELECT #{stcd} stcd, COALESCE(max(tm), '2021-01-01 00:00:00') tm, MAX ( chtm ) chtm FROM st_pptn_r_h WHERE stcd = #{stcd}
|
SELECT #{stcd} stcd, COALESCE(max(tm), '2021-01-01 00:00:00') tm, MAX ( chtm ) chtm FROM st_pptn_r_h WHERE stcd = #{stcd}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryDayRz" resultType="com.gunshi.project.ss.model.StPptnRD">
|
|
||||||
|
<select id="queryDayRzByStcd" resultType="com.gunshi.project.ss.model.StPptnRD">
|
||||||
select tm,rz as drp,TO_CHAR(tm, 'DD') as day,TO_CHAR(tm, 'MM') as month from public.st_rsvr_r where TO_CHAR(tm, 'YYYY') = #{year}
|
select tm,rz as drp,TO_CHAR(tm, 'DD') as day,TO_CHAR(tm, 'MM') as month from public.st_rsvr_r where TO_CHAR(tm, 'YYYY') = #{year}
|
||||||
and TRIM(TO_CHAR(tm, 'HH24')) = '08'
|
and TRIM(TO_CHAR(tm, 'HH24')) = '08'
|
||||||
and stcd = (select stcd from public.att_res_base where res_code = '42118130001')
|
and stcd = #{stcd}
|
||||||
order by tm asc
|
order by tm asc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue