Compare commits
6 Commits
0569099b02
...
c4eb443372
Author | SHA1 | Date |
---|---|---|
|
c4eb443372 | |
|
b3bc515135 | |
|
4e021d316b | |
|
57c31b68c3 | |
|
0774e29edd | |
|
43f51881ca |
|
@ -1,2 +1,2 @@
|
||||||
com.couplet.remote.factory.RemoteVehicleFallbackFactory
|
com.couplet.remote.factory.RemoteVehicleFallbackFactory
|
||||||
com.couplet.remote.factory.RemoteVehicleFallbackFactory
|
com.couplet.remote.factory.RemoteTroubleFallbackFactory
|
||||||
|
|
|
@ -28,6 +28,10 @@
|
||||||
<groupId>com.couplet</groupId>
|
<groupId>com.couplet</groupId>
|
||||||
<artifactId>couplet-common-core</artifactId>
|
<artifactId>couplet-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.couplet</groupId>
|
||||||
|
<artifactId>couplet-common-business</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.couplet.common.redis.service;
|
package com.couplet.common.redis.service;
|
||||||
|
|
||||||
|
import com.couplet.common.domain.CoupletVehicleData;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.*;
|
import org.springframework.data.redis.core.*;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -19,6 +20,12 @@ public class RedisService {
|
||||||
@Resource
|
@Resource
|
||||||
public RedisTemplate redisTemplate;
|
public RedisTemplate redisTemplate;
|
||||||
|
|
||||||
|
|
||||||
|
public List<CoupletVehicleData> getList () {
|
||||||
|
return redisTemplate.opsForList().range("coupletMsgData", 0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缓存基本的对象,Integer、String、实体类等
|
* 缓存基本的对象,Integer、String、实体类等
|
||||||
*
|
*
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
@EnableCustomSwagger2
|
@EnableCustomSwagger2
|
||||||
@EnableMyFeignClients(basePackages = ("com.couplet"))
|
@EnableMyFeignClients(basePackages = ("com.couplet"))
|
||||||
@SpringBootApplication(scanBasePackages = {"com.couplet"})
|
@SpringBootApplication(scanBasePackages = {"com.couplet", "com.couplet.mq.remote"})
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
public class CoupletBusinessApplication {
|
public class CoupletBusinessApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.domain.CoupletVehicleData;
|
import com.couplet.common.domain.CoupletVehicleData;
|
||||||
import com.couplet.common.domain.Vehicle;
|
import com.couplet.common.domain.Vehicle;
|
||||||
import com.couplet.common.domain.request.RealTimeDataRequest;
|
import com.couplet.common.domain.request.RealTimeDataRequest;
|
||||||
|
import com.couplet.common.redis.service.RedisService;
|
||||||
import com.couplet.common.security.utils.SecurityUtils;
|
import com.couplet.common.security.utils.SecurityUtils;
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -31,6 +32,8 @@ public class VehicleDetectionController {
|
||||||
private VehicleDetectionService vehicleDetectionService;
|
private VehicleDetectionService vehicleDetectionService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RabbitTemplate rabbitTemplate;
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
private final String REDIS_LIST_KEY = "coupletMsgData";
|
private final String REDIS_LIST_KEY = "coupletMsgData";
|
||||||
/*
|
/*
|
||||||
* @param :
|
* @param :
|
||||||
|
@ -65,7 +68,11 @@ public class VehicleDetectionController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("realData")
|
||||||
|
public Result<List<CoupletVehicleData>> realData(){
|
||||||
|
List<CoupletVehicleData> list = redisService.getList();
|
||||||
|
Result<List<CoupletVehicleData>> success = Result.success(list);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.couplet.business.server.service;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.web.page.TableDataInfo;
|
import com.couplet.common.core.web.page.TableDataInfo;
|
||||||
import com.couplet.common.system.domain.SysUser;
|
import com.couplet.common.system.domain.SysUser;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import com.couplet.common.domain.VehicleType;
|
||||||
import com.couplet.common.domain.request.VehicleEditParams;
|
import com.couplet.common.domain.request.VehicleEditParams;
|
||||||
import com.couplet.common.domain.request.VehicleInsertParams;
|
import com.couplet.common.domain.request.VehicleInsertParams;
|
||||||
import com.couplet.common.domain.request.VehicleListParams;
|
import com.couplet.common.domain.request.VehicleListParams;
|
||||||
|
import com.couplet.mq.remote.RemoteFenceService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -36,6 +37,10 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
|
||||||
@Autowired
|
@Autowired
|
||||||
private VehicleMapper vehicleMapper;
|
private VehicleMapper vehicleMapper;
|
||||||
|
|
||||||
|
//远程发送mq
|
||||||
|
@Autowired
|
||||||
|
private RemoteFenceService remoteFenceService;
|
||||||
|
|
||||||
//车辆类型服务
|
//车辆类型服务
|
||||||
@Autowired
|
@Autowired
|
||||||
private VehicleTypeService vehicleTypeService;
|
private VehicleTypeService vehicleTypeService;
|
||||||
|
@ -166,6 +171,19 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
|
||||||
//删除绑定之后,再添加新的绑定
|
//删除绑定之后,再添加新的绑定
|
||||||
vehicleAndLogoService.vehicleBindLogo(editParams.getVehicleId(), editParams.getLogoIds());
|
vehicleAndLogoService.vehicleBindLogo(editParams.getVehicleId(), editParams.getLogoIds());
|
||||||
|
|
||||||
|
|
||||||
|
//mq
|
||||||
|
List<Long> logoList = getBindLogoById(editParams.getVehicleId());
|
||||||
|
if (0 != logoList.size()) {
|
||||||
|
String ids = "";
|
||||||
|
for (Long l : logoList) {
|
||||||
|
ids = "," + l;
|
||||||
|
}
|
||||||
|
ids = ids.substring(1);
|
||||||
|
remoteFenceService.vehicleQueue(editParams.getVehicleId() + "-" + ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
result = "编辑成功!";
|
result = "编辑成功!";
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -234,6 +252,17 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
|
||||||
int i = vehicleAndLogoService.vehicleBindLogo(vehicle.getVehicleId(), insertParams.getLogoIds());
|
int i = vehicleAndLogoService.vehicleBindLogo(vehicle.getVehicleId(), insertParams.getLogoIds());
|
||||||
|
|
||||||
|
|
||||||
|
List<Long> logoList = getBindLogoById(vehicle.getVehicleId());
|
||||||
|
if (0 != logoList.size()) {
|
||||||
|
String ids = "";
|
||||||
|
for (Long l : logoList) {
|
||||||
|
ids = "," + l;
|
||||||
|
}
|
||||||
|
ids = ids.substring(1);
|
||||||
|
remoteFenceService.vehicleQueue(vehicle.getVehicleId() + "-" + ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
result = "新增成功!";
|
result = "新增成功!";
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -304,4 +333,5 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.couplet.business.server.time;
|
||||||
import com.couplet.business.server.service.VehicleService;
|
import com.couplet.business.server.service.VehicleService;
|
||||||
import com.couplet.common.domain.Vehicle;
|
import com.couplet.common.domain.Vehicle;
|
||||||
import com.couplet.common.domain.request.VehicleListParams;
|
import com.couplet.common.domain.request.VehicleListParams;
|
||||||
import com.couplet.common.redis.service.RedisService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
@ -29,14 +28,22 @@ public class Timer {
|
||||||
private VehicleService vehicleService;
|
private VehicleService vehicleService;
|
||||||
|
|
||||||
|
|
||||||
|
@Scheduled(cron = "0/1 * * * * *")
|
||||||
|
public void aa() {
|
||||||
|
System.out.println("********************************************************");
|
||||||
|
}
|
||||||
|
|
||||||
//判断车辆是否下线
|
//判断车辆是否下线
|
||||||
@Scheduled(cron = "* * * * * *")
|
@Scheduled(cron = "0/1 * * * * *")
|
||||||
public void outLine() {
|
public void downLine() {
|
||||||
log.info("定时器启动");
|
log.info("定时器启动");
|
||||||
|
|
||||||
//先查询车辆列表
|
//先查询车辆列表
|
||||||
List<Vehicle> list = vehicleService.list(new VehicleListParams(null, null, null, null));
|
List<Vehicle> list = vehicleService.list(new VehicleListParams(null, null, null, null));
|
||||||
for (Vehicle vehicle : list) {
|
|
||||||
|
|
||||||
|
list.forEach(vehicle -> {
|
||||||
|
try {
|
||||||
//只针对已经上线的车辆
|
//只针对已经上线的车辆
|
||||||
if (redis.hasKey(vehicle.getVin())) {
|
if (redis.hasKey(vehicle.getVin())) {
|
||||||
|
|
||||||
|
@ -47,14 +54,18 @@ public class Timer {
|
||||||
//执行修改下线状态的方法
|
//执行修改下线状态的方法
|
||||||
Integer i = vehicleService.onOrOutLineByVIN(vehicle.getVin(), 0);
|
Integer i = vehicleService.onOrOutLineByVIN(vehicle.getVin(), 0);
|
||||||
|
|
||||||
// if (0 == 1) {
|
if (0 == i) {
|
||||||
// log.error("下线状态修改失败");
|
log.error("下线状态修改失败");
|
||||||
// }
|
} else {
|
||||||
|
|
||||||
log.info("下线状态修改成功");
|
log.info("下线状态修改成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
com.couplet.business.server.time.Timer
|
|
|
@ -16,9 +16,11 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 172469
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 172469
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -29,13 +29,16 @@ public class RabbitMQConfig implements RabbitTemplate.ConfirmCallback, RabbitTem
|
||||||
//队列名
|
//队列名
|
||||||
public static final String finByVinQueueName = "finByVinQueueName";
|
public static final String finByVinQueueName = "finByVinQueueName";
|
||||||
public static final String FENCE_QUEUE = "fenceQueue";
|
public static final String FENCE_QUEUE = "fenceQueue";
|
||||||
|
public static final String vehicleQueue = "vehicleQueue";
|
||||||
//交换机
|
//交换机
|
||||||
public static final String VinExchangeName = "vinExchangeName";
|
public static final String VinExchangeName = "vinExchangeName";
|
||||||
public static final String FENCE_EXCHANGE = "fenceExchange";
|
public static final String FENCE_EXCHANGE = "fenceExchange";
|
||||||
|
public static final String vehicleQueueExchange = "vehicleQueueExchange";
|
||||||
|
|
||||||
//路由键
|
//路由键
|
||||||
public static final String VinRoutingKey = "vinRoutingKey";
|
public static final String VinRoutingKey = "vinRoutingKey";
|
||||||
public static final String FENCE_ROUTINGKEY = "fenceRoutingKey";
|
public static final String FENCE_ROUTINGKEY = "fenceRoutingKey";
|
||||||
|
public static final String VehicleQueue_ROUTINGKEY = "VehicleQueueRoutingKey";
|
||||||
//队列名
|
//队列名
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,15 +77,23 @@ public class RabbitMQConfig implements RabbitTemplate.ConfirmCallback, RabbitTem
|
||||||
public Queue queue() {
|
public Queue queue() {
|
||||||
return new Queue(queueName, true);
|
return new Queue(queueName, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean("fenceQueue")
|
@Bean("fenceQueue")
|
||||||
public Queue queue2() {
|
public Queue queue2() {
|
||||||
return new Queue(FENCE_QUEUE, true);
|
return new Queue(FENCE_QUEUE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean("finByVinQueueName")
|
@Bean("finByVinQueueName")
|
||||||
public Queue finByVinQueueName() {
|
public Queue finByVinQueueName() {
|
||||||
return new Queue(finByVinQueueName, true);
|
return new Queue(finByVinQueueName, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//当增删改车辆的时候,发送当前车辆的id到"vehicleQueue"队列
|
||||||
|
@Bean("vehicleQueue")
|
||||||
|
public Queue vehicleQueue() {
|
||||||
|
return new Queue("vehicleQueue", true);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @Author: LiuYunHu
|
* @Author: LiuYunHu
|
||||||
* @Date: 2024/3/29 21:26
|
* @Date: 2024/3/29 21:26
|
||||||
|
@ -105,6 +116,11 @@ public class RabbitMQConfig implements RabbitTemplate.ConfirmCallback, RabbitTem
|
||||||
return new DirectExchange(VinExchangeName);
|
return new DirectExchange(VinExchangeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean("vehicleQueueExchange")
|
||||||
|
public DirectExchange vehicleQueueExchange() {
|
||||||
|
return new DirectExchange("vehicleQueueExchange");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @Author: LiuYunHu
|
* @Author: LiuYunHu
|
||||||
|
@ -152,11 +168,17 @@ public class RabbitMQConfig implements RabbitTemplate.ConfirmCallback, RabbitTem
|
||||||
public Binding binding2() {
|
public Binding binding2() {
|
||||||
return BindingBuilder.bind(queue2()).to(directExchange2()).with(FENCE_ROUTINGKEY);
|
return BindingBuilder.bind(queue2()).to(directExchange2()).with(FENCE_ROUTINGKEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean("vinRoutingKey")
|
@Bean("vinRoutingKey")
|
||||||
public Binding binding3() {
|
public Binding binding3() {
|
||||||
return BindingBuilder.bind(finByVinQueueName()).to(vinExchangeName()).with(VinRoutingKey);
|
return BindingBuilder.bind(finByVinQueueName()).to(vinExchangeName()).with(VinRoutingKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean("VehicleQueueRoutingKey")
|
||||||
|
public Binding binding4() {
|
||||||
|
return BindingBuilder.bind(vehicleQueue()).to(vehicleQueueExchange()).with(VehicleQueue_ROUTINGKEY);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @Author: LiuYunHu
|
* @Author: LiuYunHu
|
||||||
* @Date: 2024/3/29 21:28
|
* @Date: 2024/3/29 21:28
|
||||||
|
|
|
@ -90,4 +90,13 @@ public class MqController {
|
||||||
}, new CorrelationData(IdUtils.randomUUID())
|
}, new CorrelationData(IdUtils.randomUUID())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/vehicleQueue/{msg}")
|
||||||
|
public void vehicleQueue(@PathVariable("msg") String msg){
|
||||||
|
rabbitTemplate.convertAndSend(RabbitMQConfig.vehicleQueueExchange, RabbitMQConfig.VehicleQueue_ROUTINGKEY, msg, message -> {
|
||||||
|
message.getMessageProperties().setMessageId(IdUtils.randomUUID());
|
||||||
|
return message;
|
||||||
|
}, new CorrelationData(IdUtils.randomUUID())
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ import com.couplet.common.core.constant.ServiceNameConstants;
|
||||||
import com.couplet.common.domain.request.FenceUpdateRequest;
|
import com.couplet.common.domain.request.FenceUpdateRequest;
|
||||||
import com.couplet.mq.remote.factory.RemoteFenceFallbackFactory;
|
import com.couplet.mq.remote.factory.RemoteFenceFallbackFactory;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
@ -16,4 +18,7 @@ public interface RemoteFenceService {
|
||||||
@PostMapping("/mq/fenceQueue")
|
@PostMapping("/mq/fenceQueue")
|
||||||
public void fenceQueue(@RequestBody FenceUpdateRequest teRequest);
|
public void fenceQueue(@RequestBody FenceUpdateRequest teRequest);
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/mq/vehicleQueue/{msg}")
|
||||||
|
public void vehicleQueue(@PathVariable("msg") String msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,11 @@ public class RemoteFenceFallbackFactory implements FallbackFactory<RemoteFenceSe
|
||||||
public void fenceQueue(FenceUpdateRequest fenceUpdateRequest) {
|
public void fenceQueue(FenceUpdateRequest fenceUpdateRequest) {
|
||||||
error("调用失败...."+cause.getMessage());
|
error("调用失败...."+cause.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void vehicleQueue(String msg) {
|
||||||
|
log.error("调取失败:"+cause.getMessage());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.couplet.online.utils;
|
package com.couplet.online.utils;
|
||||||
|
|
||||||
import com.couplet.common.domain.Vehicle;
|
import com.couplet.common.domain.Vehicle;
|
||||||
|
import com.couplet.common.redis.service.RedisService;
|
||||||
import com.couplet.remote.RemoteVehicleService;
|
import com.couplet.remote.RemoteVehicleService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
import org.apache.kafka.clients.producer.KafkaProducer;
|
||||||
|
@ -72,7 +73,7 @@ public class MqttMonitor {
|
||||||
|
|
||||||
//redis
|
//redis
|
||||||
@Autowired
|
@Autowired
|
||||||
private StringRedisTemplate redis;
|
private RedisService redis;
|
||||||
|
|
||||||
|
|
||||||
//Kafka生产者配置
|
//Kafka生产者配置
|
||||||
|
@ -187,7 +188,7 @@ public class MqttMonitor {
|
||||||
|
|
||||||
|
|
||||||
//如果不存在这个车
|
//如果不存在这个车
|
||||||
if (0 == vehicles.size()) {
|
if (0 == vehicles.size() || null == vehicles) {
|
||||||
//将不属于自己系统的车辆存入缓存,便于提前进行拒绝提示
|
//将不属于自己系统的车辆存入缓存,便于提前进行拒绝提示
|
||||||
// redis.setCacheObject("不存在的车辆VIN" + start17, start17);
|
// redis.setCacheObject("不存在的车辆VIN" + start17, start17);
|
||||||
log.error("未找到vin码为" + start17 + "的车辆信息");
|
log.error("未找到vin码为" + start17 + "的车辆信息");
|
||||||
|
@ -197,7 +198,7 @@ public class MqttMonitor {
|
||||||
log.info("远程调用查询到的车辆数据:" + vehicle);
|
log.info("远程调用查询到的车辆数据:" + vehicle);
|
||||||
|
|
||||||
//上线车辆存入redis 6秒 用于判断车辆是否下线,还要写定时器,定时查询
|
//上线车辆存入redis 6秒 用于判断车辆是否下线,还要写定时器,定时查询
|
||||||
redis.opsForValue().set(start17, start17, 6L, TimeUnit.SECONDS);
|
redis.setCacheObject(start17, start17, 6L, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
|
||||||
log.info("vin码为" + start17 + "的车辆属于本系统,允许上线!");
|
log.info("vin码为" + start17 + "的车辆属于本系统,允许上线!");
|
||||||
|
|
|
@ -36,7 +36,7 @@ mqtt:
|
||||||
# broker: mqtt://115.159.47.13:1883
|
# broker: mqtt://115.159.47.13:1883
|
||||||
username:
|
username:
|
||||||
password:
|
password:
|
||||||
clientId: fluxmq
|
clientId: fluxMq
|
||||||
qos: 0
|
qos: 0
|
||||||
topic: test
|
topic: test
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue