解决测值查询时测点为空时报错

master
wany 2024-08-15 09:21:23 +08:00
parent 8353708120
commit 1a00b6844d
1 changed files with 11 additions and 1 deletions

View File

@ -45,6 +45,10 @@ public class OsmoticPressRService extends ServiceImpl<OsmoticPressRMapper, Osmot
* @return * @return
*/ */
public List<OsmoticStationVo> queryValue(OsmoticQuerySo osmoticQuerySo,Integer year) { public List<OsmoticStationVo> queryValue(OsmoticQuerySo osmoticQuerySo,Integer year) {
List<OsmoticStationVo> resList = new ArrayList<>();
if(CollectionUtils.isEmpty(osmoticQuerySo.getStationCodes())){
return resList;
}
Boolean isDesc = true; Boolean isDesc = true;
//查询测站降雨量 //查询测站降雨量
Map<String,BigDecimal> drpMap = new HashMap<>(); Map<String,BigDecimal> drpMap = new HashMap<>();
@ -54,7 +58,7 @@ public class OsmoticPressRService extends ServiceImpl<OsmoticPressRMapper, Osmot
drpMap = drpList.stream().collect(Collectors.toMap(StRzVo::getTm, StRzVo::getRz)); drpMap = drpList.stream().collect(Collectors.toMap(StRzVo::getTm, StRzVo::getRz));
} }
List<String> dateList = DateUtil.getDatesBetween(osmoticQuerySo.getDateTimeRangeSo().getStart(), osmoticQuerySo.getDateTimeRangeSo().getEnd(),isDesc); List<String> dateList = DateUtil.getDatesBetween(osmoticQuerySo.getDateTimeRangeSo().getStart(), osmoticQuerySo.getDateTimeRangeSo().getEnd(),isDesc);
List<OsmoticStationVo> resList = new ArrayList<>();
//查询库水位 //查询库水位
List<StRzVo> list = baseMapper.queryRz(osmoticQuerySo); List<StRzVo> list = baseMapper.queryRz(osmoticQuerySo);
Map<String, BigDecimal> rzMap = list.stream().collect(Collectors.toMap(StRzVo::getTm, StRzVo::getRz)); Map<String, BigDecimal> rzMap = list.stream().collect(Collectors.toMap(StRzVo::getTm, StRzVo::getRz));
@ -78,6 +82,9 @@ public class OsmoticPressRService extends ServiceImpl<OsmoticPressRMapper, Osmot
public List<OsmoticChartVo> queryChart(OsmoticQuerySo osmoticQuerySo,Integer year) { public List<OsmoticChartVo> queryChart(OsmoticQuerySo osmoticQuerySo,Integer year) {
List<OsmoticChartVo> resList = new ArrayList<>(); List<OsmoticChartVo> resList = new ArrayList<>();
List<String> stationCodes = osmoticQuerySo.getStationCodes(); List<String> stationCodes = osmoticQuerySo.getStationCodes();
if(CollectionUtils.isEmpty(stationCodes)){
return resList;
}
//查询库水位 //查询库水位
List<StRzVo> list = baseMapper.queryRz(osmoticQuerySo); List<StRzVo> list = baseMapper.queryRz(osmoticQuerySo);
//查询测站管水位 //查询测站管水位
@ -408,6 +415,9 @@ public class OsmoticPressRService extends ServiceImpl<OsmoticPressRMapper, Osmot
public List<OsmoticPressDetailVo> detailValue(OsmoticDetailQuerySo so) { public List<OsmoticPressDetailVo> detailValue(OsmoticDetailQuerySo so) {
List<OsmoticPressDetailVo> list = baseMapper.detailValue(so); List<OsmoticPressDetailVo> list = baseMapper.detailValue(so);
if(so.getType() == 2){
return list;
}
OsmoticQuerySo osmoticQuerySo = new OsmoticQuerySo(); OsmoticQuerySo osmoticQuerySo = new OsmoticQuerySo();
BeanUtils.copyProperties(so,osmoticQuerySo); BeanUtils.copyProperties(so,osmoticQuerySo);
List<StRzVo> stRzVos = baseMapper.queryLineRz(osmoticQuerySo); List<StRzVo> stRzVos = baseMapper.queryLineRz(osmoticQuerySo);