|
|
|
|
@ -9,12 +9,14 @@ import cn.iocoder.yudao.module.camera.dal.dataobject.resources.URLResourcesDo;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.dataobject.stock.StockDO;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.dataobject.street.StreetDO;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.dataobject.warn.WarnDO;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.dataobject.lightsource.LightSourceDO;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.entity.ScanData;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.mysql.checklog.CheckLogMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.mysql.order.OrderMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.mysql.sensorgun.SensorGunMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.mysql.stocklog.StockLogMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.dal.mysql.warn.WarnMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.framework.light.LightFactory;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.framework.netty.ksec.KsecDataInfo;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.framework.netty.streetAlgorithm.executor.AlgorithmDelayTask;
|
|
|
|
|
import cn.iocoder.yudao.module.camera.framework.netty.streetAlgorithm.executor.GetPhotoDelayExecutor;
|
|
|
|
|
@ -134,6 +136,37 @@ public class PLCServiceImpl implements PLCService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void gyrateCameraByCode(CameraDO cameraDO, String code,String defaultCode) {
|
|
|
|
|
if (cameraDO == null){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
CameraIoDO cameraIoDO = cameraIoService.getOne(new QueryWrapper<CameraIoDO>()
|
|
|
|
|
.eq("camera_Id", cameraDO.getId())
|
|
|
|
|
.eq("code", code)
|
|
|
|
|
.last(" limit 1"));
|
|
|
|
|
if (cameraIoDO == null){
|
|
|
|
|
log.error("ptz not found in sql,code:{},cameraId:{}", code, cameraDO.getId());
|
|
|
|
|
cameraIoDO = cameraIoService.getOne(new QueryWrapper<CameraIoDO>()
|
|
|
|
|
.eq("camera_Id", cameraDO.getId())
|
|
|
|
|
.eq("code", defaultCode)
|
|
|
|
|
.last(" limit 1"));
|
|
|
|
|
|
|
|
|
|
if (cameraIoDO == null){
|
|
|
|
|
log.error("ptz not found in sql,code:{},cameraId:{}", defaultCode, cameraDO.getId());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Integer ptzId = cameraIoDO.getPtzId();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ptzId != null && ptzId >= 0) {
|
|
|
|
|
log.info("gyrate camera by code, code:{},cameraId:{},ptId:{}", code, cameraDO.getId(), ptzId);
|
|
|
|
|
cameraModFactory.get(cameraDO.getType()).toPtz(ptzId, cameraDO.getId());
|
|
|
|
|
} else {
|
|
|
|
|
log.error("ptz not found ,code:{},cameraId:{}", code, cameraDO.getId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// public void plcService (KescEntity kescEntity){
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
@ -718,6 +751,13 @@ public class PLCServiceImpl implements PLCService {
|
|
|
|
|
checkLogDO = checkLogService.getById(checkLogDO.getId());
|
|
|
|
|
if (checkLogDO != null && checkLogDO.getStatus()!=0){
|
|
|
|
|
resultReport(checkLogDO);
|
|
|
|
|
|
|
|
|
|
List<LightSourceDO> list = null;
|
|
|
|
|
list = streetService.getLightSourceListByStreetId(checkLogDO.getStreetId());
|
|
|
|
|
for(LightSourceDO lightSourceDO : list){
|
|
|
|
|
LightFactory.LightController(lightSourceDO,0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
@ -1441,7 +1481,7 @@ public class PLCServiceImpl implements PLCService {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 旋转到预置点位(故障码作为预置点 code)
|
|
|
|
|
gyrateCameraByCode(cameraDO, warnCode);
|
|
|
|
|
gyrateCameraByCode(cameraDO, "warnCode_"+warnCode,"warnCode");
|
|
|
|
|
// 拍照
|
|
|
|
|
String pathSrc = PathUtil.createFileName("jpg", cameraDO.getId());
|
|
|
|
|
pathSrc = cameraCapture(cameraDO, false, false,pathSrc,warnCode, dictDataService.getDictDataList("camera_conf"));
|
|
|
|
|
|