水库水情-河道水情
parent
9c4e40e644
commit
b408547964
|
|
@ -22,7 +22,7 @@ import java.util.Date;
|
||||||
* author: cxw
|
* author: cxw
|
||||||
* date: 2024-09-24 14:01:07
|
* date: 2024-09-24 14:01:07
|
||||||
*/
|
*/
|
||||||
@Schema(description="")
|
@Schema(description="河道水位表")
|
||||||
@Data
|
@Data
|
||||||
@TableName("public.st_river_r")
|
@TableName("public.st_river_r")
|
||||||
public class StRiverR implements Serializable {
|
public class StRiverR implements Serializable {
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,13 @@ public class StRsvrRReal implements Serializable {
|
||||||
@NotBlank(message = "stcd不能为空")
|
@NotBlank(message = "stcd不能为空")
|
||||||
private String stcd;
|
private String stcd;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stnm
|
||||||
|
*/
|
||||||
|
@TableField(exist=false)
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tm
|
* tm
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.gunshi.project.hsz.service;
|
package com.gunshi.project.hsz.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
@ -48,6 +49,14 @@ public class ReservoirWaterService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private StZvarlBService stZvarlBService;
|
private StZvarlBService stZvarlBService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StRiverRRealService stRiverRRealServices;
|
||||||
|
|
||||||
|
|
||||||
|
//实时供水
|
||||||
|
@Autowired
|
||||||
|
private StWaterRRealService stWaterRRealService;
|
||||||
|
|
||||||
public List<AttResBaseVo> list() {
|
public List<AttResBaseVo> list() {
|
||||||
List<AttResBaseVo> attResBaseVos = attResBaseMapper.queryList();
|
List<AttResBaseVo> attResBaseVos = attResBaseMapper.queryList();
|
||||||
if(CollectionUtils.isEmpty(attResBaseVos)){
|
if(CollectionUtils.isEmpty(attResBaseVos)){
|
||||||
|
|
@ -121,11 +130,37 @@ public class ReservoirWaterService {
|
||||||
|
|
||||||
BigDecimal rz = vo.getRz();
|
BigDecimal rz = vo.getRz();
|
||||||
if (rz != null) {
|
if (rz != null) {
|
||||||
|
//TODO 这里可能也要更改一下水位-库容的计算方式,不能直接进行水库库容曲线的判断
|
||||||
BigDecimal w = stZvarlBService.getWFromZvarl(rz, null, zvarlList);
|
BigDecimal w = stZvarlBService.getWFromZvarl(rz, null, zvarlList);
|
||||||
vo.setNowCap(w);
|
vo.setNowCap(w);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//TODO 计算2个灌溉站的流量之和
|
||||||
|
BigDecimal totalSum = BigDecimal.ZERO;
|
||||||
|
String stcd1 = "1112";
|
||||||
|
QueryWrapper<StWaterRReal> irrQw1 = new QueryWrapper<>();
|
||||||
|
irrQw1.eq("stcd", stcd1).orderBy(true, false, "tm");
|
||||||
|
StWaterRReal stWaterRReal1 = stWaterRRealService.getOne(irrQw1);
|
||||||
|
if(stWaterRReal1 != null){
|
||||||
|
totalSum.add(stWaterRReal1.getQ());
|
||||||
|
}
|
||||||
|
String stcd2 = "1113";
|
||||||
|
QueryWrapper<StWaterRReal> irrQw2 = new QueryWrapper<>();
|
||||||
|
irrQw2.eq("stcd", stcd2).orderBy(true, false, "tm");
|
||||||
|
StWaterRReal stWaterRReal2 = stWaterRRealService.getOne(irrQw2);
|
||||||
|
if(stWaterRReal2 != null){
|
||||||
|
totalSum.add(stWaterRReal2.getQ());
|
||||||
|
}
|
||||||
|
voList.stream().forEach(o -> o.setIrrigationFlowSum(totalSum));
|
||||||
|
//获取生态供水流量
|
||||||
|
String ecologyStcd = "1114";
|
||||||
|
QueryWrapper<StWaterRReal> ecologyQw = new QueryWrapper<>();
|
||||||
|
ecologyQw.eq("stcd", ecologyStcd).orderBy(true, false, "tm");
|
||||||
|
StWaterRReal ecologyWaterRReal = stWaterRRealService.getOne(ecologyQw);
|
||||||
|
if(ecologyWaterRReal != null){
|
||||||
|
voList.stream().forEach(o -> o.setEcologyFlow(ecologyWaterRReal.getQ()));
|
||||||
|
}
|
||||||
return voList;
|
return voList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue