From 0d91bad397c1a1b41bc77d9cd9f7555ed78f7f1a Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 19 三月 2020 16:57:48 +0800
Subject: [PATCH] 团队奖励相关机制建立
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 46 insertions(+), 6 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 4e1af56..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;
@@ -232,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;
@@ -268,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();
}
@@ -441,16 +443,34 @@
}
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, TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME), payMoney));
+
+// 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;
@@ -521,7 +541,27 @@
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 = 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);
@@ -536,7 +576,7 @@
} catch (ParseException e) {
e.printStackTrace();
}
-
+
UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
if (extra != null
&& (extra.getFirstLoginTime() == null || extra.getFirstLoginTime().getTime() < executeDate.getTime())) {
--
Gitblit v1.8.0