@ -5,6 +5,7 @@ import com.ruoyi.api.mapper.DapingMapper;
@@ -5,6 +5,7 @@ import com.ruoyi.api.mapper.DapingMapper;
import com.ruoyi.api.service.DapingService ;
import com.ruoyi.code.camera.domain.WaterPhotoInfo ;
import com.ruoyi.common.core.page.R ;
import com.ruoyi.common.utils.StringUtils ;
import org.springframework.stereotype.Service ;
import java.util.ArrayList ;
@ -23,8 +24,10 @@ public class DapingServiceImpl extends ServiceImpl<DapingMapper, WaterPhotoInfo>
@@ -23,8 +24,10 @@ public class DapingServiceImpl extends ServiceImpl<DapingMapper, WaterPhotoInfo>
public List < WaterPhotoInfo > getStationInfo ( ) {
return baseMapper . selectStationInfo ( ) . stream ( ) . filter ( waterPhotoInfo - > {
String imgName = waterPhotoInfo . getImgName ( ) ;
String img = imgName . replace ( "\\" , "/" ) ;
waterPhotoInfo . setImgName ( img ) ;
if ( StringUtils . isNotBlank ( imgName ) ) {
String img = imgName . replace ( "\\" , "/" ) ;
waterPhotoInfo . setImgName ( img ) ;
}
return true ;
} ) . collect ( Collectors . toList ( ) ) ;
}
@ -57,10 +60,18 @@ public class DapingServiceImpl extends ServiceImpl<DapingMapper, WaterPhotoInfo>
@@ -57,10 +60,18 @@ public class DapingServiceImpl extends ServiceImpl<DapingMapper, WaterPhotoInfo>
}
valueList = new ArrayList < > ( ) ;
valMap = new HashMap < > ( ) ;
for ( WaterPhotoInfo waterPhotoInfo : waterPhotoInfos ) {
valueList . add ( waterPhotoInfo . getValue ( ) ) ;
if ( ! tmList . contains ( waterPhotoInfo . getTm ( ) ) ) {
tmList . add ( waterPhotoInfo . getTm ( ) ) ;
for ( int i = 0 ; i < waterPhotoInfos . size ( ) ; i + + ) {
if ( waterPhotoInfos . get ( i ) . getId ( ) ! = null ) {
valueList . add ( waterPhotoInfos . get ( i ) . getValue ( ) ) ;
} else {
if ( i > 0 ) {
valueList . add ( valueList . get ( i - 1 ) ) ;
} else {
valueList . add ( waterPhotoInfos . get ( i ) . getValue ( ) ) ;
}
}
if ( ! tmList . contains ( waterPhotoInfos . get ( i ) . getTm ( ) ) ) {
tmList . add ( waterPhotoInfos . get ( i ) . getTm ( ) ) ;
}
}