wjc
2025-09-16 ac7e902dca62fe00f442094a751048a802d13f90
app/src/main/java/com/hdl/photovoltaic/ui/CPowerStationActivity.java
@@ -52,7 +52,7 @@
import com.hdl.sdk.link.core.bean.gateway.GatewayBean;
import com.hdl.sdk.link.core.config.HDLLinkConfig;
import com.hdl.sdk.link.core.utils.mqtt.MqttRecvClient;
import com.umeng.analytics.MobclickAgent;
//import com.umeng.analytics.MobclickAgent;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@@ -259,15 +259,16 @@
        UserConfigManage.getInstance().setUniBottomSafeDistanceBackgroundColor(0);
        List<HouseIdBean> HouseIdList = HdlResidenceLogic.getInstance().getHouseIdList();
        if (HouseIdList.isEmpty()) {
            if (TextUtils.isEmpty(UserConfigManage.getInstance().getHomeId())) {
                String path = HDLUniMP.UNI_EVENT_OPEN_HOME_Null_C;
                HdlUniLogic.getInstance().openUniMP(path, null);
            } else {
                //1,解决手机没有外网,获取不到电站列表,自动登录进来,默认传上一次的住宅id;
                //2,之前电站列表只有一个电站,然后删除掉电站,这时住宅id还缓存着,再一次进来,默认传上一次的住宅id;
                String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS_C + "?homeId=" + UserConfigManage.getInstance().getHomeId() + "&homeName=" + UserConfigManage.getInstance().getHomeName();
                HdlUniLogic.getInstance().openUniMP(path, null);
            }
//            if (TextUtils.isEmpty(UserConfigManage.getInstance().getHomeId())) {
            String path = HDLUniMP.UNI_EVENT_OPEN_HOME_Null_C;
            HdlUniLogic.getInstance().openUniMP(path, null);
//            } else {
//                //暂时不考虑这种情况
//                //1,解决手机没有外网,获取不到电站列表,自动登录进来,默认传上一次的住宅id;
//                //2,之前电站列表只有一个电站,然后删除掉电站,这时住宅id还缓存着,再一次进来,默认传上一次的住宅id;
//                String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS_C + "?homeId=" + UserConfigManage.getInstance().getHomeId() + "&homeName=" + UserConfigManage.getInstance().getHomeName();
//                HdlUniLogic.getInstance().openUniMP(path, null);
//            }
        } else {
            int select_home = 0;
@@ -322,8 +323,8 @@
                    HDLUniMPSDKManager.getInstance().getUniMP().closeUniMP();
                }
                AppManagerUtils.getAppManager().finishAllActivity();
                //如果开发者调用kill或者exit之类的方法杀死进程,或者双击back键会杀死进程,请务必在此之前调用MobclickAgent.onKillProcess方法,用来保存统计数据。
                MobclickAgent.onKillProcess(_mActivity);
//                //友盟sdk如果开发者调用kill或者exit之类的方法杀死进程,或者双击back键会杀死进程,请务必在此之前调用MobclickAgent.onKillProcess方法,用来保存统计数据。
//                MobclickAgent.onKillProcess(_mActivity);
                Process.killProcess(Process.myPid());
            }
        }
@@ -502,14 +503,14 @@
//                        HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean);
                        HdlLogLogic.print(linkResponse.getTopic() + new Gson().toJson(linkResponse.getData()), true);
//                        HdlDeviceLogic.getInstance().searchAllNetworkGateway(null);//逆变器wifi状态-重新搜索一下逆变器-重新更新连接状态
                    } else if (linkResponse.getTopic().endsWith("/app/thing/event/appHomeRefresh/up")) {
                    } else if (linkResponse.getTopic().endsWith("/app/thing/event/appHomeDeliverRollbackRefresh/up")) {
                        try {
                            //住宅交付状态回滚通知
                            String[] topicArray = linkResponse.getTopic().split("/");
                            if (topicArray.length < 2) {
                                return;
                            }
                            final String HomeId = topicArray[1];
                            final String HomeId = topicArray[2];
                            //先删除电站
                            HdlResidenceLogic.getInstance().delHouseId(HomeId);
                            List<HouseIdBean> localHouseIdList = HdlResidenceLogic.getInstance().getHouseIdList();
@@ -520,6 +521,8 @@
                                uniCallBackBaseBean.setType(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_DETAILS);
                                uniCallBackBaseBean.setData(jsonObject);
                                HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean);
                                UserConfigManage.getInstance().setHomeId("");
                                UserConfigManage.getInstance().Save();
                            } else {
                                if (HomeId.equals(UserConfigManage.getInstance().getHomeId()) || TextUtils.isEmpty(UserConfigManage.getInstance().getHomeId())) {
                                    HouseIdBean houseIdBean = localHouseIdList.get(0);
@@ -534,7 +537,9 @@
                                    HdlUniLogic.getInstance().sendUni(HDLUniMP.UNI_EVENT_NOTIFICATION_DEVICE_MODEL, uniCallBackBaseBean);
                                }
                            }
                        } catch (Exception e) {
                            HdlLogLogic.print("回滚异常", false);
                        }
                        if (AppManagerUtils.getAppManager().existsTopActivity(PowerStationsListActivity.class, PowerStationsMoveActivity.class)) {
                            //存在栈里再通知更新