From b9f8ef2c4737b6e6be4b12fc8f7bafb033bfcfe5 Mon Sep 17 00:00:00 2001
From: admin <2780501319@qq.com>
Date: 星期日, 22 九月 2019 16:47:33 +0800
Subject: [PATCH] 金币BUG修改

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java |  124 ++++++++++++++++++++++-------------------
 1 files changed, 66 insertions(+), 58 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 5bb40a6..2f992c1 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
@@ -44,20 +44,21 @@
 import com.yeshi.fanli.log.LogHelper;
 import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
 import com.yeshi.fanli.service.inter.config.ConfigService;
-import com.yeshi.fanli.service.inter.integral.CodePublishRecordService;
-import com.yeshi.fanli.service.inter.integral.IntegralDetailService;
-import com.yeshi.fanli.service.inter.integral.IntegralExchangeRecordService;
-import com.yeshi.fanli.service.inter.integral.IntegralExchangeService;
-import com.yeshi.fanli.service.inter.integral.IntegralGetService;
-import com.yeshi.fanli.service.inter.integral.IntegralTaskClassService;
-import com.yeshi.fanli.service.inter.integral.IntegralTaskRankService;
-import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
-import com.yeshi.fanli.service.inter.integral.IntegralTaskService;
 import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
 import com.yeshi.fanli.service.inter.user.UserInfoService;
+import com.yeshi.fanli.service.inter.user.integral.CodePublishRecordService;
+import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
+import com.yeshi.fanli.service.inter.user.integral.IntegralExchangeRecordService;
+import com.yeshi.fanli.service.inter.user.integral.IntegralExchangeService;
+import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
+import com.yeshi.fanli.service.inter.user.integral.IntegralTaskClassService;
+import com.yeshi.fanli.service.inter.user.integral.IntegralTaskRankService;
+import com.yeshi.fanli.service.inter.user.integral.IntegralTaskRecordService;
+import com.yeshi.fanli.service.inter.user.integral.IntegralTaskService;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.TimeUtil;
+import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
 import com.yeshi.fanli.vo.integral.DailySignVO;
 import com.yeshi.fanli.vo.integral.ExchangeTipVO;
 import com.yeshi.fanli.vo.integral.IntegralDetailVO;
@@ -183,11 +184,11 @@
 				data.put("userRank", gson.toJson(userRank));
 				data.put("dailySign", dailySignVO);
 			}
-			for(int i = 0; i < list.size(); i++) {
+			for (int i = 0; i < list.size(); i++) {
 				IntegralTaskClassVO taskClassVO = list.get(i);
-				
+
 				UniqueKeyEnum uniqueKey = taskClassVO.getUniqueKey();
-				
+
 				// 閭�璇峰ソ鍙嬶細鏄惁婵�娲婚個璇风爜
 				if (uniqueKey == UniqueKeyEnum.inviteTeam) {
 					UserInfoExtraVO extraVO = userInfoExtraService.getInfoExtraVOByUid(uid);
@@ -234,7 +235,6 @@
 					taskClassVO.setLightUp(true);
 				}
 
-				
 				int countFinished = 0;
 				Long id = taskClassVO.getId();
 				// 鏌ヨ褰撴棩
@@ -245,16 +245,17 @@
 						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; }
+				 * // 瀹屽杽淇℃伅瀹屾垚鍚庯紝鍒楄〃涓秷澶� if (uniqueKey ==
+				 * UniqueKeyEnum.accountMaintain && taskNum == countFinished) {
+				 * list.remove(i); i --; continue; }
 				 */
-				
+
 				progress = progress.replace("{宸插畬鎴恾", countFinished + "").replace("{鎬讳换鍔", taskNum + "");
 
 				if (signState == 0 && uniqueKey == UniqueKeyEnum.dailySign) {
@@ -312,6 +313,7 @@
 	 *            // 鏈鍙杋d
 	 * @param out
 	 */
+	@RequestSerializableByKey(key = "'receiveGoldCoin-'+#uid")
 	@RequestMapping(value = "receiveGoldCoin", method = RequestMethod.POST)
 	public void receiveGoldCoin(AcceptData acceptData, Long uid, Integer type, String ids, String gids,
 			PrintWriter out) {
@@ -342,7 +344,7 @@
 			JSONObject data = new JSONObject();
 			data.put("goldCoin", goldCoin);
 			out.print(JsonUtil.loadTrueResult(data));
-		} catch (IntegralTaskRecordException e) {
+		} catch (IntegralTaskRecordException e) { 
 			out.print(JsonUtil.loadFalseResult(e.getMsg()));
 		}
 	}
@@ -421,6 +423,7 @@
 	 * @param id
 	 * @param out
 	 */
+	@RequestSerializableByKey(key = "'integralexchange-'+#uid")
 	@RequestMapping(value = "exchange", method = RequestMethod.POST)
 	public void exchange(AcceptData acceptData, Long uid, Long id, PrintWriter out) {
 		try {
@@ -472,6 +475,7 @@
 	 * @param id
 	 * @param out
 	 */
+	@RequestSerializableByKey(key = "'exchangeInviteCode-'+#uid")
 	@RequestMapping(value = "exchangeInviteCode", method = RequestMethod.POST)
 	public void exchangeInviteCode(AcceptData acceptData, Long uid, Long id, PrintWriter out) {
 		try {
@@ -540,46 +544,50 @@
 		}
 		IntegralTaskRecord record = null;
 
-		if (TaskUniqueKeyEnum.recommendSearch.name().equalsIgnoreCase(event)) {
-			record = integralGetService.addRecommendSearch(uid);
-		} else if (TaskUniqueKeyEnum.shareInvite.name().equalsIgnoreCase(event)) {
-			record = integralGetService.addShareInvite(uid);
-		} else if (TaskUniqueKeyEnum.inShop.name().equalsIgnoreCase(event)) {
-			JSONObject json = JSONObject.fromObject(data);
-			record = integralGetService.addIntoShop(uid, StringUtil.Md5(json.optString("url")));
-		} else if (TaskUniqueKeyEnum.scanPush.name().equalsIgnoreCase(event)) {
-			record = integralGetService.addScanPushHistory(uid);
-		} else if (TaskUniqueKeyEnum.scanGoods.name().equalsIgnoreCase(event)) {
-			JSONObject json = JSONObject.fromObject(data);
-			record = integralGetService.addScanGoodsDetail(uid, json.optInt("goodsType"), json.optLong("goodsId"));
-		} else if (TaskUniqueKeyEnum.scanHomeBanner.name().equalsIgnoreCase(event)) {
-			JSONObject json = JSONObject.fromObject(data);
-			record = integralGetService.addScanRecommendBanner(uid, json.optString("id"));
-		} else if (TaskUniqueKeyEnum.scanSpecial.name().equalsIgnoreCase(event)) {
-			JSONObject json = JSONObject.fromObject(data);
-			record = integralGetService.addScanRecommendSpecial(uid, json.optString("id"));
-		} else if (TaskUniqueKeyEnum.scanTBCart.name().equalsIgnoreCase(event)) {
-			record = integralGetService.addScanTaoBaoCart(uid);
-		}
-
-		if (record != null) {
-			JSONObject notifyData = new JSONObject();
-			if (TaskUniqueKeyEnum.recommendSearch.name().equalsIgnoreCase(event)
-					|| TaskUniqueKeyEnum.scanGoods.name().equalsIgnoreCase(event)
-					|| TaskUniqueKeyEnum.scanTBCart.name().equalsIgnoreCase(event)) {
-				JSONObject notify = new JSONObject();
-				if (TaskUniqueKeyEnum.recommendSearch.name().equalsIgnoreCase(event))
-					notify.put("name", "瀹屾垚涓�娆℃櫤鑳芥悳绱�");
-				else if (TaskUniqueKeyEnum.scanGoods.name().equalsIgnoreCase(event))
-					notify.put("name", "瀹屾垚涓�娆″晢鍝佹祻瑙�");
-				else if (TaskUniqueKeyEnum.scanTBCart.name().equalsIgnoreCase(event))
-					notify.put("name", "瀹屾垚涓�娆¤喘鐗╄溅娴忚");
-
-				notify.put("score", String.format("+%s閲戝竵", record.getGoldCoin()));
-				notifyData.put("notify", notify);
+		try {
+			if (TaskUniqueKeyEnum.recommendSearch.name().equalsIgnoreCase(event)) {
+				record = integralGetService.addRecommendSearch(uid);
+			} else if (TaskUniqueKeyEnum.shareInvite.name().equalsIgnoreCase(event)) {
+				record = integralGetService.addShareInvite(uid);
+			} else if (TaskUniqueKeyEnum.inShop.name().equalsIgnoreCase(event)) {
+				JSONObject json = JSONObject.fromObject(data);
+				record = integralGetService.addIntoShop(uid, StringUtil.Md5(json.optString("url")));
+			} else if (TaskUniqueKeyEnum.scanPush.name().equalsIgnoreCase(event)) {
+				record = integralGetService.addScanPushHistory(uid);
+			} else if (TaskUniqueKeyEnum.scanGoods.name().equalsIgnoreCase(event)) {
+				JSONObject json = JSONObject.fromObject(data);
+				record = integralGetService.addScanGoodsDetail(uid, json.optInt("goodsType"), json.optLong("goodsId"));
+			} else if (TaskUniqueKeyEnum.scanHomeBanner.name().equalsIgnoreCase(event)) {
+				JSONObject json = JSONObject.fromObject(data);
+				record = integralGetService.addScanRecommendBanner(uid, json.optString("id"));
+			} else if (TaskUniqueKeyEnum.scanSpecial.name().equalsIgnoreCase(event)) {
+				JSONObject json = JSONObject.fromObject(data);
+				record = integralGetService.addScanRecommendSpecial(uid, json.optString("id"));
+			} else if (TaskUniqueKeyEnum.scanTBCart.name().equalsIgnoreCase(event)) {
+				record = integralGetService.addScanTaoBaoCart(uid);
 			}
-			out.print(JsonUtil.loadTrueResult(notifyData));
-		} else {
+
+			if (record != null) {
+				JSONObject notifyData = new JSONObject();
+				if (TaskUniqueKeyEnum.recommendSearch.name().equalsIgnoreCase(event)
+						|| TaskUniqueKeyEnum.scanGoods.name().equalsIgnoreCase(event)
+						|| TaskUniqueKeyEnum.scanTBCart.name().equalsIgnoreCase(event)) {
+					JSONObject notify = new JSONObject();
+					if (TaskUniqueKeyEnum.recommendSearch.name().equalsIgnoreCase(event))
+						notify.put("name", "瀹屾垚涓�娆℃櫤鑳芥悳绱�");
+					else if (TaskUniqueKeyEnum.scanGoods.name().equalsIgnoreCase(event))
+						notify.put("name", "瀹屾垚涓�娆″晢鍝佹祻瑙�");
+					else if (TaskUniqueKeyEnum.scanTBCart.name().equalsIgnoreCase(event))
+						notify.put("name", "瀹屾垚涓�娆¤喘鐗╄溅娴忚");
+
+					notify.put("score", String.format("+%s閲戝竵", record.getGoldCoin()));
+					notifyData.put("notify", notify);
+				}
+				out.print(JsonUtil.loadTrueResult(notifyData));
+			} else {
+				out.print(JsonUtil.loadFalseResult(""));
+			}
+		} catch (Exception e) {
 			out.print(JsonUtil.loadFalseResult(""));
 		}
 	}

--
Gitblit v1.8.0