feat: persist jt808 registration identity
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -9,6 +9,7 @@ import com.lingniu.ingest.identity.VehicleIdentityLookup;
|
||||
import com.lingniu.ingest.identity.VehicleIdentityRegistry;
|
||||
import com.lingniu.ingest.identity.VehicleIdentityResolver;
|
||||
import com.lingniu.ingest.identity.VehicleIdentitySource;
|
||||
import com.lingniu.ingest.identity.VehicleRegistrationBinding;
|
||||
import com.lingniu.ingest.protocol.jt808.codec.Jt808FrameEncoder;
|
||||
import com.lingniu.ingest.protocol.jt808.codec.Jt808MalformedFrame;
|
||||
import com.lingniu.ingest.protocol.jt808.codec.Jt808MessageDecoder;
|
||||
@@ -286,7 +287,18 @@ public class Jt808ChannelHandler extends SimpleChannelInboundHandler<Object> {
|
||||
Instant.now(), Instant.now(),
|
||||
Map.of("protocolVersion", msg.header().version().name())));
|
||||
session = session.withVin(identity.vin());
|
||||
if (msg.body() instanceof Jt808Body.Register reg && reg.plate() != null) {
|
||||
if (msg.body() instanceof Jt808Body.Register reg) {
|
||||
identityRegistry.register(new VehicleRegistrationBinding(
|
||||
ProtocolId.JT808,
|
||||
session.vin(),
|
||||
phone,
|
||||
reg.deviceId(),
|
||||
reg.plate(),
|
||||
reg.province(),
|
||||
reg.city(),
|
||||
reg.maker(),
|
||||
reg.deviceType(),
|
||||
reg.plateColor()));
|
||||
if (identity.resolved() && session.vin() != null
|
||||
&& !session.vin().isBlank()
|
||||
&& !"unknown".equalsIgnoreCase(session.vin())) {
|
||||
|
||||
Reference in New Issue
Block a user