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 |  605 ++++++++++++++++++++++++++----------------------------
 1 files changed, 290 insertions(+), 315 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 5b8f6f4..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,315 +1,290 @@
-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 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.fanli.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 com.yeshi.fanli.util.wx.WXLoginUtil;
-
-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 ConfigService configService;
-
-	@Resource
-	private HongBaoManageService hongBaoManageService;
-
-	@Resource
-	private ShamUserService shamUserService;
-
-	@Resource
-	private TaoBaoCouponService taoBaoCouponService;
-
-	@Resource
-	private ThreeSaleSerivce threeSaleSerivce;
-
-	@Resource
-	private UserInfoService userInfoService;
-
-	@Resource
-	private BusinessSystemService businessSystemService;
-
-	@Resource
-	private SystemConfigService systemConfigService;
-
-	@Resource
-	private SystemClientParamsService systemClientParamsService;
-
-	@Resource
-	private ShareGoodsService shareGoodsService;
-
-	@Resource
-	private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
-
-	@Resource
-	private UserInviteRecordService userInviteRecordService;
-
-	@Resource
-	private RedisManager redisManager;
-
-	@Resource
-	private TaoBaoUnionConfigService taoBaoUnionConfigService;
-
-	@Resource
-	private CustomerNameService customerNameService;
-
-	@Resource
-	private CustomerContentService customerContentService;
-
-	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(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="
-					+ 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("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) {
-				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));
-		}
-	}
-
-}
+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