|
@@ -3,6 +3,7 @@ package com.bgy.autosale.payutil;
|
|
import static com.hboxs.base_library.base.BaseApplication.getContext;
|
|
import static com.hboxs.base_library.base.BaseApplication.getContext;
|
|
import static com.hboxs.base_library.util.ToastUtil.showToast;
|
|
import static com.hboxs.base_library.util.ToastUtil.showToast;
|
|
|
|
|
|
|
|
+import android.annotation.SuppressLint;
|
|
import android.app.Service;
|
|
import android.app.Service;
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
@@ -12,10 +13,14 @@ import android.media.AudioManager;
|
|
import android.net.ConnectivityManager;
|
|
import android.net.ConnectivityManager;
|
|
import android.net.NetworkInfo;
|
|
import android.net.NetworkInfo;
|
|
import android.net.wifi.WifiManager;
|
|
import android.net.wifi.WifiManager;
|
|
|
|
+import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Handler;
|
|
import android.os.IBinder;
|
|
import android.os.IBinder;
|
|
import android.os.Message;
|
|
import android.os.Message;
|
|
|
|
+import android.support.annotation.RequiresApi;
|
|
|
|
+import android.support.v4.app.Fragment;
|
|
|
|
+import android.support.v4.app.FragmentTransaction;
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
|
|
|
|
|
|
|
|
@@ -25,8 +30,10 @@ import com.bgy.autosale.Constant;
|
|
import com.bgy.autosale.IceCreamDeviceConstants;
|
|
import com.bgy.autosale.IceCreamDeviceConstants;
|
|
import com.bgy.autosale.R;
|
|
import com.bgy.autosale.R;
|
|
import com.bgy.autosale.RemoteSupportService;
|
|
import com.bgy.autosale.RemoteSupportService;
|
|
|
|
+import com.bgy.autosale.entitys.MakeIceCreamBean;
|
|
import com.bgy.autosale.helpers.CommunicationHelper;
|
|
import com.bgy.autosale.helpers.CommunicationHelper;
|
|
import com.bgy.autosale.interfaces.SendCallback;
|
|
import com.bgy.autosale.interfaces.SendCallback;
|
|
|
|
+import com.bgy.autosale.ui.consumer.PaySuccessFragment;
|
|
import com.bgy.autosale.ui.operator.LockActivity;
|
|
import com.bgy.autosale.ui.operator.LockActivity;
|
|
import com.bgy.autosale.ui.MainActivity;
|
|
import com.bgy.autosale.ui.MainActivity;
|
|
import com.bgy.autosale.ui.operator.fragments.ControlFragment;
|
|
import com.bgy.autosale.ui.operator.fragments.ControlFragment;
|
|
@@ -79,8 +86,10 @@ import java.net.HttpURLConnection;
|
|
import java.net.URL;
|
|
import java.net.URL;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
+import java.util.LinkedList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -123,6 +132,7 @@ public class MQService extends Service implements SendCallback {
|
|
private boolean isManualMake = false;
|
|
private boolean isManualMake = false;
|
|
|
|
|
|
|
|
|
|
|
|
+ @SuppressLint("NewApi")
|
|
private void getMessage(Message msg) {
|
|
private void getMessage(Message msg) {
|
|
|
|
|
|
String message = msg.getData().getString("msg");
|
|
String message = msg.getData().getString("msg");
|
|
@@ -234,12 +244,22 @@ public class MQService extends Service implements SendCallback {
|
|
// if (IceCreamErrorUtils.getInstance().getErrorMessage()!=null){
|
|
// if (IceCreamErrorUtils.getInstance().getErrorMessage()!=null){
|
|
// EventBus.getDefault().post(new ApiMessageEvent(Name.WARNING_ALARM,IceCreamErrorUtils.getInstance().getErrorMessage()));
|
|
// EventBus.getDefault().post(new ApiMessageEvent(Name.WARNING_ALARM,IceCreamErrorUtils.getInstance().getErrorMessage()));
|
|
// }
|
|
// }
|
|
-// eliminateApi(gson, baseBean, kind);
|
|
|
|
|
|
+ eliminateApi(gson, baseBean, kind);
|
|
break;
|
|
break;
|
|
case "dosugar":
|
|
case "dosugar":
|
|
//远程制作棉花糖
|
|
//远程制作棉花糖
|
|
- CommunicationHelper.getInstance().sendControl(IceCreamDeviceConstants.ORDER_OPERATE_CLEAN, this);
|
|
|
|
|
|
+// CommunicationHelper.getInstance().sendControl(IceCreamDeviceConstants.ORDER_OPERATE_CLEAN, this);
|
|
// EventBus.getDefault().post(new ApiMessageEvent("dosugar", baseBean.getKind_data()));
|
|
// EventBus.getDefault().post(new ApiMessageEvent("dosugar", baseBean.getKind_data()));
|
|
|
|
+ LinkedList<MakeIceCreamBean> iceCreamOrders = new LinkedList<>();
|
|
|
|
+ MakeIceCreamBean detail = new MakeIceCreamBean();
|
|
|
|
+ String strData = baseBean.getKind_data();
|
|
|
|
+ String[] stringArray = strData.replaceAll("[\\[\\] ]", "").split(",");
|
|
|
|
+ detail.makeCodes= Arrays.stream(stringArray)
|
|
|
|
+ .mapToInt(Integer::parseInt)
|
|
|
|
+ .toArray();
|
|
|
|
+ iceCreamOrders.add(detail);
|
|
|
|
+ Log.d(TAG, "getMessage: dosugar"+iceCreamOrders);
|
|
|
|
+ CommunicationHelper.getInstance().setMakingIceCreams(iceCreamOrders);
|
|
break;
|
|
break;
|
|
case "alarmClock":
|
|
case "alarmClock":
|
|
//远程星期调节闹钟
|
|
//远程星期调节闹钟
|
|
@@ -366,6 +386,10 @@ public class MQService extends Service implements SendCallback {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private boolean isManualMode() {
|
|
|
|
+ return App.app.payChannel != Constant.PAY_FREE;
|
|
|
|
+ }
|
|
|
|
+
|
|
public void getProductPrice() {
|
|
public void getProductPrice() {
|
|
HashMap<String, String> params = new HashMap<>();
|
|
HashMap<String, String> params = new HashMap<>();
|
|
params.put("clientId", Heartbeat.deviceId);
|
|
params.put("clientId", Heartbeat.deviceId);
|