| | |
| | | } 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事件分发 |
| | |
| | | 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; |
| | | //电站删除 |
| | |
| | | // HDLUniMP.UNI_EVENT_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE, |
| | | // LowerTagType.power_station.toString(), |
| | | // getKeyValue("data", data)); |
| | | if (callback != null) { |
| | | uniSuccessCallback(type, null, callback); |
| | | } |
| | | } |
| | | break; |
| | | //住宅【电站】编辑 |
| | |
| | | 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; |
| | | //电站手动交付(安装商) |
| | |
| | | } |
| | | break; |
| | | |
| | | |
| | | } |
| | | if (callback != null) { |
| | | uniSuccessCallback(type, null, callback); |
| | | } |
| | | |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_MODEL.equals(topic)) { |
| | | //设备模块 |
| | | switch (type) { |
| | |
| | | */ |
| | | 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) { |
| | | } |
| | | } |
| | |
| | | */ |
| | | 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) { |
| | | } |
| | | } |
| | |
| | | */ |
| | | 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) { |
| | | } |
| | | } |
| | |
| | | */ |
| | | 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) { |
| | | } |
| | | } |
| | |
| | | */ |
| | | 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) { |
| | | } |
| | | } |
| | |
| | | */ |
| | | 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) { |
| | | } |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |
| | | |