| | |
| | | import com.hdl.photovoltaic.enums.DebugType; |
| | | import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch; |
| | | import com.hdl.photovoltaic.enums.Languages; |
| | | import com.hdl.photovoltaic.enums.LogoutType; |
| | | import com.hdl.photovoltaic.enums.LowerTagType; |
| | | import com.hdl.photovoltaic.enums.PowerStationStatus; |
| | | import com.hdl.photovoltaic.enums.PowerStationType; |
| | | import com.hdl.photovoltaic.enums.ProjectOperation; |
| | | import com.hdl.photovoltaic.enums.ShowErrorMode; |
| | | import com.hdl.photovoltaic.enums.SortType; |
| | |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.listener.LinkCallBack; |
| | | import com.hdl.photovoltaic.listener.OnCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlAccountLogic; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.other.HdlDeviceLogic; |
| | | import com.hdl.photovoltaic.other.HdlDialogLogic; |
| | |
| | | private String installedCapacityMaxValue = "";//最大组串容量(装机容量) |
| | | private String screeningConditionStatus = DebugStatus.All;//筛选条件状态 |
| | | private String powerStationStatusValue = PowerStationStatus.All;//电站状态(全部 不传该过滤参数,1:正常(运行),2:离线,3:待接入,4:故障) |
| | | private String powerStationTypeValue = PowerStationType.All;//电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | |
| | | private final long pageSize = 100;//一页大小 |
| | | |
| | |
| | | installedCapacityMaxValue = ""; |
| | | screeningConditionStatus = DebugStatus.All; |
| | | powerStationStatusValue = PowerStationStatus.All; |
| | | powerStationTypeValue = PowerStationType.All; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | private void initEvent() { |
| | | |
| | | viewBinding.exitTv.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlAccountLogic.getInstance().logout(LogoutType.NormalLogout); |
| | | } |
| | | }); |
| | | //电站标签 |
| | | viewBinding.powerStationLabel.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | |
| | | selectedTitleLabelStyle(); |
| | | initializationState(); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | |
| | | } |
| | | }); |
| | |
| | | powerStationStatusValue = PowerStationStatus.All; |
| | | stationStatusStyle(viewBinding.allLl, viewBinding.allDesTv); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //故障 |
| | |
| | | powerStationStatusValue = PowerStationStatus.malfunction; |
| | | stationStatusStyle(viewBinding.faultsLl, viewBinding.faultsDesTv); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //离线 |
| | |
| | | powerStationStatusValue = PowerStationStatus.off; |
| | | stationStatusStyle(viewBinding.offlineLl, viewBinding.offlineDesTv); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //待接入 |
| | |
| | | powerStationStatusValue = PowerStationStatus.connecting; |
| | | stationStatusStyle(viewBinding.connectedLl, viewBinding.connectedDesTv); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | |
| | |
| | | public void onClick(View v) { |
| | | DefaultFilteringDialog defaultFilteringDialog = new DefaultFilteringDialog(_mActivity); |
| | | defaultFilteringDialog.show(); |
| | | defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus); |
| | | defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationTypeValue); |
| | | defaultFilteringDialog.setOnClickListener(new DefaultFilteringDialog.OnClickListener() { |
| | | @Override |
| | | public void confirm(String min, String max, String state) { |
| | | public void confirm(String min, String max, String state, String powerStationType) { |
| | | installedCapacityMinValue = min;//最小组串容量(装机容量) |
| | | installedCapacityMaxValue = max;//最大组串容量(装机容量) |
| | | screeningConditionStatus = state;//调试状态(全部;调试中;调试完成;已交付;授权调试) |
| | | powerStationTypeValue = powerStationType;//电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | } |
| | |
| | | }); |
| | | } else { |
| | | showLoading(getString(R.string.deleting_please_wait)); |
| | | if (houseIdBean.getDebugType().equals(DebugType.NORMAL)) { |
| | | //【常规方式】发起删除电站指令 |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> list) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, list); |
| | | // if (houseIdBean.getDebugType().equals(DebugType.NORMAL)) { |
| | | //【常规方式】发起删除电站指令(搜索网关是考到网关没有连接到云端,使用本地发送初始化指令) |
| | | // 硬件那边叫新固件也发初始化 2025年10月14日10:55:18 |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), houseIdBean.getPowerStationType(), new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> list) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, list); |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, null); |
| | | } |
| | | }); |
| | | } else { |
| | | //【简易方式】发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, null); |
| | | } |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | //发起删除电站指令 |
| | | deleteResidence(position, houseIdBean, null); |
| | | } |
| | | }); |
| | | // } else { |
| | | // //【简易方式】发起删除电站指令 |
| | | // deleteResidence(position, houseIdBean, null); |
| | | // } |
| | | } |
| | | } |
| | | }); |
| | |
| | | key = SortType.installedCapacitySort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //额定功率筛选 |
| | |
| | | key = SortType.invPowerSort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //电站电池容量筛选 |
| | |
| | | key = SortType.batteryCapacitySort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //电站当日发电量筛选 |
| | |
| | | key = SortType.todayElectricitySort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //设备点击 |
| | |
| | | List<CloudInverterDeviceBean> newList = new ArrayList<>(); |
| | | newList.add(deviceBean); |
| | | //目的是为了获取拿到网关ID,mqtt通讯秘钥等信息,拿到后缓存到本地逆变器列表里面,发送数据数据时自动去缓存列表里面去查找; |
| | | HdlDeviceLogic.getInstance().setDeviceRemoteInfo(newList, deviceBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() { |
| | | HdlDeviceLogic.getInstance().setDeviceRemoteInfo(newList, deviceBean.getHomeId(), PowerStationType.All, new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> obj) { |
| | | |
| | |
| | | |
| | | |
| | | private void initView() { |
| | | if (UserConfigManage.getInstance().isTourist_mode()) { |
| | | viewBinding.addIv.setVisibility(View.GONE); |
| | | viewBinding.exitTv.setVisibility(View.VISIBLE); |
| | | } else { |
| | | viewBinding.addIv.setVisibility(View.VISIBLE); |
| | | viewBinding.exitTv.setVisibility(View.GONE); |
| | | } |
| | | viewBinding.powerStationLabelParent.setVisibility(View.VISIBLE); |
| | | viewBinding.deviceLabelParent.setVisibility(View.GONE); |
| | | |
| | |
| | | viewBinding.powerStationLabel.setTextAppearance(R.style.Text18Style); |
| | | viewBinding.deviceLabel.setTextAppearance(R.style.Text14Style); |
| | | // viewBinding.editIv.setVisibility(View.VISIBLE);//编辑图标隐藏 |
| | | viewBinding.addIv.setVisibility(View.VISIBLE);//添加图标隐藏 |
| | | if (UserConfigManage.getInstance().isTourist_mode()) { |
| | | viewBinding.addIv.setVisibility(View.GONE);//添加图标隐藏 |
| | | } else { |
| | | viewBinding.addIv.setVisibility(View.VISIBLE);//添加图标隐藏 |
| | | } |
| | | viewBinding.powerStationLabelParent.setVisibility(View.VISIBLE);//电站标签【父容器】显示 |
| | | viewBinding.deviceLabelParent.setVisibility(View.GONE);//设备标签【父容器】隐藏 |
| | | if (viewBinding.deviceNullDataIc.getRoot().getVisibility() == View.VISIBLE) { |
| | |
| | | viewBinding.deviceLabel.setTextAppearance(R.style.Text18Style); |
| | | viewBinding.powerStationLabel.setTextAppearance(R.style.Text14Style); |
| | | // viewBinding.editIv.setVisibility(View.GONE);//编辑图标隐藏 |
| | | viewBinding.addIv.setVisibility(View.GONE);//添加图标隐藏 |
| | | if (UserConfigManage.getInstance().isTourist_mode()) { |
| | | viewBinding.addIv.setVisibility(View.GONE);//添加图标隐藏 |
| | | } else { |
| | | viewBinding.addIv.setVisibility(View.GONE);//添加图标隐藏 |
| | | } |
| | | viewBinding.powerStationLabelParent.setVisibility(View.GONE);//电站标签【父容器】隐藏 |
| | | viewBinding.deviceLabelParent.setVisibility(View.VISIBLE);//设备标签【父容器】显示 |
| | | if (viewBinding.homeNullDataIc.getRoot().getVisibility() == View.VISIBLE) { |
| | |
| | | // MqttRecvClient.getInstance().removeAllTopic(); |
| | | // } |
| | | |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) { |
| | | // 取消粘性事件 |
| | |
| | | } |
| | | String homeId = eventBus.getData().toString(); |
| | | //进去住宅详情uni读取逆变器列表成功后通知 |
| | | for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId).size(); i++) { |
| | | String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId).get(i).getGatewayId(); |
| | | for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId,PowerStationType.All).size(); i++) { |
| | | String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId,PowerStationType.All).get(i).getGatewayId(); |
| | | //字符串是自己按规则拼接的,里面注册主题时会解析字符串,只拿getGatewayId()值; |
| | | String topic = "/user/" + gatewayId + "/#"; |
| | | //进去住宅详情开始订阅主题 |
| | |
| | | initializationState(); |
| | | stationStatusStyle(viewBinding.allLl, viewBinding.allDesTv); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } else if (eventBus.getType().equals(ConstantManage.station_page)) { |
| | | // 取消粘性事件 |
| | | EventBus.getDefault().removeStickyEvent(eventBus); |
| | |
| | | stationStatusStyle(viewBinding.connectedLl, viewBinding.connectedDesTv); |
| | | } |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } else if (eventBus.getType().equals(ConstantManage.station_edit)) { |
| | | //编辑后更新一下住宅列表 |
| | | //loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | |
| | | * 电站状态概览 |
| | | */ |
| | | private void getStatusOverview() { |
| | | HdlResidenceLogic.getInstance().getStatusOverview(screeningConditionStatus, installedCapacityMinValue, installedCapacityMaxValue, new CloudCallBeak<StatusOverviewBean>() { |
| | | HdlResidenceLogic.getInstance().getStatusOverview(screeningConditionStatus, installedCapacityMinValue, installedCapacityMaxValue, powerStationTypeValue, new CloudCallBeak<StatusOverviewBean>() { |
| | | @Override |
| | | public void onSuccess(StatusOverviewBean statusOverviewBean) { |
| | | if (statusOverviewBean == null) { |
| | |
| | | * @param installedCapacityMax 最大组串容量(装机容量) |
| | | * @param gridType 调试状态(全部;调试中;调试完成;已交付;授权调试) |
| | | * @param powerStationStatus 电站状态 (全部 :"";1 : 正常;2 : 离线; 3 : 待接入;4 : 故障) |
| | | * @param powerStationType 电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | * @param pageNo 页码 |
| | | * @param isClear 是否清除数据 |
| | | */ |
| | | private void loadNextPageHouseList(boolean isRefreshing, String key, String keyValue, String installedCapacityMin, String installedCapacityMax, String gridType, String powerStationStatus, long pageNo, boolean isClear) { |
| | | private void loadNextPageHouseList(boolean isRefreshing, String key, String keyValue, String installedCapacityMin, String installedCapacityMax, String gridType, String powerStationStatus, String powerStationType, long pageNo, boolean isClear) { |
| | | isReadData = true; |
| | | if (isClear) { |
| | | clearData(); |
| | |
| | | } |
| | | |
| | | //获取住宅(电站)ID列表 |
| | | HdlResidenceLogic.getInstance().getResidenceIdList(key, keyValue, installedCapacityMin, installedCapacityMax, gridType, powerStationStatus, pageNo, pageSize, new CloudCallBeak<HdlResidenceLogic.HouseBeanClass>() { |
| | | HdlResidenceLogic.getInstance().getResidenceIdList(key, keyValue, installedCapacityMin, installedCapacityMax, gridType, powerStationStatus, powerStationType, pageNo, pageSize, new CloudCallBeak<HdlResidenceLogic.HouseBeanClass>() { |
| | | @Override |
| | | public void onSuccess(HdlResidenceLogic.HouseBeanClass houseBeanClass) { |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | |
| | | // 执行任务(如更新UI、跳转等) |
| | | viewBinding.fragmentHouseSrl.endRefreshing(); |
| | | //加载最新数据完成 |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | getStatusOverview(); |
| | | } |
| | | }.execute(); |
| | |
| | | viewBinding.fragmentHouseSrl.endLoadingMore(); |
| | | if (!isHouseLoadingMore) { |
| | | // 滑动到了底部,执行相应的操作 |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, ++currentHouseListPage, false); |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, ++currentHouseListPage, false); |
| | | } |
| | | } |
| | | }.execute(); |