| | |
| | | //无锁 |
| | | rtuType = false; |
| | | } |
| | | log.debug("定位数据:车辆carId:"+carId+"经度lng:"+lng+"纬度lat:"+lat); |
| | | // log.debug("定位数据:车辆carId:"+carId+"经度lng:"+lng+"纬度lat:"+lat); |
| | | //定义2维空间 |
| | | Point2D.Double point = new Point2D.Double(Double.parseDouble(lng), Double.parseDouble(lat)); |
| | | List<Point2D.Double> pts = new ArrayList<Point2D.Double>(); |
| | |
| | | |
| | | @Slf4j(topic = "mqttCar") |
| | | @Component |
| | | public class AutoMqtt { |
| | | public class AutoMqtt { |
| | | |
| | | @Autowired |
| | | private ArdSyCarRtuService ardSyCarRtuService; |
| | | |
| | | // @PostConstruct |
| | | @PostConstruct |
| | | public void init() { |
| | | // ArdSyCarRtuService carRtuService = SpringUtils.getBean(ArdSyCarRtuService.class); |
| | | // //获取电磁锁地址 |
| | |
| | | EmqClient emqClient = new EmqClient(carId+"mqttSubscribe"+UUID.randomUUID()); |
| | | emqClient.connect(); |
| | | emqClient.subscribe(subscribe, QosEnum.QoS2); |
| | | log.debug("订阅主题:"+subscribe); |
| | | log.info("订阅主题:"+subscribe); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |