|
|
|
|
@ -1,10 +1,12 @@
|
|
|
|
|
package com.zhehekeji.web.service;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.api.R;
|
|
|
|
|
import com.zhehekeji.web.entity.Camera;
|
|
|
|
|
import com.zhehekeji.web.entity.Street;
|
|
|
|
|
import com.zhehekeji.web.mapper.CameraMapper;
|
|
|
|
|
import com.zhehekeji.web.mapper.StreetMapper;
|
|
|
|
|
import com.zhehekeji.web.pojo.realTime.RealTime;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
@ -21,6 +23,9 @@ public class RealTimeService {
|
|
|
|
|
@Resource
|
|
|
|
|
private CameraMapper cameraMapper;
|
|
|
|
|
|
|
|
|
|
@Value("${videoStyleAll}")
|
|
|
|
|
private Integer videoStyleAll;
|
|
|
|
|
|
|
|
|
|
public List<RealTime> realTimes(){
|
|
|
|
|
List<Street> streets = streetMapper.selectByMap(new HashMap<>(0));
|
|
|
|
|
List<Camera> cameras = cameraMapper.selectByMap(new HashMap<>(0));
|
|
|
|
|
@ -33,6 +38,7 @@ public class RealTimeService {
|
|
|
|
|
RealTime realTime = new RealTime();
|
|
|
|
|
realTime.setStreetId(street.getId());
|
|
|
|
|
realTime.setStreetName(street.getName());
|
|
|
|
|
realTime.setVideoStyle(street.getVideoStyle());
|
|
|
|
|
List<Camera> cameraList = new ArrayList<>(2);
|
|
|
|
|
if(cameraMap.get(street.getCamera1Id()) != null){
|
|
|
|
|
cameraList.add(cameraMap.get(street.getCamera1Id()));
|
|
|
|
|
@ -43,7 +49,15 @@ public class RealTimeService {
|
|
|
|
|
realTime.setCameras(cameraList);
|
|
|
|
|
realTimes.add(realTime);
|
|
|
|
|
});
|
|
|
|
|
RealTime all = new RealTime();
|
|
|
|
|
all.setStreetId(0);
|
|
|
|
|
all.setStreetName("全部");
|
|
|
|
|
all.setCameras(cameras);
|
|
|
|
|
all.setVideoStyle(videoStyleAll);
|
|
|
|
|
realTimes.add(all);
|
|
|
|
|
return realTimes;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|