|
|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.leaper.web.service;
|
|
|
|
package com.leaper.web.service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.leaper.web.config.ConfigProperties;
|
|
|
|
import com.leaper.web.config.ConfigProperties;
|
|
|
|
import com.leaper.web.entity.Camera;
|
|
|
|
import com.leaper.web.entity.Camera;
|
|
|
|
import com.leaper.web.entity.Street;
|
|
|
|
import com.leaper.web.entity.Street;
|
|
|
|
@ -8,6 +9,7 @@ import com.leaper.web.mapper.StreetMapper;
|
|
|
|
import com.leaper.web.pojo.realTime.RealTime;
|
|
|
|
import com.leaper.web.pojo.realTime.RealTime;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
@ -67,5 +69,24 @@ public class RealTimeService {
|
|
|
|
return streets.stream().collect(Collectors.groupingBy(Street::getArea)).keySet();
|
|
|
|
return streets.stream().collect(Collectors.groupingBy(Street::getArea)).keySet();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<Camera> getAllCamerasByArea(String area){
|
|
|
|
|
|
|
|
List<Camera> cameras = new ArrayList<>();
|
|
|
|
|
|
|
|
if(StringUtils.isEmpty(area)){
|
|
|
|
|
|
|
|
return cameras;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Street> streets = streetMapper.selectList(new QueryWrapper<Street>().eq("`area`",area));
|
|
|
|
|
|
|
|
List<Integer> cameraIds = new ArrayList<>();
|
|
|
|
|
|
|
|
streets.forEach(street -> {
|
|
|
|
|
|
|
|
if(street.getCamera1Id() != null){
|
|
|
|
|
|
|
|
cameraIds.add(street.getCamera1Id());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(street.getCamera2Id() != null){
|
|
|
|
|
|
|
|
cameraIds.add(street.getCamera2Id());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
cameras = cameraMapper.selectBatchIds(cameraIds);
|
|
|
|
|
|
|
|
return cameras;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|