|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | MqttLog mqttLog = new MqttLog(); | 
|---|
|  |  |  | mqttLog.setMsgId(msgId); | 
|---|
|  |  |  | if(mqttLogMapper.selectCount(new QueryWrapper<MqttLog>().lambda().eq(MqttLog::getMsgId, msgId)) >0){ | 
|---|
|  |  |  | int msgCount  =mqttLogMapper.selectCount(new QueryWrapper<MqttLog>().lambda().eq(MqttLog::getMsg, param).eq(MqttLog::getType, Constants.ZERO)); | 
|---|
|  |  |  | if(msgCount>0){ | 
|---|
|  |  |  | log.error("mqtt消息订阅==============已消费数据====="+param); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if(StringUtils.contains(topic, info)){ | 
|---|
|  |  |  | //如果锁头信息上报 | 
|---|
|  |  |  | Locks locks  = JSONObject.parseObject(param, Locks.class); | 
|---|
|  |  |  | locks.setId(lockid); | 
|---|
|  |  |  | locks.setSiteId(siteid); | 
|---|
|  |  |  | locks.setCode(lockid); | 
|---|
|  |  |  | locks.setInfo(logId); | 
|---|
|  |  |  | result = memberRidesService.mqttLockInfoEvent(locks); | 
|---|
|  |  |  | logInfo = "mqtt消息订阅锁头信息"; | 
|---|
|  |  |  | 
|---|
|  |  |  | JSONObject pjson  = JSONObject.parseObject(param); | 
|---|
|  |  |  | MemberRides bikes = new MemberRides(); | 
|---|
|  |  |  | bikes.setBikeCode(pjson.getString("bikeCode")); | 
|---|
|  |  |  | bikes.setBackLockId( pjson.getString("lockId")); | 
|---|
|  |  |  | bikes.setBackSiteId( pjson.getString("siteId")); | 
|---|
|  |  |  | bikes.setBackLockId( lockid); | 
|---|
|  |  |  | bikes.setBackSiteId( siteid); | 
|---|
|  |  |  | bikes.setBackCommondId(logId); | 
|---|
|  |  |  | result = memberRidesService.mqttCloseBikeEvent(bikes); | 
|---|
|  |  |  | logInfo = "mqtt消息订阅还车消息"; | 
|---|
|  |  |  | log.info("mqtt消息订阅=========还车==========成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }catch (BusinessException e){ | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | logInfo = "mqtt消息订阅错误==="+e.getMessage(); | 
|---|
|  |  |  | result =1; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | logInfo = "mqtt消息订阅异常==="; | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | logInfo = "mqtt消息订阅异常==="+e.getMessage(); | 
|---|
|  |  |  | result =1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | createSubLog(topic,msgId,logId,result,param,logInfo); | 
|---|
|  |  |  | 
|---|
|  |  |  | log.setType(Constants.ZERO); | 
|---|
|  |  |  | log.setMsg(param); | 
|---|
|  |  |  | log.setInfo(info); | 
|---|
|  |  |  | log.setIsdeleted(Constants.ZERO); | 
|---|
|  |  |  | log.setMsgId(msgId); | 
|---|
|  |  |  | mqttLogMapper.insert(log); | 
|---|
|  |  |  | } | 
|---|