wjc
2025-01-10 2e91f8abdcb87feda9e237895d4460a19fd7aed8
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -55,6 +55,7 @@
import com.hdl.photovoltaic.ui.bean.MemberBean;
import com.hdl.photovoltaic.ui.bean.NotRunBean;
import com.hdl.photovoltaic.ui.bean.OidBean;
import com.hdl.photovoltaic.ui.bean.QrcodeUrlBean;
import com.hdl.photovoltaic.ui.bean.StaffBean;
import com.hdl.photovoltaic.ui.bean.UnCountBean;
import com.hdl.photovoltaic.ui.bean.UserRightTypeBean;
@@ -147,7 +148,7 @@
            String type = getKeyValue("type", data);//小类
            String logTag = getKeyValue("logTag", data);//标记uni指令
            String mode_type = "大类-" + topic + "---" + "小类-" + type;//用来打印的
//            HdlLogLogic.print(logTag + ":" + "uni---发送---" + mode_type + "\r\n" + data, true);
            HdlLogLogic.print(logTag + ":" + "uni---发送---" + mode_type + "\r\n" + data, true);
            if (HDLUniMP.UNI_EVENT_REPLY_USER_MODEL.equals(topic)) {
                //用户模块
                switch (type) {
@@ -428,12 +429,18 @@
                    break;
                    //逆变器以太网配置
                    case HDLUniMP.UNI_EVENT_REPLY_DEVICE_ETHERNET_SET: {
                        uniGetAndSetNetwork(mode_type, data, TopicApi.DELETING_GATEWAY_ETHERNET_EDIT, callback);
                        if (callback != null) {
                            uniSuccessCallback(type, "", callback);
                        }
                        //uniGetAndSetNetwork(mode_type, data, TopicApi.DELETING_GATEWAY_ETHERNET_EDIT, callback);
                    }
                    break;
                    //逆变器以太网获取
                    case HDLUniMP.UNI_EVENT_REPLY_DEVICE_ETHERNET_GET: {
                        uniGetAndSetNetwork(mode_type, data, TopicApi.DELETING_GATEWAY_ETHERNET_GET, callback);
                        if (callback != null) {
                            uniSuccessCallback(type, "", callback);
                        }
                        //uniGetAndSetNetwork(mode_type, data, TopicApi.DELETING_GATEWAY_ETHERNET_GET, callback);
                    }
                    break;
@@ -845,7 +852,7 @@
    //region ******uni接口方法******
    /**
     * link进行密码验证
     * link进行本地密码登录验证
     */
    private void uniCheckPasswordVerification(String type, Object data, DCUniMPJSCallback callback) {
        String password = getKeyValue("password", getKeyValue("data", data));
@@ -1002,9 +1009,8 @@
            public void onSuccess(String obj) {
                try {
                    Gson g = new Gson();
                    JsonObject jObject = g.fromJson(obj, JsonObject.class);
                    String deliveryUrl = jObject.get("deliveryUrl").toString();
                    uniSuccessCallback(type, deliveryUrl, callback);
                    QrcodeUrlBean qrcodeUrlBean = g.fromJson(obj, QrcodeUrlBean.class);
                    uniSuccessCallback(type, qrcodeUrlBean.getDeliveryUrl(), callback);
                } catch (Exception ignored) {
                    uniSuccessCallback(type, obj, callback);
                }
@@ -2792,7 +2798,7 @@
        //HdlLogLogic.print("uni---发送---ModBus---" + Arrays.toString(modBusBean.getData()), true);
        //发送modbus协议
        long startTime = System.currentTimeMillis();
        HDLModBusConnect.getInstance().Send(modBusBean.getMac(), modBusBean.getData(), new ModbusCallBack() {
        HDLModBusConnect.getInstance().asyncSend(modBusBean.getMac(), modBusBean.getData(), new ModbusCallBack() {
            @Override
            public void onSuccess(int[] data) {
                uniSuccessCallback(type, data, callback);
@@ -2872,7 +2878,7 @@
            if (callback != null) {
                callback.invoke(getJSONObject(uniCallBackBaseBean));
//                callback.invoke(uniCallBackBaseBean);
//                HdlLogLogic.print("回复---uni---" + type + "---" + new Gson().toJson(uniCallBackBaseBean), true);
                HdlLogLogic.print("回复---uni---" + type + "---" + new Gson().toJson(uniCallBackBaseBean), true);
            }
        } catch (Exception e) {
            HdlLogLogic.print("回复---uni---" + type + "---" + e.getMessage(), true);