mac
2024-06-07 c09f79b3f0c32b09520b7d4ff948aa8aae222a69
app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java
@@ -8,27 +8,18 @@
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.hdl.linkpm.sdk.core.exception.HDLException;
import com.hdl.photovoltaic.bean.HttpResponsePack;
import com.hdl.photovoltaic.config.AppConfigManage;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.internet.HttpClient;
import com.hdl.photovoltaic.internet.api.HttpApi;
import com.hdl.photovoltaic.listener.BaseSuccessFailureCallBeak;
import com.hdl.photovoltaic.listener.CloudCallBeak;
import com.hdl.photovoltaic.ui.bean.CloudInverterDeviceBean;
import com.hdl.photovoltaic.ui.bean.ContactBean;
import com.hdl.photovoltaic.ui.bean.DeviceBean;
import com.hdl.photovoltaic.ui.bean.HouseInfoBean;
import com.hdl.photovoltaic.ui.bean.HouseIdBean;
import com.hdl.photovoltaic.ui.bean.MessageBean;
import com.hdl.sdk.link.common.exception.HDLLinkException;
import com.hdl.sdk.link.core.bean.gateway.GatewayBean;
import com.hdl.sdk.link.core.callback.GatewayCallBack;
import com.hdl.photovoltaic.ui.bean.StatusOverviewBean;
import com.hdl.sdk.link.core.config.HDLLinkConfig;
import com.hdl.sdk.link.core.utils.mqtt.MqttRecvClient;
import com.hdl.sdk.link.gateway.HDLLinkLocalGateway;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -77,10 +68,10 @@
    }
    public void clearHouseList() {
        if (houseInfoList == null) {
            return;
        if (mHouseIdList != null && mHouseIdList.size() > 0) {
            mHouseIdList.clear();
        }
        if (houseInfoList.size() > 0) {
        if (houseInfoList != null && houseInfoList.size() > 0) {
            houseInfoList.clear();
        }
    }
@@ -581,6 +572,37 @@
    }
    /**
     * 电站状态概览(安装商)
     */
    public void getStatusOverview(CloudCallBeak<StatusOverviewBean> cloudCallBeak) {
        String requestUrl = HttpApi.POST_statusOverview;
        JsonObject json = new JsonObject();
//        json.addProperty("zoneType", zoneType);//区域
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() {
            @Override
            public void onSuccess(String jsonStr) {
                if (TextUtils.isEmpty(jsonStr)) {
                    if (cloudCallBeak != null) {
                        cloudCallBeak.onSuccess(new StatusOverviewBean());
                    }
                }
                Gson gson = new Gson();
                StatusOverviewBean statusOverviewBean = gson.fromJson(jsonStr, StatusOverviewBean.class);
                if (cloudCallBeak != null) {
                    cloudCallBeak.onSuccess(statusOverviewBean);
                }
            }
            @Override
            public void onFailure(HDLException e) {
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(e);
                }
            }
        });
    }
    /**
     * 添加住宅(电站)到云端
     *
     * @param houseInfoBean -
@@ -865,7 +887,7 @@
        //重新创建住宅文件夹
        HdlFileLogic.getInstance().createDirectory();
        //进去住宅详情搜索一下逆变器列表,目的是建立通讯通道;
        HdlDeviceLogic.getInstance().searchCurrentHomeGateway(null);
        HdlDeviceLogic.getInstance().searchCurrentHomeGateway(houseIdBean.getHomeId(),null);
    }