From b1303ee6ba15d8202f7fe95037267feaa4520fc5 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期日, 28 四月 2024 15:55:48 +0800 Subject: [PATCH] 2024年04月28日15:55:42 --- app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java | 106 ++++++++++++++++++++++++++-------------------------- 1 files changed, 53 insertions(+), 53 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java index 7e15422..f94c1b4 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java +++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java @@ -11,12 +11,9 @@ import android.location.LocationManager; import android.os.IBinder; import android.text.TextUtils; -import android.view.View; -import android.widget.TextView; import androidx.core.app.ActivityCompat; -import com.alibaba.fastjson.JSON; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonObject; @@ -54,7 +51,6 @@ import com.hdl.photovoltaic.uni.HDLUniMPSDKManager; import com.hdl.photovoltaic.utils.NetworkUtils; import com.hdl.photovoltaic.utils.WifiUtils; -import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; import com.hdl.sdk.link.common.exception.HDLLinkCode; import com.hdl.sdk.link.common.exception.HDLLinkException; import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus; @@ -76,7 +72,6 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; @@ -376,49 +371,6 @@ break; } - } else if (HDLUniMP.UNI_EVENT_REPLY_OTHER_MODEL.equals(topic)) { - //鍏跺畠妯″潡 - switch (type) { - //鑾峰彇娓╁害鍗曚綅 - case HDLUniMP.UNI_EVENT_REPLY_OTHER_UNIT: { - uniCallbackData(mode_type, UserConfigManage.getInstance().getTemperature_unit(), callback); - } - break; - //鑾峰彇褰撳墠app璇█ - case HDLUniMP.UNI_EVENT_REPLY_OTHER_APP_LANGUAGE: { - uniCallbackData(mode_type, UserConfigManage.getInstance().getCurrentAppLanguage(), callback); - } - break; - //鑾峰彇浣嶇疆淇℃伅 - case HDLUniMP.UNI_EVENT_REPLY_OTHER_LOCATION_INFO: { - this.uniGetLocationInfo(mode_type, data, callback); - } - break; - //搴旂敤鍐茬獊 - case HDLUniMP.UNI_EVENT_REPLY_OTHER_APPLICATION_CONFLICT: { - if (callback != null) { - uniCallbackData(type, HDLUdpConnect.getInstance().isBindSuccess(), callback); - } - } - break; - //涓撻棬鏀堕泦uni鏃ュ織 - case HDLUniMP.UNI_EVENT_REPLY_OTHER_UNI_LOG: { - String customizeContentFormat = getKeyValue("customizeContentFormat", getKeyValue("data", data)); - HdlLogLogic.print("uni--->log--->" + customizeContentFormat, true); - - } - break; - //uni涓婚〉鐐瑰嚮杩斿洖閫氱煡 - case HDLUniMP.UNI_EVENT_REPLY_OTHER_BACK: { - //EventBus浜嬩欢鍒嗗彂 - BaseEventBus baseEventBus = new BaseEventBus(); - baseEventBus.setTopic(HDLUniMP.UNI_EVENT_REPLY_OTHER_MODEL); - baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_OTHER_BACK); - EventBus.getDefault().post(baseEventBus); - - } - break; - } } else if (HDLUniMP.UNI_EVENT_REPLY_MINE_MODEL.equals(topic)) { //鎴戠殑妯″潡 switch (type) { @@ -464,6 +416,54 @@ break; + } + } else if (HDLUniMP.UNI_EVENT_REPLY_OTHER_MODEL.equals(topic)) { + //鍏跺畠妯″潡 + switch (type) { + //鑾峰彇娓╁害鍗曚綅 + case HDLUniMP.UNI_EVENT_REPLY_OTHER_UNIT: { + uniCallbackData(mode_type, UserConfigManage.getInstance().getTemperature_unit(), callback); + } + break; + //鑾峰彇褰撳墠app璇█ + case HDLUniMP.UNI_EVENT_REPLY_OTHER_APP_LANGUAGE: { + uniCallbackData(mode_type, UserConfigManage.getInstance().getCurrentAppLanguage(), callback); + } + break; + //鑾峰彇浣嶇疆淇℃伅 + case HDLUniMP.UNI_EVENT_REPLY_OTHER_LOCATION_INFO: { + this.uniGetLocationInfo(mode_type, data, callback); + } + break; + //搴旂敤鍐茬獊 + case HDLUniMP.UNI_EVENT_REPLY_OTHER_APPLICATION_CONFLICT: { + if (callback != null) { + uniCallbackData(type, HDLUdpConnect.getInstance().isBindSuccess(), callback); + } + } + break; + //涓撻棬鏀堕泦uni鏃ュ織 + case HDLUniMP.UNI_EVENT_REPLY_OTHER_UNI_LOG: { + String customizeContentFormat = getKeyValue("customizeContentFormat", getKeyValue("data", data)); + HdlLogLogic.print("uni--->log--->" + customizeContentFormat, true); + + } + break; + //uni涓婚〉鐐瑰嚮杩斿洖閫氱煡 + case HDLUniMP.UNI_EVENT_REPLY_OTHER_BACK: { + //EventBus浜嬩欢鍒嗗彂 + BaseEventBus baseEventBus = new BaseEventBus(); + baseEventBus.setTopic(HDLUniMP.UNI_EVENT_REPLY_OTHER_MODEL); + baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_OTHER_BACK); + EventBus.getDefault().post(baseEventBus); + + } + break; + //uni閫氱煡鍘熺敓閫�鍑虹櫥褰� + case HDLUniMP.UNI_EVENT_REPLY_OTHER_LOGOUT: { + HDLLinkPMUser.getInstance().logout(0); + } + break; } } @@ -1276,7 +1276,7 @@ GatewayBean gatewayBean = new GatewayBean(); gatewayBean.setDevice_mac(mac); list.add(gatewayBean); - HdlDeviceLogic.getInstance().uploadDataToCloud(UserConfigManage.getInstance().getHomeId(), list, null); + HdlDeviceLogic.getInstance().uploadOidDataToCloud(UserConfigManage.getInstance().getHomeId(), list, true, null); } /** @@ -1409,7 +1409,7 @@ // com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray(data); try { String devices = getKeyValue("devices", getKeyValue("data", data)); - String homeId = UserConfigManage.getInstance().getHomeId(); //getKeyValue("homeId", getKeyValue("data", data)); + String homeId = UserConfigManage.getInstance().getHomeId(); //缁戝畾鎴愬姛涔嬪悗閫氱煡 Gson gson = new Gson(); Type typeOfT = new TypeToken<List<GatewayBean>>() { }.getType(); @@ -1542,7 +1542,7 @@ baseEventBus.setData(list); EventBus.getDefault().post(baseEventBus); //杩涙潵浣忓畢璇︽儏閮借涓婁紶涓�娆id鍒楄〃鍒颁簯绔�; - HdlDeviceLogic.getInstance().uploadDataToCloud(homeId, list, null); + HdlDeviceLogic.getInstance().uploadOidDataToCloud(homeId, list, false, null); } @Override @@ -1737,10 +1737,10 @@ if (callback != null) { callback.invoke(getJSONObject(uniCallBackBaseBean)); // callback.invoke(uniCallBackBaseBean); - HdlLogLogic.print("uni--->鎺ユ敹--->" + type + "--->" + new Gson().toJson(uniCallBackBaseBean), true); + HdlLogLogic.print("uni--->鍥炲--->" + type + "--->" + new Gson().toJson(uniCallBackBaseBean), true); } } catch (Exception e) { - HdlLogLogic.print("uni--->鎺ユ敹--->" + type + "--->" + e.getMessage(), true); + HdlLogLogic.print("uni--->鍥炲--->" + type + "--->" + e.getMessage(), true); } -- Gitblit v1.8.0