|
|
@ -81,6 +81,7 @@ public class DeviceData extends BaseData { |
|
|
public static final String HINT_DEVICE_MAC = "hint_device_mac"; |
|
|
public static final String HINT_DEVICE_MAC = "hint_device_mac"; |
|
|
public static final String HINT_DEVICE_TYPE = "hint_device_type"; |
|
|
public static final String HINT_DEVICE_TYPE = "hint_device_type"; |
|
|
public static final String VOICE_CODE = "voice_code"; //语音code
|
|
|
public static final String VOICE_CODE = "voice_code"; //语音code
|
|
|
|
|
|
public static final String VOICE_CONFIG = "voice_config"; // 语音配置
|
|
|
public static final String HINT_DEVICE_TOUCH = "hint_device_touch";//触摸属性 // 0触摸 1非触摸
|
|
|
public static final String HINT_DEVICE_TOUCH = "hint_device_touch";//触摸属性 // 0触摸 1非触摸
|
|
|
public static final String HINT_SYNC_TEST = "hint_sync_test"; |
|
|
public static final String HINT_SYNC_TEST = "hint_sync_test"; |
|
|
public static final String HINT_DEVICE_ROTATION = "hint_device_rotation"; |
|
|
public static final String HINT_DEVICE_ROTATION = "hint_device_rotation"; |
|
|
@ -233,7 +234,8 @@ public class DeviceData extends BaseData { |
|
|
* 通过接口来判断网络是否正常 |
|
|
* 通过接口来判断网络是否正常 |
|
|
* */ |
|
|
* */ |
|
|
public static void getMachine(QueryFinishListener finishListener) { |
|
|
public static void getMachine(QueryFinishListener finishListener) { |
|
|
RetrofitUtil.getBaseService().getMachine(DeviceData.getDeviceInfo(HINT_DEVICE_CODE)).enqueue(new Callback<Resp>() { |
|
|
|
|
|
|
|
|
String mallCode = FloorData.getMallCode(); |
|
|
|
|
|
RetrofitUtil.getBaseService().getMachine(mallCode,DeviceData.getDeviceInfo(HINT_DEVICE_CODE)).enqueue(new Callback<Resp>() { |
|
|
@Override |
|
|
@Override |
|
|
public void onResponse(Call<Resp> call, Response<Resp> response) { |
|
|
public void onResponse(Call<Resp> call, Response<Resp> response) { |
|
|
try { |
|
|
try { |
|
|
@ -250,9 +252,10 @@ public class DeviceData extends BaseData { |
|
|
if(jsonObject.get("voiceActivationCode") != null){ |
|
|
if(jsonObject.get("voiceActivationCode") != null){ |
|
|
String voiceActivationCode = jsonObject.get("voiceActivationCode").getAsString(); |
|
|
String voiceActivationCode = jsonObject.get("voiceActivationCode").getAsString(); |
|
|
DeviceData.saveDeviceInfo(DeviceData.VOICE_CODE, voiceActivationCode); //设备语音激活码
|
|
|
DeviceData.saveDeviceInfo(DeviceData.VOICE_CODE, voiceActivationCode); //设备语音激活码
|
|
|
|
|
|
String voiceActivationSourceConfig = jsonObject.get("voiceActivationSourceConfig").getAsString(); |
|
|
|
|
|
DeviceData.saveDeviceInfo(DeviceData.VOICE_CONFIG, voiceActivationSourceConfig); //设备语音激活码
|
|
|
}else{ |
|
|
}else{ |
|
|
String deviceCode = DeviceData.getDeviceInfo(DeviceData.HINT_DEVICE_CODE); |
|
|
|
|
|
DeviceData.saveDeviceInfo(DeviceData.VOICE_CODE, deviceCode); //设备Code语音激活码
|
|
|
|
|
|
|
|
|
DeviceData.saveDeviceInfo(DeviceData.VOICE_CODE, ""); |
|
|
} |
|
|
} |
|
|
LoggerUtil.e("getMachine()", typeName); |
|
|
LoggerUtil.e("getMachine()", typeName); |
|
|
} |
|
|
} |
|
|
@ -370,8 +373,8 @@ public class DeviceData extends BaseData { |
|
|
* */ |
|
|
* */ |
|
|
public static void getMachineOnOffTime(QueryPreparedListener preparedListener, QueryFinishListener finishListener) { |
|
|
public static void getMachineOnOffTime(QueryPreparedListener preparedListener, QueryFinishListener finishListener) { |
|
|
if (preparedListener != null) preparedListener.onPrepared(); |
|
|
if (preparedListener != null) preparedListener.onPrepared(); |
|
|
|
|
|
|
|
|
RetrofitUtil.getBaseService().getMachineOnOffTime(DeviceData.getDeviceInfo(HINT_DEVICE_CODE)).enqueue(new Callback<Resp>() { |
|
|
|
|
|
|
|
|
String mallCode = FloorData.getMallCode(); |
|
|
|
|
|
RetrofitUtil.getBaseService().getMachineOnOffTime(mallCode,DeviceData.getDeviceInfo(HINT_DEVICE_CODE)).enqueue(new Callback<Resp>() { |
|
|
@Override |
|
|
@Override |
|
|
public void onResponse(Call<Resp> call, Response<Resp> response) { |
|
|
public void onResponse(Call<Resp> call, Response<Resp> response) { |
|
|
try { |
|
|
try { |
|
|
@ -432,7 +435,6 @@ public class DeviceData extends BaseData { |
|
|
} catch (Throwable t) { |
|
|
} catch (Throwable t) { |
|
|
LoggerUtil.e("getPrimaryMachine", StringUtil.getThrowableStr(t)); |
|
|
LoggerUtil.e("getPrimaryMachine", StringUtil.getThrowableStr(t)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (finishListener != null) finishListener.onFinish(); |
|
|
if (finishListener != null) finishListener.onFinish(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|