|
|
@ -35,27 +35,34 @@ public class DapingServiceImpl extends ServiceImpl<DapingMapper, WaterPhotoInfo> |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R getWaterLevelTrend() { |
|
|
|
public R getWaterLevelTrend() { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> valMap = new HashMap<>(); |
|
|
|
Map<String, Object> valMap; |
|
|
|
List<String> valueList; |
|
|
|
List<String> valueList; |
|
|
|
Set<String> tmList = new HashSet<>(); |
|
|
|
Set<String> tmList = new HashSet<>(); |
|
|
|
Set<String> stnmList = new HashSet<>(); |
|
|
|
Set<String> stnmList = new HashSet<>(); |
|
|
|
|
|
|
|
List<Map<String, Object>> valuesList = new ArrayList<>(); |
|
|
|
List<Integer> idList = baseMapper.selectStationInfoId(); |
|
|
|
List<Integer> idList = baseMapper.selectStationInfoId(); |
|
|
|
for (Integer id : idList) { |
|
|
|
for (Integer id : idList) { |
|
|
|
List<WaterPhotoInfo> waterPhotoInfos = baseMapper.selectWaterLevelTrend(id); |
|
|
|
List<WaterPhotoInfo> waterPhotoInfos = baseMapper.selectWaterLevelTrend(id); |
|
|
|
|
|
|
|
if (waterPhotoInfos.size()==0){ |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
valueList = new ArrayList<>(); |
|
|
|
valueList = new ArrayList<>(); |
|
|
|
String stnm = ""; |
|
|
|
valMap = new HashMap<>(); |
|
|
|
|
|
|
|
String name = ""; |
|
|
|
for (WaterPhotoInfo waterPhotoInfo : waterPhotoInfos) { |
|
|
|
for (WaterPhotoInfo waterPhotoInfo : waterPhotoInfos) { |
|
|
|
|
|
|
|
name = waterPhotoInfo.getStnm(); |
|
|
|
valueList.add(waterPhotoInfo.getValue()); |
|
|
|
valueList.add(waterPhotoInfo.getValue()); |
|
|
|
stnmList.add(waterPhotoInfo.getStnm()); |
|
|
|
stnmList.add(waterPhotoInfo.getStnm()); |
|
|
|
stnm = waterPhotoInfo.getStnm(); |
|
|
|
|
|
|
|
tmList.add(waterPhotoInfo.getTm()); |
|
|
|
tmList.add(waterPhotoInfo.getTm()); |
|
|
|
} |
|
|
|
} |
|
|
|
valMap.put(stnm,valueList); |
|
|
|
valMap.put("stnm",name); |
|
|
|
|
|
|
|
valMap.put("value",valueList); |
|
|
|
|
|
|
|
valuesList.add(valMap); |
|
|
|
} |
|
|
|
} |
|
|
|
map.put("values",valMap); |
|
|
|
map.put("values",valuesList); |
|
|
|
map.put("tms",tmList); |
|
|
|
map.put("tms",tmList); |
|
|
|
map.put("stnms",stnmList); |
|
|
|
map.put("stnms",stnmList); |
|
|
|
return R.ok().put("map",map); |
|
|
|
return R.ok().put("data",map); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|