| | |
| | | import com.ruoyi.device.hiksdk.common.GlobalVariable; |
| | | import com.ruoyi.device.hiksdk.service.IHikClientService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @Version: 1.0 |
| | | **/ |
| | | @Component("SdkTask") |
| | | @Slf4j(topic = "hikSdk") |
| | | public class SdkTask { |
| | | |
| | | /** |
| | |
| | | * @修改人和其它信息 |
| | | */ |
| | | public void ptzPush() { |
| | | try { |
| | | ISysUserService sysUserService = SpringUtils.getBean(ISysUserService.class); |
| | | IArdCamerasService ardCamerasService = SpringUtils.getBean(IArdCamerasService.class); |
| | | IHikClientService hikClientService = SpringUtils.getBean(IHikClientService.class); |
| | |
| | | } |
| | | |
| | | //获取时间差 |
| | | long secDatePoor = DateUtils.getSecDatePoor(camera.getOperatorExpired(), new Date()); |
| | | long secDatePoor = 0; |
| | | if (StringUtils.isNotNull(camera.getOperatorExpired())) { |
| | | secDatePoor = DateUtils.getSecDatePoor(camera.getOperatorExpired(), new Date()); |
| | | if(secDatePoor<0) |
| | | { |
| | | secDatePoor=0; |
| | | } |
| | | } |
| | | |
| | | if (ptz.size() > 0) { |
| | | ptz.put("cameraId", cmd.getCameraId()); |
| | |
| | | WebSocketUtils.sendMessageAll(sendMap); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | log.error("推送ptz异常:"+ex.getMessage()); |
| | | } |
| | | } |
| | | } |