From d960fdbfe07a65cb80ccb764bfb15ce78ebfd84a Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 10 四月 2020 18:21:04 +0800
Subject: [PATCH] 消息修改

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserCouponController.java |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserCouponController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserCouponController.java
index 58f80f4..902464d 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserCouponController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserCouponController.java
@@ -19,6 +19,7 @@
 import com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord;
 import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
 import com.yeshi.fanli.entity.bus.user.UserLotteryRecord;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.entity.system.SystemCoupon;
 import com.yeshi.fanli.exception.user.UserLotteryRecordException;
 import com.yeshi.fanli.exception.user.UserSystemCouponException;
@@ -104,7 +105,7 @@
 			// 绂忓埄涓績鍥剧墖
 			String topPicture = null;
 			if (page == 1) {
-				List<SwiperPicture> listswiper = swiperPictureService.getByBannerCard("welfare_top");
+				List<SwiperPicture> listswiper = swiperPictureService.getByBannerCardAndVersion("welfare_top",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
 				if (listswiper != null && listswiper.size() > 0) {
 					topPicture = listswiper.get(0).getSrc();
 				}
@@ -184,11 +185,11 @@
 			}
 
 			JSONObject dataTip = new JSONObject();
-			dataTip.put("content", configService.get("free_coupon_tip"));
+			dataTip.put("content", configService.get(ConfigKeyEnum.freeCouponTip.getKey()));
 			dataTip.put("fontColor", "#F14242");
 
 			JSONObject data = new JSONObject();
-			data.put("helpLink", configService.get("free_coupon_help"));
+			data.put("helpLink", configService.get(ConfigKeyEnum.freeCouponHelp.getKey()));
 			data.put("tip", dataTip);
 			data.put("count", resultList.size());
 			data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
@@ -257,7 +258,7 @@
 			}
 
 			JSONObject data = new JSONObject();
-			data.put("helpLink", configService.get("reward_coupon_help"));
+			data.put("helpLink", configService.get(ConfigKeyEnum.rewardCouponHelp.getKey()));
 			data.put("count", resultList.size());
 			data.put("result_list", JsonUtil.getApiCommonGson().toJson(resultList));
 
@@ -279,31 +280,27 @@
 	 * @param uid
 	 * @param out
 	 */
-	@RequestMapping(value = "useRewardCoupon", method = RequestMethod.POST)
-	public void useRewardCoupon(AcceptData acceptData, Long uid, Long cid, String orderNo, Integer goodsType, PrintWriter out) {
-
+	@RequestMapping(value = "useRewardCoupon")
+	public void useRewardCoupon(String callback, AcceptData acceptData, Long uid, Long cid, String orderNo, Integer goodsType, PrintWriter out) {
 		if (uid == null) {
-			out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
 			return;
 		}
-
 		if (userVIPInfoService.isVIP(uid)) {
-			out.print(JsonUtil.loadFalseResult("瓒呯骇浼氬憳涓嶅彲浣跨敤濂栧姳鍒�"));
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("瓒呯骇浼氬憳涓嶅彲浣跨敤濂栧姳鍒�"));
 			return;
 		}
-		
 		if (goodsType == null || goodsType > 3 || goodsType < 1) {
 			goodsType = Constant.SOURCE_TYPE_TAOBAO;
 		}
-		
 		try {
 			UserSystemCouponService.useOrderCoupon(uid, cid, orderNo, goodsType, acceptData);
 			JSONObject data = commonOrderService.getRewardJumpInfo(orderNo, goodsType);
-			out.print(JsonUtil.loadTrueResult(data));
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
 		} catch (UserSystemCouponException e) {
-			out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
 		} catch (Exception e) {
-			out.print(JsonUtil.loadFalseResult(1, "浣跨敤澶辫触"));
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "浣跨敤澶辫触"));
 			e.printStackTrace();
 		}
 	}
@@ -402,7 +399,7 @@
 				count = count - list.size();
 			}
 			// 鎶藉瑙勫垯
-			String lotteryRule = configService.get("lottery_rule_newbies");
+			String lotteryRule = configService.get(ConfigKeyEnum.lotteryRuleNewbies.getKey());
 			
 			JSONObject data = new JSONObject();
 			data.put("count", count);

--
Gitblit v1.8.0