|
|
|
@ -88,12 +88,8 @@ public class PlcService {
|
|
|
|
|
|
|
|
|
|
|
|
public Integer plcStatus() {
|
|
|
|
public Integer plcStatus() {
|
|
|
|
Integer count = 2;
|
|
|
|
Integer count = 2;
|
|
|
|
if(configProperties.getServerMode() == 0){
|
|
|
|
|
|
|
|
count = streetMapper.selectCount(new QueryWrapper<>());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Integer> connIds = StreetConn.connList();
|
|
|
|
return 0;
|
|
|
|
return (count - connIds.size());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -147,7 +143,6 @@ public class PlcService {
|
|
|
|
LocalDateTime endTime = LocalDateTime.now();
|
|
|
|
LocalDateTime endTime = LocalDateTime.now();
|
|
|
|
Street street = streetMapper.getStreetByPlcId(plcCmdInfo.getPlcId());
|
|
|
|
Street street = streetMapper.getStreetByPlcId(plcCmdInfo.getPlcId());
|
|
|
|
|
|
|
|
|
|
|
|
List<LightSource> lightSources = lightSourceMapper.selectList(new QueryWrapper<LightSource>().eq("street_id",street.getId()));
|
|
|
|
|
|
|
|
if (street == null) {
|
|
|
|
if (street == null) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -171,18 +166,26 @@ public class PlcService {
|
|
|
|
if(duration.toMinutes() > 50){
|
|
|
|
if(duration.toMinutes() > 50){
|
|
|
|
endDownLoadTime = order.getStartTime().plusMinutes(50);
|
|
|
|
endDownLoadTime = order.getStartTime().plusMinutes(50);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String path ="";
|
|
|
|
|
|
|
|
String path1 ="";
|
|
|
|
if (street.getCamera1Id() != null) {
|
|
|
|
if (street.getCamera1Id() != null) {
|
|
|
|
String path = cameraVideo(street.getCamera1Id(),order.getStartTime(),endDownLoadTime);
|
|
|
|
path = cameraVideo(street.getCamera1Id(),order.getStartTime(),endDownLoadTime);
|
|
|
|
update.setVideoPath1(path);
|
|
|
|
update.setVideoPath1(path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (street.getCamera2Id() != null) {
|
|
|
|
if (street.getCamera2Id() != null) {
|
|
|
|
String path = cameraVideo(street.getCamera2Id(),order.getStartTime(),endDownLoadTime);
|
|
|
|
path1 = cameraVideo(street.getCamera2Id(),order.getStartTime(),endDownLoadTime);
|
|
|
|
update.setVideoPath2(path);
|
|
|
|
update.setVideoPath2(path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (street.getCamera3Id() != null) {
|
|
|
|
|
|
|
|
cameraVideo(street.getCamera1Id(),order.getStartTime(),endDownLoadTime ,path+".mp4");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (street.getCamera4Id() != null) {
|
|
|
|
|
|
|
|
cameraVideo(street.getCamera2Id(),order.getStartTime(),endDownLoadTime,path1+".mp4");
|
|
|
|
|
|
|
|
}
|
|
|
|
orderMapper.updateById(update);
|
|
|
|
orderMapper.updateById(update);
|
|
|
|
lightSources.forEach(lightSource -> {
|
|
|
|
|
|
|
|
lightSourceService.controllerLightSource(lightSource,0);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void orderStopByWarn(String orderNum) {
|
|
|
|
public void orderStopByWarn(String orderNum) {
|
|
|
|
@ -214,6 +217,21 @@ public class PlcService {
|
|
|
|
return path;
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String cameraVideo(Integer cameraId, LocalDateTime startTime, LocalDateTime endTime,String path) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Camera camera = cameraService.detail(cameraId);
|
|
|
|
|
|
|
|
Thread thread = new Thread(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
String realPath = configProperties.getSavePath().getMp4Path() + path;
|
|
|
|
|
|
|
|
TaskDelayExecutor.addMp4DelayTask(camera,realPath,startTime,endTime,configProperties.getCameraConfig().getDelayDownloadMp4());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
thread.start();
|
|
|
|
|
|
|
|
//cameraControlModule.downloadMp4(cameraId,realPath,startTime,endTime);
|
|
|
|
|
|
|
|
return path;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* //times == 1 ,做动作
|
|
|
|
* //times == 1 ,做动作
|
|
|
|
* //times == 2 ,拍照
|
|
|
|
* //times == 2 ,拍照
|
|
|
|
|