From a0f699663a85185a697d88ea964179cdca59f548 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 14 十二月 2018 10:53:23 +0800
Subject: [PATCH] 单品分享页面增加人民币符号

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java |   67 +++++++++++++++++++++++++++++++--
 1 files changed, 63 insertions(+), 4 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java
index 076deeb..762bea1 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/ShareController.java
@@ -15,6 +15,7 @@
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.yeshi.utils.BigDecimalUtil;
 import org.yeshi.utils.HttpUtil;
 import org.yeshi.utils.JsonUtil;
 import org.yeshi.utils.taobao.TbImgUtil;
@@ -123,6 +124,8 @@
 				String text = configService.get("goods_share_text_coupon");
 				shareText = text.replace("[鏍囬]", taoBaoLink.getGoods().getTitle())
 						.replace("[鍦ㄥ敭浠穄", "楼" + taoBaoLink.getGoods().getZkPrice())
+						.replace("[浼樻儬鍒搁噾棰漖",
+								"楼"+BigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getCouponAmount()).toString())
 						.replace("[鍒稿悗浠穄", "楼" + TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()));
 			}
 			shareText = shareText.replace("[浠锋牸绫诲瀷]", shopType);
@@ -140,7 +143,7 @@
 			data.put("notifyDesc", configService.get("goods_share_notify"));
 
 			// 娣诲姞鍒嗕韩璁板綍
-			BigDecimal rate = hongBaoManageService.getFanLiRate();
+			BigDecimal rate = hongBaoManageService.getShareRate();
 			UserShareGoodsHistory history = new UserShareGoodsHistory();
 			history.setTkCode(taoBaoLink.getTaoToken());
 			history.setLink(taoBaoLink.getClickUrl());
@@ -158,6 +161,8 @@
 			history.setUser(new UserInfo(uid));
 			history.setPostPicture(taoBaoLink.getGoods().getPictUrl());
 
+			data.put("shareMoney","楼"+ history.getHongbao().toString());
+
 			out.print(JsonUtil.loadTrueResult(data));
 
 			// 寮傛鎿嶄綔
@@ -167,7 +172,7 @@
 				public void run() {
 					shareGoodsService.addShareGoodsHistory(history);
 					try {
-						userShareGoodsRecordService.save(uid, ShareSourceTypeEnum.goodsDetail, taoBaoLink.getGoods());
+						userShareGoodsRecordService.save(uid, ShareSourceTypeEnum.goodsDetail, null,taoBaoLink.getGoods());
 					} catch (UserShareGoodsRecordException e) {
 						e.printStackTrace();
 					}
@@ -183,7 +188,7 @@
 		}
 
 	}
-
+	
 	/**
 	 * 鍒嗕韩璁板綍缁熻鍒楄〃
 	 * 
@@ -203,6 +208,10 @@
 
 		if (uid == null) {
 			out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
+		}
+
+		if ("all".equals(source)) {
+			source = null;// 鏌ヨ鍏ㄩ儴
 		}
 
 		try {
@@ -242,7 +251,7 @@
 		}
 
 		try {
-			JSONObject data = userShareGoodsGroupService.getGoodsGroup(recordId);
+			JSONObject data = userShareGoodsRecordService.getGoodsGroup(recordId);
 			out.print(JsonUtil.loadTrueResult(data));
 		} catch (Exception e) {
 			out.print(JsonUtil.loadFalseResult("鍔犺浇澶辫触"));
@@ -282,4 +291,54 @@
 		}
 	}
 
+	
+	
+	/**
+	 * 鍟嗗搧璇︽儏鍒嗕韩
+	 * @param acceptData
+	 * @param uid  鐢ㄦ埛id
+	 * @param auctionId  鍟嗗搧id
+	 * @param type 鍥剧墖鍒嗕韩绫诲瀷  鍗曞浘single 澶氬浘many 
+	 * @param out
+	 */
+	@RequestMapping(value = "sharedetail", method = RequestMethod.POST)
+	public void shareDetail(AcceptData acceptData, Long uid, Long auctionId, String type, PrintWriter out) {
+		try {
+			userShareGoodsRecordService.saveDetail(uid, auctionId, type);
+			out.print(JsonUtil.loadTrueResult("鍒嗕韩鎴愬姛"));
+		} catch (UserShareGoodsRecordException e) {
+			out.print(JsonUtil.loadFalseResult(e.getMsg()));
+			e.printStackTrace();
+		} catch (Exception e) {
+			out.print(JsonUtil.loadFalseResult("鍔犺浇澶辫触"));
+			e.printStackTrace();
+		}
+	}
+	
+	
+	/**
+	 * 鏇存柊鍒嗕韩璁板綍
+	 * @param acceptData
+	 * @param shareId
+	 * @param out
+	 */
+	@RequestMapping(value = "updaterecord", method = RequestMethod.POST)
+	public void updateRecord(AcceptData acceptData, Long shareId, PrintWriter out) {
+		if (shareId == null) {
+			out.print(JsonUtil.loadFalseResult("鍙傛暟涓嶆纭�"));
+		}
+		
+		try {
+			userShareGoodsRecordService.updateShareRecord(shareId);
+			out.print(JsonUtil.loadTrueResult(""));
+		} catch (UserShareGoodsRecordException e) {
+			out.print(JsonUtil.loadFalseResult(e.getMsg()));
+			e.printStackTrace();
+		} catch (Exception e) {
+			out.print(JsonUtil.loadFalseResult("鍔犺浇澶辫触"));
+			e.printStackTrace();
+		}
+	}
+
+	
 }

--
Gitblit v1.8.0