From fa2c6bc596778480e57a9df64ea1aa925ed1f8b4 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期一, 26 五月 2025 09:31:20 +0800 Subject: [PATCH] 2025年05月26日09:31:18 --- app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java | 42 ++++++++++++++++++++++++++++-------------- 1 files changed, 28 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java index 8a8744c..8e018b0 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java @@ -8,6 +8,7 @@ import android.os.AsyncTask; import android.os.Bundle; import android.provider.Settings; +import android.text.TextUtils; import android.util.Log; import android.view.View; import android.widget.ImageView; @@ -436,7 +437,17 @@ HdlDeviceLogic.getInstance().setDeviceRemoteInfo(newList, deviceBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() { @Override public void onSuccess(List<GatewayBean> obj) { + GatewayBean newGatewayBean = HDLLinkLocalGateway.getInstance().getLocalGateway(deviceBean.getOsn()); + if (newGatewayBean == null) { + HdlThreadLogic.toast(_mActivity, getString(R.string.device_off)); + return; + } + if (TextUtils.isEmpty(newGatewayBean.getGatewayId()) || TextUtils.isEmpty(newGatewayBean.getAesKey())) { + //杩欓噷鍙敮鎸佽繙绋嬭皟璇曪紝杩滅▼鎷夸笉鍒癿qtt閫氳绉橀挜浠ュ強gatewayId锛� + HdlThreadLogic.toast(_mActivity, getString(R.string.Device_failed_to_certificate) + "(124004)"); + return; + } String jsonEncryption = URLEncodingUtils.encodeURIComponent(new Gson().toJson(newGatewayBean)); String path = HDLUniMP.UNI_EVENT_OPEN_DEVICE_DETAILS + "?inverterInfo=" + jsonEncryption; HdlUniLogic.getInstance().openUniMP(path, null); @@ -581,15 +592,18 @@ if (HDLUniMP.UNI_EVENT_REPLY_HOME_CREATION.equals(eventBus.getType())) { // 鍙栨秷绮樻�т簨浠� EventBus.getDefault().removeStickyEvent(eventBus); - //uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡 - loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); - if (eventBus.getData() != null) { - Gson gson = new Gson(); - String json = eventBus.getData().toString(); - HouseIdBean houseIdBean = gson.fromJson(json, HouseIdBean.class); - HdlResidenceLogic.getInstance().switchHouse(houseIdBean, true); - - } +// HdlLogLogic.print("杩涙潵浜�---11111" + eventBus.getData().toString()); +// //uin鍒涘缓鐢电珯鎴愬姛鍚庨�氱煡 +// loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); +// if (eventBus.getData() != null) { +// HdlLogLogic.print("杩涙潵浜�---" + eventBus.getData().toString()); +// Gson gson = new Gson(); +// String json = eventBus.getData().toString(); +// HouseIdBean houseIdBean = gson.fromJson(json, HouseIdBean.class); +// HdlResidenceLogic.getInstance().switchHouse(houseIdBean, true); +// HdlLogLogic.print("杩涙潵浜�---缁撴潫" + eventBus.getData().toString()); +// +// } } else if (HDLUniMP.UNI_EVENT_REPLY_HOME_EDIT.equals(eventBus.getType())) { // 鍙栨秷绮樻�т簨浠� EventBus.getDefault().removeStickyEvent(eventBus); @@ -1002,8 +1016,8 @@ public void requestPermissions(OnCallBeak onCallBeak) { - //ACCESS_FINE_LOCATION 鍏佽浣跨敤GPS瀹氫綅 - //ACCESS_COARSE_LOCATION 鍏佽浣跨敤WIFI鐑偣鎴栧熀绔欐潵鑾峰彇绮楃暐鐨勫畾浣� + //ACCESS_FINE_LOCATION 鍏佽浣跨敤GPS瀹氫綅 + //ACCESS_COARSE_LOCATION 鍏佽浣跨敤WIFI鐑偣鎴栧熀绔欐潵鑾峰彇绮楃暐鐨勫畾浣� String[] ary = PermissionUtils.checkPermission(_mActivity, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}); if (ary.length > 0) { this.requestPermissions(ary, PermissionUtils.STATUS_SUCCESS); @@ -1079,7 +1093,7 @@ // 鎵ц浠诲姟锛堝鏇存柊UI銆佽烦杞瓑锛� viewBinding.fragmentHouseSrl.endRefreshing(); //鍔犺浇鏈�鏂版暟鎹畬鎴� - loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); + loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); getStatusOverview(); } }.execute(); @@ -1142,7 +1156,7 @@ @Override protected void onPostExecute(Void aVoid) { viewBinding.fragmentDeviceSrl.endRefreshing(); - loadNextPageDeviceList(true, 1, true); + loadNextPageDeviceList(false, 1, true); } }.execute(); } @@ -1181,4 +1195,4 @@ } -} +} \ No newline at end of file -- Gitblit v1.8.0