From 2d634416cc026d139d515d53b6fa56f73d253458 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 29 一月 2019 10:35:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java | 79 ++++++++++++++++++++++++--------------- 1 files changed, 49 insertions(+), 30 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java index b5f3d47..cb81a1d 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserInfoController.java @@ -1889,41 +1889,60 @@ */ @RequestMapping(value = "countMyTeam", method = RequestMethod.POST) public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) { + try { + long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1); + long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null); - long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1); - long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null); + long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1); + long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null); + JSONObject bossData = new JSONObject(); + ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid); + if (threeSale != null) { + UserInfo boss = threeSale.getBoss(); + if (boss != null) { + bossData.put("nickName", boss.getNickName()); + bossData.put("portrait", boss.getPortrait()); + } - long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1); - long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null); - JSONObject bossData = new JSONObject(); - ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid); - if (threeSale != null) { - UserInfo boss = threeSale.getBoss(); - if (boss != null) { - bossData.put("nickName", boss.getNickName()); - bossData.put("portrait", boss.getPortrait()); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); + Long createTime = threeSale.getCreateTime(); + Date inviteTime = new Date(createTime); + bossData.put("inviteTime", "閭�璇锋椂闂�: " + sdf.format(inviteTime)); } - SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); - Long createTime = threeSale.getCreateTime(); - Date inviteTime = new Date(createTime); - bossData.put("inviteTime", "閭�璇锋椂闂�: " + sdf.format(inviteTime)); + JSONObject resultData = new JSONObject(); + + String helpLink = configService.get("team_help_url"); + if (helpLink == null) { + helpLink = ""; + } + resultData.put("helpLink", helpLink); + resultData.put("firstTeam", firstTeam); + resultData.put("firstTeamTotal", firstTeamTotal); + resultData.put("secondTeam", secondTeam); + resultData.put("secondTeamTotal", secondTeamTotal); + resultData.put("boss", bossData); + + + boolean hasCode = false; + String inviteCode = userInfoExtraService.getUserInviteCode(uid); + if (inviteCode != null && inviteCode.trim().length() > 0) { + hasCode = true; // 宸叉湁閭�璇风爜 + } else { + // 閭�璇锋縺娲婚摼鎺� + resultData.put("activationlink", configService.get("invite_activation_url")); + } + resultData.put("hasCode", hasCode); + + out.print(JsonUtil.loadTrueResult(resultData)); + + } catch (UserInfoExtraException e) { + out.print(JsonUtil.loadFalseResult(e.getMsg())); + } catch (Exception e) { + out.print(JsonUtil.loadFalseResult("缁熻澶辫触")); + e.printStackTrace(); } - - JSONObject resultData = new JSONObject(); - - String helpLink = configService.get("team_help_url"); - if (helpLink == null) { - helpLink = ""; - } - resultData.put("helpLink", helpLink); - resultData.put("firstTeam", firstTeam); - resultData.put("firstTeamTotal", firstTeamTotal); - resultData.put("secondTeam", secondTeam); - resultData.put("secondTeamTotal", secondTeamTotal); - resultData.put("boss", bossData); - - out.print(JsonUtil.loadTrueResult(resultData)); + } /** -- Gitblit v1.8.0