mac
2024-03-20 5ca2b601848c62607d88fee5afdae6af80f6eea7
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -118,7 +118,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) {
@@ -126,6 +126,7 @@
                    case HDLUniMP.UNI_EVENT_REPLY_USER_INFO: {
                        this.uniGetUserInfo(mode_type, data, callback);
                    }
                    break;
                    //用户头像(旧平台逻辑是头像单独获取下载地址)
                    case HDLUniMP.UNI_EVENT_REPLY_USER_IMAGE: {
                        uniGetImageKey(mode_type, data, callback);
@@ -1123,6 +1124,7 @@
                UserConfigManage.getInstance().Save();
                //获取用户头像路径
                if (cUserInfo.getMemberHeadIcon().contains("http")) {
                    UserConfigManage.getInstance().setUserImageUrl(cUserInfo.getMemberHeadIcon());
                    //更新用户头像
                    uniCallbackData(type, cUserInfo, callback);
                } else {
@@ -1130,12 +1132,13 @@
                        @Override
                        public void onSuccess(String url) {
                            cUserInfo.setMemberHeadIcon(url);
                            UserConfigManage.getInstance().setUserImageUrl(cUserInfo.getMemberHeadIcon());
                            uniCallbackData(type, cUserInfo, callback);
                        }
                        @Override
                        public void onFailure(HDLException e) {
                            uniCallbackData(type, null, e.getCode(), e.getMsg(), callback);
                            uniCallbackData(type, cUserInfo, callback);
                        }
                    });
                }
@@ -1482,16 +1485,16 @@
                    }
                    return;
                }
                //进来住宅详情都要上传一次oid列表到云端;
                HdlDeviceLogic.getInstance().uploadDataToCloud(homeId, list, null);
                if (callback != null) {
                    uniCallbackData(type, list, callback);
                }
                //EventBus事件分发,进入住宅开始订阅主题
                BaseEventBus baseEventBus = new BaseEventBus();
                baseEventBus.setType(HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST);
                baseEventBus.setData(list);
                EventBus.getDefault().post(baseEventBus);
                if (callback != null) {
                    uniCallbackData(type, list, callback);
                }
                //进来住宅详情都要上传一次oid列表到云端;
                HdlDeviceLogic.getInstance().uploadDataToCloud(homeId, list, null);
            }
            @Override
@@ -1545,14 +1548,14 @@
            @Override
            public void onSuccess(int[] data) {
                uniCallbackData(type, data, callback);
                HdlLogLogic.print("uni--->接收--->ModBus--->" + Arrays.toString(data), true);
//                HdlLogLogic.print("uni--->接收--->ModBus--->" + Arrays.toString(data), true);
            }
            @Override
            public void onError(HDLLinkException e) {
                uniCallbackData(type, null, e.getCode(), e.getMsg(), callback);
                HdlLogLogic.print("uni--->接收--->ModBus--->" + e.getMsg() + "(" + e.getCode() + ")", true);
//                HdlLogLogic.print("uni--->接收--->ModBus--->" + e.getMsg() + "(" + e.getCode() + ")", true);
            }
        });
    }