From 29bb04f5981562726febc3538dbb5bc394017273 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 09 五月 2020 21:41:47 +0800
Subject: [PATCH] 2.1.1相关功能提交
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java | 120 +++++++++++++++++++++++++-----------------------------------
1 files changed, 50 insertions(+), 70 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
index df83082..f1edece 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserInfoController.java
@@ -40,6 +40,7 @@
import com.yeshi.fanli.dto.HongBaoDTO;
import com.yeshi.fanli.dto.money.AccountDetails;
import com.yeshi.fanli.dto.order.OrderItem;
+import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
import com.yeshi.fanli.entity.AppVersionInfo;
import com.yeshi.fanli.entity.accept.AcceptData;
@@ -108,6 +109,7 @@
import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
+import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
import com.yeshi.fanli.util.AESUtil;
@@ -242,14 +244,17 @@
@Resource
private UserVIPInfoService userVIPInfoService;
-
+
@Resource
private UserVipConfigService userVipConfigService;
-
+
@Resource
private RedPackForbidService redPackForbidService;
- private static final String EXTRACT_MIN_MONEY = ConfigKeyEnum.extractMoneyMin.getKey();
+ @Resource
+ private UserInviteService userInviteService;
+
+ private static final String EXTRACT_MIN_MONEY = ConfigKeyEnum.extractMoneyMin.getKey();
private static final String EXTRACT_MAX_MONEY = ConfigKeyEnum.extractMoneyMAX.getKey();
/**
@@ -435,7 +440,7 @@
form.setWxName(xinUser.getNickname());
String wxHeadImg = COSManager.getInstance()
.uploadFile(HttpUtil.getAsInputStream(xinUser.getHeadimgurl()),
- Constant.WXHEADURL + UUID.randomUUID().toString())
+ FilePathEnum.userPortrait + UUID.randomUUID().toString())
.getUrl();
form.setWxPic(wxHeadImg);
} else if (formLoginType == Constant.TAOBAO) {
@@ -1139,7 +1144,6 @@
return;
}
-
if (!Constant.IS_TEST) {
// 鍒ゆ柇鎵嬫満楠岃瘉鐮佺殑姝g‘鎬�
String oldCode = redisManager.getSMSVCode(user.getPhone(), SMSHistory.TYPE_LOGIN);
@@ -1675,19 +1679,17 @@
JSONObject resultData = new JSONObject();
if (type == 1) {
- resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid, null);
+ resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid);
} else if (type == 2) {
- resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid, null);
+ resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid);
}
// 瀹夊崜绯荤粺杩斿洖鎵�鏈夋暟鎹�
String platform = acceptData.getPlatform();
if ("android".equalsIgnoreCase(platform)) {
- long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
- long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null);
+ long firstTeam = threeSaleSerivce.countFirstTeam(uid);
- long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
- long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
+ long secondTeam = threeSaleSerivce.countSecondTeam(uid);
JSONObject bossData = null;
ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
@@ -1722,9 +1724,9 @@
resultData.put("helpLink", helpLink);
resultData.put("firstTeam", firstTeam);
- resultData.put("firstTeamTotal", firstTeamTotal);
+ resultData.put("firstTeamTotal", firstTeam);
resultData.put("secondTeam", secondTeam);
- resultData.put("secondTeamTotal", secondTeamTotal);
+ resultData.put("secondTeamTotal", secondTeam);
resultData.put("boss", bossData);
}
out.print(JsonUtil.loadTrueResult(resultData));
@@ -1750,17 +1752,17 @@
JSONObject resultData = new JSONObject();
if (type == 1) {
- resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid, 1);
+ resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid);
} else if (type == 2) {
- resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid, 1);
+ resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid);
}
// 瀹夊崜绯荤粺杩斿洖鎵�鏈夋暟鎹�
String platform = acceptData.getPlatform();
if ("android".equalsIgnoreCase(platform)) {
- long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
+ long firstTeam = threeSaleSerivce.countFirstTeam(uid);
- long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
+ long secondTeam = threeSaleSerivce.countSecondTeam(uid);
JSONObject bossData = null;
ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
@@ -1815,11 +1817,9 @@
@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);
- long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
- long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
+ long secondTeam = threeSaleSerivce.countSecondTeam(uid);
JSONObject bossData = new JSONObject();
ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
if (threeSale != null) {
@@ -1843,9 +1843,9 @@
}
resultData.put("helpLink", helpLink);
resultData.put("firstTeam", firstTeam);
- resultData.put("firstTeamTotal", firstTeamTotal);
+ resultData.put("firstTeamTotal", firstTeam);
resultData.put("secondTeam", secondTeam);
- resultData.put("secondTeamTotal", secondTeamTotal);
+ resultData.put("secondTeamTotal", secondTeam);
resultData.put("boss", bossData);
boolean hasCode = false;
@@ -1909,41 +1909,6 @@
out.print(JsonUtil.loadTrueResult("淇濆瓨鎴愬姛"));
}
- /**
- * 鍒犻櫎闃熷憳鍏崇郴
- *
- * @param acceptData
- * @param uid
- * @param inviteId
- * 閭�璇穒d
- * @param out
- */
- @RequestMapping(value = "removethreesale", method = RequestMethod.POST)
- public void removethreesale(AcceptData acceptData, long uid, long inviteId, PrintWriter out) {
- try {
- List<ThreeSale> listThreeSale = threeSaleSerivce.listbyIdAndBossId(inviteId, uid, 1);
- if (listThreeSale == null || listThreeSale.size() == 0) {
- out.print(JsonUtil.loadFalseResult("鎿嶄綔鏁版嵁鏃犳晥"));
- return;
- }
-
- UserInfo worker = listThreeSale.get(0).getWorker();
- if (worker == null) {
- out.print(JsonUtil.loadFalseResult("鎿嶄綔鏁版嵁鏃犳晥"));
- return;
- }
-
- // 鍒犻櫎鍏崇郴
- threeSaleSerivce.deleteByPrimaryKey(inviteId);
- // 鍒犻櫎澶囨敞
- threeSaleExtraInfoSerivce.deleteByBossIdAndWorkerId(uid, worker.getId());
-
- out.print(JsonUtil.loadTrueResult("鍒犻櫎鎴愬姛"));
- } catch (Exception e) {
- out.print(JsonUtil.loadFalseResult("鍒犻櫎澶辫触"));
- e.printStackTrace();
- }
- }
/**
* 璁剧疆鐣岄潰寮�鍏崇姸鎬�
@@ -2125,6 +2090,10 @@
if (mySettings.getNoInvitationBonus() == null) {
mySettings.setNoInvitationBonus(0);
}
+
+ if (mySettings.getNoDisplayPhoneNum() == null) {
+ mySettings.setNoDisplayPhoneNum(0);
+ }
if (mySettings.getOpenSpreadHongBao() == null) {
if (userTaoLiJinDetailService.countDetail(uid) > 0) {
@@ -2150,7 +2119,7 @@
tailor = true;
invitCode = userInfoExtra.getInviteCode();
}
-
+
if (userInfoExtra.getUserRank() != null) {
String picture = userInfoExtra.getUserRank().getPicture();
String icon = userInfoExtra.getUserRank().getIcon();
@@ -2169,13 +2138,13 @@
if (!StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin()))
userInfo.setWeiXin(userInfoExtra.getWeiXin());
}
-
+
// 浜岀淮鐮�
userInfo.setErCode(userInfoExtra.getErCode());
}
// 鏄剧ず閭�璇风爜鐗瑰埗鍏ュ彛
data.put("tailor", tailor);
-
+
// 1.6.5 涔嬪悗杩斿洖 寰俊鍙锋彁绀�
if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
userInfo.setWeiXinTip("娣诲姞寰俊鍙峰悗锛屼綘鐨勯個璇蜂汉鍜岀洿鎺ョ矇涓濆彲浠ラ�氳繃寰俊涓庝綘寤虹珛鑱旂郴銆�");
@@ -2183,7 +2152,7 @@
// 鏌ヨ鏄惁涓篤IP
if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
userInfo.setVip(userVIPInfoService.isVIP(uid));
-
+
boolean verifyForbid = redPackForbidService.verifyForbid(uid);
data.put("redPackLock", verifyForbid);
}
@@ -2204,8 +2173,8 @@
bindPhone = bindRemindService.bindRemind(uid, BindRemind.TYPE_PHONE);
data.put("bindPhone", bindPhone);
}
-
- if (!StringUtil.isNullOrEmpty(invitCode)) {
+
+ if (!StringUtil.isNullOrEmpty(invitCode)) {
// 2.0.6 杩斿洖閭�璇蜂汉
if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
String bossName = "";
@@ -2216,8 +2185,20 @@
data.put("bossName", bossName);
}
}
-
-
+
+ if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
+ UserInviteLevelEnum level = null;
+ if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
+ level = userInviteService.getUserInviteLevelNew(uid);
+ } else {
+ level = userInviteService.getUserInviteLevel(uid);
+ }
+ JSONObject inviteLevel = new JSONObject();
+ inviteLevel.put("level", level.name());
+ inviteLevel.put("link", level.getLink());
+ data.put("inviteLevel", inviteLevel);
+ }
+
out.print(JsonUtil.loadTrueResult(data));
final UserInfo uuser = userInfo;
@@ -2384,6 +2365,7 @@
}
}
+ //淇敼閭�璇风爜
if (!StringUtil.isNullOrEmpty(inviteCode)) {// 閭�璇风爜涓嶄负绌�
inviteCode = inviteCode.trim();
if (inviteCode.length() >= 4 && inviteCode.length() <= 12) {
@@ -2399,14 +2381,12 @@
return;
}
}
-
+
// 浜岀淮鐮�
if (qrCodeFile != null) {
userInfoExtraService.uploadERCode(qrCodeFile, uid);
}
-
-
-
+
out.print(JsonUtil.loadTrueResult("淇濆瓨鎴愬姛"));
} catch (UserInfoException e) {
out.print(JsonUtil.loadFalseResult(e.getMsg()));
--
Gitblit v1.8.0