From 0770fc4f03196a27e8f4c899a44da63bb1a683e2 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期四, 12 六月 2025 18:17:29 +0800 Subject: [PATCH] 2025年06月12日18:17:27 --- app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java | 46 ++++++++++++++++++++++++++++++++++++---------- 1 files changed, 36 insertions(+), 10 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 f66db1a..1db0a91 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java +++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java @@ -9,9 +9,7 @@ import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationManager; -import android.net.wifi.ScanResult; import android.os.IBinder; -import android.os.SystemClock; import android.provider.Settings; import android.text.TextUtils; import android.util.Log; @@ -51,7 +49,6 @@ import com.hdl.photovoltaic.ui.bean.DeviceTimeBean; import com.hdl.photovoltaic.ui.bean.Geolocation; import com.hdl.photovoltaic.ui.bean.HouseIdBean; -import com.hdl.photovoltaic.ui.bean.HouseInfoBean; import com.hdl.photovoltaic.ui.bean.LinkBean; import com.hdl.photovoltaic.ui.bean.MemberBean; import com.hdl.photovoltaic.ui.bean.NotRunBean; @@ -63,8 +60,8 @@ import com.hdl.photovoltaic.ui.me.AsRegardsActivity; import com.hdl.photovoltaic.ui.me.CPersonalDataActivity; import com.hdl.photovoltaic.ui.me.SetActivity; -import com.hdl.photovoltaic.ui.newC.MessageCenterList; -import com.hdl.photovoltaic.ui.newC.PowerStationsListEdit; +import com.hdl.photovoltaic.ui.newC.MessageCenterListActivity; +import com.hdl.photovoltaic.ui.newC.PowerStationsListActivity; import com.hdl.photovoltaic.uni.HDLUniMP; import com.hdl.photovoltaic.uni.HDLUniMPSDKManager; import com.hdl.photovoltaic.utils.NetworkUtils; @@ -83,7 +80,6 @@ import com.hdl.sdk.link.gateway.HDLLinkLocalGateway; import org.greenrobot.eventbus.EventBus; -import org.json.JSONArray; import org.json.JSONObject; @@ -217,7 +213,7 @@ HouseIdBean houseIdBean = gson.fromJson(dataJsonStr, HouseIdBean.class); HdlResidenceLogic.getInstance().switchHouse(houseIdBean, true); } - HdlLogLogic.print("uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡---"+dataJsonStr, true); + HdlLogLogic.print("uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡---" + dataJsonStr, true); } catch (Exception e) { HdlLogLogic.print("uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡---" + e.getMessage(), true); } @@ -563,7 +559,7 @@ case HDLUniMP.UNI_EVENT_REPLY_MINE_SELECTED_POWERSTATION: { Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.setClass(HDLApp.getInstance(), PowerStationsListEdit.class); + intent.setClass(HDLApp.getInstance(), PowerStationsListActivity.class); HDLApp.getInstance().startActivity(intent); } break; @@ -573,7 +569,7 @@ String isShowFault = getKeyValue("isShowFault", getKeyValue("data", data)); Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.setClass(HDLApp.getInstance(), MessageCenterList.class); + intent.setClass(HDLApp.getInstance(), MessageCenterListActivity.class); if (!TextUtils.isEmpty(homeId)) { intent.putExtra("homeId", homeId); } @@ -813,6 +809,36 @@ } break; } + } else if (HDLUniMP.UNI_EVENT_REPLY_NO_WORK_MODEL.equals(topic)) { + //鏃犵綉妯″紡 + switch (type) { + + case HDLUniMP.UNI_EVENT_REPLY_NO_WORK_MODEL_EXIT: { + //閫�鍑烘棤缃戞ā寮忔爣璇� + UserConfigManage.getInstance().setNoNetworkFlag(false); + UserConfigManage.getInstance().Save(); + } + break; + case HDLUniMP.UNI_EVENT_REPLY_NO_WORK_MODEL_DEVICE_INFO: { + try { + //杩涘叆鏃犵綉妯″紡閫嗗彉鍣ㄨ鎯呴〉锛岀紦瀛榤ac鍜屽瘑鐮� + String mac = getKeyValue("mac", getKeyValue("data", data)); + String password = getKeyValue("password", getKeyValue("data", data)); + UserConfigManage.getInstance().setNoNetworkDeviceMac(mac); + UserConfigManage.getInstance().setNoNetworkPassword(password); + UserConfigManage.getInstance().Save(); + } catch (Exception ignored) { + } + } + break; + case HDLUniMP.UNI_EVENT_REPLY_NO_WORK_MODEL_CLEAR_DEVICE_INFO: { + //鏃犵綉妯″紡閫嗗彉鍣ㄨ鎯呴〉锛屾竻闄ょ紦瀛榤ac鍜屽瘑鐮� + UserConfigManage.getInstance().setNoNetworkDeviceMac(""); + UserConfigManage.getInstance().setNoNetworkPassword(""); + UserConfigManage.getInstance().Save(); + } + break; + } } else if (HDLUniMP.UNI_EVENT_REPLY_UNI_SEND_TO_CLOUD.equals(topic)) { //缃戠粶璇锋眰妯″潡 JsonObject jObject = new JsonObject(); @@ -932,7 +958,7 @@ if (callback != null) { uniSuccessCallback(type, null, callback); } - List<GatewayBean> list = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId, null); + List<GatewayBean> list = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId); for (int i = 0; i < list.size(); i++) { GatewayBean gatewayBean = list.get(i); HdlDeviceLogic.getInstance().initializeInverter(gatewayBean.getDevice_mac(), null); -- Gitblit v1.8.0