From fdb089cb8bee6099efcbd7b0ca2672c63cbb6784 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期一, 11 十一月 2019 09:33:56 +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/RedPackControllerV2.java |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
index 5dfaaf7..4864793 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java
@@ -29,6 +29,7 @@
 import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
 import com.yeshi.fanli.entity.bus.user.UserInfo;
 import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
+import com.yeshi.fanli.entity.redpack.RedPackBalance;
 import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
 import com.yeshi.fanli.entity.redpack.RedPackExchange;
 import com.yeshi.fanli.entity.redpack.RedPackWinInvite;
@@ -77,8 +78,8 @@
 
 	@Resource
 	private RedPackWinInviteService redPackWinInviteService;
-	
-	@Resource	
+
+	@Resource
 	private RedPackWinNewUserService redPackWinNewUserService;
 
 	@Resource
@@ -86,10 +87,10 @@
 
 	@Resource
 	private UserInfoExtraService userInfoExtraService;
-	
+
 	@Resource
 	private JumpDetailV2Service jumpDetailV2Service;
-	
+
 	@Resource
 	private SwiperPictureService swiperPictureService;
 
@@ -380,10 +381,18 @@
 			out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�"));
 			return;
 		}
+
 		JSONObject data = new JSONObject();
 		data.put("balance", redPackBalanceService.getBalance(uid));
 		data.put("ruleLink", redPackConfigService.getValueByKey("invite_reward_rule_link"));
 		data.put("shareLink", UserInviteUtil.getShareUrl(uid));
+
+		RedPackBalance redPackBalance = redPackBalanceService.selectByPrimaryKey(uid);
+		if (redPackBalance != null && redPackBalance.getState() == RedPackBalance.STATE_LOCKED) {
+			data.put("redPackLock", true);
+		} else {
+			data.put("redPackLock", false);
+		}
 
 		UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
 		if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
@@ -397,10 +406,10 @@
 		} else
 			out.print(JsonUtil.loadTrueResult(data));
 	}
-	
-	
+
 	/**
 	 * 鏂颁汉绾㈠寘璇︽儏
+	 * 
 	 * @param acceptData
 	 * @param uid
 	 * @param out
@@ -411,7 +420,7 @@
 			out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�"));
 			return;
 		}
-		
+
 		try {
 			RedPackWinDetailVO winDetail = redPackWinNewUserService.receiveReward(uid);
 			if (winDetail == null) {
@@ -420,7 +429,7 @@
 			}
 			winDetail.setLogo(Constant.systemCommonConfig.getDefaultPortrait());
 			winDetail.setLogoLight(Constant.systemCommonConfig.getDefaultPortrait());
-			
+
 			JSONObject params = new JSONObject();
 			params.put("url", redPackConfigService.getValueByKey("goods_shop_link_h5"));
 			winDetail.setParams(params.toString());
@@ -433,11 +442,11 @@
 			List<SwiperPicture> topPicList = new ArrayList<>();
 			if (oldtopPicList != null && oldtopPicList.size() > 0)
 				topPicList.addAll(oldtopPicList);
-			
+
 			JSONObject data = new JSONObject();
 			data.put("detail", JsonUtil.getApiCommonGson().toJson(winDetail));
 			data.put("banner", JsonUtil.getApiCommonGson().toJson(topPicList));
-		    out.print(JsonUtil.loadTrueResult(data));		
+			out.print(JsonUtil.loadTrueResult(data));
 		} catch (Exception e) {
 			out.print(JsonUtil.loadFalseResult(1, "绾㈠寘宸茶鎶㈠厜鍟�"));
 		}

--
Gitblit v1.8.0