From 2f2860b50f24e5e3598d223db03d43df61d95c97 Mon Sep 17 00:00:00 2001
From: yj <Administrator@192>
Date: 星期五, 13 三月 2020 16:31:30 +0800
Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java |   88 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 66 insertions(+), 22 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
index 259d793..bb4ba74 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
@@ -25,6 +25,7 @@
 import com.google.gson.JsonSerializer;
 import com.yeshi.fanli.entity.accept.AcceptData;
 import com.yeshi.fanli.entity.bus.user.SMSHistory;
+import com.yeshi.fanli.entity.bus.user.ThreeSale;
 import com.yeshi.fanli.entity.bus.user.UserInfo;
 import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
 import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
@@ -32,6 +33,7 @@
 import com.yeshi.fanli.entity.push.DeviceActive;
 import com.yeshi.fanli.entity.shop.BanLiShopOrder;
 import com.yeshi.fanli.entity.system.BusinessSystem;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.exception.user.UserAccountException;
 import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
 import com.yeshi.fanli.log.LogHelper;
@@ -231,6 +233,7 @@
 			} else {
 				JSONObject data = new JSONObject();
 				data.put("userInfo", UserUtil.filterForClientUser(userInfo));
+				data.put("inviteCode", userInfoExtraService.getInviteCodeByUid(userInfo.getId()));
 				out.print(JsonUtil.loadTrueResult(data));
 
 				final UserInfo uuser = userInfo;
@@ -267,7 +270,7 @@
 			} else {
 				out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
 				try {
-					LogHelper.cookieLog("鐧诲綍鍑洪敊:" + e.getCode() + "-" + e.getMessage());
+					LogHelper.error("鐧诲綍鍑洪敊:" + e.getCode() + "-" + e.getMessage());
 				} catch (Exception e1) {
 					e1.printStackTrace();
 				}
@@ -388,7 +391,7 @@
 		vo.setNickName(userInfo.getNickName());
 		vo.setPortrait(userInfo.getPortrait());
 		vo.setHelpLink(userVipConfigService.getValueByKey("help_link_vip_h5"));
-		vo.setCsdLink(configService.get("customer_service_link"));
+		vo.setCsdLink(configService.get(ConfigKeyEnum.customerServiceLink.getKey()));
 
 		Date now = new Date();
 		Date start = new Date(0);
@@ -440,7 +443,35 @@
 		}
 		vo.setFinishMoney(hongBaoV2CountService.getRewardMoneyBySelf(uid));
 
-		// 浼氬憳瑙勫垯鎵ц鏃堕棿
+		List<Integer> list = new ArrayList<Integer>();
+		list.add(BanLiShopOrder.STATE_SUCCESS);
+		BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
+
+		vo.setFinishGoldCoin(Long.parseLong(integralDetailService.getCumulativeMoney(uid).setScale(0).toString()));
+		
+//		vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
+//				, payMoney));
+		
+		int finishTeam = 0;
+		long vipBegin = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
+		List<ThreeSale> listThreeSale = threeSaleSerivce.getValidWorkerIdsByTime(uid, vipBegin);
+		if (listThreeSale != null && listThreeSale.size() > 0) {
+			for (ThreeSale three: listThreeSale) {
+				UserInfo worker = three.getWorker();
+				if (worker == null || worker.getId() == null) {
+					continue;
+				}
+				// 1銆侀個璇峰叧绯绘垚鍔熷悗锛�2銆佸崟锛堝垎浜� + 鑷喘锛夊疄浠樻澶т簬1鍏�
+				long countValid = hongBaoV2CountService.countValidOrderByUidAndTime(worker.getId(), three.getSucceedTime(), payMoney);
+				if (countValid > 0) {
+					finishTeam ++;
+				}
+			}
+		}
+		vo.setFinishTeam(finishTeam);
+		vo.setFinishHongBao(banLiShopOrderService.countByUidAndState(uid, list));
+
+		// 鍖哄垎鑰佺敤鎴峰拰鏂扮敤鎴�
 		String limtDate = userVipConfigService.getValueByKey("vip_execute_time");
 		Date executeDate = null;
 		try {
@@ -449,14 +480,6 @@
 		} catch (ParseException e) {
 			e.printStackTrace();
 		}
-		List<Integer> list = new ArrayList<Integer>();
-		list.add(BanLiShopOrder.STATE_SUCCESS);
-		BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
-
-		vo.setFinishGoldCoin(Long.parseLong(integralDetailService.getCumulativeMoney(uid).setScale(0).toString()));
-		vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid, executeDate.getTime(), payMoney));
-		vo.setFinishHongBao(banLiShopOrderService.countByUidAndState(uid, list));
-
 		UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
 		if (extra != null
 				&& (extra.getFirstLoginTime() == null || extra.getFirstLoginTime().getTime() < executeDate.getTime())) {
@@ -513,7 +536,38 @@
 
 		// 鐪侀挶 -鑷喘浜х敓杩斿埄
 
-		// 浼氬憳瑙勫垯鎵ц鏃堕棿
+		List<Integer> list = new ArrayList<Integer>();
+		list.add(BanLiShopOrder.STATE_SUCCESS);
+		BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
+
+		BigDecimal finishGoldCoin = integralDetailService.getCumulativeMoney(uid);
+		
+//		long finishTeam = hongBaoV2CountService.countValidOrderTeamUserByUid(uid,
+//				TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney);
+//	
+		long finishTeam = 0L;
+		long vipBegin = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
+		List<ThreeSale> listThreeSale = threeSaleSerivce.getValidWorkerIdsByTime(uid, vipBegin);
+		if (listThreeSale != null && listThreeSale.size() > 0) {
+			for (ThreeSale three: listThreeSale) {
+				UserInfo worker = three.getWorker();
+				if (worker == null || worker.getId() == null) {
+					continue;
+				}
+				// 1銆侀個璇峰叧绯绘垚鍔熷悗锛�2銆佸崟锛堝垎浜� + 鑷喘锛夊疄浠樻澶т簬1鍏�
+				long countValid = hongBaoV2CountService.countValidOrderByUidAndTime(worker.getId(), three.getSucceedTime(), payMoney);
+				if (countValid > 0) {
+					finishTeam ++;
+				}
+			}
+		}
+		
+		long finishHongBao = banLiShopOrderService.countByUidAndState(uid, list);
+		BigDecimal finishMoney = hongBaoV2CountService.getRewardMoneyBySelf(uid);
+
+		long limitTeam = 0;
+
+		// 鍖哄垎鑰佺敤鎴峰拰鏂扮敤鎴�
 		String limtDate = userVipConfigService.getValueByKey("vip_execute_time");
 		Date executeDate = null;
 		try {
@@ -522,16 +576,6 @@
 		} catch (ParseException e) {
 			e.printStackTrace();
 		}
-		List<Integer> list = new ArrayList<Integer>();
-		list.add(BanLiShopOrder.STATE_SUCCESS);
-		BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
-
-		BigDecimal finishGoldCoin = integralDetailService.getCumulativeMoney(uid);
-		long finishTeam = hongBaoV2CountService.countValidOrderTeamUserByUid(uid, executeDate.getTime(), payMoney);
-		long finishHongBao = banLiShopOrderService.countByUidAndState(uid, list);
-		BigDecimal finishMoney = hongBaoV2CountService.getRewardMoneyBySelf(uid);
-
-		long limitTeam = 0;
 
 		UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
 		if (extra != null

--
Gitblit v1.8.0