| | |
| | | * @param pageSize 页数(一页多少数据) |
| | | * @param cloudCallBeak - |
| | | */ |
| | | public void getStaffList(long pageNo, long pageSize, CloudCallBeak<PageNumberObject<List<StaffBean>>> cloudCallBeak) { |
| | | public void getStaffList(long pageNo, long pageSize, CloudCallBeak<PageNumberObject<StaffBean>> cloudCallBeak) { |
| | | String requestUrl = HttpApi.B_POST_GET_LISTBYPAGE; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("pageNo", pageNo); |
| | | json.addProperty("pageSize", pageNo); |
| | | json.addProperty("pageSize", pageSize); |
| | | HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String jsonStr) { |
| | |
| | | } |
| | | } |
| | | Gson gson = new Gson(); |
| | | Type type = new TypeToken<PageNumberObject<List<StaffBean>>>() { |
| | | Type type = new TypeToken<PageNumberObject<StaffBean>>() { |
| | | }.getType(); |
| | | PageNumberObject<List<StaffBean>> pageNumberObject = gson.fromJson(jsonStr, type); |
| | | PageNumberObject<StaffBean> pageNumberObject = gson.fromJson(jsonStr, type); |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(pageNumberObject); |
| | | } |
| | |
| | | * @param userId - |
| | | * @param cloudCallBeak - |
| | | */ |
| | | public void getStaffInfo(String userId, CloudCallBeak<PageNumberObject<StaffBean>> cloudCallBeak) { |
| | | public void getStaffInfo(String userId, CloudCallBeak<StaffBean> cloudCallBeak) { |
| | | String requestUrl = HttpApi.B_POST_GET_MANAGE_INFO; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("userId", userId); |
| | |
| | | public void onSuccess(String jsonStr) { |
| | | if (TextUtils.isEmpty(jsonStr)) { |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(new PageNumberObject<>()); |
| | | cloudCallBeak.onSuccess(new StaffBean()); |
| | | } |
| | | } |
| | | Gson gson = new Gson(); |
| | | Type type = new TypeToken<PageNumberObject<StaffBean>>() { |
| | | }.getType(); |
| | | PageNumberObject<StaffBean> pageNumberObject = gson.fromJson(jsonStr, type); |
| | | |
| | | StaffBean staffBean = gson.fromJson(jsonStr, StaffBean.class); |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(pageNumberObject); |
| | | cloudCallBeak.onSuccess(staffBean); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取电站交付二维码(B端) |
| | | * 描述:安装商电站的交付二维码 |
| | | * |
| | | * @param homeId 电站id |
| | | * @param cloudCallBeak - |
| | | */ |
| | | public void getDeliveryUrlQrcode(String homeId, CloudCallBeak<String> cloudCallBeak) { |
| | | String requestUrl = HttpApi.POST_getDeliveryUrlQrcode; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("homeId", homeId); |
| | | // json.addProperty("zoneType", memberBean.getId());//区域 |
| | | |
| | | HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String jsonStr) { |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(jsonStr); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onFailure(e); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 电站手动交付(B端) |
| | | * 描述:安装商手动交付电站给指定的C端账号 |
| | | * |
| | | * @param homeId 电站id |
| | | * @param account C端账号 |
| | | * @param cloudCallBeak - |
| | | */ |
| | | public void getDeliverToAccount(String homeId, String account, CloudCallBeak<Boolean> cloudCallBeak) { |
| | | String requestUrl = HttpApi.POST_deliverToAccount; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("homeId", homeId); |
| | | json.addProperty("account", account);//C端账号 |
| | | // json.addProperty("zoneType", memberBean.getId());//区域 |
| | | |
| | | HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String jsonStr) { |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(true); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onFailure(e); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取成员列表(C端) |
| | |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加成员(C端) |
| | |
| | | json.addProperty("homeId", memberBean.getHomeId()); |
| | | json.addProperty("childAccountId", memberBean.getChildAccountId()); |
| | | json.addProperty("childId", memberBean.getId());//查找子账号接口获取到的数据(主键id==childId) |
| | | |
| | | HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() { |
| | | @Override |
| | | public void onSuccess(String jsonStr) { |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onSuccess(true); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(HDLException e) { |
| | | if (cloudCallBeak != null) { |
| | | cloudCallBeak.onFailure(e); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 电站授权安装商(C端) |
| | | * 描述:交付后的住宅,C端用户可以开启授权后安装商可以继续调试电站 |
| | | * |
| | | * @param homeId 电站id |
| | | * @param debugPerm 授权状态(true可以继续调试) |
| | | * @param cloudCallBeak - |
| | | */ |
| | | public void homeUpdateDebugPerm(String homeId, boolean debugPerm, CloudCallBeak<Boolean> cloudCallBeak) { |
| | | String requestUrl = HttpApi.C_POST_HOME_UPDATEDEBUGPERM; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("homeId", homeId); |
| | | json.addProperty("debugPerm", debugPerm); |
| | | // json.addProperty("zoneType", memberBean.getId());//区域 |
| | | |
| | | HttpClient.getInstance().requestHttp(requestUrl, json.toString(), new CloudCallBeak<String>() { |
| | | @Override |