wjc
2023-06-12 390261037c530be2a59e99a93ed44f6817d0d006
2023年06月12日21:18:47

更新一下代码
5个文件已添加
5个文件已修改
872 ■■■■■ 已修改文件
app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java 227 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterChildDeviceBean.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterDeviceBean.java 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/bean/InverterDeviceBean.java 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/ui/bean/OidBean.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java
@@ -1,7 +1,9 @@
package com.hdl.photovoltaic.internet.api;
public class HttpApi {
    /*-----用户管理---------*/
    /**
     * -----用户管理---------
     */
    //获取账号区域信息
    public static final String POST_RegionByUserAccount = "/smart-footstone/region/regionByUserAccount";
    //登录接口
@@ -25,7 +27,9 @@
    //查询图片路径
    public static final String POST_GET_IMAGE_URL = "/home-wisdom/app/images/get_image_url";
    /*-----电站列表---------*/
    /**
     * ------电站管理(住宅)--------
     */
    //电站列表
    public static final String POST_PowerStation_List = "/home-wisdom/app/powerStation/page";
    //电站创建
@@ -37,4 +41,19 @@
    //电站编辑
    public static final String POST_PowerStation_Edit = "/home-wisdom/app/powerStation/edit";
    /**
     * ------设备管理--------
     */
    //添加逆变器
    public static final String POST_Device_Add = "/home-wisdom/app/device/independentRegister";
    //获取逆变器列表
    public static final String POST_Device_List = "/home-wisdom/app/device/inverter/list";
    //删除逆变器
    public static final String POST_Device_Remove = "/home-wisdom/app/device/remove";
    //获取下挂设备列表
    public static final String POST_Device_ChildDevices_List = "/home-wisdom/app/powerStation/childDevices";
    //全量更新OID
    public static final String POST_Device_Oid = "/home-wisdom/program/device/oid/add";
}
app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java
@@ -17,12 +17,17 @@
import java.util.regex.Pattern;
/**
 * 登陆界面的逻辑
 * 登录界面的逻辑
 */
public class HdlAccountLogic {
    private static volatile HdlAccountLogic sHdlAccountLogic;
    /**
     * 获取当前对象
     *
     * @return HdlAccountLogic
     */
    public static synchronized HdlAccountLogic getInstance() {
        if (sHdlAccountLogic == null) {
            synchronized (HdlAccountLogic.class) {
@@ -48,14 +53,12 @@
        HttpClient.getInstance().requestFullHttp(full, jsonObject.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                if (httpResponsePack.getData() != null) {
                if (httpResponsePack != null && httpResponsePack.getData() != null) {
                    Gson gson = new Gson();
                    String json = gson.toJson(httpResponsePack.getData());
                    LoginUserRegionBean loginUserRegionBean = new Gson().fromJson(json, LoginUserRegionBean.class);
                    if (cloudCallBeak != null) {
                        cloudCallBeak.onSuccess(loginUserRegionBean);
                    } else {
                        cloudCallBeak.onFailure(new Exception());
                    }
                }
            }
@@ -88,15 +91,13 @@
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                if (httpResponsePack.getData() != null) {
                if (httpResponsePack != null && httpResponsePack.getData() != null) {
                    Gson gson = new Gson();
                    String json = gson.toJson(httpResponsePack.getData());
                    LoginBean loginBean = new Gson().fromJson(json, LoginBean.class);
                    saveUserData(loginBean);
                    if (cloudCallBeak != null) {
                        cloudCallBeak.onSuccess(loginBean);
                    } else {
                        cloudCallBeak.onFailure(new Exception());
                    }
                }
            }
app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java
New file
@@ -0,0 +1,227 @@
package com.hdl.photovoltaic.other;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.hdl.photovoltaic.bean.HttpResponsePack;
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.CloudInverterChildDeviceBean;
import com.hdl.photovoltaic.ui.bean.CloudInverterDeviceBean;
import com.hdl.photovoltaic.ui.bean.InverterDeviceBean;
import com.hdl.photovoltaic.ui.bean.OidBean;
import java.lang.reflect.Type;
import java.util.List;
/**
 * 设备逻辑的界面
 */
public class HdlDeviceLogic {
    private static volatile HdlDeviceLogic sHdlDeviceLogic;
    /**
     * 获取当前对象
     *
     * @return HdlDeviceLogic
     */
    public static synchronized HdlDeviceLogic getInstance() {
        if (sHdlDeviceLogic == null) {
            synchronized (HdlDeviceLogic.class) {
                if (sHdlDeviceLogic == null) {
                    sHdlDeviceLogic = new HdlDeviceLogic();
                }
            }
        }
        return sHdlDeviceLogic;
    }
    /**
     * 添加逆变器
     *
     * @param inverterDeviceBean 逆变器对象
     * @param cloudCallBeak      回调
     */
    public void addInverterDevice(InverterDeviceBean inverterDeviceBean, CloudCallBeak<Boolean> cloudCallBeak) {
        String requestUrl = HttpApi.POST_Device_Add;
        JsonObject json = new JsonObject();
        json.addProperty("homeId", UserConfigManage.getInstance().getHomeId());
        json.addProperty("mac", inverterDeviceBean.getDevice_mac());
        json.addProperty("spk", inverterDeviceBean.getGateway_type());
        json.addProperty("sid", inverterDeviceBean.getSid());
        json.addProperty("oid", inverterDeviceBean.getOid());
        json.addProperty("name", inverterDeviceBean.getDevice_name());
        // json.addProperty("zoneType", "password");//区域
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                if (cloudCallBeak != null) {
                    cloudCallBeak.onSuccess(true);
                }
            }
            @Override
            public void onFailure(Exception exception) {
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
    }
    /**
     * 获取逆变器列表
     *
     * @param inverterDeviceBean 逆变器对象
     * @param cloudCallBeak      回调
     */
    public void getInverterDeviceList(InverterDeviceBean inverterDeviceBean, CloudCallBeak<CloudInverterDeviceBean> cloudCallBeak) {
        String requestUrl = HttpApi.POST_Device_List;
        JsonObject json = new JsonObject();
        json.addProperty("homeId", UserConfigManage.getInstance().getHomeId());
        // json.addProperty("zoneType", "password");//区域
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                if (httpResponsePack != null && httpResponsePack.getData() != null) {
                    Gson gson = new Gson();
                    String json = gson.toJson(httpResponsePack.getData());
                    CloudInverterDeviceBean loginUserRegionBean = new Gson().fromJson(json, CloudInverterDeviceBean.class);
                    if (cloudCallBeak != null) {
                        cloudCallBeak.onSuccess(loginUserRegionBean);
                    }
                }
            }
            @Override
            public void onFailure(Exception exception) {
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
    }
    /**
     * 删除逆变器
     *
     * @param deviceId      设备id
     * @param cloudCallBeak 回调
     */
    public void delInverterDevice(String deviceId, CloudCallBeak<Boolean> cloudCallBeak) {
        String requestUrl = HttpApi.POST_Device_Remove;
        JsonObject json = new JsonObject();
        json.addProperty("homeId", UserConfigManage.getInstance().getHomeId());
        json.addProperty("deviceId", deviceId);
        // json.addProperty("zoneType", "password");//区域
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                if (cloudCallBeak != null) {
                    cloudCallBeak.onSuccess(true);
                }
            }
            @Override
            public void onFailure(Exception exception) {
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
    }
    /**
     * 获取逆变器下挂设备列表
     *
     * @param parentOid     上级设备的Oid
     * @param cloudCallBeak 回调
     */
    public void getInverterDeviceChildDeviceList(String parentOid, CloudCallBeak<List<CloudInverterChildDeviceBean>> cloudCallBeak) {
        String requestUrl = HttpApi.POST_Device_ChildDevices_List;
        JsonObject json = new JsonObject();
        json.addProperty("homeId", UserConfigManage.getInstance().getHomeId());
        json.addProperty("parentOid", parentOid);
        // json.addProperty("zoneType", "password");//区域
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                if (httpResponsePack != null && httpResponsePack.getData() != null) {
                    Gson gson = new Gson();
                    String json = gson.toJson(httpResponsePack.getData());
                    Type typeOfT = new TypeToken<List<CloudInverterChildDeviceBean>>() {
                    }.getType();
                    List<CloudInverterChildDeviceBean> list = gson.fromJson(json, typeOfT);
                    if (cloudCallBeak != null) {
                        cloudCallBeak.onSuccess(list);
                    }
                }
            }
            @Override
            public void onFailure(Exception exception) {
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
    }
    /**
     * 全量更新OID
     *
     * @param oidList       oid列表
     * @param cloudCallBeak 回调
     */
    public void fullRenewalOid(List<OidBean> oidList, CloudCallBeak<Boolean> cloudCallBeak) {
        String requestUrl = HttpApi.POST_Device_ChildDevices_List;
        JsonObject json = new JsonObject();
        json.addProperty("operationSource", "PROGRAM_ENERGY");//
        json.addProperty("homeId", UserConfigManage.getInstance().getHomeId());
        JsonArray jsonArray = new JsonArray();
        for (int i = 0; i < oidList.size(); i++) {
            OidBean oidBean = oidList.get(i);
            JsonObject jsonObject = new JsonObject();
            jsonObject.addProperty("protocolType", oidBean.getProtocolType());
            jsonObject.addProperty("deviceType", oidBean.getDeviceType());
            jsonObject.addProperty("mac", oidBean.getMac());
            jsonObject.addProperty("oid", oidBean.getOid());
            jsonObject.addProperty("device_name", oidBean.getDevice_name());
            jsonObject.addProperty("device_model", oidBean.getDevice_model());
            jsonObject.addProperty("addresses", oidBean.getAddresses());
            jsonObject.addProperty("parentOid", oidBean.getParentOid());
            jsonArray.add(jsonObject);
        }
        json.add("devices", jsonArray);
        // json.addProperty("zoneType", "password");//区域
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                if (cloudCallBeak != null) {
                    cloudCallBeak.onSuccess(true);
                }
            }
            @Override
            public void onFailure(Exception exception) {
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
    }
}
app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java
@@ -13,10 +13,18 @@
import java.io.FileOutputStream;
import java.io.IOException;
/**
 * 文件界面的逻辑
 */
public class HdlFileLogic {
    private static volatile HdlFileLogic sHdlFileLogic;
    /**
     * 获取当前对象
     *
     * @return HdlFileLogic
     */
    public static synchronized HdlFileLogic getInstance() {
        if (sHdlFileLogic == null) {
            synchronized (HdlFileLogic.class) {
app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java
@@ -9,6 +9,11 @@
    private static volatile HdlLogLogic sHdlLogLogic;
    /**
     * 获取当前对象
     *
     * @return HdlLogLogic
     */
    public static synchronized HdlLogLogic getInstance() {
        if (sHdlLogLogic == null) {
            synchronized (HdlLogLogic.class) {
@@ -23,9 +28,6 @@
    public static void print(String tag, String mgs) {
        Log.d(tag, mgs);
    }
}
app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java
@@ -14,10 +14,18 @@
import java.util.ArrayList;
import java.util.List;
/**
 * 住宅逻辑界面
 */
public class HdlResidenceLogic {
    private static volatile HdlResidenceLogic sHdlResidenceLogic;
    /**
     * 获取当前对象
     *
     * @return HdlResidenceLogic
     */
    public static synchronized HdlResidenceLogic getInstance() {
        if (sHdlResidenceLogic == null) {
            synchronized (HdlResidenceLogic.class) {
@@ -79,22 +87,20 @@
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                if (httpResponsePack != null) {
                    if (httpResponsePack.getData() != null) {
                        Gson gson = new Gson();
                        String jsonStr = gson.toJson(httpResponsePack.getData().toString());
                        HouseInfoBeanClass houseInfoBeanClass = gson.fromJson(jsonStr, HouseInfoBeanClass.class);
                        houseList.addAll(houseInfoBeanClass.getList());
                        //总共有多少页
                        long totalPage = houseInfoBeanClass.totalPage;
                        if (totalPage == houseInfoBeanClass.getPageNo()) {
                if (httpResponsePack != null && httpResponsePack.getData() != null) {
                    Gson gson = new Gson();
                    String jsonStr = gson.toJson(httpResponsePack.getData().toString());
                    HouseInfoBeanClass houseInfoBeanClass = gson.fromJson(jsonStr, HouseInfoBeanClass.class);
                    houseList.addAll(houseInfoBeanClass.getList());
                    //总共有多少页
                    long totalPage = houseInfoBeanClass.totalPage;
                    if (totalPage == houseInfoBeanClass.getPageNo()) {
                        if (cloudCallBeak != null) {
                            cloudCallBeak.onSuccess(true);
                            return;
                        }
                        getResidenceList(pageNo + 1, 100, cloudCallBeak);
                    } else {
                        cloudCallBeak.onSuccess(false);
                        return;
                    }
                    getResidenceList(pageNo + 1, 100, cloudCallBeak);
                }
            }
@@ -102,7 +108,9 @@
            @Override
            public void onFailure(Exception exception) {
                cloudCallBeak.onFailure(exception);
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
    }
@@ -115,29 +123,28 @@
     * @param cloudCallBeak 回调
     */
    public void getResidenceInfo(String homeId, CloudCallBeak<HouseInfoBean> cloudCallBeak) {
        String requestUrl = HttpApi.POST_GET_MEMBER_INFO;
        String requestUrl = HttpApi.POST_PowerStation_Info;
        JsonObject json = new JsonObject();
        json.addProperty("homeId", homeId);//电站id
        //json.addProperty("zoneType", "password");//区域
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                if (httpResponsePack != null) {
                    if (httpResponsePack.getData() != null) {
                        Gson gson = new Gson();
                        String jsonStr = gson.toJson(httpResponsePack.getData().toString());
                        HouseInfoBean houseInfoBean = gson.fromJson(jsonStr, HouseInfoBean.class);
                if (httpResponsePack != null && httpResponsePack.getData() != null) {
                    Gson gson = new Gson();
                    String jsonStr = gson.toJson(httpResponsePack.getData().toString());
                    HouseInfoBean houseInfoBean = gson.fromJson(jsonStr, HouseInfoBean.class);
                    if (cloudCallBeak != null) {
                        cloudCallBeak.onSuccess(houseInfoBean);
                    } else {
                        cloudCallBeak.onSuccess(null);
                    }
                }
            }
            @Override
            public void onFailure(Exception exception) {
                cloudCallBeak.onFailure(exception);
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
@@ -152,7 +159,7 @@
     * @param cloudCallBeak -
     */
    public void editResidence(HouseInfoBean houseInfoBean, CloudCallBeak<Boolean> cloudCallBeak) {
        String requestUrl = HttpApi.POST_PowerStation_Create;
        String requestUrl = HttpApi.POST_PowerStation_Edit;
        JsonObject json = new JsonObject();
        JsonObject location = new JsonObject();
        json.addProperty("homeId", houseInfoBean.getHomeId());
@@ -179,13 +186,17 @@
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                cloudCallBeak.onSuccess(true);
                if (cloudCallBeak != null) {
                    cloudCallBeak.onSuccess(true);
                }
            }
            @Override
            public void onFailure(Exception exception) {
                cloudCallBeak.onFailure(exception);
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
    }
@@ -204,13 +215,17 @@
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                cloudCallBeak.onSuccess(true);
                if (cloudCallBeak != null) {
                    cloudCallBeak.onSuccess(true);
                }
            }
            @Override
            public void onFailure(Exception exception) {
                cloudCallBeak.onFailure(exception);
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
@@ -250,19 +265,24 @@
        HttpClient.getInstance().requestHttp(requestUrl, json.toString(), true, true, new BaseSuccessFailureCallBeak() {
            @Override
            public void onSuccess(HttpResponsePack httpResponsePack) {
                cloudCallBeak.onSuccess(true);
                if (cloudCallBeak != null) {
                    cloudCallBeak.onSuccess(true);
                }
            }
            @Override
            public void onFailure(Exception exception) {
                cloudCallBeak.onFailure(exception);
                if (cloudCallBeak != null) {
                    cloudCallBeak.onFailure(exception);
                }
            }
        });
    }
    static class HouseInfoBeanClass {
        //总条数
app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterChildDeviceBean.java
New file
@@ -0,0 +1,90 @@
package com.hdl.photovoltaic.ui.bean;
import java.io.Serializable;
public class CloudInverterChildDeviceBean implements Serializable {
    private String deviceOidId;//设备Oid id
    private String deviceName;//设备名称
    private String oid;//
    private String deviceModel;//设备型号
    private String mac;//
    private String addresses;//子网号/设备号
    private String soc;//soc
    private String chargeToDay;//当日充电
    private String dischargeToDay;//当日放电
    public String getDeviceOidId() {
        return deviceOidId == null ? "" : deviceOidId;
    }
    public void setDeviceOidId(String deviceOidId) {
        this.deviceOidId = deviceOidId;
    }
    public String getDeviceName() {
        return deviceName == null ? "" : deviceName;
    }
    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }
    public String getOid() {
        return oid == null ? "" : oid;
    }
    public void setOid(String oid) {
        this.oid = oid;
    }
    public String getDeviceModel() {
        return deviceModel == null ? "" : deviceModel;
    }
    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }
    public String getMac() {
        return mac == null ? "" : mac;
    }
    public void setMac(String mac) {
        this.mac = mac;
    }
    public String getAddresses() {
        return addresses == null ? "" : addresses;
    }
    public void setAddresses(String addresses) {
        this.addresses = addresses;
    }
    public String getSoc() {
        return soc == null ? "" : soc;
    }
    public void setSoc(String soc) {
        this.soc = soc;
    }
    public String getChargeToDay() {
        return chargeToDay == null ? "" : chargeToDay;
    }
    public void setChargeToDay(String chargeToDay) {
        this.chargeToDay = chargeToDay;
    }
    public String getDischargeToDay() {
        return dischargeToDay == null ? "" : dischargeToDay;
    }
    public void setDischargeToDay(String dischargeToDay) {
        this.dischargeToDay = dischargeToDay;
    }
}
app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterDeviceBean.java
New file
@@ -0,0 +1,153 @@
package com.hdl.photovoltaic.ui.bean;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
public class CloudInverterDeviceBean implements Serializable {
    private String gatewayId;//网关Id
    private String gatewayName;//网关名称
    private String deviceId;//设备id
    private String name;//设备名称
    private String spk;
    private String spkName;//
    private String sid;
    private String oid;
    private String omodel;//设备型号
    private String osn;//设备sn(mac)
    private String powerPvNow;//发电功率
    private String totalElectricityPvToday;//今日发电量
    private String inv;//inv状态
    private int deviceStatus;//1:待机,2:连接中,3:故障,4:运行,5:离线
    private String addresses;
    private Map<String, String> status;
    public String getGatewayId() {
        return gatewayId == null ? "" : gatewayId;
    }
    public void setGatewayId(String gatewayId) {
        this.gatewayId = gatewayId;
    }
    public String getGatewayName() {
        return gatewayName == null ? "" : gatewayName;
    }
    public void setGatewayName(String gatewayName) {
        this.gatewayName = gatewayName;
    }
    public String getDeviceId() {
        return deviceId == null ? "" : deviceId;
    }
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
    public String getName() {
        return name == null ? "" : name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getSpk() {
        return spk == null ? "" : spk;
    }
    public void setSpk(String spk) {
        this.spk = spk;
    }
    public String getSpkName() {
        return spkName == null ? "" : spkName;
    }
    public void setSpkName(String spkName) {
        this.spkName = spkName;
    }
    public String getSid() {
        return sid == null ? "" : sid;
    }
    public void setSid(String sid) {
        this.sid = sid;
    }
    public String getOid() {
        return oid == null ? "" : oid;
    }
    public void setOid(String oid) {
        this.oid = oid;
    }
    public String getOmodel() {
        return omodel == null ? "" : omodel;
    }
    public void setOmodel(String omodel) {
        this.omodel = omodel;
    }
    public String getOsn() {
        return osn == null ? "" : osn;
    }
    public void setOsn(String osn) {
        this.osn = osn;
    }
    public String getPowerPvNow() {
        return powerPvNow == null ? "" : powerPvNow;
    }
    public void setPowerPvNow(String powerPvNow) {
        this.powerPvNow = powerPvNow;
    }
    public String getTotalElectricityPvToday() {
        return totalElectricityPvToday == null ? "" : totalElectricityPvToday;
    }
    public void setTotalElectricityPvToday(String totalElectricityPvToday) {
        this.totalElectricityPvToday = totalElectricityPvToday;
    }
    public String getInv() {
        return inv == null ? "" : inv;
    }
    public void setInv(String inv) {
        this.inv = inv;
    }
    public int getDeviceStatus() {
        return deviceStatus;
    }
    public void setDeviceStatus(int deviceStatus) {
        this.deviceStatus = deviceStatus;
    }
    public String getAddresses() {
        return addresses == null ? "" : addresses;
    }
    public void setAddresses(String addresses) {
        this.addresses = addresses;
    }
    public Map<String, String> getStatus() {
        return status == null ? new HashMap<>() : status;
    }
    public void setStatus(Map<String, String> status) {
        this.status = status;
    }
}
app/src/main/java/com/hdl/photovoltaic/ui/bean/InverterDeviceBean.java
New file
@@ -0,0 +1,185 @@
package com.hdl.photovoltaic.ui.bean;
import java.io.Serializable;
public class InverterDeviceBean implements Serializable {
    //true-在线,false-离线
    private boolean online;
    //型号
    private String device_model;
    //网关备注
    private String device_name;
    //网关Mac
    private String device_mac;
    //网关Id
    private String gatewayId;
    //网关类型
    private String gatewayType;
    private String gateway_type;
    //oid
    private String oid;
    //IP地址
    private String ip_address;
    //连接的网关类型 LAN WIFI
    private String access_mode;
    //是否主网关 true false
    private String master;
    //是否加密
    private boolean isLocalEncrypt;
    //是否本地网关
    private boolean isLocalGateWay;
    //住宅Id
    private String homeId;
    //使用mqtt的时候需要解密
    private String aesKey;
    private String deviceId;
    //sid
    private String sid;
    //设备来源(自定义:0=表示网关;1=表示平台)
    private String src;
    public boolean isOnline() {
        return online;
    }
    public void setOnline(boolean online) {
        this.online = online;
    }
    public String getDevice_model() {
        return device_model == null ? "" : device_model;
    }
    public void setDevice_model(String device_model) {
        this.device_model = device_model;
    }
    public String getDevice_name() {
        return device_name == null ? "" : device_name;
    }
    public void setDevice_name(String device_name) {
        this.device_name = device_name;
    }
    public String getDevice_mac() {
        return device_mac == null ? "" : device_mac;
    }
    public void setDevice_mac(String device_mac) {
        this.device_mac = device_mac;
    }
    public String getGatewayId() {
        return gatewayId == null ? "" : gatewayId;
    }
    public void setGatewayId(String gatewayId) {
        this.gatewayId = gatewayId;
    }
    public String getGatewayType() {
        return gatewayType == null ? "" : gatewayType;
    }
    public void setGatewayType(String gatewayType) {
        this.gatewayType = gatewayType;
    }
    public String getGateway_type() {
        return gateway_type == null ? "" : gateway_type;
    }
    public void setGateway_type(String gateway_type) {
        this.gateway_type = gateway_type;
    }
    public String getOid() {
        return oid == null ? "" : oid;
    }
    public void setOid(String oid) {
        this.oid = oid;
    }
    public String getIp_address() {
        return ip_address == null ? "" : ip_address;
    }
    public void setIp_address(String ip_address) {
        this.ip_address = ip_address;
    }
    public String getAccess_mode() {
        return access_mode == null ? "" : access_mode;
    }
    public void setAccess_mode(String access_mode) {
        this.access_mode = access_mode;
    }
    public String getMaster() {
        return master == null ? "" : master;
    }
    public void setMaster(String master) {
        this.master = master;
    }
    public boolean isLocalEncrypt() {
        return isLocalEncrypt;
    }
    public void setLocalEncrypt(boolean localEncrypt) {
        isLocalEncrypt = localEncrypt;
    }
    public boolean isLocalGateWay() {
        return isLocalGateWay;
    }
    public void setLocalGateWay(boolean localGateWay) {
        isLocalGateWay = localGateWay;
    }
    public String getHomeId() {
        return homeId == null ? "" : homeId;
    }
    public void setHomeId(String homeId) {
        this.homeId = homeId;
    }
    public String getAesKey() {
        return aesKey == null ? "" : aesKey;
    }
    public void setAesKey(String aesKey) {
        this.aesKey = aesKey;
    }
    public String getDeviceId() {
        return deviceId == null ? "" : deviceId;
    }
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
    public String getSid() {
        return sid == null ? "" : sid;
    }
    public void setSid(String sid) {
        this.sid = sid;
    }
    public String getSrc() {
        return src == null ? "" : src;
    }
    public void setSrc(String src) {
        this.src = src;
    }
}
app/src/main/java/com/hdl/photovoltaic/ui/bean/OidBean.java
New file
@@ -0,0 +1,81 @@
package com.hdl.photovoltaic.ui.bean;
import java.io.Serializable;
public class OidBean implements Serializable {
    private String protocolType;//设备spk
    private int deviceType;//设备类型
    private String device_name;//设备名称
    private String oid;//设备oid
    private String addresses;//子网号设备号
    private String device_model;//设备型号
    private String mac;//设备mac/sn
    private String parentOid;//父设备id
    public String getProtocolType() {
        return protocolType == null ? "" : protocolType;
    }
    public void setProtocolType(String protocolType) {
        this.protocolType = protocolType;
    }
    public int getDeviceType() {
        return deviceType;
    }
    public void setDeviceType(int deviceType) {
        this.deviceType = deviceType;
    }
    public String getDevice_name() {
        return device_name == null ? "" : device_name;
    }
    public void setDevice_name(String device_name) {
        this.device_name = device_name;
    }
    public String getOid() {
        return oid == null ? "" : oid;
    }
    public void setOid(String oid) {
        this.oid = oid;
    }
    public String getAddresses() {
        return addresses == null ? "" : addresses;
    }
    public void setAddresses(String addresses) {
        this.addresses = addresses;
    }
    public String getDevice_model() {
        return device_model == null ? "" : device_model;
    }
    public void setDevice_model(String device_model) {
        this.device_model = device_model;
    }
    public String getMac() {
        return mac == null ? "" : mac;
    }
    public void setMac(String mac) {
        this.mac = mac;
    }
    public String getParentOid() {
        return parentOid == null ? "" : parentOid;
    }
    public void setParentOid(String parentOid) {
        this.parentOid = parentOid;
    }
}