@ -11,14 +11,14 @@ import com.ruoyi.code.camera.service.IWaterPhotoInfoService;
@@ -11,14 +11,14 @@ import com.ruoyi.code.camera.service.IWaterPhotoInfoService;
import com.ruoyi.code.sctaationinfo.domain.ScStationInfo ;
import com.ruoyi.code.sctaationinfo.service.IScStationInfoService ;
import com.ruoyi.common.core.page.R ;
import com.ruoyi.common.exception.RYException ;
import com.ruoyi.common.utils.DateUtils ;
import com.ruoyi.common.utils.Query ;
import com.ruoyi.common.utils.StringUtils ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.stereotype.Service ;
import java.util.ArrayList ;
import java.util.HashMap ;
import java.util.List ;
import java.util.Map ;
import java.util.* ;
/ * *
* Service业务层处理
@ -35,6 +35,16 @@ public class WaterPhotoInfoServiceImpl extends ServiceImpl<WaterPhotoInfoMapper,
@@ -35,6 +35,16 @@ public class WaterPhotoInfoServiceImpl extends ServiceImpl<WaterPhotoInfoMapper,
@Override
public R queryPage ( Map < String , Object > params ) {
String startTime = ( String ) params . get ( "startTime" ) ;
String endTime = ( String ) params . get ( "endTime" ) ;
if ( StringUtils . isBlank ( startTime ) | | StringUtils . isBlank ( endTime ) ) {
throw new RYException ( "开始结束时间不能为空" ) ;
}
Date start = DateUtils . dateTime ( DateUtils . YYYY_MM_DD_HH_MM_SS , startTime ) ;
Date end = DateUtils . dateTime ( DateUtils . YYYY_MM_DD_HH_MM_SS , endTime ) ;
if ( end . getTime ( ) - start . getTime ( ) > = 1000 * 60 * 60 * 24 * 7 ) {
throw new RYException ( "时间跨度不能大于七天" ) ;
}
IPage < WaterPhotoInfo > page = baseMapper . queryPhotoList (
new Query < WaterPhotoInfo > ( ) . getPage ( params ) ,