From 65460a2dc7c69d8c0e031ec4c89e25d47e5173f2 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期二, 10 九月 2019 16:54:11 +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/IntegralControllerV2.java |   69 +++++++++++++++-------------------
 1 files changed, 31 insertions(+), 38 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java
index 15790fc..5bb40a6 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java
@@ -183,17 +183,20 @@
 				data.put("userRank", gson.toJson(userRank));
 				data.put("dailySign", dailySignVO);
 			}
-
-			for (IntegralTaskClassVO taskClassVO : list) {
+			for(int i = 0; i < list.size(); i++) {
+				IntegralTaskClassVO taskClassVO = list.get(i);
+				
 				UniqueKeyEnum uniqueKey = taskClassVO.getUniqueKey();
-
-				UserInfoExtraVO extraVO = userInfoExtraService.getInfoExtraVOByUid(uid);
-				if (extraVO == null || StringUtil.isNullOrEmpty(extraVO.getInviteCode())) {
-					JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache("invite_activate",
-							Constant.getPlatformCode(acceptData.getPlatform()),
-							Integer.parseInt(acceptData.getVersion()));
-
-					taskClassVO.setJumpDetail(jumpDetailV2);
+				
+				// 閭�璇峰ソ鍙嬶細鏄惁婵�娲婚個璇风爜
+				if (uniqueKey == UniqueKeyEnum.inviteTeam) {
+					UserInfoExtraVO extraVO = userInfoExtraService.getInfoExtraVOByUid(uid);
+					if (extraVO == null || StringUtil.isNullOrEmpty(extraVO.getInviteCode())) {
+						JumpDetailV2 jumpDetailV2 = jumpDetailV2Service.getByTypeCache("invite_activate",
+								Constant.getPlatformCode(acceptData.getPlatform()),
+								Integer.parseInt(acceptData.getVersion()));
+						taskClassVO.setJumpDetail(jumpDetailV2);
+					}
 				}
 
 				String progress = taskClassVO.getProgress();
@@ -231,18 +234,27 @@
 					taskClassVO.setLightUp(true);
 				}
 
-				Integer dateType = 1; // 鏌ヨ褰撴棩
-				if (uniqueKey == UniqueKeyEnum.orderReward)
-					dateType = null; // 鏌ヨ鍘嗗彶
-
-				Long id = taskClassVO.getId();
+				
 				int countFinished = 0;
-				Integer totalGoldCoin = integralTaskRecordService.getTotalGoldCoin(uid, id, dateType);
+				Long id = taskClassVO.getId();
+				// 鏌ヨ褰撴棩
+				Integer totalGoldCoin = integralTaskRecordService.getTotalGoldCoin(uid, id, 1);
 				if (totalGoldCoin != null && totalGoldCoin > 0) {
 					taskClassVO.setFinishedCoin("+" + totalGoldCoin);
-					if (uniqueKey != UniqueKeyEnum.dailySign)
-						countFinished = integralTaskRecordService.countFinished(uid, id, dateType);
+					if (uniqueKey != UniqueKeyEnum.dailySign && uniqueKey != UniqueKeyEnum.accountMaintain) {
+						countFinished = integralTaskRecordService.countFinished(uid, id, 1);
+					}
 				}
+				
+				if (uniqueKey == UniqueKeyEnum.accountMaintain) {
+					countFinished = integralTaskRecordService.countFinished(uid, id, null); // 鏌ヨ鍘嗗彶
+				}
+				
+				/*
+				 * // 瀹屽杽淇℃伅瀹屾垚鍚庯紝鍒楄〃涓秷澶� if (uniqueKey == UniqueKeyEnum.accountMaintain && taskNum ==
+				 * countFinished) { list.remove(i); i --; continue; }
+				 */
+				
 				progress = progress.replace("{宸插畬鎴恾", countFinished + "").replace("{鎬讳换鍔", taskNum + "");
 
 				if (signState == 0 && uniqueKey == UniqueKeyEnum.dailySign) {
@@ -274,10 +286,7 @@
 			return;
 		}
 
-		int count = 5;
-		if ("android".equalsIgnoreCase(acceptData.getPlatform())) {
-			count = Integer.MAX_VALUE;
-		}
+		int count = Integer.MAX_VALUE;
 
 		List<IntegralTaskRecord> list = integralTaskRecordService.listNotReceived(count, uid);
 		if (list == null) {
@@ -330,24 +339,8 @@
 				return;
 			}
 			Integer goldCoin = integralTaskRecordService.receiveGoldCoin(uid, idList);
-			Set<Long> gidList = gson.fromJson(gids, new TypeToken<HashSet<Long>>() {
-			}.getType());
-			List<IntegralTaskRecord> list = null;
-			if (gidList != null && gidList.size() > 0) {
-				list = integralTaskRecordService.listNotReceivedExcludeId(5 - gidList.size(), uid, gidList);
-			} else {
-				list = integralTaskRecordService.listNotReceivedExcludeId(5, uid, null);
-			}
-
-			if (list == null) {
-				list = new ArrayList<IntegralTaskRecord>();
-			}
-			GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
-			Gson gson2 = gsonBuilder.create();
-
 			JSONObject data = new JSONObject();
 			data.put("goldCoin", goldCoin);
-			data.put("list", gson2.toJson(list));
 			out.print(JsonUtil.loadTrueResult(data));
 		} catch (IntegralTaskRecordException e) {
 			out.print(JsonUtil.loadFalseResult(e.getMsg()));

--
Gitblit v1.8.0