Commit 0aed9f3e by wnb0128

车家智能数据服务 kafka消息推送--think.wang

1 parent 6052a251
......@@ -35,8 +35,13 @@ public class DeviceAddressProducer {
*/
public void pushUserDeviceData(String deviceId, String lngAndLat, Integer value) {
//kafka 发送消息数据封装
String[] strArr = lngAndLat.split(":");
Fence.GpsLoc gpsLoc = this.buildGpsLoc(strArr[0], strArr[1]);
Fence.GpsLoc gpsLoc;
if(value == Fence.OperationType.DEL_VALUE){ //删除不需要经纬度数据
gpsLoc = Fence.GpsLoc.newBuilder().build();
} else{
String[] strArr = lngAndLat.split(":");
gpsLoc = this.buildGpsLoc(strArr[0], strArr[1]);
}
Fence.FenceDeviceFamilyInfo deviceFamilyInfo = this.buildFenceDevice(deviceId, gpsLoc);
Fence.OptFamilyFenceInfo familyFenceInfo = this.buildFamilyFence(value, deviceFamilyInfo);
try {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!