parent
dae66822bc
commit
1fd47cae72
|
|
@ -53,28 +53,28 @@ public class AttResBase implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value="low_left_long")
|
@TableField(value="low_left_long")
|
||||||
@Schema(description="左下角经度")
|
@Schema(description="左下角经度")
|
||||||
private String lowLeftLong;
|
private BigDecimal lowLeftLong;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 左下角纬度
|
* 左下角纬度
|
||||||
*/
|
*/
|
||||||
@TableField(value="low_left_lat")
|
@TableField(value="low_left_lat")
|
||||||
@Schema(description="左下角纬度")
|
@Schema(description="左下角纬度")
|
||||||
private String lowLeftLat;
|
private BigDecimal lowLeftLat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 右上角经度
|
* 右上角经度
|
||||||
*/
|
*/
|
||||||
@TableField(value="up_right_long")
|
@TableField(value="up_right_long")
|
||||||
@Schema(description="右上角经度")
|
@Schema(description="右上角经度")
|
||||||
private String upRightLong;
|
private BigDecimal upRightLong;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 右上角纬度
|
* 右上角纬度
|
||||||
*/
|
*/
|
||||||
@TableField(value="up_right_lat")
|
@TableField(value="up_right_lat")
|
||||||
@Schema(description="右上角纬度")
|
@Schema(description="右上角纬度")
|
||||||
private String upRightLat;
|
private BigDecimal upRightLat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 水库所在位置
|
* 水库所在位置
|
||||||
|
|
@ -113,14 +113,14 @@ public class AttResBase implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value="wat_shed_area")
|
@TableField(value="wat_shed_area")
|
||||||
@Schema(description="坝址控制流域面积")
|
@Schema(description="坝址控制流域面积")
|
||||||
private String watShedArea;
|
private BigDecimal watShedArea;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 防洪高水位
|
* 防洪高水位
|
||||||
*/
|
*/
|
||||||
@TableField(value="upp_lev_flco")
|
@TableField(value="upp_lev_flco")
|
||||||
@Schema(description="防洪高水位")
|
@Schema(description="防洪高水位")
|
||||||
private String uppLevFlco;
|
private BigDecimal uppLevFlco;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 正常蓄水位
|
* 正常蓄水位
|
||||||
|
|
@ -128,7 +128,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="norm_wat_lev")
|
@TableField(value="norm_wat_lev")
|
||||||
@Schema(description="正常蓄水位")
|
@Schema(description="正常蓄水位")
|
||||||
// @Size(max = 0,message = "正常蓄水位最大长度要小于 0")
|
// @Size(max = 0,message = "正常蓄水位最大长度要小于 0")
|
||||||
private String normWatLev;
|
private BigDecimal normWatLev;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 正常蓄水位相应水面面积
|
* 正常蓄水位相应水面面积
|
||||||
|
|
@ -136,7 +136,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="norm_pool_stag_area")
|
@TableField(value="norm_pool_stag_area")
|
||||||
@Schema(description="正常蓄水位相应水面面积")
|
@Schema(description="正常蓄水位相应水面面积")
|
||||||
// @Size(max = 0,message = "正常蓄水位相应水面面积最大长度要小于 0")
|
// @Size(max = 0,message = "正常蓄水位相应水面面积最大长度要小于 0")
|
||||||
private String normPoolStagArea;
|
private BigDecimal normPoolStagArea;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 正常蓄水位相应库容
|
* 正常蓄水位相应库容
|
||||||
|
|
@ -144,7 +144,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="norm_pool_stag_cap")
|
@TableField(value="norm_pool_stag_cap")
|
||||||
@Schema(description="正常蓄水位相应库容")
|
@Schema(description="正常蓄水位相应库容")
|
||||||
// @Size(max = 0,message = "正常蓄水位相应库容最大长度要小于 0")
|
// @Size(max = 0,message = "正常蓄水位相应库容最大长度要小于 0")
|
||||||
private String normPoolStagCap;
|
private BigDecimal normPoolStagCap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主汛期防洪限制水位
|
* 主汛期防洪限制水位
|
||||||
|
|
@ -159,7 +159,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="fl_low_lim_lev_cap")
|
@TableField(value="fl_low_lim_lev_cap")
|
||||||
@Schema(description="防洪限制水位库容")
|
@Schema(description="防洪限制水位库容")
|
||||||
// @Size(max = 0,message = "防洪限制水位库容最大长度要小于 0")
|
// @Size(max = 0,message = "防洪限制水位库容最大长度要小于 0")
|
||||||
private String flLowLimLevCap;
|
private BigDecimal flLowLimLevCap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 死水位
|
* 死水位
|
||||||
|
|
@ -167,7 +167,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="dead_lev")
|
@TableField(value="dead_lev")
|
||||||
@Schema(description="死水位")
|
@Schema(description="死水位")
|
||||||
// @Size(max = 0,message = "死水位最大长度要小于 0")
|
// @Size(max = 0,message = "死水位最大长度要小于 0")
|
||||||
private String deadLev;
|
private BigDecimal deadLev;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总库容
|
* 总库容
|
||||||
|
|
@ -175,7 +175,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="tot_cap")
|
@TableField(value="tot_cap")
|
||||||
@Schema(description="总库容")
|
@Schema(description="总库容")
|
||||||
// @Size(max = 0,message = "总库容最大长度要小于 0")
|
// @Size(max = 0,message = "总库容最大长度要小于 0")
|
||||||
private String totCap;
|
private BigDecimal totCap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 兴利库容
|
* 兴利库容
|
||||||
|
|
@ -183,7 +183,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="ben_res_cap")
|
@TableField(value="ben_res_cap")
|
||||||
@Schema(description="兴利库容")
|
@Schema(description="兴利库容")
|
||||||
// @Size(max = 0,message = "兴利库容最大长度要小于 0")
|
// @Size(max = 0,message = "兴利库容最大长度要小于 0")
|
||||||
private String benResCap;
|
private BigDecimal benResCap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 死库容
|
* 死库容
|
||||||
|
|
@ -191,7 +191,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="dead_cap")
|
@TableField(value="dead_cap")
|
||||||
@Schema(description="死库容")
|
@Schema(description="死库容")
|
||||||
// @Size(max = 0,message = "死库容最大长度要小于 0")
|
// @Size(max = 0,message = "死库容最大长度要小于 0")
|
||||||
private String deadCap;
|
private BigDecimal deadCap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调洪库容
|
* 调洪库容
|
||||||
|
|
@ -199,7 +199,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="stor_fl_cap")
|
@TableField(value="stor_fl_cap")
|
||||||
@Schema(description="调洪库容")
|
@Schema(description="调洪库容")
|
||||||
// @Size(max = 0,message = "调洪库容最大长度要小于 0")
|
// @Size(max = 0,message = "调洪库容最大长度要小于 0")
|
||||||
private String storFlCap;
|
private BigDecimal storFlCap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 防洪库容
|
* 防洪库容
|
||||||
|
|
@ -207,7 +207,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="flco_cap")
|
@TableField(value="flco_cap")
|
||||||
@Schema(description="防洪库容")
|
@Schema(description="防洪库容")
|
||||||
// @Size(max = 0,message = "防洪库容最大长度要小于 0")
|
// @Size(max = 0,message = "防洪库容最大长度要小于 0")
|
||||||
private String flcoCap;
|
private BigDecimal flcoCap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工程建设情况 在建 0 已建 1
|
* 工程建设情况 在建 0 已建 1
|
||||||
|
|
@ -332,7 +332,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="elev_dat")
|
@TableField(value="elev_dat")
|
||||||
@Schema(description="高程基准面 基面名称")
|
@Schema(description="高程基准面 基面名称")
|
||||||
@Size(max = 256,message = "高程基准面 基面名称最大长度要小于 256")
|
@Size(max = 256,message = "高程基准面 基面名称最大长度要小于 256")
|
||||||
private String elevDat;
|
private BigDecimal elevDat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 水库功能 功能名称
|
* 水库功能 功能名称
|
||||||
|
|
@ -372,7 +372,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="crest_elev")
|
@TableField(value="crest_elev")
|
||||||
@Schema(description="坝顶高程")
|
@Schema(description="坝顶高程")
|
||||||
// @Size(max = 0,message = "坝顶高程最大长度要小于 0")
|
// @Size(max = 0,message = "坝顶高程最大长度要小于 0")
|
||||||
private String crestElev;
|
private BigDecimal crestElev;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最大坝高
|
* 最大坝高
|
||||||
|
|
@ -380,7 +380,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="max_dam_heig")
|
@TableField(value="max_dam_heig")
|
||||||
@Schema(description="最大坝高")
|
@Schema(description="最大坝高")
|
||||||
// @Size(max = 0,message = "最大坝高最大长度要小于 0")
|
// @Size(max = 0,message = "最大坝高最大长度要小于 0")
|
||||||
private String maxDamHeig;
|
private BigDecimal maxDamHeig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设计洪水位时最大下泄流量
|
* 设计洪水位时最大下泄流量
|
||||||
|
|
@ -388,7 +388,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="max_des_flood_flow")
|
@TableField(value="max_des_flood_flow")
|
||||||
@Schema(description="设计洪水位时最大下泄流量")
|
@Schema(description="设计洪水位时最大下泄流量")
|
||||||
// @Size(max = 0,message = "设计洪水位时最大下泄流量最大长度要小于 0")
|
// @Size(max = 0,message = "设计洪水位时最大下泄流量最大长度要小于 0")
|
||||||
private String maxDesFloodFlow;
|
private BigDecimal maxDesFloodFlow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校核洪水位时最大下泄流量
|
* 校核洪水位时最大下泄流量
|
||||||
|
|
@ -396,7 +396,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="max_cal_flood_flow")
|
@TableField(value="max_cal_flood_flow")
|
||||||
@Schema(description="校核洪水位时最大下泄流量")
|
@Schema(description="校核洪水位时最大下泄流量")
|
||||||
// @Size(max = 0,message = "校核洪水位时最大下泄流量最大长度要小于 0")
|
// @Size(max = 0,message = "校核洪水位时最大下泄流量最大长度要小于 0")
|
||||||
private String maxCalFloodFlow;
|
private BigDecimal maxCalFloodFlow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下游河道安全流量
|
* 下游河道安全流量
|
||||||
|
|
@ -404,7 +404,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="ds_saft_flow")
|
@TableField(value="ds_saft_flow")
|
||||||
@Schema(description="下游河道安全流量")
|
@Schema(description="下游河道安全流量")
|
||||||
// @Size(max = 0,message = "下游河道安全流量最大长度要小于 0")
|
// @Size(max = 0,message = "下游河道安全流量最大长度要小于 0")
|
||||||
private String dsSaftFlow;
|
private BigDecimal dsSaftFlow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工程概况
|
* 工程概况
|
||||||
|
|
@ -436,7 +436,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="danger_overview")
|
@TableField(value="danger_overview")
|
||||||
@Schema(description="病险概况")
|
@Schema(description="病险概况")
|
||||||
// @Size(max = 0,message = "病险概况最大长度要小于 0")
|
// @Size(max = 0,message = "病险概况最大长度要小于 0")
|
||||||
private String dangerOverview;
|
private BigDecimal dangerOverview;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重点水库
|
* 重点水库
|
||||||
|
|
@ -452,7 +452,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="lgtd")
|
@TableField(value="lgtd")
|
||||||
@Schema(description="经度 (°)")
|
@Schema(description="经度 (°)")
|
||||||
// @Size(max = 0,message = "经度 (°)最大长度要小于 0")
|
// @Size(max = 0,message = "经度 (°)最大长度要小于 0")
|
||||||
private String lgtd;
|
private BigDecimal lgtd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 纬度 (°)
|
* 纬度 (°)
|
||||||
|
|
@ -460,7 +460,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="lttd")
|
@TableField(value="lttd")
|
||||||
@Schema(description="纬度 (°)")
|
@Schema(description="纬度 (°)")
|
||||||
// @Size(max = 0,message = "纬度 (°)最大长度要小于 0")
|
// @Size(max = 0,message = "纬度 (°)最大长度要小于 0")
|
||||||
private String lttd;
|
private BigDecimal lttd;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* geojson
|
* geojson
|
||||||
|
|
@ -468,7 +468,7 @@ public class AttResBase implements Serializable {
|
||||||
@TableField(value="geometry")
|
@TableField(value="geometry")
|
||||||
@Schema(description="geojson")
|
@Schema(description="geojson")
|
||||||
// @Size(max = 0,message = "geojson最大长度要小于 0")
|
// @Size(max = 0,message = "geojson最大长度要小于 0")
|
||||||
private String geometry;
|
private BigDecimal geometry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否有大坝安监数据
|
* 是否有大坝安监数据
|
||||||
|
|
@ -519,7 +519,7 @@ public class AttResBase implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value="benefit")
|
@TableField(value="benefit")
|
||||||
@Schema(description="供水效益")
|
@Schema(description="供水效益")
|
||||||
private String benefit;
|
private BigDecimal benefit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全流域面积
|
* 全流域面积
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.gunshi.project.xyt.service;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gunshi.project.xyt.entity.dto.StZqrlBDto;
|
import com.gunshi.project.xyt.entity.dto.StZqrlBDto;
|
||||||
import com.gunshi.project.xyt.entity.so.HomeStStbprpBSo;
|
import com.gunshi.project.xyt.entity.so.HomeStStbprpBSo;
|
||||||
|
|
@ -10,8 +11,10 @@ import com.gunshi.project.xyt.entity.vo.*;
|
||||||
import com.gunshi.project.xyt.mapper.OsmoticPressRMapper;
|
import com.gunshi.project.xyt.mapper.OsmoticPressRMapper;
|
||||||
import com.gunshi.project.xyt.mapper.OsmoticShiftRMapper;
|
import com.gunshi.project.xyt.mapper.OsmoticShiftRMapper;
|
||||||
import com.gunshi.project.xyt.mapper.StStbprpBMapper;
|
import com.gunshi.project.xyt.mapper.StStbprpBMapper;
|
||||||
|
import com.gunshi.project.xyt.model.StRsvrR;
|
||||||
import com.gunshi.project.xyt.model.StStbprpB;
|
import com.gunshi.project.xyt.model.StStbprpB;
|
||||||
import com.gunshi.project.xyt.model.StZqrlB;
|
import com.gunshi.project.xyt.model.StZqrlB;
|
||||||
|
import com.gunshi.project.xyt.model.StZvarlB;
|
||||||
import com.gunshi.project.xyt.util.DateUtil;
|
import com.gunshi.project.xyt.util.DateUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -35,8 +38,7 @@ import java.util.stream.Collectors;
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB> {
|
||||||
{
|
|
||||||
@Resource
|
@Resource
|
||||||
private OsmoticPressRMapper pressRMapper;
|
private OsmoticPressRMapper pressRMapper;
|
||||||
|
|
||||||
|
|
@ -46,15 +48,20 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
||||||
@Autowired
|
@Autowired
|
||||||
private StZqrlBService stZqrlBService;
|
private StZqrlBService stZqrlBService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StZvarlBService stZvarlBService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private StRsvrRService rsvrRService;
|
private StRsvrRService rsvrRService;
|
||||||
|
|
||||||
public List<HomeStStbprpBVo> rainfallStationDetailsList(HomeStStbprpBSo dto) {
|
public List<HomeStStbprpBVo> rainfallStationDetailsList(HomeStStbprpBSo dto) {
|
||||||
return baseMapper.rainfallStationDetailsList(dto);
|
return baseMapper.rainfallStationDetailsList(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<HomeStStbprpBVo> reservoirStationDetailsList() {
|
public List<HomeStStbprpBVo> reservoirStationDetailsList() {
|
||||||
return baseMapper.reservoirStationDetailsList();
|
return baseMapper.reservoirStationDetailsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<HomeStStbprpBVo> flowStationDetailsList() {
|
public List<HomeStStbprpBVo> flowStationDetailsList() {
|
||||||
return baseMapper.flowStationDetailsList();
|
return baseMapper.flowStationDetailsList();
|
||||||
}
|
}
|
||||||
|
|
@ -73,20 +80,20 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
||||||
List<StStatusVo> imgList = baseMapper.imgList();
|
List<StStatusVo> imgList = baseMapper.imgList();
|
||||||
rainList.addAll(rzList);
|
rainList.addAll(rzList);
|
||||||
rainList.addAll(imgList);
|
rainList.addAll(imgList);
|
||||||
rainList.stream().collect(Collectors.toMap(obj->obj.getStcd(),obj-> obj,(obj1,obj2)->
|
rainList.stream().collect(Collectors.toMap(obj -> obj.getStcd(), obj -> obj, (obj1, obj2) ->
|
||||||
DateUtil.convertStringToDate(obj1.getTm()).after(DateUtil.convertStringToDate(obj2.getTm())) ? obj1 : obj2
|
DateUtil.convertStringToDate(obj1.getTm()).after(DateUtil.convertStringToDate(obj2.getTm())) ? obj1 : obj2
|
||||||
)).values().stream().collect(Collectors.toList());
|
)).values().stream().collect(Collectors.toList());
|
||||||
for(StStatusVo statusVo : rainList){
|
for (StStatusVo statusVo : rainList) {
|
||||||
String tm = statusVo.getTm();
|
String tm = statusVo.getTm();
|
||||||
if(StringUtils.isEmpty(tm) || DateUtil.hoursBetweenDate(DateUtil.convertStringToDate(tm),new Date()) > 2){
|
if (StringUtils.isEmpty(tm) || DateUtil.hoursBetweenDate(DateUtil.convertStringToDate(tm), new Date()) > 2) {
|
||||||
offLineList.add(statusVo);
|
offLineList.add(statusVo);
|
||||||
}else {
|
} else {
|
||||||
onLineList.add(statusVo);
|
onLineList.add(statusVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//渗压
|
//渗压
|
||||||
List<OsmoticPressVo> pressList = pressRMapper.listValue();
|
List<OsmoticPressVo> pressList = pressRMapper.listValue();
|
||||||
list.addAll(pressList.stream().map(o->{
|
list.addAll(pressList.stream().map(o -> {
|
||||||
StStatusVo vo = new StStatusVo();
|
StStatusVo vo = new StStatusVo();
|
||||||
vo.setStnm(o.getStationCode());
|
vo.setStnm(o.getStationCode());
|
||||||
vo.setTm(o.getTm());
|
vo.setTm(o.getTm());
|
||||||
|
|
@ -94,7 +101,7 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
||||||
}).collect(Collectors.toList()));
|
}).collect(Collectors.toList()));
|
||||||
//渗流
|
//渗流
|
||||||
List<OsmoticPressVo> flowList = pressRMapper.flowListValue();
|
List<OsmoticPressVo> flowList = pressRMapper.flowListValue();
|
||||||
list.addAll(flowList.stream().map(o->{
|
list.addAll(flowList.stream().map(o -> {
|
||||||
StStatusVo vo = new StStatusVo();
|
StStatusVo vo = new StStatusVo();
|
||||||
vo.setStnm(o.getStationCode());
|
vo.setStnm(o.getStationCode());
|
||||||
vo.setTm(o.getTm());
|
vo.setTm(o.getTm());
|
||||||
|
|
@ -102,23 +109,23 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
||||||
}).collect(Collectors.toList()));
|
}).collect(Collectors.toList()));
|
||||||
//位移
|
//位移
|
||||||
List<OsmoticShiftListVo> shiftList = shiftRMapper.listValue();
|
List<OsmoticShiftListVo> shiftList = shiftRMapper.listValue();
|
||||||
list.addAll(shiftList.stream().map(o->{
|
list.addAll(shiftList.stream().map(o -> {
|
||||||
StStatusVo vo = new StStatusVo();
|
StStatusVo vo = new StStatusVo();
|
||||||
vo.setStnm(o.getStationCode());
|
vo.setStnm(o.getStationCode());
|
||||||
vo.setTm(o.getTm());
|
vo.setTm(o.getTm());
|
||||||
return vo;
|
return vo;
|
||||||
}).collect(Collectors.toList()));
|
}).collect(Collectors.toList()));
|
||||||
|
|
||||||
for (StStatusVo vo : list){
|
for (StStatusVo vo : list) {
|
||||||
String tm = vo.getTm();
|
String tm = vo.getTm();
|
||||||
if(StringUtils.isEmpty(tm) || DateUtil.hoursBetweenDate(DateUtil.convertStringToDate(tm),new Date()) > 24){
|
if (StringUtils.isEmpty(tm) || DateUtil.hoursBetweenDate(DateUtil.convertStringToDate(tm), new Date()) > 24) {
|
||||||
offLineList.add(vo);
|
offLineList.add(vo);
|
||||||
}else {
|
} else {
|
||||||
onLineList.add(vo);
|
onLineList.add(vo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
res.setOnline(onLineList.stream().sorted(Comparator.comparing(StStatusVo::getTm,Comparator.nullsFirst(String::compareTo)).reversed()).collect(Collectors.toList()));
|
res.setOnline(onLineList.stream().sorted(Comparator.comparing(StStatusVo::getTm, Comparator.nullsFirst(String::compareTo)).reversed()).collect(Collectors.toList()));
|
||||||
res.setOffLine(offLineList.stream().sorted(Comparator.comparing(StStatusVo::getTm,Comparator.nullsFirst(String::compareTo)).reversed()).collect(Collectors.toList()));
|
res.setOffLine(offLineList.stream().sorted(Comparator.comparing(StStatusVo::getTm, Comparator.nullsFirst(String::compareTo)).reversed()).collect(Collectors.toList()));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,38 +133,70 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
||||||
return this.baseMapper.rainList();
|
return this.baseMapper.rainList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<StZqrlBVo> flowList(StZqrlBDto obj){
|
public List<StZqrlBVo> flowList(StZqrlBDto obj) {
|
||||||
/*
|
/*
|
||||||
* 查出时段内的水位列表,按时间升序排,根据水位查水位流量曲线表得到流量
|
* 查出时段内的水位列表,按时间升序排,根据水位查水位流量曲线表得到流量
|
||||||
* 第一条数据的累计溢洪量设为0,第二条累计溢洪量=上一条累计溢洪量+本条溢洪流量*60分*60秒,以此类推
|
* 第一条数据的累计溢洪量设为0,第二条累计溢洪量=上一条累计溢洪量+本条溢洪流量*60分*60秒,以此类推
|
||||||
*/
|
*/
|
||||||
// rsvrRService.
|
|
||||||
List<StZqrlBVo> stZqrlBVos = baseMapper.flowList(obj);
|
List<StRsvrR> rsvrList = rsvrRService.lambdaQuery()
|
||||||
|
.between(StRsvrR::getTm, obj.getDateSo().getStart(), obj.getDateSo().getEnd())
|
||||||
|
.orderBy(true, true, StRsvrR::getTm)
|
||||||
|
.list();
|
||||||
List<StZqrlB> zqrlList = stZqrlBService.list();
|
List<StZqrlB> zqrlList = stZqrlBService.list();
|
||||||
|
zqrlList.sort(Comparator.comparing(StZqrlB::getZ));
|
||||||
|
List<StZvarlB> zvarlList = stZvarlBService.list();
|
||||||
|
zvarlList.sort(Comparator.comparing(StZvarlB::getRz));
|
||||||
|
List<StZqrlBVo> ret = new ArrayList<>();
|
||||||
|
|
||||||
BigDecimal runningSum = BigDecimal.ZERO;
|
for (int i = 0; i < rsvrList.size(); i++) {
|
||||||
|
StRsvrR rsvr = rsvrList.get(i);
|
||||||
|
BigDecimal rz = new BigDecimal(rsvr.getRz());
|
||||||
|
StZqrlBVo vo = new StZqrlBVo();
|
||||||
|
vo.setStcd(rsvr.getStcd());
|
||||||
|
vo.setTm(rsvr.getTm());
|
||||||
|
vo.setWaterLevel(rz);
|
||||||
|
|
||||||
for (StZqrlBVo current : stZqrlBVos) {
|
zqrlList.stream()
|
||||||
// 将当前记录的flowNum加到累计和中
|
.filter(zqrl -> zqrl.getZ().equals(new BigDecimal(rsvr.getRz())))
|
||||||
if (current.getFlowNum() != null) {
|
.findFirst()
|
||||||
runningSum = runningSum.add(current.getFlowNum());
|
.ifPresentOrElse(zqrl -> {
|
||||||
|
vo.setFlowNum(zqrl.getQ());
|
||||||
|
}, () -> vo.setFlowNum(BigDecimal.ZERO));
|
||||||
|
|
||||||
|
zvarlList.stream()
|
||||||
|
.filter(zvarl -> zvarl.getRz().equals(new BigDecimal(rsvr.getRz())))
|
||||||
|
.findFirst()
|
||||||
|
.ifPresentOrElse(zvarl -> {
|
||||||
|
vo.setBoxNum(zvarl.getW());
|
||||||
|
}, () -> vo.setBoxNum(BigDecimal.ZERO));
|
||||||
|
|
||||||
|
if (i == 0) {
|
||||||
|
vo.setQtotal(BigDecimal.ZERO);
|
||||||
|
} else {
|
||||||
|
StZqrlBVo voPrev = ret.get(i - 1);
|
||||||
|
BigDecimal qTotal = vo.getFlowNum().multiply(BigDecimal.valueOf(60 * 60));
|
||||||
|
BigDecimal prevQtotal = voPrev.getQtotal();
|
||||||
|
qTotal = qTotal.add(prevQtotal);
|
||||||
|
vo.setQtotal(qTotal);
|
||||||
}
|
}
|
||||||
// 设置当前记录的qtotal为之前所有flowNum的和
|
|
||||||
current.setQtotal(runningSum);
|
ret.add(vo);
|
||||||
}
|
}
|
||||||
return stZqrlBVos;
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StZqrlBCountVo count(Serializable stcd) {
|
public StZqrlBCountVo count(Serializable stcd) {
|
||||||
StZqrlBCountVo vo = new StZqrlBCountVo();
|
StZqrlBCountVo vo = new StZqrlBCountVo();
|
||||||
vo.setStcd(stcd.toString());
|
vo.setStcd(stcd.toString());
|
||||||
if(Objects.isNull(stcd)){
|
if (Objects.isNull(stcd)) {
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
String stcdstr = stcd.toString();
|
String stcdstr = stcd.toString();
|
||||||
|
|
||||||
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
||||||
qw.eq(StZqrlB::getStcd,stcdstr).orderByDesc(StZqrlB::getModitime).last(" limit 1");
|
qw.eq(StZqrlB::getStcd, stcdstr).orderByDesc(StZqrlB::getModitime).last(" limit 1");
|
||||||
StZqrlB bean = stZqrlBService.getOne(qw);
|
StZqrlB bean = stZqrlBService.getOne(qw);
|
||||||
vo.setVal(bean.getQ());
|
vo.setVal(bean.getQ());
|
||||||
vo.setCreateTime(bean.getModitime());
|
vo.setCreateTime(bean.getModitime());
|
||||||
|
|
@ -166,21 +205,21 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
||||||
LocalDateTime todayStart = LocalDate.now().atStartOfDay();
|
LocalDateTime todayStart = LocalDate.now().atStartOfDay();
|
||||||
// 获取当前时间 (带时分秒)
|
// 获取当前时间 (带时分秒)
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
vo.setCurrDayValSum(sumVal(stcdstr,todayStart,now));
|
vo.setCurrDayValSum(sumVal(stcdstr, todayStart, now));
|
||||||
|
|
||||||
// 获取本月1号0点
|
// 获取本月1号0点
|
||||||
LocalDateTime firstDayOfMonth = LocalDate.now().withDayOfMonth(1).atStartOfDay();
|
LocalDateTime firstDayOfMonth = LocalDate.now().withDayOfMonth(1).atStartOfDay();
|
||||||
vo.setCurrMonthSum(sumVal(stcdstr,firstDayOfMonth,now));
|
vo.setCurrMonthSum(sumVal(stcdstr, firstDayOfMonth, now));
|
||||||
|
|
||||||
// 获取本年第一天 00:00:00
|
// 获取本年第一天 00:00:00
|
||||||
LocalDateTime firstDayOfYear = LocalDate.now().withDayOfYear(1).atStartOfDay();
|
LocalDateTime firstDayOfYear = LocalDate.now().withDayOfYear(1).atStartOfDay();
|
||||||
vo.setCurrYearSum(sumVal(stcdstr,firstDayOfYear,now));
|
vo.setCurrYearSum(sumVal(stcdstr, firstDayOfYear, now));
|
||||||
|
|
||||||
//年次数
|
//年次数
|
||||||
vo.setCurrYearCount(countVal(stcdstr,firstDayOfYear,now));
|
vo.setCurrYearCount(countVal(stcdstr, firstDayOfYear, now));
|
||||||
|
|
||||||
//本年最大
|
//本年最大
|
||||||
vo.setCurrYearMaxVal(maxVal(stcdstr,firstDayOfYear,now));
|
vo.setCurrYearMaxVal(maxVal(stcdstr, firstDayOfYear, now));
|
||||||
|
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
@ -203,7 +242,7 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
||||||
// 获取24小时前的时间
|
// 获取24小时前的时间
|
||||||
LocalDateTime before24 = now.minusHours(24);
|
LocalDateTime before24 = now.minusHours(24);
|
||||||
List<StZqrlB> list = getList(stcdstr, before24, now);
|
List<StZqrlB> list = getList(stcdstr, before24, now);
|
||||||
if(CollectionUtil.isEmpty(list)){
|
if (CollectionUtil.isEmpty(list)) {
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
StZqrlB stZqrlB = list.stream()
|
StZqrlB stZqrlB = list.stream()
|
||||||
|
|
@ -245,45 +284,46 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<StZqrlB> getList(String stcd, LocalDateTime start, LocalDateTime end){
|
private List<StZqrlB> getList(String stcd, LocalDateTime start, LocalDateTime end) {
|
||||||
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
||||||
qw.eq(StZqrlB::getStcd, stcd);
|
qw.eq(StZqrlB::getStcd, stcd);
|
||||||
qw.ge(StZqrlB::getModitime,start);
|
qw.ge(StZqrlB::getModitime, start);
|
||||||
qw.le(StZqrlB::getModitime,end);
|
qw.le(StZqrlB::getModitime, end);
|
||||||
List<StZqrlB> list = stZqrlBService.list(qw);
|
List<StZqrlB> list = stZqrlBService.list(qw);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BigDecimal sumVal(String stcd, LocalDateTime start, LocalDateTime end){
|
private BigDecimal sumVal(String stcd, LocalDateTime start, LocalDateTime end) {
|
||||||
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
||||||
qw.eq(StZqrlB::getStcd, stcd);
|
qw.eq(StZqrlB::getStcd, stcd);
|
||||||
qw.ge(StZqrlB::getModitime,start);
|
qw.ge(StZqrlB::getModitime, start);
|
||||||
qw.le(StZqrlB::getModitime,end);
|
qw.le(StZqrlB::getModitime, end);
|
||||||
List<StZqrlB> list = stZqrlBService.list(qw);
|
List<StZqrlB> list = stZqrlBService.list(qw);
|
||||||
if(CollectionUtil.isNotEmpty(list)){
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
return list.stream().map(StZqrlB::getQ).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
return list.stream().map(StZqrlB::getQ).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
private Long countVal(String stcd, LocalDateTime start, LocalDateTime end){
|
|
||||||
|
private Long countVal(String stcd, LocalDateTime start, LocalDateTime end) {
|
||||||
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
||||||
qw.eq(StZqrlB::getStcd, stcd);
|
qw.eq(StZqrlB::getStcd, stcd);
|
||||||
qw.ge(StZqrlB::getModitime,start);
|
qw.ge(StZqrlB::getModitime, start);
|
||||||
qw.le(StZqrlB::getModitime,end);
|
qw.le(StZqrlB::getModitime, end);
|
||||||
List<StZqrlB> list = stZqrlBService.list(qw);
|
List<StZqrlB> list = stZqrlBService.list(qw);
|
||||||
if(CollectionUtil.isNotEmpty(list)){
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
return list.stream().map(StZqrlB::getQ).filter(Objects::nonNull).filter(q -> q.compareTo(BigDecimal.ZERO) > 0).count();
|
return list.stream().map(StZqrlB::getQ).filter(Objects::nonNull).filter(q -> q.compareTo(BigDecimal.ZERO) > 0).count();
|
||||||
}
|
}
|
||||||
return 0l;
|
return 0l;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BigDecimal maxVal(String stcd, LocalDateTime start, LocalDateTime end){
|
private BigDecimal maxVal(String stcd, LocalDateTime start, LocalDateTime end) {
|
||||||
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
||||||
qw.eq(StZqrlB::getStcd, stcd);
|
qw.eq(StZqrlB::getStcd, stcd);
|
||||||
qw.ge(StZqrlB::getModitime,start);
|
qw.ge(StZqrlB::getModitime, start);
|
||||||
qw.le(StZqrlB::getModitime,end);
|
qw.le(StZqrlB::getModitime, end);
|
||||||
List<StZqrlB> list = stZqrlBService.list(qw);
|
List<StZqrlB> list = stZqrlBService.list(qw);
|
||||||
if(CollectionUtil.isNotEmpty(list)){
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
return list.stream().map(StZqrlB::getQ).filter(Objects::nonNull).max(Comparator.naturalOrder()).orElse(null);
|
return list.stream().map(StZqrlB::getQ).filter(Objects::nonNull).max(Comparator.naturalOrder()).orElse(null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue