From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 25 二月 2025 16:41:22 +0800
Subject: [PATCH] 淘宝转链接口更新

---
 fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java | 1191 ++++++++++++++---------------------------------------------
 1 files changed, 290 insertions(+), 901 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java b/fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java
index b0a3ec9..6da3998 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/ClientJspController.java
@@ -1,901 +1,290 @@
-package com.yeshi.fanli.controller;
-
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.math.BigDecimal;
-import java.net.URLEncoder;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.taobao.api.ApiException;
-import com.yeshi.fanli.entity.admin.InviteGetMoney;
-import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass;
-import com.yeshi.fanli.entity.bus.recommend.RecommendDetails;
-import com.yeshi.fanli.entity.bus.recommend.RecommendSectionDetail;
-import com.yeshi.fanli.entity.bus.recommend.RecommendSectionGoods;
-import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
-import com.yeshi.fanli.entity.bus.user.HongBao;
-import com.yeshi.fanli.entity.bus.user.InviteUser;
-import com.yeshi.fanli.entity.bus.user.ThreeSaleRank;
-import com.yeshi.fanli.entity.bus.user.UserInfo;
-import com.yeshi.fanli.entity.system.CustomerContent;
-import com.yeshi.fanli.entity.system.CustomerName;
-import com.yeshi.fanli.entity.system.System;
-import com.yeshi.fanli.entity.system.SystemClientParams;
-import com.yeshi.fanli.entity.taobao.PidUser;
-import com.yeshi.fanli.entity.taobao.RelateGoods;
-import com.yeshi.fanli.entity.taobao.TaoBaoCoupon;
-import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
-import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
-import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
-import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
-import com.yeshi.fanli.exception.ShareGoodsException;
-import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
-import com.yeshi.fanli.log.LogHelper;
-import com.yeshi.fanli.service.inter.config.ConfigService;
-import com.yeshi.fanli.service.inter.config.InviteGetMoneyService;
-import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
-import com.yeshi.fanli.service.inter.config.SystemConfigService;
-import com.yeshi.fanli.service.inter.config.SystemService;
-import com.yeshi.fanli.service.inter.goods.ClassRecommendGoodsService;
-import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
-import com.yeshi.fanli.service.inter.goods.RecommendDetailsService;
-import com.yeshi.fanli.service.inter.goods.RecommendSectionDetailService;
-import com.yeshi.fanli.service.inter.goods.RecommendSectionGoodsService;
-import com.yeshi.fanli.service.inter.goods.RecommendSectionService;
-import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
-import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
-import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
-import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
-import com.yeshi.fanli.service.inter.hongbao.HongBaoMessageService;
-import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
-import com.yeshi.fanli.service.inter.hongbao.ThreeSaleRankService;
-import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
-import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
-import com.yeshi.fanli.service.inter.user.ScanHistoryService;
-import com.yeshi.fanli.service.inter.user.ShamUserService;
-import com.yeshi.fanli.service.inter.user.ShareManageService;
-import com.yeshi.fanli.service.inter.user.UserInfoService;
-import com.yeshi.fanli.util.AESUtil;
-import com.yeshi.fanli.util.Constant;
-import com.yeshi.fanli.util.GsonUtil;
-import com.yeshi.fanli.util.RedisManager;
-import com.yeshi.fanli.util.StringUtil;
-import com.yeshi.fanli.util.Utils;
-import com.yeshi.fanli.util.taobao.TaoBaoUtil;
-import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
-import com.yeshi.fanli.util.wx.WXLoginUtil;
-import org.yeshi.utils.HttpUtil;
-import org.yeshi.utils.JsonUtil;
-import org.yeshi.utils.NumberUtil;
-import org.yeshi.utils.wx.WXUtil;
-
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-
-/**
- * 瀹㈡埛绔綉椤垫帴鍙d笌寰俊缃戦〉鎺ュ彛
- * 
- * @author Administrator
- *
- */
-
-@Controller
-@RequestMapping("/client")
-public class ClientJspController {
-
-	@Resource
-	private GoodsSecondClassService goodsSecondClassService;
-
-	@Resource
-	private ClassRecommendGoodsService classRecommendGoodsService;
-
-	@Resource
-	private ScanHistoryService scanHistoryService;
-
-	@Resource
-	private ConfigService configService;
-
-	@Resource
-	private ShareManageService shareManageService;
-
-	@Resource
-	private HongBaoManageService hongBaoManageService;
-
-	@Resource
-	private ShamUserService shamUserService;
-
-	@Resource
-	private TaoBaoCouponService taoBaoCouponService;
-
-	@Resource
-	private RecommendDetailsService recommendDetailsService;
-	@Resource
-	private RecommendSectionService recommendSectionService;
-
-	@Resource
-	private RecommendSectionGoodsService recommendSectionGoodsService;
-
-	@Resource
-	private RecommendSectionDetailService recommendSectionDetailService;
-
-	@Resource
-	private ThreeSaleSerivce threeSaleSerivce;
-
-	@Resource
-	private HongBaoService hongBaoService;
-
-	@Resource
-	private UserInfoService userInfoService;
-
-	@Resource
-	private HongBaoMessageService hongBaoMessageService;
-
-	@Resource
-	private ThreeSaleRankService threeSaleRankService;
-
-	@Resource
-	private SystemService systemService;
-
-	@Resource
-	private SystemConfigService systemConfigService;
-
-	@Resource
-	private SystemClientParamsService systemClientParamsService;
-
-	@Resource
-	private ShareGoodsService shareGoodsService;
-
-	@Resource
-	private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
-
-	@Resource
-	private RedisManager redisManager;
-
-	@Resource
-	private InviteGetMoneyService inviteGetMoneyService;
-
-	@Resource
-	private TaoBaoUnionConfigService taoBaoUnionConfigService;
-
-	private static final String DOWNURL = "http://sj.qq.com/myapp/detail.htm?apkName="
-			+ Constant.systemCommonConfig.getAndroidPackageName();
-
-	private static final String DOWNURL2 = "http://121.42.200.138/apk/fanliquan20180124.apk";
-
-	@RequestMapping("classify")
-	public String setClassify(long id, String key, String title, Model model) {
-		String decodeKey = "";
-		String decodeName = "";
-		try {
-			decodeKey = new String(key.getBytes("iso8859-1"), "UTF-8");
-			decodeName = new String(title.getBytes("iso8859-1"), "UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			decodeKey = key;
-			decodeName = title;
-			e.printStackTrace();
-		}
-		List<GoodsSecondClass> goodsSecondClassList = goodsSecondClassService.getGoodsSecondClassByGoodsClassId(id);
-		List<TaoBaoGoodsBriefExtra> taoBaoGoodsBriefExtraList = scanHistoryService
-				.getHotTaoBaoGoodsBriefExtras(decodeKey, 1);
-		model.addAttribute("goodsSecondClassList", goodsSecondClassList);
-		model.addAttribute("taoBaoGoodsBriefExtraList", taoBaoGoodsBriefExtraList);
-		model.addAttribute("title", decodeName);
-		return "classify";
-	}
-
-	@RequestMapping("coupon")
-	public String conpon(Model model) {
-		List<TaoBaoCoupon> couponList = taoBaoCouponService.getTaoBaoCouponList("", 1);
-		String proportion = hongBaoManageService.get(Constant.HONGBAO_GOODS_PROPORTION);
-		String jsonArr = Utils.imgListSize(JsonUtil.getApiCommonGson().toJson(couponList));
-		JSONArray jsonArray = JSONArray.fromObject(jsonArr);
-		List<TaoBaoCoupon> collection = (List<TaoBaoCoupon>) JSONArray.toCollection(jsonArray, TaoBaoCoupon.class);
-		model.addAttribute("couponList", collection);
-		model.addAttribute("proportion", proportion);
-		return "coupon";
-	}
-
-	@RequestMapping("findThreeSaleInfo")
-	public void findThreeSaleInfo(long id, PrintWriter out) {
-		int count = threeSaleSerivce.findInviteCount(id);
-		double money = hongBaoService.findThreeSaleMoney(id);
-		List<ThreeSaleRank> list = threeSaleRankService.rank(5);
-		JSONObject data = new JSONObject();
-		data.put("count", count);
-		data.put("money", money);
-		data.put("list", list);
-		out.print(JsonUtil.loadTrueResult(data));
-	}
-
-	@RequestMapping("findThreeFriendsCount")
-	public void findThreeFriendsCount(long id, String callback, PrintWriter out) {
-		int count1 = userInfoService.findFriendsCount(id, 1);
-		int count2 = userInfoService.findFriendsCount(id, 2);
-		JSONObject data = new JSONObject();
-		data.put("count1", count1);
-		data.put("count2", count2);
-
-		if (!StringUtil.isNullOrEmpty(callback)) {
-			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
-		} else {
-			out.print(JsonUtil.loadTrueResult(data));
-		}
-	}
-
-	@RequestMapping("findThreeFriends")
-	public void findThreeFriends(long id, int type, int page, String callback, PrintWriter out) {
-		int pageSize = 30;
-		List<InviteUser> list = userInfoService.getFriendsList(id, type, page, pageSize);
-		JSONArray array = new JSONArray();
-		for (InviteUser user : list) {
-			JSONObject item = JSONObject.fromObject(new GsonBuilder().create().toJson(user.getUserInfo()));
-			item.put("valid", user.isValid());
-			array.add(item);
-		}
-
-		long count = userInfoService.getFriendsListCount(id, type);
-
-		JSONObject data = new JSONObject();
-		data.put("list", array);
-		data.put("pages", count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
-		if (!StringUtil.isNullOrEmpty(callback)) {
-			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
-		} else {
-			out.print(JsonUtil.loadTrueResult(data));
-		}
-	}
-
-	@RequestMapping("findThreeSales")
-	public void findThreeSales(long id, PrintWriter out) {
-		List<HongBao> list = hongBaoService.findThreeSaleHongBao(id);
-		String json = JsonUtil.getApiCommonGson().toJson(list);
-		JSONObject data = new JSONObject();
-		data.put("list", json);
-		out.print(JsonUtil.loadTrueResult(data));
-	}
-
-	@RequestMapping(value = "getConpon", method = RequestMethod.POST)
-	public void getConpon(int page, PrintWriter out) {
-		List<TaoBaoCoupon> taoBaoCouponList = taoBaoCouponService.getTaoBaoCouponList("", page);
-		String proportion = hongBaoManageService.get(Constant.HONGBAO_GOODS_PROPORTION);
-		JSONObject data = new JSONObject();
-		data.put("taoBaoCouponList", Utils.imgListSize(JsonUtil.getApiCommonGson().toJson(taoBaoCouponList)));
-		data.put("proportion", proportion);
-		out.print(JsonUtil.loadTrueResult(data));
-	}
-
-	@RequestMapping(value = "getHotGoods", method = RequestMethod.POST)
-	public void getHotGoods(String key, int page, PrintWriter out) {
-		List<TaoBaoGoodsBriefExtra> taoBaoGoodsBriefExtraList = scanHistoryService.getHotTaoBaoGoodsBriefExtras(key,
-				page);
-		if (taoBaoGoodsBriefExtraList.size() > 0) {
-			out.append(JsonUtil.loadTrueResult(taoBaoGoodsBriefExtraList));
-		} else {
-			out.append(JsonUtil.loadFalseResult("娌℃湁鏇村鍟嗗搧"));
-		}
-	}
-
-	@RequestMapping("share")
-	public String getShare(Model model, String uid) {
-		String value = configService.get("share_message");
-		try {
-			if (uid == null) {
-				uid = "0";
-			}
-			String base64String = StringUtil.getBase64String(uid + "");
-			String format = MessageFormat.format(value, base64String);
-			model.addAttribute("share", format);
-			model.addAttribute("down",
-					"http://file.sovideo.cn/buxinjie/weixinfriendinvite/index.html?yqm=" + base64String);
-			model.addAttribute("shareCode", "閭�璇风爜锛�" + base64String);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return "getcash";
-	}
-
-	@RequestMapping("shares")
-	public String getShares(Model model, String uid) {
-		String value = configService.get("share_message");
-		try {
-			if (uid == null) {
-				uid = "0";
-			}
-			String base64String = StringUtil.getBase64String(uid + "");
-			String format = MessageFormat.format(value, base64String);
-			model.addAttribute("share", format);
-			model.addAttribute("uid", uid);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return "invite";
-	}
-
-	@RequestMapping(value = "/{uid}")
-	public String threeShareRep(@PathVariable String uid, String code, String state, String packages, String platform,
-			String ios, HttpSession httpSession, HttpServletRequest request) {
-
-		System system = systemService.getSystem(platform, packages);
-		String wxState = (String) httpSession.getAttribute("wxState");
-		// 閫氳繃閰嶇疆鍙傛暟鑾峰彇
-		String down = DOWNURL2;
-
-		SystemClientParams params = systemClientParamsService.getSystemClientParamsBySystemAndKey(system,
-				"fenxiao_download_apk_url");
-		if (params != null)
-			down = params.getValue();
-		if ("2".equalsIgnoreCase(ios)) {
-			down = DOWNURL;
-		}
-		if (!state.equals(wxState)) {// 涓嶆槸寰俊杩斿洖鐨勶紒
-			// request.setAttribute("error", "1");
-			return "redirect:" + down;
-		}
-		if (code == null) {// 鐢ㄦ埛鍙栨秷浜嗙櫥闄嗭紒
-			return "redirect:" + down;
-		}
-
-		UserInfo inviter = userInfoService.getUserById(Long.parseLong(uid));
-		if (inviter == null) {// 娌″緱杩欎釜浜�
-			return "redirect:" + down;
-		}
-		boolean b = userInfoService.inviteWXUserInfo(code, inviter);
-		if (!b) { // 缁戝畾澶辫触
-			// request.setAttribute("msg", "闈炲父閬楁喚锛屼綘宸查鍙栬繃绾㈠寘锛岃鍕垮啀娆¢鍙栥��");
-			return "redirect:" + down;
-		}
-
-		return "redirect:" + down;
-	}
-
-	@RequestMapping(value = "/new/{uid}")
-	public String threeShareRepNew(@PathVariable String uid, String code, String state, String packages,
-			String platform, String ios, HttpSession httpSession, HttpServletRequest request) {
-
-		System system = systemService.getSystem(platform, packages);
-		String wxState = (String) httpSession.getAttribute("wxState");
-		// 閫氳繃閰嶇疆鍙傛暟鑾峰彇
-		String down = DOWNURL2;
-
-		SystemClientParams params = systemClientParamsService.getSystemClientParamsBySystemAndKey(system,
-				"download_app_url");
-		if (params != null)
-			down = params.getValue();
-
-		if (!state.equals(wxState)) {// 涓嶆槸寰俊杩斿洖鐨勶紒
-			// request.setAttribute("error", "1");
-			return "redirect:" + down;
-		}
-		if (code == null) {// 鐢ㄦ埛鍙栨秷浜嗙櫥闄嗭紒
-			return "redirect:" + down;
-		}
-
-		UserInfo inviter = userInfoService.getUserById(Long.parseLong(uid));
-		if (inviter == null) {// 娌″緱杩欎釜浜�
-			return "redirect:" + down;
-		}
-
-		boolean b = userInfoService.inviteWXUserInfo(code, inviter);
-		if (!b) { // 缁戝畾澶辫触
-			// request.setAttribute("msg", "闈炲父閬楁喚锛屼綘宸查鍙栬繃绾㈠寘锛岃鍕垮啀娆¢鍙栥��");
-			return "redirect:" + down;
-		}
-
-		return "redirect:" + down;
-	}
-
-	@RequestMapping("threeShare")
-	public String threeShare(HttpServletRequest request, HttpSession session, long uid) {
-		String serverName = request.getServerName();
-		String contextPath = request.getContextPath();
-		UserInfo userInfo = userInfoService.getUserById(uid);
-		if (userInfo == null) {
-			return "share/error";
-		}
-
-		try {
-			String header = request.getHeader("User-Agent");// MicroMessenger锛氬井淇℃祻瑙堝櫒
-			String ios = "ios=1";
-			if (header.contains("iPhone")) {
-				ios = "ios=2";
-			}
-			String redirect_uri = "http://" + serverName + contextPath + "/client/" + uid + "?packages="
-					+ Constant.systemCommonConfig.getAndroidPackageName() + "&platform=ANDROID&" + ios;
-			redirect_uri = URLEncoder.encode(redirect_uri, "utf-8");
-			long currentTimeMillis = java.lang.System.currentTimeMillis();
-			String md5 = StringUtil.Md5(currentTimeMillis + "");
-			session.setAttribute("wxState", md5);
-			String baseUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + WXLoginUtil.WEXIN_APPID
-					+ "&redirect_uri=" + redirect_uri + "&response_type=code&scope=snsapi_userinfo&state=" + md5
-					+ "#wechat_redirect";
-			// List<HongBaoMessage> list =
-			// shamUserService.findShamThreeSaleInfo();
-			request.setAttribute("jumpUrl", baseUrl);
-			request.setAttribute("name", userInfo.getNickName());
-			request.setAttribute("picture", userInfo.getPortrait());
-			// request.setAttribute("list", list);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		return "share2/yaoqing";
-	}
-
-	// 鏂扮増鍒嗕韩
-	@RequestMapping("threeShareNew")
-	public String threeShareNew(HttpServletRequest request, HttpSession session, HttpServletResponse response,
-			long uid) {
-		String serverName = request.getServerName();
-		String contextPath = request.getContextPath();
-		UserInfo userInfo = userInfoService.getUserById(uid);
-		if (userInfo == null) {
-			return "share/error";
-		}
-
-		try {
-			String header = request.getHeader("User-Agent");// MicroMessenger锛氬井淇℃祻瑙堝櫒
-			String ios = "ios=1";
-			if (header.contains("iPhone")) {
-				ios = "ios=2";
-			}
-			String redirect_uri = "http://" + Constant.wxGZConfig.getLoginHost() + "/"
-					+ Constant.systemCommonConfig.getProjectName() + "/client/new/" + uid + "?packages="
-					+ Constant.systemCommonConfig.getAndroidPackageName() + "&platform=ANDROID&" + ios;
-			redirect_uri = URLEncoder.encode(redirect_uri, "utf-8");
-
-			long currentTimeMillis = java.lang.System.currentTimeMillis();
-			String md5 = StringUtil.Md5(currentTimeMillis + "");
-			session.setAttribute("wxState", md5);
-			String baseUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + WXLoginUtil.WEXIN_APPID
-					+ "&redirect_uri=" + redirect_uri + "&response_type=code&scope=snsapi_userinfo&state=" + md5
-					+ "#wechat_redirect";
-			response.sendRedirect(baseUrl);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		return "share2/yaoqing";
-	}
-
-	@RequestMapping("callBack")
-	public void callBack(HttpServletRequest request, PrintWriter out) {
-		if (!StringUtil.isNullOrEmpty(request.getParameter("echostr"))) {
-			out.print(request.getParameter("echostr"));
-			return;
-		}
-
-		Map<String, String> map = WXUtil.parseXML(request);
-		String ghId = map.get("ToUserName");
-		if (ghId == null) {
-			out.print("");
-			return;
-		}
-		String type = map.get("MsgType");
-		if ("event".equalsIgnoreCase(type)) {
-			String event = map.get("Event");
-			if (event.equalsIgnoreCase("subscribe")) {// 鍏虫敞
-				Map<String, String> parmas = new HashMap<>();
-				parmas.put("ToUserName", map.get("FromUserName"));
-				parmas.put("FromUserName", ghId);
-				parmas.put("CreateTime", java.lang.System.currentTimeMillis() / 1000 + "");
-				parmas.put("MsgType", "text");
-				parmas.put("Content", Constant.wxGZConfig.getWelcomeMsg());
-				out.print(WXUtil.loadWXMessage(parmas));
-			}
-		} else if ("text".equalsIgnoreCase(type)) {
-			String content = map.get("Content");
-			if (!StringUtil.isNullOrEmpty(content)) {
-				try {
-					if (request.getSession().getAttribute("search-quan-" + map.get("FromUserName")) == null) {
-						request.getSession().setAttribute("search-quan-" + map.get("FromUserName"), "1");
-						TaoBaoSearchResult result = TaoKeApiUtil.searchCouple(content, null, 1, 5);
-						if (result == null || result.getTaoBaoGoodsBriefs() == null
-								|| result.getTaoBaoGoodsBriefs().size() <= 0) {
-							Map<String, String> parmas = new HashMap<>();
-							parmas.put("ToUserName", map.get("FromUserName"));
-							parmas.put("FromUserName", ghId);
-							parmas.put("CreateTime", java.lang.System.currentTimeMillis() / 1000 + "");
-							parmas.put("MsgType", "text");
-							parmas.put("Content", String.format("[寰瑧]鎶辨瓑锛屾病鏈夎兘涓轰綘鎵惧埌鍏充簬銆�%s銆戠殑浼樻儬鍒革紝[鏈烘櫤]浣犲彲浠ヨ瘯璇曞叾浠栧叧閿瘝", content));
-							out.print(WXUtil.loadWXMessage(parmas));
-						} else {
-							String host = HttpUtil.getHost(Constant.wxGZConfig.getH5Url());
-							String url = HttpUtil.getShortLink("http://" + host + "/search.html?key=" + content);
-							String text = String.format("[寰楁剰]宸茬粡涓轰綘鎵惧埌浜嗗叧浜庛��%s銆戠殑浼樻儬鍒� \n 馃憠 %s", content, url);
-							Map<String, String> parmas = new HashMap<>();
-							parmas.put("ToUserName", map.get("FromUserName"));
-							parmas.put("FromUserName", ghId);
-							parmas.put("CreateTime", java.lang.System.currentTimeMillis() / 1000 + "");
-							parmas.put("MsgType", "text");
-							parmas.put("Content", text);
-							out.print(WXUtil.loadWXMessage(parmas));
-						}
-					}
-
-				} finally {
-					request.getSession().removeAttribute("search-quan-" + map.get("FromUserName"));
-				}
-
-			}
-
-		}
-
-	}
-
-	@RequestMapping(value = "shareSubmit", method = RequestMethod.POST)
-	public void getShareSubmit(long uid, String share, PrintWriter out) {
-		String uidStr = StringUtil.getFromBase64(share);
-		boolean b = NumberUtil.isNumeric(uidStr);
-		if (!b) {
-			out.print(JsonUtil.loadTrueResult("0")); // 涓嶅瓨鍦ㄨ閭�璇风爜
-			return;
-		}
-		long inviterId = Long.parseLong(uidStr);
-		int type = shareManageService.addShareManage(inviterId, uid);
-		if (type == -1) {
-			out.print(JsonUtil.loadTrueResult("-1")); // 閭�璇疯�呬笌琚個璇疯�呬笉鑳界浉鍚�
-			return;
-		} else if (type == 0) {
-			out.print(JsonUtil.loadTrueResult("0")); // 涓嶅瓨鍦ㄨ閭�璇风爜
-			return;
-		} else if (type == 2) {
-			out.print(JsonUtil.loadTrueResult("2")); // 琚個璇疯�呬笉鏄柊鐢ㄦ埛
-			return;
-		} else if (type == 3) {
-			out.print(JsonUtil.loadTrueResult("3")); // 琚個璇疯�呭凡瀛樺湪
-			return;
-		} else {
-			out.print(JsonUtil.loadTrueResult("1")); // 娣诲姞鎴愬姛
-		}
-	}
-
-	@RequestMapping("details")
-	public String getRecommendDetails(long drid, Model model) {
-		RecommendDetails recommendDetails = recommendDetailsService.getRecommendDetails(drid, 0);
-		if (recommendDetails == null) {
-			return "";
-		}
-		model.addAttribute("recommendDetails", recommendDetails);
-		try {
-			List<RelateGoods> list = TaoKeApiUtil
-					.getRelateGoodsList(Long.parseLong(recommendDetails.getDynamicRecommend().getAuctionId()));
-			String upicUrls = recommendDetails.getDynamicRecommend().getuPicUrl();
-			String[] imgs = upicUrls.split(",");
-			List<String> tbImg = Arrays.asList(imgs);
-			// List<String> tbImg =
-			// TaoBaoUtil.getTbImg(recommendDetails.getDynamicRecommend().getAuctionId());
-			model.addAttribute("tbImgs", tbImg);
-			model.addAttribute("relateGoodsList", list);
-		} catch (NumberFormatException e) {
-			e.printStackTrace();
-		} catch (ApiException e) {
-			e.printStackTrace();
-		}
-		return "tuijian";
-	}
-
-	@RequestMapping("getRecommendSectionDetail")
-	public void getRecommendSectionDetail(long id, PrintWriter out) {
-		RecommendSectionDetail recommendSectionDetail = recommendSectionDetailService
-				.getRecommendSectionDetailByRsId(id);
-		if (recommendSectionDetail == null) {
-			out.println(JsonUtil.loadFalseResult("recommendSectionDetail涓嶈兘涓虹┖"));
-			return;
-		}
-		JSONObject data = new JSONObject();
-		data.put("picUrl", recommendSectionDetail.getPicUrl());
-		data.put("html", recommendSectionDetail.getHtmlCode());
-		out.println(JsonUtil.loadTrueResult(data));
-	}
-
-	@RequestMapping("getRecommendSectionGoodsList")
-	public void getRecommendSectionGoodsList(long id, PrintWriter out) {
-		List<RecommendSectionGoods> recommendSectionGoodsList = recommendSectionGoodsService
-				.getRecommendSectionGoods(id, Integer.MAX_VALUE);
-		if (recommendSectionGoodsList == null) {
-			JsonUtil.loadFalseResult("鍟嗗搧涓虹┖锛�");
-			return;
-		}
-		JSONObject data = new JSONObject();
-		List<TaoBaoGoodsBriefExtra> list = new ArrayList<TaoBaoGoodsBriefExtra>();
-		Map<String, String> map = hongBaoManageService.convertMap();
-		String proportion = map.get("hongbao_goods_proportion");
-		String fcRate = map.get("hongbao_fc_ratio");
-		for (RecommendSectionGoods recommendSectionGoods : recommendSectionGoodsList) {
-			list.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(recommendSectionGoods.getTaoBaoGoodsBrief(), proportion,
-					fcRate, ""));
-		}
-
-		Gson gson = JsonUtil.getApiCommonGson();
-		data.put("goodsList", gson.toJson(list));
-		out.println(JsonUtil.loadTrueResult(data));
-	}
-
-	@RequestMapping("shareGoods")
-	public void shareGoods(String auctionId, PrintWriter out) {
-		TaoBaoGoodsBrief alimama = null;
-		try {
-			alimama = redisManager.getTaoBaoGoodsBrief(Long.parseLong(auctionId));
-		} catch (NumberFormatException e) {
-			e.printStackTrace();
-		} catch (TaobaoGoodsDownException e) {
-			e.printStackTrace();
-		}
-		if (alimama != null) {
-			List<TaoBaoUnionConfig> config = taoBaoUnionConfigService.getConfigByTypeCache(PidUser.TYPE_FANLI_ANDROID);
-			TaoBaoGoodsBrief tb = null;
-			try {
-				tb = redisManager.getTaoBaoGoodsBrief(Long.parseLong(auctionId));
-			} catch (NumberFormatException e) {
-				e.printStackTrace();
-			} catch (TaobaoGoodsDownException e) {
-				e.printStackTrace();
-			}
-			TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(tb, config.get(0));
-			JSONObject data = new JSONObject();
-			data.put("tb", GsonUtil.toJsonExpose(taoBaoGoodsBriefExtra));
-			if ("1".equalsIgnoreCase(tb.getTkMktStatus())) {// 钀ラ攢璁″垝
-				data.put("yxjh", 1);
-			} else
-				data.put("yxjh", 0);
-
-			out.println(JsonUtil.loadTrueResult(data));
-			return;
-		}
-		JsonUtil.loadFalseResult("鍟嗗搧宸蹭笅鏋讹紒");
-	}
-
-	@RequestMapping("getShareGoodsInfo")
-	public void getShareGoodsInfo(HttpServletRequest request, long uid, long id, String sign, PrintWriter out) {
-
-		if (!StringUtil.Md5("" + uid + id + Constant.WEBPAGE_SIGN_KEY).equalsIgnoreCase(sign)) {
-			out.print(JsonUtil.loadFalseResult(-1, "绛惧悕閿欒"));
-			return;
-		}
-
-		// 娣诲姞鍒嗕韩
-		try {
-			long startTime = java.lang.System.currentTimeMillis();
-			UserShareGoodsHistory userShareGoodsHistory = shareGoodsService.addShareGoodsHistory(uid, id);
-			LogHelper.test("鐢熸垚鍒嗕韩鍥剧殑鎬昏�楁椂涓�:" + (java.lang.System.currentTimeMillis() - startTime));
-
-			JSONObject data = new JSONObject();
-			JSONObject shareData = new JSONObject();
-			JSONArray imgArr = new JSONArray();
-			String pictures = userShareGoodsHistory.getPictures();
-			JSONArray pictureArray = JSONArray.fromObject(pictures);
-			for (int i = 0; i < pictureArray.size(); i++) {
-				imgArr.add(pictureArray.optString(i));
-			}
-
-			TaoBaoGoodsBrief goods = redisManager.getTaoBaoGoodsBrief(userShareGoodsHistory.getGoodsId());
-
-			shareData.put("type", "2");
-			shareData.put("title", goods.getTitle());
-			shareData.put("description", goods.getTitle());
-			shareData.put("imgs", imgArr);
-			try {
-				data.put("wx", StringUtil.getBase64String(shareData.toString()));
-				data.put("wxcircle", StringUtil.getBase64String(shareData.toString()));
-				data.put("tkcode", StringUtil.getBase64String(userShareGoodsHistory.getTkCode()));
-				data.put("qq", StringUtil.getBase64String(shareData.toString()));
-				data.put("qqzone", StringUtil.getBase64String(shareData.toString()));
-				data.put("sina", StringUtil.getBase64String(shareData.toString()));
-				data.put("tishi", StringUtil.getBase64String("鍒嗕韩涓�..."));
-				data.put("shareGoods", JsonUtil.getSimpleGson().toJson(userShareGoodsHistory));
-				JSONObject goodsJSON = new JSONObject();
-				goodsJSON.put("title", goods.getTitle());
-				goodsJSON.put("zkPrice", goods.getZkPrice());
-				// 鏈夊埜
-				if (!StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
-
-					goodsJSON.put("finalPrice", TaoBaoUtil.getAfterUseCouplePrice(goods));
-				}
-				data.put("goods", goodsJSON);
-
-				String link = String.format("http://%s/%s/client/html/sharegoods/share_detail.html?uid=%s&goodsId=%s",
-						Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName(),
-						AESUtil.encrypt(uid + ""), id + "");
-				try {
-					String shortLink = HttpUtil.getShortLink(link);
-					data.put("link", shortLink);
-				} catch (Exception e) {
-					data.put("link", link);
-				}
-				out.print(JsonUtil.loadTrueResult(data));
-			} catch (Exception e) {
-				try {
-					JSONObject rdata = new JSONObject();
-					rdata.put("uid", uid);
-					rdata.put("id", id);
-					LogHelper.errorDetailInfo(e, rdata.toString(), request.getRequestURI());
-				} catch (Exception e2) {
-					e2.printStackTrace();
-				}
-				out.print(JsonUtil.loadFalseResult(1001, "鏈煡閿欒"));
-			}
-
-		} catch (ShareGoodsException e1) {
-			JSONObject data = new JSONObject();
-			data.put("uid", uid);
-			data.put("id", id);
-
-			try {
-				LogHelper.errorDetailInfo(e1, data.toString(), request.getRequestURI());
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
-
-			out.print(JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
-		} catch (Exception e) {
-			try {
-				LogHelper.errorDetailInfo(e);
-			} catch (Exception e2) {
-				e2.printStackTrace();
-			}
-		}
-
-	}
-
-	@RequestMapping("getShareGoodsDetail")
-	public void getShareGoodsDetail(String uid, long id, String sign, PrintWriter out) {
-		// 娣诲姞鍒嗕韩
-		uid = AESUtil.decrypt(uid);
-		if (StringUtil.isNullOrEmpty(uid)) {
-			out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛ID涓嶅瓨鍦�"));
-			return;
-		}
-
-		try {
-			UserShareGoodsHistory userShareGoodsHistory = shareGoodsService
-					.getShareGoodsHistoryDetail(Long.parseLong(uid), id);
-			if (userShareGoodsHistory == null) {
-				out.print(JsonUtil.loadFalseResult(2, "鍟嗗搧涓嶅瓨鍦�"));
-				return;
-			}
-
-			TaoBaoGoodsBrief goods = null;
-			try {
-				goods = redisManager.getTaoBaoGoodsBrief(userShareGoodsHistory.getGoodsId());
-			} catch (TaobaoGoodsDownException e) {
-				e.printStackTrace();
-			}
-			JSONObject data = JSONObject.fromObject(JsonUtil.getSimpleGson().toJson(userShareGoodsHistory));
-			JSONObject goodsJSON = new JSONObject();
-			goodsJSON.put("title", goods.getTitle());
-			goodsJSON.put("zkPrice", goods.getZkPrice());
-			// 鏈夊埜
-			if (!StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
-				BigDecimal finalPrice = goods.getZkPrice();
-				if (goods.getCouponStartFee().compareTo(goods.getZkPrice()) <= 0
-						&& goods.getZkPrice().compareTo(goods.getCouponAmount()) >= 0) {
-					finalPrice = goods.getZkPrice().subtract(goods.getCouponAmount());
-				}
-				goodsJSON.put("finalPrice", finalPrice);
-			}
-			data.put("goods", goodsJSON);
-			out.print(JsonUtil.loadTrueResult(data));
-		} catch (ShareGoodsException e1) {
-			out.print(JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
-
-			e1.printStackTrace();
-		}
-
-	}
-
-	// 鑾峰彇甯姪涓績鍒楄〃
-
-	@RequestMapping("getHelpList")
-	public void getHelpList(PrintWriter out) {
-		List<CustomerName> totalList = new ArrayList<>();
-		int page = 0;
-		List<CustomerName> customerNameList = systemClientParamsService.customerNameList(page, "", 1);
-		if (customerNameList != null && customerNameList.size() > 0)
-			totalList.addAll(customerNameList);
-
-		while (customerNameList != null && customerNameList.size() == Constant.PAGE_SIZE) {
-			page++;
-			customerNameList = systemClientParamsService.customerNameList(page, "", 1);
-			if (customerNameList != null && customerNameList.size() > 0)
-				totalList.addAll(customerNameList);
-		}
-
-		// 鑾峰彇姣忎釜涓嬮潰鐨勮鎯�
-		for (CustomerName cn : totalList) {
-			List<CustomerContent> contentList = systemClientParamsService.getSecondProblemList(0, "", cn.getId());
-			cn.setCustomerContentList(contentList);
-		}
-		out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(totalList)));
-	}
-
-	@RequestMapping("getHelpDetail")
-	public void getHelpDetail(long id, PrintWriter out) {
-		List<CustomerName> totalList = new ArrayList<>();
-		CustomerContent customerContent = systemClientParamsService.getCustomerContent(id);
-		out.print(JsonUtil.loadTrueResult(customerContent.getContent().replace("\n", "<br>")));
-	}
-
-	@RequestMapping("getInviteInfo")
-	public void getInviteInfo(PrintWriter out) {
-		JSONObject data = new JSONObject();
-
-		String key = "activityRules";
-		com.yeshi.fanli.entity.system.System system = new System();
-		system.setCreatetime(java.lang.System.currentTimeMillis());
-		system.setPlatform(1);
-		system.setId(4L);
-		SystemClientParams values = systemClientParamsService.getSystemClientParamsBySystemAndKey(system, key);
-		// 杞崲鎹㈣绗� 缁欏墠绔�
-		String valueN = values.getValue();
-		String valueBr = valueN;
-
-		String[] sts = valueBr.split("\n");
-		JSONArray array = new JSONArray();
-		for (String st : sts)
-			array.add(st);
-
-		data.put("activityRules", array);
-
-		List<InviteGetMoney> inviteGetMoneyList = inviteGetMoneyService.inviteGetMoneyList(0, "");
-
-		// 鍚嶅瓧*澶勭悊
-		for (InviteGetMoney inviteGetMoney : inviteGetMoneyList) {
-
-			String name = inviteGetMoney.getName();
-			if (name != null) {
-				if (name.length() > 2) {
-					name = Utils.getStarString(name, 1, name.length() - 1);
-				} else {
-					name = name.substring(0, 1) + "**" + name.substring(name.length() - 1);
-				}
-			}
-			inviteGetMoney.setName(name);
-		}
-
-		data.put("inviteGetMoneyList", JsonUtil.getSimpleGsonWithDate().toJson(inviteGetMoneyList));
-		out.print(JsonUtil.loadTrueResult(data));
-	}
-
-	/**
-	 * 鑾峰彇閭�璇锋湁濂栫殑瑙勫垯
-	 * 
-	 * @param callback
-	 * @param out
-	 */
-	@RequestMapping("getinviteactivityrules")
-	public void getInviteActivityRules(String callback, PrintWriter out) {
-		String key = "activityRules"; // key鍊�
-		com.yeshi.fanli.entity.system.System system = new System();
-		system.setCreatetime(java.lang.System.currentTimeMillis());
-		system.setPlatform(1);
-		system.setId(4L);
-		SystemClientParams values = systemClientParamsService.getSystemClientParamsBySystemAndKey(system, key);
-		// 杞崲鎹㈣绗� 缁欏墠绔�
-		String valueN = values.getValue();
-		String valueBr = valueN.replace("\n", "<br><br>");
-		if (!StringUtil.isNullOrEmpty(callback)) {
-			out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(valueBr)));
-		} else {
-			out.print(JsonUtil.loadTrueResult(valueBr));
-		}
-	}
-
-}
+package com.yeshi.fanli.controller;
+
+import java.io.PrintWriter;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import com.yeshi.fanli.entity.SystemEnum;
+import com.yeshi.fanli.entity.config.SystemConfigKeyEnum;
+import com.yeshi.fanli.util.wx.MyWXLoginUtil;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.yeshi.utils.HttpUtil;
+import org.yeshi.utils.JsonUtil;
+
+import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory;
+import com.yeshi.fanli.entity.bus.user.UserInfo;
+import com.yeshi.fanli.entity.system.BusinessSystem;
+import com.yeshi.fanli.entity.system.CustomerContent;
+import com.yeshi.fanli.entity.system.CustomerName;
+import com.yeshi.fanli.entity.system.SystemClientParams;
+import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief;
+import com.yeshi.fanli.exception.share.ShareGoodsException;
+import com.yeshi.fanli.log.LogHelper;
+import com.yeshi.fanli.service.inter.config.BusinessSystemService;
+import com.yeshi.fanli.service.inter.config.ConfigService;
+import com.yeshi.fanli.service.inter.config.CustomerContentService;
+import com.yeshi.fanli.service.inter.config.CustomerNameService;
+import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
+import com.yeshi.fanli.service.inter.config.SystemConfigService;
+import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService;
+import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
+import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
+import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
+import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
+import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
+import com.yeshi.fanli.service.inter.user.ShamUserService;
+import com.yeshi.fanli.service.inter.user.UserInfoService;
+import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
+import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
+import com.yeshi.fanli.util.AESUtil;
+import com.yeshi.fanli.util.Constant;
+import com.yeshi.fanli.util.RedisManager;
+import com.yeshi.fanli.util.StringUtil;
+import com.yeshi.fanli.util.taobao.TaoBaoUtil;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+/**
+ * 瀹㈡埛绔綉椤垫帴鍙d笌寰俊缃戦〉鎺ュ彛
+ *
+ * @author Administrator
+ */
+
+@Controller
+@RequestMapping("/client")
+public class ClientJspController {
+    @Resource
+    private UserInfoService userInfoService;
+
+    @Resource
+    private BusinessSystemService businessSystemService;
+
+
+    @Resource
+    private SystemClientParamsService systemClientParamsService;
+
+    @Resource
+    private ShareGoodsService shareGoodsService;
+
+
+    @Resource
+    private UserInviteRecordService userInviteRecordService;
+
+    @Resource
+    private RedisManager redisManager;
+
+
+    @Resource
+    private CustomerNameService customerNameService;
+
+    @Resource
+    private CustomerContentService customerContentService;
+
+    @Resource
+    private SystemConfigService systemConfigService;
+
+    private static final String DOWNURL2 = "http://121.42.200.138/apk/fanliquan20180124.apk";
+
+    @RequestMapping(value = "/new/{uid}")
+    public String threeShareRepNew(@PathVariable String uid, String code, String state, String packages,
+                                   String platform, String ios, HttpSession httpSession, HttpServletRequest request) {
+
+        BusinessSystem system = businessSystemService.getBusinessSystem(platform, packages, SystemEnum.blks);
+        String wxState = (String) httpSession.getAttribute("wxState");
+        // 閫氳繃閰嶇疆鍙傛暟鑾峰彇
+        String down = DOWNURL2;
+
+        SystemClientParams params = systemClientParamsService.getSystemClientParamsBySystemAndKey(system,
+                "download_app_url");
+        if (params != null)
+            down = params.getValue();
+
+        if (state != null && !state.equals(wxState)) {// 涓嶆槸寰俊杩斿洖鐨勶紒
+            // request.setAttribute("error", "1");
+            return "redirect:" + down;
+        }
+
+        // 淇濆瓨閭�璇疯褰�
+        userInviteRecordService.saveInviteRecord(code, uid);
+
+        return "redirect:" + down;
+    }
+
+    // 鏂扮増鍒嗕韩
+    @RequestMapping("threeShareNew")
+    public String threeShareNew(HttpServletRequest request, HttpSession session, HttpServletResponse response,
+                                long uid) {
+        UserInfo userInfo = userInfoService.getUserById(uid);
+        if (userInfo == null) {
+            return "share/error";
+        }
+
+        try {
+            String header = request.getHeader("User-Agent");// MicroMessenger锛氬井淇℃祻瑙堝櫒
+            String ios = "ios=1";
+            if (header.contains("iPhone")) {
+                ios = "ios=2";
+            }
+            String redirect_uri = "http://" + Constant.wxGZConfig.getLoginHost() + "/"
+                    + Constant.systemCommonConfig.getProjectName() + "/client/new/" + uid + "?packages="
+                    + systemConfigService.getValueCache(SystemConfigKeyEnum.androidPackageNames, userInfo.getSystem()) + "&platform=ANDROID&" + ios;
+            redirect_uri = URLEncoder.encode(redirect_uri, "utf-8");
+
+            long currentTimeMillis = java.lang.System.currentTimeMillis();
+            String md5 = StringUtil.Md5(currentTimeMillis + "");
+            session.setAttribute("wxState", md5);
+            String baseUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + systemConfigService.getValueCache(SystemConfigKeyEnum.wxGZAppId, userInfo.getSystem())
+                    + "&redirect_uri=" + redirect_uri + "&response_type=code&scope=snsapi_userinfo&state=" + md5
+                    + "#wechat_redirect";
+            response.sendRedirect(baseUrl);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return "share2/yaoqing";
+    }
+
+    @RequestMapping("getShareGoodsInfo")
+    public void getShareGoodsInfo(HttpServletRequest request, long uid, String id, String sign, PrintWriter out) {
+
+        if (!StringUtil.Md5("" + uid + id + Constant.WEBPAGE_SIGN_KEY).equalsIgnoreCase(sign)) {
+            out.print(JsonUtil.loadFalseResult(-1, "绛惧悕閿欒"));
+            return;
+        }
+
+        // 娣诲姞鍒嗕韩
+        try {
+            long startTime = java.lang.System.currentTimeMillis();
+            UserShareGoodsHistory userShareGoodsHistory = shareGoodsService.addShareGoodsHistory(uid, id);
+            LogHelper.test("鐢熸垚鍒嗕韩鍥剧殑鎬昏�楁椂涓�:" + (java.lang.System.currentTimeMillis() - startTime));
+
+            JSONObject data = new JSONObject();
+            JSONObject shareData = new JSONObject();
+            JSONArray imgArr = new JSONArray();
+            String pictures = userShareGoodsHistory.getPictures();
+            JSONArray pictureArray = JSONArray.fromObject(pictures);
+            for (int i = 0; i < pictureArray.size(); i++) {
+                imgArr.add(pictureArray.optString(i));
+            }
+
+            TaoBaoGoodsBrief goods = redisManager.getTaoBaoGoodsBrief(userShareGoodsHistory.getGoodsId());
+
+            shareData.put("type", "2");
+            shareData.put("title", goods.getTitle());
+            shareData.put("description", goods.getTitle());
+            shareData.put("imgs", imgArr);
+            try {
+                data.put("wx", StringUtil.getBase64String(shareData.toString()));
+                data.put("wxcircle", StringUtil.getBase64String(shareData.toString()));
+                data.put("tkcode", StringUtil.getBase64String(userShareGoodsHistory.getTkCode()));
+                data.put("qq", StringUtil.getBase64String(shareData.toString()));
+                data.put("qqzone", StringUtil.getBase64String(shareData.toString()));
+                data.put("sina", StringUtil.getBase64String(shareData.toString()));
+                data.put("tishi", StringUtil.getBase64String("鍒嗕韩涓�..."));
+                data.put("shareGoods", JsonUtil.getSimpleGson().toJson(userShareGoodsHistory));
+                JSONObject goodsJSON = new JSONObject();
+                goodsJSON.put("title", goods.getTitle());
+                goodsJSON.put("zkPrice", goods.getZkPrice());
+                // 鏈夊埜
+                if (!StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
+
+                    goodsJSON.put("finalPrice", TaoBaoUtil.getCouponPrice(goods));
+                }
+                data.put("goods", goodsJSON);
+
+                String link = String.format("http://%s/%s/client/html/sharegoods/share_detail.html?uid=%s&goodsId=%s",
+                        Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName(),
+                        AESUtil.encrypt(uid + ""), id + "");
+                try {
+                    String shortLink = HttpUtil.getShortLink(link);
+                    data.put("link", shortLink);
+                } catch (Exception e) {
+                    data.put("link", link);
+                }
+                out.print(JsonUtil.loadTrueResult(data));
+            } catch (Exception e) {
+                JSONObject rdata = new JSONObject();
+                rdata.put("uid", uid);
+                rdata.put("id", id);
+                LogHelper.errorDetailInfo(e, rdata.toString(), request.getRequestURI());
+                out.print(JsonUtil.loadFalseResult(1001, "鏈煡閿欒"));
+            }
+
+        } catch (ShareGoodsException e1) {
+            JSONObject data = new JSONObject();
+            data.put("uid", uid);
+            data.put("id", id);
+            LogHelper.errorDetailInfo(e1, data.toString(), request.getRequestURI());
+            out.print(JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
+        } catch (Exception e) {
+            LogHelper.errorDetailInfo(e);
+        }
+
+    }
+
+    // 鑾峰彇甯姪涓績鍒楄〃
+
+    @RequestMapping("getHelpList")
+    public void getHelpList(PrintWriter out) {
+        List<CustomerName> totalList = new ArrayList<>();
+        int page = 0;
+        List<CustomerName> customerNameList = customerNameService.customerNameList(page, "", 1);
+        if (customerNameList != null && customerNameList.size() > 0)
+            totalList.addAll(customerNameList);
+
+        while (customerNameList != null && customerNameList.size() == Constant.PAGE_SIZE) {
+            page++;
+            customerNameList = customerNameService.customerNameList(page, "", 1);
+            if (customerNameList != null && customerNameList.size() > 0)
+                totalList.addAll(customerNameList);
+        }
+
+        // 鑾峰彇姣忎釜涓嬮潰鐨勮鎯�
+        for (CustomerName cn : totalList) {
+            List<CustomerContent> contentList = customerContentService.getSecondProblemList(0, "", cn.getId());
+            cn.setCustomerContentList(contentList);
+        }
+        out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(totalList)));
+    }
+
+    @RequestMapping("getHelpDetail")
+    public void getHelpDetail(long id, PrintWriter out) {
+        List<CustomerName> totalList = new ArrayList<>();
+        CustomerContent customerContent = customerContentService.getCustomerContent(id);
+        out.print(JsonUtil.loadTrueResult(customerContent.getContent().replace("\n", "<br>")));
+    }
+
+    /**
+     * 鑾峰彇閭�璇锋湁濂栫殑瑙勫垯
+     *
+     * @param callback
+     * @param out
+     */
+    @RequestMapping("getinviteactivityrules")
+    public void getInviteActivityRules(String callback, PrintWriter out) {
+        String key = "activityRules"; // key鍊�
+        com.yeshi.fanli.entity.system.BusinessSystem system = new BusinessSystem();
+        system.setCreatetime(java.lang.System.currentTimeMillis());
+        system.setPlatform(1);
+        system.setId(4L);
+        SystemClientParams values = systemClientParamsService.getSystemClientParamsBySystemAndKey(system, key);
+        // 杞崲鎹㈣绗� 缁欏墠绔�
+        String valueN = values.getValue();
+        String valueBr = valueN.replace("\n", "<br><br>");
+        if (!StringUtil.isNullOrEmpty(callback)) {
+            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(valueBr)));
+        } else {
+            out.print(JsonUtil.loadTrueResult(valueBr));
+        }
+    }
+
+}

--
Gitblit v1.8.0