新增添加实时轨迹事件
parent
80b042b1d7
commit
9ddeefa450
|
@ -77,6 +77,11 @@
|
||||||
<artifactId>dragon-common-log</artifactId>
|
<artifactId>dragon-common-log</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dragon</groupId>
|
||||||
|
<artifactId>dragon-common-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.dragon</groupId>
|
<groupId>com.dragon</groupId>
|
||||||
<artifactId>dragon-common-core</artifactId>
|
<artifactId>dragon-common-core</artifactId>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.dragon.common.core.domain.PageResult;
|
||||||
import com.dragon.vehicle.history.common.domain.Car;
|
import com.dragon.vehicle.history.common.domain.Car;
|
||||||
import com.dragon.vehicle.history.common.domain.CarType;
|
import com.dragon.vehicle.history.common.domain.CarType;
|
||||||
import com.dragon.vehicle.history.common.domain.Fence;
|
import com.dragon.vehicle.history.common.domain.Fence;
|
||||||
|
import com.dragon.vehicle.history.common.domain.VehicleData;
|
||||||
import com.dragon.vehicle.history.common.domain.req.ReqCar;
|
import com.dragon.vehicle.history.common.domain.req.ReqCar;
|
||||||
import com.dragon.vehicle.history.common.domain.res.ResCar;
|
import com.dragon.vehicle.history.common.domain.res.ResCar;
|
||||||
import com.dragon.vehicle.history.server.service.CarService;
|
import com.dragon.vehicle.history.server.service.CarService;
|
||||||
|
@ -80,4 +81,14 @@ public class CarController {
|
||||||
public Result<List<Fence>> listFence() {
|
public Result<List<Fence>> listFence() {
|
||||||
return carService.listFence();
|
return carService.listFence();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加实时轨迹事件
|
||||||
|
* @param vin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/realTime")
|
||||||
|
public Result realTime(String vin){
|
||||||
|
return carService.realTime(vin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class HistoricalTrackController {
|
||||||
* 历史轨迹列表
|
* 历史轨迹列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/listHistoricalTrack")
|
@GetMapping("/listHistoricalTrack")
|
||||||
@DS(value = "slave")
|
@DS(value = "slave")
|
||||||
public Result<List<HistoryRecord>> listHistoricalTrack() {
|
public Result<List<HistoryRecord>> listHistoricalTrack() {
|
||||||
return Result.success(historicalTrackService.listHistoricalTrack());
|
return Result.success(historicalTrackService.listHistoricalTrack());
|
||||||
|
|
|
@ -54,4 +54,11 @@ public interface CarService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result<List<Fence>> listFence();
|
Result<List<Fence>> listFence();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加实时轨迹事件
|
||||||
|
* @param vin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result realTime(String vin);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.dragon.common.core.domain.PageResult;
|
import com.dragon.common.core.domain.PageResult;
|
||||||
import com.dragon.common.core.domain.Result;
|
import com.dragon.common.core.domain.Result;
|
||||||
|
import com.dragon.common.redis.service.RedisService;
|
||||||
import com.dragon.vehicle.history.common.domain.Car;
|
import com.dragon.vehicle.history.common.domain.Car;
|
||||||
import com.dragon.vehicle.history.common.domain.CarType;
|
import com.dragon.vehicle.history.common.domain.CarType;
|
||||||
import com.dragon.vehicle.history.common.domain.Fence;
|
import com.dragon.vehicle.history.common.domain.Fence;
|
||||||
|
@ -35,6 +36,8 @@ public class CarServiceImpl implements CarService {
|
||||||
private CarTypeMapper carTypeMapper;
|
private CarTypeMapper carTypeMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private FenceMapper fenceMapper;
|
private FenceMapper fenceMapper;
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆信息列表
|
* 车辆信息列表
|
||||||
|
@ -126,4 +129,18 @@ public class CarServiceImpl implements CarService {
|
||||||
List<Fence> fences = fenceMapper.selectList(new MPJLambdaWrapper<Fence>().select(Fence::getFenceId,Fence::getFenceName));
|
List<Fence> fences = fenceMapper.selectList(new MPJLambdaWrapper<Fence>().select(Fence::getFenceId,Fence::getFenceName));
|
||||||
return Result.success(fences);
|
return Result.success(fences);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加实时轨迹事件
|
||||||
|
* @param vin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result realTime(String vin) {
|
||||||
|
List<String> cacheList = redisService.getCacheList(vin);//根据vin查询出车辆的事件列表
|
||||||
|
cacheList.add("runtimeTraceEvent");//添加实时轨迹事件
|
||||||
|
redisService.setCacheList("event_"+vin,cacheList);//将事件列表存入redis
|
||||||
|
|
||||||
|
return Result.success("事件添加成功!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue