From 390261037c530be2a59e99a93ed44f6817d0d006 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期一, 12 六月 2023 21:18:58 +0800 Subject: [PATCH] 2023年06月12日21:18:47 --- app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java | 8 app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java | 23 + app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterChildDeviceBean.java | 90 ++++++ app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterDeviceBean.java | 153 ++++++++++ app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java | 82 +++-- app/src/main/java/com/hdl/photovoltaic/ui/bean/OidBean.java | 81 +++++ app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java | 8 app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java | 15 app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java | 227 +++++++++++++++ app/src/main/java/com/hdl/photovoltaic/ui/bean/InverterDeviceBean.java | 185 ++++++++++++ 10 files changed, 829 insertions(+), 43 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java b/app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java index 833171e..d3ab6b3 100644 --- a/app/src/main/java/com/hdl/photovoltaic/internet/api/HttpApi.java +++ b/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"; + + } diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java index a3e2047..28b4233 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlAccountLogic.java +++ b/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()); } } } diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java new file mode 100644 index 0000000..c16a5ad --- /dev/null +++ b/app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java @@ -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 涓婄骇璁惧鐨凮id + * @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); + } + } + }); + } + +} diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java index a4454fe..958fb8b 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlFileLogic.java +++ b/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) { diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java index 3233896..741a0b8 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlLogLogic.java +++ b/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); } - - - } diff --git a/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java b/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java index ec5a1cf..0a4314e 100644 --- a/app/src/main/java/com/hdl/photovoltaic/other/HdlResidenceLogic.java +++ b/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 { //鎬绘潯鏁� diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterChildDeviceBean.java b/app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterChildDeviceBean.java new file mode 100644 index 0000000..af6f140 --- /dev/null +++ b/app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterChildDeviceBean.java @@ -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; + } + + +} diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterDeviceBean.java b/app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterDeviceBean.java new file mode 100644 index 0000000..7e11fc6 --- /dev/null +++ b/app/src/main/java/com/hdl/photovoltaic/ui/bean/CloudInverterDeviceBean.java @@ -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; + } +} diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/bean/InverterDeviceBean.java b/app/src/main/java/com/hdl/photovoltaic/ui/bean/InverterDeviceBean.java new file mode 100644 index 0000000..ba0274f --- /dev/null +++ b/app/src/main/java/com/hdl/photovoltaic/ui/bean/InverterDeviceBean.java @@ -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; + } +} diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/bean/OidBean.java b/app/src/main/java/com/hdl/photovoltaic/ui/bean/OidBean.java new file mode 100644 index 0000000..d154627 --- /dev/null +++ b/app/src/main/java/com/hdl/photovoltaic/ui/bean/OidBean.java @@ -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;//鐖惰澶噄d + + + 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; + } + +} -- Gitblit v1.8.0