From e5e38de6745c8fcae91fa7e459898f3663d00001 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 19 八月 2019 17:41:32 +0800 Subject: [PATCH] 通用模板修改 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java | 47 +++++++++++++++++++++++++++++++++++------------ 1 files changed, 35 insertions(+), 12 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java index 346289b..1f8daca 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java @@ -29,7 +29,6 @@ import com.yeshi.fanli.service.inter.user.UserInfoExtraService; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; -import com.yeshi.fanli.util.VersionUtil; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -71,6 +70,7 @@ JSONObject data = new JSONObject(); data.put("nickName", userInfo.getNickName()); data.put("portrait", userInfo.getPortrait()); + data.put("tips", "纭瑕佹垚涓篢A鐨勪竴绾ч槦鍛樺悧锛熼個璇峰叧绯讳竴鏃﹀缓绔嬩笉鍙洿鏀广��"); out.print(JsonUtil.loadTrueResult(data)); } catch (UserInfoExtraException e) { out.print(JsonUtil.loadFalseResult(e.getMsg())); @@ -89,6 +89,7 @@ JSONObject data = new JSONObject(); data.put("nickName", userInfo.getNickName()); data.put("portrait", userInfo.getPortrait()); + data.put("tips", "纭瑕佹垚涓篢A鐨勪竴绾ч槦鍛樺悧锛熼個璇峰叧绯讳竴鏃﹀缓绔嬩笉鍙洿鏀广��"); out.print(JsonUtil.loadTrueResult(data)); } catch (UserInfoExtraException e) { out.print(JsonUtil.loadFalseResult(e.getMsg())); @@ -121,6 +122,18 @@ // 缁勭粐鏁版嵁 JSONObject resultData = organizeTeam(count, listTeam, uid, type); + + // 绗竴椤靛垽鏂槸鍚︽縺娲� 鏄惁鏈夐槦鍛� + if (type == 1 && page == 1) { + boolean hasCode = false; + UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid); + if (userInfoExtra != null) { + if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) + hasCode = true; + } + resultData.put("hasCode", hasCode); + resultData.put("hasTeam", count > 0? true:false); + } out.print(JsonUtil.loadTrueResult(resultData)); } @@ -227,12 +240,21 @@ public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) { JSONObject bossData = getBossInfo(acceptData, uid, threeSaleSerivce.getMyBoss(uid)); JSONObject resultData = new JSONObject(); + + long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1); resultData.put("boss", bossData); resultData.put("helpLink", configService.get("team_help_url")); - resultData.put("firstTeam", threeSaleSerivce.countFirstTeam(uid, 1)); + resultData.put("firstTeam", firstTeam); resultData.put("firstTeamTotal", threeSaleSerivce.countFirstTeam(uid, null)); resultData.put("secondTeam", threeSaleSerivce.countSecondTeam(uid, 1)); resultData.put("secondTeamTotal", threeSaleSerivce.countSecondTeam(uid, null)); + + boolean hasTeam = true; + if (firstTeam <= 0) { + hasTeam = false; + resultData.put("invitelink", configService.get("invite_activation_url")); + } + resultData.put("hasTeam", hasTeam); boolean hasCode = false; boolean bdWeiXin = false; @@ -245,15 +267,15 @@ bdWeiXin = true; } - List<String> tipCode = new ArrayList<String>(); // 鏈縺娲婚個璇风爜 + resultData.put("hasCode", hasCode); if (!hasCode) { + List<String> tipCode = new ArrayList<String>(); resultData.put("helpLinkActivate", configService.get("team_help_url")); tipCode.add("婵�娲婚個璇峰姛鑳藉悗鎵嶅彲浠ラ個璇烽槦鍛橈紝涓�绾ч槦鍛樻槸鐢变綘鐩存帴閭�璇凤紝浜岀骇闃熷憳鏄敱浣犵殑涓�绾ч槦鍛橀個璇枫��"); tipCode.add("閭�璇锋縺娲诲姛鑳斤紝蹇呴』瑕佹湁閭�璇风爜锛岄個璇风爜鍙互閫氳繃閲戝竵鍏戞崲锛屼篃鍙互鍏ㄧ綉鎼滅储銆�"); + resultData.put("tipCode", tipCode); } - resultData.put("hasCode", hasCode); - resultData.put("tipCode", tipCode); // 鏈坊鍔犲井淇″彿 List<String> tipWeiXin = new ArrayList<String>(); @@ -262,6 +284,7 @@ tipWeiXin.add("浣犱篃鍙互鍚戦個璇蜂汉瀛︿範鎴栧悜涓�绾ч槦鍛樻暀鎺堣禋閽辨妧宸с��"); } resultData.put("tipWeiXin", tipWeiXin); + resultData.put("tipWeiXinAdd", "娣诲姞寰俊鍙峰悗锛屼綘鐨勯個璇蜂汉鍜屼竴绾ч槦鍛樺彲浠ラ�氳繃寰俊涓庝綘寤虹珛鑱旂郴銆�"); resultData.put("bdWeiXin", bdWeiXin); out.print(JsonUtil.loadTrueResult(resultData)); @@ -301,7 +324,6 @@ } } bossData.put("inviteTime", "浣犱簬 " + sdf.format(inviteTime) + "鎺ュ彈浜員A鐨勯個璇�"); - } else { bossData.put("hasBoss", false); bossData.put("helpLink", configService.get("invite_code_hlep_link")); @@ -345,12 +367,13 @@ } try { - List<String> listIOS = new ArrayList<String>(); - List<String> listAndroid = new ArrayList<String>(); - pushService.pushZNX(remindId, "", "", listIOS, listAndroid); - - userSystemMsgService.addUserSystemMsg(remindId, UserSystemMsgTypeEnum.question, - "", "", UserSystemMsg.TIME_TAG_EMERGENT, null); + // TODO鐗堟湰鍖哄垎 + +// List<String> listIOS = new ArrayList<String>(); +// List<String> listAndroid = new ArrayList<String>(); +// pushService.pushZNX(remindId, "", "", listIOS, listAndroid); +// userSystemMsgService.addUserSystemMsg(remindId, UserSystemMsgTypeEnum.question, +// "", "", UserSystemMsg.TIME_TAG_EMERGENT, null); JSONObject data = new JSONObject(); data.put("weiXinState", 2); -- Gitblit v1.8.0