| | |
| | | import com.hdl.photovoltaic.enums.LowerTagType; |
| | | import com.hdl.photovoltaic.enums.NetworkType; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlAiLogic; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.other.HdlDeviceLogic; |
| | | import com.hdl.photovoltaic.other.HdlESLocalJsonLogic; |
| | |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.other.HdlUniLogic; |
| | | import com.hdl.photovoltaic.push.PushMessageInfoBean; |
| | | import com.hdl.photovoltaic.ui.bean.ChatInfoBean; |
| | | import com.hdl.photovoltaic.ui.bean.ChatMessageListBean; |
| | | import com.hdl.photovoltaic.ui.bean.ChatMessagePageBean; |
| | | import com.hdl.photovoltaic.ui.bean.DeviceRemoteInfo; |
| | | import com.hdl.photovoltaic.ui.bean.MessageBean; |
| | | import com.hdl.photovoltaic.ui.bean.OidBean; |
| | |
| | | this.getUnreadCount(); |
| | | //获取云端脚本 |
| | | HdlESLocalJsonLogic.getInstance().getAllHdlESLocalJson(); |
| | | |
| | | this.getChatInfo(); |
| | | |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | HdlLogLogic.print("添加令牌到云端失败 PushToken:" + UserConfigManage.getInstance().getPushToken() + " 错误:" + e.getMessage(), true); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 查看智能体详情 |
| | | * |
| | | */ |
| | | private void getChatInfo() { |
| | | HdlAiLogic.getInstance().getChatInfo(new CloudCallBeak<ChatInfoBean>() { |
| | | @Override |
| | | public void onSuccess(ChatInfoBean chatInfoBean) { |
| | | UserConfigManage.getInstance().setAgentSecret(chatInfoBean.getAgentSecret()); |
| | | UserConfigManage.getInstance().setAgentUrl(chatInfoBean.getAgentUrl()); |
| | | UserConfigManage.getInstance().Save(); |
| | | HdlAiLogic.getInstance().chatMessagesList(new CloudCallBeak<ChatMessagePageBean>() { |
| | | @Override |
| | | public void onSuccess(ChatMessagePageBean obj) { |
| | | if (obj != null && !obj.getData().isEmpty()) { |
| | | UserConfigManage.getInstance().setConversationId(obj.getData().get(0).getId()); |
| | | UserConfigManage.getInstance().Save(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | HdlLogLogic.print("获取智能体AppKey失败 Pu" + e.getMessage(), true); |
| | | } |
| | | }); |
| | | } |
| | |
| | | public void run() { |
| | | //防止app启动的时候没有网络(app也登录不了),导致获取不了mqtt远程连接信息; |
| | | initMqttClient(); |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(UserConfigManage.getInstance().getHomeId(), new CloudCallBeak<List<GatewayBean>>() { |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(UserConfigManage.getInstance().getHomeId(), UserConfigManage.getInstance().getPowerStationType(), new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> obj) { |
| | | // AppManagerUtils.getAppManager().hideLoading(); |
| | |
| | | */ |
| | | private void clickNotificationMessageTab() { |
| | | //触发消息点击事件 |
| | | // viewBinding.myMessageBottomIl2.clickTv.performClick(); |
| | | if (currentFragmentIndex == 2) { |
| | | HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house); |
| | | return; |
| | | } |
| | | currentFragmentIndex = 2; |
| | | bottomViewChangeOfStyle(); |
| | | showFragment(); |
| | | HdlCommonLogic.lowerTagType = LowerTagType.message; |
| | | HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house); |
| | | viewBinding.myMessageBottomIl2.clickTv.performClick(); |
| | | // if (currentFragmentIndex == 2) { |
| | | // HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house); |
| | | // return; |
| | | // } |
| | | // currentFragmentIndex = 2; |
| | | // bottomViewChangeOfStyle(); |
| | | // showFragment(); |
| | | // HdlCommonLogic.lowerTagType = LowerTagType.message; |
| | | // HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house); |
| | | } |
| | | |
| | | |