mac
2024-07-01 46f45f42abf00acf70e8160e73faa71aec3df13d
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java
@@ -91,6 +91,17 @@
    private final long pageSize = 20;//页数
    /**
     * 还原条件的初始化状态
     */
    private void InitializationState() {
        key = SortValue.all;
        value = SortValue.all;
        installedCapacityMinValue = "";
        installedCapacityMaxValue = "";
        gridTypeValue = "";
        powerStationStatusValue = PowerStationStatus.All;
    }
    @Override
    public Object getContentView() {
@@ -119,6 +130,7 @@
                }
                isClickPowerStationLabel = true;
                selectedTitleLabelStyle();
                InitializationState();
                getStatusOverview();
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true);
@@ -629,12 +641,11 @@
//                    }
//                }
            }
        } else if (HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE.equals(eventBus.getType())) {
        } else if (HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE.equals(eventBus.getTopic())) {
            // 取消粘性事件
            EventBus.getDefault().removeStickyEvent(eventBus);
            //是在电站列表页才进来这里
            //是在(电站)模块且在(电站)标签页才进来这里
            if (HdlCommonLogic.lowerTagType == LowerTagType.power_station && isClickPowerStationLabel) {
                //uin关闭住宅详情界面通知
                if (MqttRecvClient.getInstance() != null) {
@@ -654,20 +665,33 @@
                //字符串是自己按规则拼接的,里面注册主题时会解析字符串,只拿getGatewayId()值;
                String topic = "/user/" + gatewayId + "/#";
                //进去住宅详情开始订阅主题
                MqttRecvClient.getInstance().checkAndsubscribeAllTopics(topic);
                MqttRecvClient.getInstance().checkAndsubscribeAllTopics(topic);//订阅【逆变器】消息
            }
            String topicHome = "/user/" + UserConfigManage.getInstance().getHomeId() + "/#";
            MqttRecvClient.getInstance().checkAndsubscribeAllTopics(topicHome);//订阅【电站】消息
        } else if (eventBus.getTopic().equals(ConstantManage.homepage_title_tab_switch)) {
            //接收外部点击事件
            if (eventBus.getType().equals(HomepageTitleTabSwitch.powerstation.toString())) {
                // 取消粘性事件
                EventBus.getDefault().removeStickyEvent(eventBus);
                HdlLogLogic.print("正在点击【电站】");
                if (!isReadData) {
                    //1,从首页-故障-进来-电站(不读取)
                    //2,从电站-进来-电站(读取一次,后面进来不在读取)
                    loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true);
                    getStatusOverview();
                }
//                if (!isReadData) {
//                    //1,从首页-故障-进来-电站(不读取)
//                    //2,从电站-进来-电站(读取一次,后面进来不在读取)
//                    loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true);
//                    getStatusOverview();
//                }
                //2024年06月24日14:34:01 产品经理要求进去电站列表都要读取 且默认进去都是默认电站标签
                isClickPowerStationLabel = true;
                selectedTitleLabelStyle();
                InitializationState();
                getStatusOverview();
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true);
            } else if (eventBus.getType().equals(PowerStationStatus.All)) {
                isClickPowerStationLabel = true;
                selectedTitleLabelStyle();
@@ -751,7 +775,7 @@
        }
        isHouseLoadingMore = true;//标记读取状态
        if (isRefreshing) {
            showLoading();
            showLoading(getString(R.string.device_loading));
        }
        //获取住宅(电站)ID列表
@@ -820,7 +844,7 @@
        }
        isDeviceLoadingMore = true;//标记读取状态
        if (isRefreshing) {
            showLoading();
            showLoading(getString(R.string.device_loading));
        }
        //获取住宅(电站)ID列表
        HdlDeviceLogic.getInstance().getPowerStationDeviceList("", pageNo, pageSize, new CloudCallBeak<PageNumberObject<CloudInverterDeviceBean>>() {