| | |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.databinding.FragmentHouseListBinding; |
| | | import com.hdl.photovoltaic.base.CustomBaseFragment; |
| | | import com.hdl.photovoltaic.enums.DebugStatus; |
| | | import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch; |
| | | import com.hdl.photovoltaic.enums.LowerTagType; |
| | | import com.hdl.photovoltaic.enums.PowerStationStatus; |
| | |
| | | private String value = SortValue.all;//descending:降序,ascending:升序 |
| | | private String installedCapacityMinValue = "";//最小组串容量(装机容量) |
| | | private String installedCapacityMaxValue = "";//最大组串容量(装机容量) |
| | | private String gridTypeValue = "";//并网状态(全部 不传该过滤参数,FULL_GRID:并网,OFFLINE:离网) |
| | | private String screeningConditionStatus = DebugStatus.All;//筛选条件状态 |
| | | private String powerStationStatusValue = PowerStationStatus.All;//电站状态(全部 不传该过滤参数,1:正常(运行),2:离线,3:待接入,4:故障) |
| | | |
| | | private final long pageSize = 20;//页数 |
| | |
| | | value = SortValue.all; |
| | | installedCapacityMinValue = ""; |
| | | installedCapacityMaxValue = ""; |
| | | gridTypeValue = ""; |
| | | screeningConditionStatus = DebugStatus.All; |
| | | powerStationStatusValue = PowerStationStatus.All; |
| | | } |
| | | |
| | |
| | | selectedTitleLabelStyle(); |
| | | initializationState(); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | |
| | | } |
| | | }); |
| | |
| | | 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, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | //故障 |
| | |
| | | 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, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | //离线 |
| | |
| | | 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, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | //待接入 |
| | |
| | | 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, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | |
| | |
| | | public void onClick(View v) { |
| | | DefaultFilteringDialog defaultFilteringDialog = new DefaultFilteringDialog(_mActivity); |
| | | defaultFilteringDialog.show(); |
| | | defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue); |
| | | defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus); |
| | | defaultFilteringDialog.setOnClickListener(new DefaultFilteringDialog.OnClickListener() { |
| | | @Override |
| | | public void confirm(String min, String max, String state) { |
| | | installedCapacityMinValue = min;//最小组串容量(装机容量) |
| | | installedCapacityMaxValue = max;//最大组串容量(装机容量) |
| | | gridTypeValue = state;//并网状态(全部 不传该过滤参数,FULL_GRID:并网,OFFLINE:离网) |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | screeningConditionStatus = state;//调试状态(全部;调试中;调试完成;已交付;授权调试) |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | } |
| | |
| | | @Override |
| | | public void onRefresh() { |
| | | viewBinding.fragmentHouseSrl.setRefreshing(false); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | getStatusOverview(); |
| | | } |
| | | }); |
| | |
| | | if (!isHouseLoadingMore) { |
| | | // 滑动到了底部,执行相应的操作 |
| | | HdlLogLogic.print("---滑动到了底部"); |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, ++currentHouseListPage, false); |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, ++currentHouseListPage, false); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | }); |
| | | //电站编辑按钮 |
| | | 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 |
| | |
| | | screenIconState(viewBinding.stationNameRl, viewBinding.stationNameIv, isSelected); |
| | | key = SortType.homeNameSort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | //电站发电功率筛选 |
| | |
| | | screenIconState(viewBinding.stationPowerRl, viewBinding.stationPowerIv, isSelected); |
| | | key = SortType.powerSort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | //电站当日发电量筛选 |
| | |
| | | screenIconState(viewBinding.stationDayRl, viewBinding.stationDayIv, isSelected); |
| | | key = SortType.todayElectricitySort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | //电站当月发电量筛选 |
| | | //电站电池容量筛选 |
| | | viewBinding.stationMonthRl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | boolean isSelected = !v.isSelected(); |
| | | screenIconState(viewBinding.stationMonthRl, viewBinding.stationMonthIv, isSelected); |
| | | key = SortType.monthElectricitySort; |
| | | key = SortType.batteryCapacitySort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | } |
| | | }); |
| | | //设备点击 |
| | |
| | | // 取消粘性事件 |
| | | EventBus.getDefault().removeStickyEvent(eventBus); |
| | | //uin创建电站成功后通知 |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, 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(); |
| | |
| | | // if (MqttRecvClient.getInstance() != null) { |
| | | // MqttRecvClient.getInstance().removeAllTopic(); |
| | | // } |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | } |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) { |
| | | // 取消粘性事件 |
| | |
| | | selectedTitleLabelStyle(); |
| | | initializationState(); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, 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)) { |
| | |
| | | * @param key 发电功率排序(powerSort); |
| | | * 今日发电量排序(todayElectricitySort); |
| | | * 创建时间排序(createTimeSort); |
| | | * 电池容量排序(batteryCapacitySort); |
| | | * @param keyValue (descending:降序 |
| | | * ascending:升序), |
| | | * @param installedCapacityMin 最小组串容量(装机容量) |
| | | * @param installedCapacityMax 最大组串容量(装机容量) |
| | | * @param gridType 并网状态 (全部 :"";FULL_GRID : 并网;OFFLINE :离网) |
| | | * @param gridType 调试状态(全部;调试中;调试完成;已交付;授权调试) |
| | | * @param powerStationStatus 电站状态 (全部 :"";1 : 正常;2 : 离线; 3 : 待接入;4 : 故障) |
| | | * @param pageNo 页码 |
| | | * @param isClear 是否清除数据 |