modify cmdb
This commit is contained in:
@@ -51,18 +51,14 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
@Override
|
||||
public void getBindingcarInfo(String macAddress) {
|
||||
mAddress = macAddress;
|
||||
if (HmiBuildConfig.isShowSnBindingView) {
|
||||
if (getScreenType() == 1) {
|
||||
BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress, getScreenType());
|
||||
}
|
||||
if (HmiBuildConfig.isShowSnBindingView) { //TODO 需要验证
|
||||
// BindingcarNetWorkManager.getInstance().getBindingcarInfo(mContext, macAddress, getScreenType());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyCarInfo(BindingcarCallBack callBack) {
|
||||
if (getScreenType() == 1) {
|
||||
BindingcarNetWorkManager.getInstance().modifyBindingcar(mAddress, callBack, getScreenType());
|
||||
}
|
||||
// BindingcarNetWorkManager.getInstance().modifyBindingcar(mAddress, callBack, getScreenType());
|
||||
}
|
||||
|
||||
|
||||
@@ -72,9 +68,9 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
screenType = 1; //司机屏
|
||||
}
|
||||
|
||||
// if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
// screenType = 2; //乘客屏
|
||||
// }
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
screenType = 2; //乘客屏
|
||||
}
|
||||
return screenType;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.eagle.core.data.bindingcar.BindingcarInfo;
|
||||
import com.mogo.eagle.core.data.bindingcar.CarInfo;
|
||||
@@ -14,6 +15,7 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceIdUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
|
||||
@@ -37,7 +39,7 @@ public class BindingcarNetWorkManager {
|
||||
private static final String TAG = "BindingcarNetWorkManager";
|
||||
|
||||
private BindingcarNetWorkManager() {
|
||||
mBindingcarApiService = MoGoRetrofitFactory.getInstance(HostConst.BINDING_SN_HOST)
|
||||
mBindingcarApiService = MoGoRetrofitFactory.getInstance(HostConst.BINDING_SN_HOST_TEST)
|
||||
.create(BindingcarApiService.class);
|
||||
}
|
||||
|
||||
@@ -54,12 +56,17 @@ public class BindingcarNetWorkManager {
|
||||
|
||||
|
||||
/**
|
||||
* 获取绑定的车辆信息
|
||||
* 获取绑定的车辆信息 TODO
|
||||
*
|
||||
* @param macAddress mac地址
|
||||
*/
|
||||
public void getBindingcarInfo(Context context, String macAddress, int screenType) {
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
String sn = DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp());
|
||||
// String macAddress = "48:b0:2d:3a:bc:7";
|
||||
// String sn = "X20202203105S688HZ";
|
||||
// int screenType = 1;
|
||||
|
||||
Log.d("liyz", "getBindingcarInfo --- sn = " + sn + "--macAddress = " +macAddress + "--screenType = " + screenType);
|
||||
BindingcarRequest request = new BindingcarRequest(macAddress, sn, screenType);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
||||
mBindingcarApiService.getBindingcarInfo(token, requestBody)
|
||||
@@ -75,13 +82,13 @@ public class BindingcarNetWorkManager {
|
||||
if (info != null && info.getData() != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "getBindingcarInfo onNext info.getData() =" + info.getData().toString());
|
||||
Log.d("liyz", "getBindingcarInfo onNext info.getData() =" + info.getData().toString() + "--compare = " + info.getData().getCompare());
|
||||
if (info.getData().getCompare() == 0) {
|
||||
if (info.getData().getCompare().equals(0)) {
|
||||
CallerHmiManager.INSTANCE.showBindingcarDialog();
|
||||
} else if (info.getData().getCompare() == 3) {
|
||||
} else if (info.getData().getCompare().equals(3)) {
|
||||
CallerHmiManager.INSTANCE.showModifyBindingcarDialog();
|
||||
}
|
||||
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, GsonUtils.toJson(info.data));
|
||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, GsonUtils.toJson(info.getData()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +100,7 @@ public class BindingcarNetWorkManager {
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.d("liyz", "getBindingcarInfo onComplete -------- ");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -103,7 +111,9 @@ public class BindingcarNetWorkManager {
|
||||
* mac: 48:b0:2d:3a:9c:19
|
||||
*/
|
||||
public void modifyBindingcar(String macAddress, BindingcarCallBack callBack, int screenType) {
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
// String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
String sn = DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp());
|
||||
Log.d("liyz", "modifyBindingcar --- sn = " + sn + "---macAddress = " + macAddress);
|
||||
BindingcarRequest request = new BindingcarRequest(macAddress, sn, screenType);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
||||
mBindingcarApiService.modifyBindingcarInfo(token, requestBody)
|
||||
@@ -120,6 +130,8 @@ public class BindingcarNetWorkManager {
|
||||
callBack.callBackResult(info);
|
||||
CallerLogger.INSTANCE.d(TAG, "modifyBindingcar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString());
|
||||
Log.d("liyz", "modifyBindingcar onNext code = " + info.code + "---msg = " + info.msg + "--info.toString() = " + info.toString());
|
||||
} else {
|
||||
Log.e("liyz", "modifyBindingcar info == null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user