From 651a15c78f668bef3859d9ed1bb7ad0b669d3600 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 03 七月 2020 17:52:07 +0800
Subject: [PATCH] 多APP优化

---
 fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java |   72 +++++++----------------------------
 1 files changed, 15 insertions(+), 57 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java
index 1ab8e0a..6fb676e 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java
@@ -9,10 +9,10 @@
 
 import javax.annotation.Resource;
 
+import com.yeshi.fanli.entity.SystemEnum;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
-import org.yeshi.utils.DateUtil;
 import org.yeshi.utils.JsonUtil;
 
 import com.yeshi.fanli.dto.WXMPAcceptData;
@@ -22,14 +22,12 @@
 import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
 import com.yeshi.fanli.entity.bus.user.UserInfo;
 import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
-import com.yeshi.fanli.entity.bus.user.UserInviteSeparate;
 import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.service.inter.config.ConfigService;
 import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
 import com.yeshi.fanli.service.inter.push.PushService;
 import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
 import com.yeshi.fanli.service.inter.user.UserInfoService;
-import com.yeshi.fanli.service.inter.user.UserInviteSeparateService;
 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.vip.UserVIPInfoService;
@@ -56,9 +54,6 @@
 	private UserVIPInfoService userVIPInfoService;
 
 	@Resource
-	private UserInviteSeparateService userInviteSeparateService;
-
-	@Resource
 	private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce;
 	
 	@Resource
@@ -75,7 +70,6 @@
 	 * 
 	 * @param acceptData
 	 * @param uid
-	 * @param inviteId
 	 * @param out
 	 */
 	@RequestMapping(value = "tailorCode")
@@ -108,7 +102,7 @@
 		
 		JSONObject data = new JSONObject();
 		data.put("desc", array);
-		data.put("num", threeSaleSerivce.countFirstTeam(uid, 1));
+		data.put("num", threeSaleSerivce.countFirstTeam(uid));
 		data.put("limit", Constant.INVITE_CODRE_TAILOR_LIMIT);
 		
 		out.print(JsonUtil.loadTrueResult(data));
@@ -118,17 +112,13 @@
 	 * 鐢ㄦ埛闃熷憳缁熻 1.4.1
 	 * 
 	 * @param acceptData
-	 * @param id
 	 * @param out
 	 */
 	@RequestMapping(value = "countMyTeam", method = RequestMethod.POST)
 	public void countMyTeam(WXMPAcceptData acceptData, long uid, PrintWriter out) {
 		try {
-			long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
-			long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null);
-
-			long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
-			long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
+			long firstTeam = threeSaleSerivce.countFirstTeam(uid);
+			long secondTeam = threeSaleSerivce.countSecondTeam(uid);
 			JSONObject bossData = new JSONObject();
 			ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
 			if (threeSale != null) {
@@ -146,15 +136,15 @@
 
 			JSONObject resultData = new JSONObject();
 
-			String helpLink = configService.get(ConfigKeyEnum.teamHelpUrl.getKey());
+			String helpLink = configService.getValue(ConfigKeyEnum.teamHelpUrl.getKey(),acceptData.getSystem());
 			if (helpLink == null) {
 				helpLink = "";
 			}
 			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;
@@ -163,7 +153,7 @@
 				hasCode = true; // 宸叉湁閭�璇风爜
 			} else {
 				// 閭�璇锋縺娲婚摼鎺�
-				resultData.put("activationlink", configService.get(ConfigKeyEnum.inviteActivationUrl.getKey()));
+				resultData.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(),acceptData.getSystem()));
 			}
 			resultData.put("hasCode", hasCode);
 
@@ -178,7 +168,6 @@
 	/**
 	 * 
 	 * @param acceptData
-	 * @param id
 	 * @param out
 	 */
 	@RequestMapping(value = "listMyTeam")
@@ -191,11 +180,11 @@
 		long count = 0;
 		List<ThreeSale> listTeam = null;
 		if (type == 1) {
-			listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, 1);
-			count = threeSaleSerivce.countFirstTeam(uid, 1);
+			listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
+			count = threeSaleSerivce.countFirstTeam(uid);
 		} else if (type == 2) {
-			listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, 1);
-			count = threeSaleSerivce.countSecondTeam(uid, 1);
+			listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
+			count = threeSaleSerivce.countSecondTeam(uid);
 		}
 
 		boolean needVIPInfo = true;
@@ -261,35 +250,6 @@
 			// 娣诲姞鏄惁涓篤IP
 			if (vipMap != null && vipMap.get(worker.getId()) != null) {
 				object.put("vip", vipMap.get(worker.getId()));
-				if (vipMap.get(worker.getId())) {
-					UserInviteSeparate separate = userInviteSeparateService.selectByWorkerIdAndBossId(worker.getId(),
-							uid);
-					if (separate != null && separate.getEndTime() != null) {
-						try {
-
-							JSONObject contentJson1 = new JSONObject();
-							contentJson1.put("color", "#888888");
-							contentJson1.put("content", "灏嗕簬");
-
-							JSONObject contentJson2 = new JSONObject();
-							contentJson2.put("color", "#F14242");
-							contentJson2.put("content", DateUtil.dateDiff4(new Date(), separate.getEndTime()));
-
-							JSONObject contentJson3 = new JSONObject();
-							contentJson3.put("color", "#888888");
-							contentJson3.put("content", "鍚庤劚绂婚個璇峰叧绯�");
-
-							JSONArray array = new JSONArray();
-							array.add(contentJson1);
-							array.add(contentJson2);
-							array.add(contentJson3);
-							object.put("vipBreakTime", array);
-
-						} catch (Exception e) {
-							e.printStackTrace();
-						}
-					}
-				}
 			}
 			String fontColor1 = "#888888";
 			JSONArray array = new JSONArray();
@@ -359,7 +319,7 @@
 			out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
 			return;
 		}
-		JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid));
+		JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid),acceptData.getSystem());
 		out.print(JsonUtil.loadTrueResult(bossData));
 	}
 	
@@ -368,7 +328,6 @@
 	 * 
 	 * @param acceptData
 	 * @param uid
-	 * @param inviteId
 	 * @param out
 	 */
 	@RequestMapping(value = "remindBossAddWX")
@@ -463,12 +422,11 @@
 	/**
 	 * 涓婄骇淇℃伅缁勭粐
 	 * 
-	 * @param acceptData
 	 * @param uid
 	 * @param threeSale
 	 * @return
 	 */
-	private JSONObject getBossInfo(long uid, ThreeSale threeSale) {
+	private JSONObject getBossInfo(long uid, ThreeSale threeSale, SystemEnum system) {
 		JSONObject bossData = new JSONObject();
 		if (threeSale != null && threeSale.getBoss() != null) {
 			UserInfo boss = threeSale.getBoss();
@@ -497,7 +455,7 @@
 			bossData.put("inviteTime", "浣犱簬 " + sdf.format(inviteTime) + "鎺ュ彈浜員A鐨勯個璇�");
 		} else {
 			bossData.put("hasBoss", false);
-			bossData.put("helpLink", configService.get(ConfigKeyEnum.inviteCodeHlepLink.getKey()));
+			bossData.put("helpLink", configService.getValue(ConfigKeyEnum.inviteCodeHlepLink.getKey(),system));
 			bossData.put("weiXinTip", "鎭枩浣狅紝鎴戜滑鐨勪紭璐ㄧ敤鎴凤紱\r\n浣犲苟娌℃湁閭�璇蜂汉锛屼絾浣犵殑閭�璇锋縺娲诲姛鑳芥槸琚粯璁ゅ紑鍚殑锛沑r\n浣犳嫢鏈夌嫭鐗圭殑鏃犻個璇蜂汉婵�娲荤爜銆�");
 		}
 		return bossData;

--
Gitblit v1.8.0