wjc
2026-03-06 b9408687a3c0490289206b7e3b623d1490b38afd
app/src/main/java/com/hdl/photovoltaic/ui/BPowerStationActivity.java
@@ -37,6 +37,7 @@
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;
@@ -49,6 +50,9 @@
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;
@@ -111,7 +115,7 @@
    @Override
    public void onBindView(Bundle savedInstanceState) {
//        //通知栏点击进来,防止应用在后台时被重复启动,阿里云推动通知指定打开某个Activity,没有设置Flags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);默认启动新实例,导致多个实例
////        //通知栏点击进来,防止应用在后台时被重复启动,阿里云推动通知指定打开某个Activity,没有设置Flags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);默认启动新实例,导致多个实例
//        if (!isTaskRoot()) {
//            finish();
//        }
@@ -141,7 +145,7 @@
        this.getUnreadCount();
        //获取云端脚本
        HdlESLocalJsonLogic.getInstance().getAllHdlESLocalJson();
        this.getChatInfo();
    }
@@ -155,8 +159,8 @@
            if (TextUtils.isEmpty(data)) {
                return;
            }
            PushMessageInfoBean pushMessageInfoBean = new Gson().fromJson(data, PushMessageInfoBean.class);
//            PushMessageInfoBean pushMessageInfoBean = HdlPushLogic.getInstance().pushDataProcessing("", "", data);
//            PushMessageInfoBean pushMessageInfoBean = new Gson().fromJson(data, PushMessageInfoBean.class);
            PushMessageInfoBean pushMessageInfoBean = HdlPushLogic.getInstance().pushDataProcessing("", "", data);
            if (TextUtils.isEmpty(pushMessageInfoBean.getMsgId())) {
                return;
            }
@@ -324,7 +328,7 @@
//                    UserConfigManage.getInstance().setRegistrationID(registrationID);
//                    UserConfigManage.getInstance().Save();
                    String finalRegistrationID = registrationID;
                    HdlResidenceLogic.getInstance().pushAdd(new CloudCallBeak<String>() {
                    HdlPushLogic.getInstance().pushAdd(new CloudCallBeak<String>() {
                        @Override
                        public void onSuccess(String pushId) {
@@ -362,7 +366,7 @@
        if (TextUtils.isEmpty(token)) {
            return;
        }
        HdlResidenceLogic.getInstance().pushAdd(new CloudCallBeak<String>() {
        HdlPushLogic.getInstance().pushAdd(new CloudCallBeak<String>() {
            @Override
            public void onSuccess(String pushId) {
                HdlLogLogic.print("添加令牌到云端 PushToken:" + UserConfigManage.getInstance().getPushToken() + " pushId:" + pushId, true);
@@ -371,6 +375,40 @@
            @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);
            }
        });
    }
@@ -880,13 +918,14 @@
        //触发消息点击事件
        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.homepage_title_tab_switch, HomepageTitleTabSwitch.message.toString());
//        HdlCommonLogic.getInstance().postEventBusSticky(ConstantManage.refresh_message_house, ConstantManage.refresh_message_house);
    }