wjc
2026-03-31 56f5de5eb6c1501175e7a36b10cf3d1b57284b47
app/src/main/java/com/hdl/photovoltaic/ui/newC/PowerStationsListActivity.java
@@ -19,6 +19,7 @@
import com.hdl.photovoltaic.config.ConstantManage;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.databinding.ActivityPowerStationsListBinding;
import com.hdl.photovoltaic.enums.Languages;
import com.hdl.photovoltaic.enums.ShowErrorMode;
import com.hdl.photovoltaic.internet.HttpClient;
import com.hdl.photovoltaic.listener.CloudCallBeak;
@@ -32,6 +33,7 @@
import com.hdl.photovoltaic.ui.device.ScanActivity;
import com.hdl.photovoltaic.ui.newC.adapter.HouseListAdapter;
import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.photovoltaic.utils.AppManagerUtils;
import com.hdl.photovoltaic.utils.PermissionUtils;
import com.hdl.photovoltaic.widget.ConfirmationCancelDialog;
import com.hdl.photovoltaic.widget.DelayedConfirmationCancelDialog;
@@ -151,7 +153,7 @@
                        public void Confirm() {
                            delayedConfirmationCancelDialog.dismiss();
                            showLoading(getString(R.string.deleting_please_wait));
                            HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() {
                            HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), houseIdBean.getPowerStationType(), new CloudCallBeak<List<GatewayBean>>() {
                                @Override
                                public void onSuccess(List<GatewayBean> list) {
                                    //发起删除电站指令
@@ -181,7 +183,6 @@
        viewBinding.addPowerStationTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 未授权 如果应用程序没有所需的权限,则显示解释说明
                PermissionExplanationDialog.getInstance().showPortConflictPdDialog(_mActivity, getString(R.string.camera_storage_instructions), getString(R.string.camera_storage_purpose));
                PermissionUtils.requestPermissionsResultCallback(_mActivity, Manifest.permission.CAMERA, new PermissionUtils.PermissionState() {
@@ -215,6 +216,9 @@
        houseListAdapter.setList(this.houseListBeanIDList);
        this.nullDataUpdateUi(houseListBeanIDList);
        pullToRefresh();
        if (UserConfigManage.getInstance().isArabicLanguage()) {
            viewBinding.toolbarTopRl.topLeftIv.setRotation(180); // 旋转180度
        }
    }
    /**
@@ -283,21 +287,19 @@
                            hideLoading();
                        }
                        if (list != null && !list.isEmpty()) {
                            if (!comparableList(houseListBeanIDList, list)) {
                                //更新缓存
                                HdlResidenceLogic.getInstance().setHouseIdList(list, true);
                                if (houseListAdapter != null) {
                                    //重新获取列表数据
                                    initData();
                                    refreshDetails("");
                                    //更新电站选中状态
                                    setSelectState();
                                    //更新列表数据
                                    houseListAdapter.setList(houseListBeanIDList);
                                }
//                            if (!comparableList(houseListBeanIDList, list)) {
                            //更新缓存
                            HdlResidenceLogic.getInstance().setHouseIdList(list, true);
                            if (houseListAdapter != null) {
                                //重新获取列表数据
                                initData();
                                refreshDetails("");
                                //更新电站选中状态
                                setSelectState();
                                //更新列表数据
                                houseListAdapter.setList(houseListBeanIDList);
                            }
//                            }
                        }
                        nullDataUpdateUi(list);
                    }
@@ -348,9 +350,10 @@
     * @param houseIdBean 选中数据
     */
    private void houseSelectionDialog(HouseIdBean houseIdBean) {
        String placeholder = UserConfigManage.getInstance().getCurrentAppLanguage().equals(Languages.ar) ? "s%" : "%s";
        ConfirmationCancelDialog dialog = new ConfirmationCancelDialog(this);
        dialog.setTitle(getString(R.string.loading_title_tip));
        dialog.setContent(getString(R.string.switch_power_station).replace("%s", "\"" + houseIdBean.getHomeName() + "\""));
        dialog.setContent(getString(R.string.switch_power_station).replace(placeholder, "\"" + houseIdBean.getHomeName() + "\""));
        dialog.show();
        dialog.isHideTitle(true);
        dialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() {
@@ -362,6 +365,7 @@
                jsonObject.addProperty("homeId", houseIdBean.getHomeId());
                jsonObject.addProperty("homeName", houseIdBean.getHomeName());
                jsonObject.addProperty("powerStationStatus", houseIdBean.getPowerStationStatus() + "");
                jsonObject.addProperty("powerStationType", houseIdBean.getPowerStationType());
                HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean();
                uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_DETAILS);
                uniCallBackBaseBean.setData(jsonObject);
@@ -550,6 +554,7 @@
                    jsonObject.addProperty("homeId", houseIdBean.getHomeId());
                    jsonObject.addProperty("homeName", houseIdBean.getHomeName());
                    jsonObject.addProperty("powerStationStatus", houseIdBean.getPowerStationStatus() + "");
                    jsonObject.addProperty("powerStationType", houseIdBean.getPowerStationType());
                    HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean();
                    uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_DETAILS);
                    uniCallBackBaseBean.setData(jsonObject);