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