From 64a1ca289eda4deb422549311c4539b09fd30ba3 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期四, 07 十一月 2019 12:31:36 +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/ShareControllerV2.java |   46 +++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
index 6cf3175..dd8b50c 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ShareControllerV2.java
@@ -21,6 +21,7 @@
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
+import com.yeshi.fanli.dto.ConfigParamsDTO;
 import com.yeshi.fanli.dto.jd.JDCouponInfo;
 import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
 import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
@@ -166,10 +167,16 @@
 	@RequestMapping(value = "createShareInfo")
 	public void createShareInfo(AcceptData acceptData, Long uid, Long goodsId, String source, Integer totalNum,
 			Integer goodsType, HttpServletRequest request, PrintWriter out) {
-
 		if (uid == null || uid <= 0) {
 			out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛ID涓嶈兘涓虹┖"));
 			return;
+		}
+		try {
+			// 鏃ュ織璁板綍
+			String info = String.format("type=share&uid=%s&goodsId=%s&source=%s&goodsType=%s", uid, goodsId, source,
+					goodsType);
+			LogHelper.orderInfo(info);
+		} catch (Exception e) {
 		}
 
 		UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
@@ -200,6 +207,21 @@
 			createPDDShare(acceptData, uid, goodsId, source, out);
 			return;
 		}
+	}
+
+	public static String getERCodeContent(TaoBaoGoodsBrief goods, String token) {
+		String content = String.format("銆�%s銆�%s鍏�", goods.getUserType() == 1 ? "T鐚环" : "T瀹濅环",
+				MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + "");
+		content += "\n\r";
+
+		if (!StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
+			content += String.format("銆愬埜鍚庝环銆�%s鍏�", TaoBaoUtil.getAfterUseCouplePrice(goods) + "");
+			content += "\n\r";
+		}
+		content += "------------";
+		content += "\n\r";
+		content += "寰╁埗杩欐潯" + token + "锛岄�插叆Tao瀹濆嵆鍙喘涔�";
+		return content;
 	}
 
 	/**
@@ -235,6 +257,14 @@
 
 		try {
 			ShareInfoVO shareInfo = new ShareInfoVO();
+			// 娴嬭瘯
+			List<String> commentTexts = new ArrayList<>();
+			commentTexts.add("鍙d护1");
+			commentTexts.add("鍙d护2鍙d护鍙d护娣樺彛浠ゅ彛浠ゅ彛浠ゆ窐鍙d护");
+			commentTexts.add("鍙d护3");
+			commentTexts.add("鍙d护鍙d护娣樺彛浠ゅ彛浠ゅ彛浠ゆ窐鍙d护鍙d护鍙d护娣樺彛浠ゅ彛浠ゅ彛浠ゆ窐鍙d护鍙d护鍙d护娣樺彛浠ゅ彛浠ゅ彛浠ゆ窐鍙d护");
+			shareInfo.setCommentTexts(commentTexts);
+			shareInfo.setWxErCode("杩欐槸寰俊鍒嗕韩浜岀淮鐮佸唴瀹�");
 
 			TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
 
@@ -254,7 +284,8 @@
 
 			String shareText = "";
 			// 鏃犲埜
-			String shopType = taoBaoLink.getGoods().getUserType() == 0 ? TaoBaoConstant.SHARE_PRICE_TAOBAO : TaoBaoConstant.SHARE_PRICE_TM;
+			String shopType = taoBaoLink.getGoods().getUserType() == 0 ? TaoBaoConstant.SHARE_PRICE_TAOBAO
+					: TaoBaoConstant.SHARE_PRICE_TM;
 
 			if (StringUtil.isNullOrEmpty(taoBaoLink.getGoods().getCouponInfo())) {
 				String text = shareGoodsTextTemplateService.getCommonTemplate(uid);
@@ -286,6 +317,8 @@
 				descText = descText.substring(0);
 			}
 			shareInfo.setDescText(descText);
+			// 娴嬭瘯
+			shareInfo.setClickUrl(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
 
 			// 鎻愮ず鍥炬枃鍐呭
 			String imgs = configService.get("goods_share_notify_imgs");
@@ -437,7 +470,8 @@
 			shareInfo.setPictUrl(TbImgUtil.getTBSizeImg(goods.getPictUrl(), 500));
 
 			// 鏃犲埜
-			String shopType = goods.getUserType() == 0 ? TaoBaoConstant.SHARE_PRICE_TAOBAO :TaoBaoConstant.SHARE_PRICE_TM;
+			String shopType = goods.getUserType() == 0 ? TaoBaoConstant.SHARE_PRICE_TAOBAO
+					: TaoBaoConstant.SHARE_PRICE_TM;
 			String shareText = "";
 
 			if (StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
@@ -543,7 +577,7 @@
 	public void createJDShare(AcceptData acceptData, Long uid, Long goodsId, String source, PrintWriter out) {
 		JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsId);
 		if (jdGoods == null) {
-			out.print(JsonUtil.loadFalseResult(1, "璇ュ晢鍝佹窐宸蹭笅鏋�"));
+			out.print(JsonUtil.loadFalseResult(1, "璇ュ晢鍝佸凡涓嬫灦"));
 			return;
 		}
 
@@ -1323,6 +1357,8 @@
 
 		BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
 		BigDecimal shareRate = hongBaoManageService.getShareRate();
+		ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
+
 		Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
 				.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
 
@@ -1361,7 +1397,7 @@
 			dataObject.put("totalOrder", goodsGroup.getTotalOrder());
 			dataObject.put("totalMoney", "楼" + goodsGroup.getTotalMoney());
 
-			GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, null, fanLiRate, shareRate);
+			GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
 			detailVO.setId(commonGoods.getId());
 			dataObject.put("goods", gson.toJson(detailVO));
 			array.add(dataObject);

--
Gitblit v1.8.0