From 43a00f6b852dcf91cf51fb8f1a5c1386ee437a35 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 18 一月 2020 11:52:01 +0800
Subject: [PATCH] 增加订单商品分类日志
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java | 65 +++++++++++++++++++++++++++-----
1 files changed, 54 insertions(+), 11 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 fee5ff4..710b690 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
@@ -27,6 +27,7 @@
import com.yeshi.fanli.entity.bus.user.UserInviteSeparate;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.entity.system.BusinessSystem;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.system.SystemClientParams;
import com.yeshi.fanli.exception.user.UserAccountException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
@@ -44,6 +45,7 @@
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.util.Constant;
+import com.yeshi.fanli.util.RedisKeyEnum;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.VersionUtil;
@@ -135,8 +137,8 @@
if (wxUnionId == null || wxUnionId.trim().length() == 0)
throw new UserInfoExtraException(1, "寰俊鎺堟潈澶辫触");
- String activeWX = StringUtil.Md5("activeWX:" + weiXinUser.getUnionid());
- redisManager.cacheCommonString(activeWX, JsonUtil.getSimpleGson().toJson(weiXinUser), 60 * 20);
+ String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey, StringUtil.Md5("activeWX:" + weiXinUser.getUnionid()));
+ redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(weiXinUser), 60 * 20);
// 閭�璇峰叧绯荤敤鎴蜂俊鎭�
UserInfo userInfo = userInfoExtraService.getInviterInfo(uid, wxUnionId);
@@ -145,7 +147,7 @@
data.put("nickName", userInfo.getNickName());
data.put("portrait", userInfo.getPortrait());
data.put("tips", "纭瑕佹垚涓篢A鐨勭洿鎺ョ矇涓濆悧锛熼個璇峰叧绯讳竴鏃﹀缓绔嬩笉鍙洿鏀广��");
- data.put("key", activeWX);
+ data.put("key", key);
out.print(JsonUtil.loadTrueResult(data));
} catch (UserInfoExtraException e) {
out.print(JsonUtil.loadFalseResult(e.getMsg()));
@@ -211,7 +213,7 @@
}
boolean needVIPInfo = false;
- if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
+ if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
needVIPInfo = true;
// 缁勭粐鏁版嵁
@@ -370,12 +372,12 @@
*/
@RequestMapping(value = "countMyTeam", method = RequestMethod.POST)
public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) {
- JSONObject bossData = getBossInfo(acceptData, uid, threeSaleSerivce.getMyBoss(uid));
+ JSONObject bossData = getBossInfo(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("helpLink", configService.get(ConfigKeyEnum.teamHelpUrl.getKey()));
resultData.put("firstTeam", firstTeam);
resultData.put("firstTeamTotal", threeSaleSerivce.countFirstTeam(uid, null));
resultData.put("secondTeam", threeSaleSerivce.countSecondTeam(uid, 1));
@@ -384,7 +386,7 @@
boolean hasTeam = true;
if (firstTeam <= 0) {
hasTeam = false;
- resultData.put("invitelink", configService.get("invite_activation_url"));
+ resultData.put("invitelink", configService.get(ConfigKeyEnum.inviteActivationUrl.getKey()));
}
resultData.put("hasTeam", hasTeam);
@@ -403,7 +405,7 @@
resultData.put("hasCode", hasCode);
if (!hasCode) {
List<String> tipCode = new ArrayList<String>();
- resultData.put("helpLinkActivate", configService.get("team_help_url"));
+ resultData.put("helpLinkActivate", configService.get(ConfigKeyEnum.teamHelpUrl.getKey()));
tipCode.add("婵�娲婚個璇峰姛鑳藉悗鎵嶅彲浠ラ個璇风矇涓濓紝鐩存帴绮変笣鏄敱浣犵洿鎺ラ個璇凤紝闂存帴绮変笣鏄敱浣犵殑鐩存帴绮変笣閭�璇枫��");
tipCode.add("閭�璇锋縺娲诲姛鑳斤紝蹇呴』瑕佹湁閭�璇风爜锛岄個璇风爜鍙互閫氳繃閲戝竵鍏戞崲锛屼篃鍙互鍏ㄧ綉鎼滅储銆�");
resultData.put("tipCode", tipCode);
@@ -423,6 +425,23 @@
}
/**
+ * 鑾峰彇鐢ㄦ埛淇℃伅
+ * @param acceptData
+ * @param uid
+ * @param out
+ */
+ @RequestMapping(value = "getBossInfo", method = RequestMethod.POST)
+ public void getBossInfo(AcceptData acceptData, Long uid, PrintWriter out) {
+ if (uid == null || uid <= 0) {
+ out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
+ return;
+ }
+ JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid));
+ out.print(JsonUtil.loadTrueResult(bossData));
+ }
+
+
+ /**
* 涓婄骇淇℃伅缁勭粐
*
* @param acceptData
@@ -430,7 +449,7 @@
* @param threeSale
* @return
*/
- private JSONObject getBossInfo(AcceptData acceptData, long uid, ThreeSale threeSale) {
+ private JSONObject getBossInfo(long uid, ThreeSale threeSale) {
JSONObject bossData = new JSONObject();
if (threeSale != null && threeSale.getBoss() != null) {
UserInfo boss = threeSale.getBoss();
@@ -459,7 +478,7 @@
bossData.put("inviteTime", "浣犱簬 " + sdf.format(inviteTime) + "鎺ュ彈浜員A鐨勯個璇�");
} else {
bossData.put("hasBoss", false);
- bossData.put("helpLink", configService.get("invite_code_hlep_link"));
+ bossData.put("helpLink", configService.get(ConfigKeyEnum.inviteCodeHlepLink.getKey()));
bossData.put("weiXinTip", "鎭枩浣狅紝鎴戜滑鐨勪紭璐ㄧ敤鎴凤紱\r\n浣犲苟娌℃湁閭�璇蜂汉锛屼絾浣犵殑閭�璇锋縺娲诲姛鑳芥槸琚粯璁ゅ紑鍚殑锛沑r\n浣犳嫢鏈夌嫭鐗圭殑鏃犻個璇蜂汉婵�娲荤爜銆�");
}
return bossData;
@@ -598,7 +617,7 @@
JSONObject data = new JSONObject();
data.put("count", spreadImgService.countAll());
data.put("inviteCode", inviteCode);
- data.put("helpLink", configService.get("invite_help_link"));
+ data.put("helpLink", configService.get(ConfigKeyEnum.inviteHelpLink.getKey()));
data.put("inviteRules", values.getValue().replace("\n", "<br><br>"));
data.put("imgUrlList", JsonUtil.getSimpleGsonWithDate().toJson(imgList));
data.put("inviteLink", "http://a.app.qq.com/o/simple.jsp?pkgname=com.yeshi.ec.rebate");
@@ -608,4 +627,28 @@
out.print(JsonUtil.loadFalseResult("閭�璇蜂俊鎭幏鍙栧け璐�"));
}
}
+
+ /**
+ * 绔欏唴淇℃彁閱掗槦鍛樻坊鍔犲井淇″彿
+ *
+ * @param acceptData
+ * @param uid
+ * @param inviteId
+ * @param out
+ */
+ @RequestMapping(value = "tailorCode")
+ public void tailorCode(AcceptData acceptData, String callback, Long uid, PrintWriter out) {
+ if (uid == null) {
+ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛id缂哄け"));
+ return;
+ }
+
+ JSONObject data = new JSONObject();
+ data.put("num", threeSaleSerivce.countFirstTeam(uid, 1));
+ data.put("limit", Constant.INVITE_CODRE_TAILOR_LIMIT);
+ JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
+ }
+
+
+
}
--
Gitblit v1.8.0