wjc
2025-04-08 79065fc64a88ea55408416be55823a608f700857
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java
@@ -103,7 +103,7 @@
    private String value = SortValue.all;//descending:降序,ascending:升序
    private String installedCapacityMinValue = "";//最小组串容量(装机容量)
    private String installedCapacityMaxValue = "";//最大组串容量(装机容量)
    private String debugStatus = DebugStatus.All;//筛选条件状态
    private String screeningConditionStatus = DebugStatus.All;//筛选条件状态
    private String powerStationStatusValue = PowerStationStatus.All;//电站状态(全部 不传该过滤参数,1:正常(运行),2:离线,3:待接入,4:故障)
    private final long pageSize = 20;//页数
@@ -116,7 +116,7 @@
        value = SortValue.all;
        installedCapacityMinValue = "";
        installedCapacityMaxValue = "";
        debugStatus = DebugStatus.All;
        screeningConditionStatus = DebugStatus.All;
        powerStationStatusValue = PowerStationStatus.All;
    }
@@ -149,7 +149,7 @@
                selectedTitleLabelStyle();
                initializationState();
                getStatusOverview();
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            }
        });
@@ -174,7 +174,7 @@
                viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff));
                viewBinding.offlineLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff));
                viewBinding.connectedLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff));
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            }
        });
        //故障
@@ -186,7 +186,7 @@
                viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_yes_ffffff));
                viewBinding.offlineLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff));
                viewBinding.connectedLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff));
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            }
        });
        //离线
@@ -198,7 +198,7 @@
                viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff));
                viewBinding.offlineLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_yes_ffffff));
                viewBinding.connectedLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff));
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            }
        });
        //待接入
@@ -210,7 +210,7 @@
                viewBinding.faultsLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff));
                viewBinding.offlineLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_no_ffffff));
                viewBinding.connectedLl.setBackground(AppCompatResources.getDrawable(_mActivity, R.drawable.station_status_yes_ffffff));
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            }
        });
@@ -244,14 +244,14 @@
            public void onClick(View v) {
                DefaultFilteringDialog defaultFilteringDialog = new DefaultFilteringDialog(_mActivity);
                defaultFilteringDialog.show();
                defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, debugStatus);
                defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus);
                defaultFilteringDialog.setOnClickListener(new DefaultFilteringDialog.OnClickListener() {
                    @Override
                    public void confirm(String min, String max, String state) {
                        installedCapacityMinValue = min;//最小组串容量(装机容量)
                        installedCapacityMaxValue = max;//最大组串容量(装机容量)
                        debugStatus = state;//调试状态(全部;调试中;调试完成;已交付;授权调试)
                        loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                        screeningConditionStatus = state;//调试状态(全部;调试中;调试完成;已交付;授权调试)
                        loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
                    }
                });
            }
@@ -264,7 +264,7 @@
            @Override
            public void onRefresh() {
                viewBinding.fragmentHouseSrl.setRefreshing(false);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
                getStatusOverview();
            }
        });
@@ -285,7 +285,7 @@
                    if (!isHouseLoadingMore) {
                        // 滑动到了底部,执行相应的操作
                        HdlLogLogic.print("---滑动到了底部");
                        loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, ++currentHouseListPage, false);
                        loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, ++currentHouseListPage, false);
                    }
                }
            }
@@ -387,13 +387,13 @@
            }
        });
        //电站编辑按钮
        viewBinding.editIv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(HouseListEditActivity.class);
            }
        });
//        //电站编辑按钮
//        viewBinding.editIv.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                startActivity(HouseListEditActivity.class);
//            }
//        });
        //电站名称筛选
        viewBinding.stationNameRl.setOnClickListener(new View.OnClickListener() {
            @Override
@@ -402,7 +402,7 @@
                screenIconState(viewBinding.stationNameRl, viewBinding.stationNameIv, isSelected);
                key = SortType.homeNameSort;
                value = isSelected ? SortValue.ascending : SortValue.descending;
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            }
        });
        //电站发电功率筛选
@@ -413,7 +413,7 @@
                screenIconState(viewBinding.stationPowerRl, viewBinding.stationPowerIv, isSelected);
                key = SortType.powerSort;
                value = isSelected ? SortValue.ascending : SortValue.descending;
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            }
        });
        //电站当日发电量筛选
@@ -424,7 +424,7 @@
                screenIconState(viewBinding.stationDayRl, viewBinding.stationDayIv, isSelected);
                key = SortType.todayElectricitySort;
                value = isSelected ? SortValue.ascending : SortValue.descending;
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            }
        });
        //电站电池容量筛选
@@ -435,7 +435,7 @@
                screenIconState(viewBinding.stationMonthRl, viewBinding.stationMonthIv, isSelected);
                key = SortType.batteryCapacitySort;
                value = isSelected ? SortValue.ascending : SortValue.descending;
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            }
        });
        //设备点击
@@ -621,7 +621,7 @@
                // 取消粘性事件
                EventBus.getDefault().removeStickyEvent(eventBus);
                //uin创建电站成功后通知
                loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
                if (eventBus.getData() != null) {
                    Gson gson = new Gson();
                    String json = eventBus.getData().toString();
@@ -665,7 +665,7 @@
//                if (MqttRecvClient.getInstance() != null) {
//                    MqttRecvClient.getInstance().removeAllTopic();
//                }
                loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            }
        } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) {
            // 取消粘性事件
@@ -707,7 +707,7 @@
                selectedTitleLabelStyle();
                initializationState();
                getStatusOverview();
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, debugStatus, powerStationStatusValue, 1, true);
                loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true);
            } else if (eventBus.getType().equals(ConstantManage.station_page)) {
                //通过首页电站进来的
                if (eventBus.getData().equals(PowerStationStatus.All)) {
@@ -1039,8 +1039,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);
@@ -1090,4 +1090,4 @@
        }
    }
}
}