hxb
2023-06-28 60f74b306659cba1a8ed7378f9df54a71e48a614
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -3,6 +3,7 @@
import android.text.TextUtils;
import com.alibaba.fastjson.JSON;
import com.google.gson.Gson;
import com.hdl.photovoltaic.HDLApp;
import com.hdl.photovoltaic.config.UserConfigManage;
@@ -10,19 +11,16 @@
import com.hdl.photovoltaic.ui.bean.HouseIdBean;
import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.photovoltaic.uni.HDLUniMPSDKManager;
import com.hdl.photovoltaic.uni.UniToAndroidBean;
import com.hdl.photovoltaic.utils.WifiUtils;
import com.hdl.sdk.link.HDLLinkLocalSdk;
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.sdk.link.core.callback.HDLLinkCallBack;
import com.hdl.sdk.link.core.config.HDLLinkConfig;
import com.hdl.sdk.link.gateway.HDLLinkLocalGateway;
import com.hdl.sdk.link.core.connect.HDLModBusConnect;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import io.dcloud.feature.unimp.DCUniMPJSCallback;
@@ -64,19 +62,11 @@
            if (!HDLUniMP.UNI_APP_ID.equals(appId)) {
                return;
            }
            org.json.JSONObject jsonObject = getJSONObject(data);
            String type_value = "";
            String oid="";
            if (jsonObject.has("type")) {
                type_value = jsonObject.getString("type");
            }
            if (jsonObject.has("oid")) {
                oid = jsonObject.getString("oid");
            }
            UniToAndroidBean uniToAndroidBean = com.alibaba.fastjson.JSONObject.parseObject(JSON.toJSONString(data), UniToAndroidBean.class);
            if (HDLUniMP.UNI_EVENT_REPLY_HOME_MODEL.equals(event)) {
                //住宅模块
                switch (type_value) {
                switch (uniToAndroidBean.getType()) {
                    case HDLUniMP.UNI_EVENT_REPLY_HOME_CREATION: {
                        //创建
                        HdlResidenceLogic.getInstance().getResidenceIdList("", "", new CloudCallBeak<List<HouseIdBean>>() {
@@ -104,7 +94,7 @@
                }
            } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_MODEL.equals(event)) {
                //设备模块
                switch (type_value) {
                switch (uniToAndroidBean.getType()) {
                    case HDLUniMP.UNI_EVENT_REPLY_DEVICE_ADD: {
                        //添加
                    }
@@ -131,14 +121,14 @@
                    break;
                    case HDLUniMP.UNI_EVENT_REPLY_DEVICE_MODBUS_SEND:{
                        //发送modbus协议
                        HDLModBusConnect.getInstance().Send(uniToAndroidBean.getGatewayOid(),null,);
                    }
                }
            } else if (HDLUniMP.UNI_EVENT_REPLY_WIFI_MODEL.equals(event)) {
                WifiUtils wifiUtils = new WifiUtils(HDLApp.getInstance());
                //wifi模块
                switch (type_value) {
                switch (uniToAndroidBean.getType()) {
                    case HDLUniMP.UNI_EVENT_REPLY_WIFI_LIST: {
                        //获取wifi列表
                        if (callback != null) {