| | |
| | | |
| | | package com.fzzy.protocol.sdkhk.common; |
| | | |
| | | import com.fzzy.api.utils.SpringUtil; |
| | | import com.fzzy.gateway.GatewayUtils; |
| | | import com.fzzy.gateway.api.GatewayRemoteManager; |
| | | import com.fzzy.gateway.data.BaseReqData; |
| | | import com.fzzy.gateway.entity.GatewayDevice; |
| | | import com.fzzy.protocol.sdkhk.HKUtils; |
| | | import com.sun.jna.Pointer; |
| | | import org.apache.commons.lang.StringUtils; |
| | |
| | | public class LPRCallBask_V31 implements HCNetSDK.FMSGCallBack_V31 { |
| | | |
| | | Logger log = LoggerFactory.getLogger(LPRCallBask_V31.class); |
| | | |
| | | GatewayRemoteManager gatewayRemoteManager; |
| | | |
| | | //报警信息回调函数 |
| | | public boolean invoke(int lCommand, HCNetSDK.NET_DVR_ALARMER pAlarmer, Pointer pAlarmInfo, int dwBufLen, Pointer pUser) { |
| | |
| | | if (StringUtils.isNotEmpty(deviceIp)) deviceIp = deviceIp.trim(); |
| | | |
| | | |
| | | log.info("车牌号:" + sLicense + ":车辆类型:" + VehicleType + ":监控点编号:" + MonitoringSiteID + "-设备IP=" + deviceIp + "-SN=" + deviceSn); |
| | | //log.info("车牌号:" + sLicense + ":车辆类型:" + VehicleType + ":监控点编号:" + MonitoringSiteID + "-设备IP=" + deviceIp + "-SN=" + deviceSn); |
| | | |
| | | log.info("车牌号:" + sLicense + ":车辆类型:" + VehicleType + "-设备IP=" + deviceIp + "-SN=" + deviceSn); |
| | | |
| | | //开始执行推送 |
| | | GatewayDevice device = GatewayUtils.getCacheByDeviceSn(deviceSn); |
| | | if (null == device) { |
| | | log.error("车牌识别未获取到相关配置设备信息----无法执行推送"); |
| | | return; |
| | | } |
| | | |
| | | if (null == gatewayRemoteManager) { |
| | | gatewayRemoteManager = SpringUtil.getBean(GatewayRemoteManager.class); |
| | | } |
| | | |
| | | //数据封装推送 |
| | | BaseReqData reqData = new BaseReqData(device); |
| | | |
| | | if (sLicense.startsWith("蓝") || sLicense.startsWith("黄")) { |
| | | sLicense = sLicense.replace("蓝", "").replace("黄", ""); |
| | | } |
| | | reqData.setCarNumber(sLicense); |
| | | gatewayRemoteManager.getDeviceReportService(device.getPushProtocol()).reportLprData(reqData); |
| | | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |