mac
2024-06-21 bf27f4339722c3c00f8600bd3952c74ecafa5fdd
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -167,6 +167,20 @@
            } else if (HDLUniMP.UNI_EVENT_REPLY_HOME_MODEL.equals(topic)) {
                //住宅模块
                switch (type) {
                    //扫码添加电站
                    case HDLUniMP.UNI_EVENT_REPLY_HOME_ADD: {
                        String url = getKeyValue("url", getKeyValue("data", data));
                        //EventBus事件分发
                        HdlCommonLogic.getInstance().postEventBusSticky(
                                HDLUniMP.UNI_EVENT_REPLY_HOME_ADD,
                                HDLUniMP.UNI_EVENT_REPLY_HOME_ADD,
                                url);
                        if (callback != null) {
                            uniSuccessCallback(type, null, callback);
                        }
                    }
                    break;
                    //创建电站
                    case HDLUniMP.UNI_EVENT_REPLY_HOME_CREATION: {
                        //EventBus事件分发
@@ -174,11 +188,17 @@
                                HDLUniMP.UNI_EVENT_REPLY_HOME_MODEL,
                                HDLUniMP.UNI_EVENT_REPLY_HOME_CREATION,
                                getKeyValue("data", data));
                        if (callback != null) {
                            uniSuccessCallback(type, null, callback);
                        }
                    }
                    break;
                    //读取详情
                    case HDLUniMP.UNI_EVENT_REPLY_HOME_DETAILS: {
                        if (callback != null) {
                            uniSuccessCallback(type, null, callback);
                        }
                    }
                    break;
                    //电站删除
@@ -194,6 +214,9 @@
//                                HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE,
//                                LowerTagType.power_station.toString(),
//                                getKeyValue("data", data));
                        if (callback != null) {
                            uniSuccessCallback(type, null, callback);
                        }
                    }
                    break;
                    //住宅【电站】编辑
@@ -203,12 +226,14 @@
                                HDLUniMP.UNI_EVENT_REPLY_HOME_MODEL,
                                HDLUniMP.UNI_EVENT_REPLY_HOME_EDIT,
                                getKeyValue("data", data));
                        if (callback != null) {
                            uniSuccessCallback(type, null, callback);
                        }
                    }
                    break;
                    //电站的交付二维码(安装商)
                    case HDLUniMP.UNI_EVENT_REPLY_HOME_DELIVERYURLQRCODE: {
                        uniGetDeliveryUrlQrcode(type, data, callback);
                    }
                    break;
                    //电站手动交付(安装商)
@@ -224,10 +249,9 @@
                    }
                    break;
                }
                if (callback != null) {
                    uniSuccessCallback(type, null, callback);
                }
            } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_MODEL.equals(topic)) {
                //设备模块
                switch (type) {
@@ -762,10 +786,10 @@
     */
    private void uniGetStaffEdit(String type, Object data, DCUniMPJSCallback callback) {
        StaffBean staffBean = new StaffBean();
        String member_info = getKeyValue("staffInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(member_info)) {
        String staffInfo = getKeyValue("staffInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(staffInfo)) {
            try {
                staffBean = new Gson().fromJson(member_info, StaffBean.class);
                staffBean = new Gson().fromJson(staffInfo, StaffBean.class);
            } catch (Exception ignored) {
            }
        }
@@ -787,10 +811,10 @@
     */
    private void uniGetStaffDelete(String type, Object data, DCUniMPJSCallback callback) {
        StaffBean staffBean = new StaffBean();
        String member_info = getKeyValue("staffInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(member_info)) {
        String staffInfo = getKeyValue("staffInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(staffInfo)) {
            try {
                staffBean = new Gson().fromJson(member_info, StaffBean.class);
                staffBean = new Gson().fromJson(staffInfo, StaffBean.class);
            } catch (Exception ignored) {
            }
        }
@@ -812,10 +836,10 @@
     */
    private void uniGetStaffAdd(String type, Object data, DCUniMPJSCallback callback) {
        StaffBean staffBean = new StaffBean();
        String member_info = getKeyValue("staffInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(member_info)) {
        String staffInfo = getKeyValue("staffInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(staffInfo)) {
            try {
                staffBean = new Gson().fromJson(member_info, StaffBean.class);
                staffBean = new Gson().fromJson(staffInfo, StaffBean.class);
            } catch (Exception ignored) {
            }
        }
@@ -856,10 +880,10 @@
     */
    private void uniGetMemberEdit(String type, Object data, DCUniMPJSCallback callback) {
        MemberBean memberBean = new MemberBean();
        String member_info = getKeyValue("memberInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(member_info)) {
        String memberInfo = getKeyValue("memberInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(memberInfo)) {
            try {
                memberBean = new Gson().fromJson(member_info, MemberBean.class);
                memberBean = new Gson().fromJson(memberInfo, MemberBean.class);
            } catch (Exception ignored) {
            }
        }
@@ -881,10 +905,10 @@
     */
    private void uniGetMemberDelete(String type, Object data, DCUniMPJSCallback callback) {
        MemberBean memberBean = new MemberBean();
        String member_info = getKeyValue("memberInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(member_info)) {
        String memberInfo = getKeyValue("memberInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(memberInfo)) {
            try {
                memberBean = new Gson().fromJson(member_info, MemberBean.class);
                memberBean = new Gson().fromJson(memberInfo, MemberBean.class);
            } catch (Exception ignored) {
            }
        }
@@ -906,10 +930,10 @@
     */
    private void uniGetMemberAdd(String type, Object data, DCUniMPJSCallback callback) {
        MemberBean memberBean = new MemberBean();
        String member_info = getKeyValue("memberInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(member_info)) {
        String memberInfo = getKeyValue("memberInfo", getKeyValue("data", data));
        if (!TextUtils.isEmpty(memberInfo)) {
            try {
                memberBean = new Gson().fromJson(member_info, MemberBean.class);
                memberBean = new Gson().fromJson(memberInfo, MemberBean.class);
            } catch (Exception ignored) {
            }
        }
@@ -2386,12 +2410,11 @@
            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);
            HdlLogLogic.print("回复---uni---" + type + "---" + e.getMessage(), true);
        }
    }