parent
dae66822bc
commit
1fd47cae72
|
|
@ -53,28 +53,28 @@ public class AttResBase implements Serializable {
|
|||
*/
|
||||
@TableField(value="low_left_long")
|
||||
@Schema(description="左下角经度")
|
||||
private String lowLeftLong;
|
||||
private BigDecimal lowLeftLong;
|
||||
|
||||
/**
|
||||
* 左下角纬度
|
||||
*/
|
||||
@TableField(value="low_left_lat")
|
||||
@Schema(description="左下角纬度")
|
||||
private String lowLeftLat;
|
||||
private BigDecimal lowLeftLat;
|
||||
|
||||
/**
|
||||
* 右上角经度
|
||||
*/
|
||||
@TableField(value="up_right_long")
|
||||
@Schema(description="右上角经度")
|
||||
private String upRightLong;
|
||||
private BigDecimal upRightLong;
|
||||
|
||||
/**
|
||||
* 右上角纬度
|
||||
*/
|
||||
@TableField(value="up_right_lat")
|
||||
@Schema(description="右上角纬度")
|
||||
private String upRightLat;
|
||||
private BigDecimal upRightLat;
|
||||
|
||||
/**
|
||||
* 水库所在位置
|
||||
|
|
@ -113,14 +113,14 @@ public class AttResBase implements Serializable {
|
|||
*/
|
||||
@TableField(value="wat_shed_area")
|
||||
@Schema(description="坝址控制流域面积")
|
||||
private String watShedArea;
|
||||
private BigDecimal watShedArea;
|
||||
|
||||
/**
|
||||
* 防洪高水位
|
||||
*/
|
||||
@TableField(value="upp_lev_flco")
|
||||
@Schema(description="防洪高水位")
|
||||
private String uppLevFlco;
|
||||
private BigDecimal uppLevFlco;
|
||||
|
||||
/**
|
||||
* 正常蓄水位
|
||||
|
|
@ -128,7 +128,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="norm_wat_lev")
|
||||
@Schema(description="正常蓄水位")
|
||||
// @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")
|
||||
@Schema(description="正常蓄水位相应水面面积")
|
||||
// @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")
|
||||
@Schema(description="正常蓄水位相应库容")
|
||||
// @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")
|
||||
@Schema(description="防洪限制水位库容")
|
||||
// @Size(max = 0,message = "防洪限制水位库容最大长度要小于 0")
|
||||
private String flLowLimLevCap;
|
||||
private BigDecimal flLowLimLevCap;
|
||||
|
||||
/**
|
||||
* 死水位
|
||||
|
|
@ -167,7 +167,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="dead_lev")
|
||||
@Schema(description="死水位")
|
||||
// @Size(max = 0,message = "死水位最大长度要小于 0")
|
||||
private String deadLev;
|
||||
private BigDecimal deadLev;
|
||||
|
||||
/**
|
||||
* 总库容
|
||||
|
|
@ -175,7 +175,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="tot_cap")
|
||||
@Schema(description="总库容")
|
||||
// @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")
|
||||
@Schema(description="兴利库容")
|
||||
// @Size(max = 0,message = "兴利库容最大长度要小于 0")
|
||||
private String benResCap;
|
||||
private BigDecimal benResCap;
|
||||
|
||||
/**
|
||||
* 死库容
|
||||
|
|
@ -191,7 +191,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="dead_cap")
|
||||
@Schema(description="死库容")
|
||||
// @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")
|
||||
@Schema(description="调洪库容")
|
||||
// @Size(max = 0,message = "调洪库容最大长度要小于 0")
|
||||
private String storFlCap;
|
||||
private BigDecimal storFlCap;
|
||||
|
||||
/**
|
||||
* 防洪库容
|
||||
|
|
@ -207,7 +207,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="flco_cap")
|
||||
@Schema(description="防洪库容")
|
||||
// @Size(max = 0,message = "防洪库容最大长度要小于 0")
|
||||
private String flcoCap;
|
||||
private BigDecimal flcoCap;
|
||||
|
||||
/**
|
||||
* 工程建设情况 在建 0 已建 1
|
||||
|
|
@ -332,7 +332,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="elev_dat")
|
||||
@Schema(description="高程基准面 基面名称")
|
||||
@Size(max = 256,message = "高程基准面 基面名称最大长度要小于 256")
|
||||
private String elevDat;
|
||||
private BigDecimal elevDat;
|
||||
|
||||
/**
|
||||
* 水库功能 功能名称
|
||||
|
|
@ -372,7 +372,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="crest_elev")
|
||||
@Schema(description="坝顶高程")
|
||||
// @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")
|
||||
@Schema(description="最大坝高")
|
||||
// @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")
|
||||
@Schema(description="设计洪水位时最大下泄流量")
|
||||
// @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")
|
||||
@Schema(description="校核洪水位时最大下泄流量")
|
||||
// @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")
|
||||
@Schema(description="下游河道安全流量")
|
||||
// @Size(max = 0,message = "下游河道安全流量最大长度要小于 0")
|
||||
private String dsSaftFlow;
|
||||
private BigDecimal dsSaftFlow;
|
||||
|
||||
/**
|
||||
* 工程概况
|
||||
|
|
@ -436,7 +436,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="danger_overview")
|
||||
@Schema(description="病险概况")
|
||||
// @Size(max = 0,message = "病险概况最大长度要小于 0")
|
||||
private String dangerOverview;
|
||||
private BigDecimal dangerOverview;
|
||||
|
||||
/**
|
||||
* 重点水库
|
||||
|
|
@ -452,7 +452,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="lgtd")
|
||||
@Schema(description="经度 (°)")
|
||||
// @Size(max = 0,message = "经度 (°)最大长度要小于 0")
|
||||
private String lgtd;
|
||||
private BigDecimal lgtd;
|
||||
|
||||
/**
|
||||
* 纬度 (°)
|
||||
|
|
@ -460,7 +460,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="lttd")
|
||||
@Schema(description="纬度 (°)")
|
||||
// @Size(max = 0,message = "纬度 (°)最大长度要小于 0")
|
||||
private String lttd;
|
||||
private BigDecimal lttd;
|
||||
|
||||
/**
|
||||
* geojson
|
||||
|
|
@ -468,7 +468,7 @@ public class AttResBase implements Serializable {
|
|||
@TableField(value="geometry")
|
||||
@Schema(description="geojson")
|
||||
// @Size(max = 0,message = "geojson最大长度要小于 0")
|
||||
private String geometry;
|
||||
private BigDecimal geometry;
|
||||
|
||||
/**
|
||||
* 是否有大坝安监数据
|
||||
|
|
@ -519,7 +519,7 @@ public class AttResBase implements Serializable {
|
|||
*/
|
||||
@TableField(value="benefit")
|
||||
@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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.gunshi.project.xyt.entity.dto.StZqrlBDto;
|
||||
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.OsmoticShiftRMapper;
|
||||
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.StZqrlB;
|
||||
import com.gunshi.project.xyt.model.StZvarlB;
|
||||
import com.gunshi.project.xyt.util.DateUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -35,8 +38,7 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
||||
{
|
||||
public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB> {
|
||||
@Resource
|
||||
private OsmoticPressRMapper pressRMapper;
|
||||
|
||||
|
|
@ -46,15 +48,20 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
|||
@Autowired
|
||||
private StZqrlBService stZqrlBService;
|
||||
|
||||
@Autowired
|
||||
private StZvarlBService stZvarlBService;
|
||||
|
||||
@Autowired
|
||||
private StRsvrRService rsvrRService;
|
||||
|
||||
public List<HomeStStbprpBVo> rainfallStationDetailsList(HomeStStbprpBSo dto) {
|
||||
return baseMapper.rainfallStationDetailsList(dto);
|
||||
}
|
||||
|
||||
public List<HomeStStbprpBVo> reservoirStationDetailsList() {
|
||||
return baseMapper.reservoirStationDetailsList();
|
||||
}
|
||||
|
||||
public List<HomeStStbprpBVo> flowStationDetailsList() {
|
||||
return baseMapper.flowStationDetailsList();
|
||||
}
|
||||
|
|
@ -131,21 +138,53 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
|||
* 查出时段内的水位列表,按时间升序排,根据水位查水位流量曲线表得到流量
|
||||
* 第一条数据的累计溢洪量设为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();
|
||||
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) {
|
||||
// 将当前记录的flowNum加到累计和中
|
||||
if (current.getFlowNum() != null) {
|
||||
runningSum = runningSum.add(current.getFlowNum());
|
||||
zqrlList.stream()
|
||||
.filter(zqrl -> zqrl.getZ().equals(new BigDecimal(rsvr.getRz())))
|
||||
.findFirst()
|
||||
.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) {
|
||||
|
|
@ -265,6 +304,7 @@ public class StStbprpBService extends ServiceImpl<StStbprpBMapper, StStbprpB>
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Long countVal(String stcd, LocalDateTime start, LocalDateTime end) {
|
||||
LambdaQueryWrapper<StZqrlB> qw = new LambdaQueryWrapper();
|
||||
qw.eq(StZqrlB::getStcd, stcd);
|
||||
|
|
|
|||
Loading…
Reference in New Issue