localizer
parent
b27c54dd2e
commit
28adc5863b
|
|
@ -14,6 +14,7 @@ import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
|
@ -150,6 +151,7 @@ public final class JT808 {
|
||||||
|
|
||||||
public static JT808Message parseMessage(ByteBuf buf) {
|
public static JT808Message parseMessage(ByteBuf buf) {
|
||||||
JT808Message jt808Message = new JT808Message();
|
JT808Message jt808Message = new JT808Message();
|
||||||
|
byte[] bytes = ByteBufUtil.getBytes(buf);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 1. 消息ID (2字节)
|
// 1. 消息ID (2字节)
|
||||||
|
|
@ -191,6 +193,12 @@ public final class JT808 {
|
||||||
log.error("校验码错误: {}", jt808Message);
|
log.error("校验码错误: {}", jt808Message);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
int messageId = jt808Message.getMessageId();
|
||||||
|
if (messageId == 0x0200
|
||||||
|
|| messageId == 0x704
|
||||||
|
|| messageId == 0x0201) {
|
||||||
|
log.info("{},{},报文:{}", terminalPhone, MessageType.getMessageType(messageId), Arrays.toString(bytes));
|
||||||
|
}
|
||||||
|
|
||||||
return jt808Message;
|
return jt808Message;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.njzscloud.localizer.device.controller;
|
||||||
|
|
||||||
import com.njzscloud.common.core.utils.R;
|
import com.njzscloud.common.core.utils.R;
|
||||||
import com.njzscloud.common.localizer.DeviceStore;
|
import com.njzscloud.common.localizer.DeviceStore;
|
||||||
|
import com.njzscloud.common.localizer.tuqiang.Tuqiang;
|
||||||
import com.njzscloud.localizer.device.service.LocalizerDeviceService;
|
import com.njzscloud.localizer.device.service.LocalizerDeviceService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -29,4 +30,10 @@ public class LocalizerDeviceController {
|
||||||
return R.success(DeviceStore.list());
|
return R.success(DeviceStore.list());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/current")
|
||||||
|
public R<?> current(String terminalId) {
|
||||||
|
Tuqiang.currentLocation(terminalId);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue