From 207dc8655711cddac2653e18b51e58a88dba2084 Mon Sep 17 00:00:00 2001
From: yj <Administrator@192>
Date: 星期五, 06 三月 2020 18:14:36 +0800
Subject: [PATCH] 发圈处理

---
 fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java |  384 ++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 240 insertions(+), 144 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java
index 29d678e..da335a4 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java
@@ -1,6 +1,7 @@
 package com.yeshi.fanli.controller.admin;
 
 import java.io.PrintWriter;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -16,12 +17,20 @@
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.google.gson.reflect.TypeToken;
+import com.yeshi.fanli.dto.ConfigParamsDTO;
+import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
 import com.yeshi.fanli.entity.dynamic.CommentInfo;
+import com.yeshi.fanli.entity.dynamic.CommentInfo.CommentInfoEnum;
 import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
 import com.yeshi.fanli.entity.dynamic.ImgInfo;
-import com.yeshi.fanli.entity.dynamic.CommentInfo.CommentInfoEnum;
 import com.yeshi.fanli.entity.dynamic.ImgInfo.ImgEnum;
+import com.yeshi.fanli.entity.dynamic.ListComment;
+import com.yeshi.fanli.entity.goods.CommonGoods;
+import com.yeshi.fanli.entity.jd.JDGoods;
+import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
 import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException;
+import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
+import com.yeshi.fanli.log.LogHelper;
 import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
 import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
 import com.yeshi.fanli.service.manger.ClipboardAnalysisManager;
@@ -32,6 +41,7 @@
 import com.yeshi.fanli.util.TimeUtil;
 import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
 import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
+import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
 import com.yeshi.fanli.vo.goods.GoodsDetailVO;
 
 import net.sf.json.JSONObject;
@@ -74,13 +84,14 @@
 	@RequestMapping(value = "saveHead")
 	public void saveHead(String callback, GoodsEvaluate evaluate, HttpServletRequest request, PrintWriter out) {
 		try {
+			String id = null;
 			if (request instanceof MultipartHttpServletRequest) {
 				MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
-				goodsEvaluateService.saveHead(fileRequest.getFile("portraitFile"), evaluate);
+				id = goodsEvaluateService.saveHead(fileRequest.getFile("portraitFile"), evaluate);
 			} else {
-				goodsEvaluateService.saveHead(null, evaluate);
+				id = goodsEvaluateService.saveHead(null, evaluate);
 			}
-			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇濆瓨鎴愬姛"));
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(id));
 		} catch (GoodsEvaluateException e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
 		} catch (Exception e) {
@@ -105,8 +116,10 @@
 			if (request instanceof MultipartHttpServletRequest) {
 				fileRequest = (MultipartHttpServletRequest) request;
 			}
-			goodsEvaluateService.saveSingleGoods(pid, goodsId, goodsType, videoUrl, picNum, picUrls, fileRequest);
-			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇濆瓨鎴愬姛"));
+			String commentText = goodsEvaluateService.saveSingleGoods(pid, goodsId, goodsType, videoUrl, picNum, picUrls, fileRequest);
+			JSONObject object = new JSONObject();
+			object.put("comment", commentText);
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(object));
 		} catch (GoodsEvaluateException e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
 		} catch (Exception e) {
@@ -114,7 +127,7 @@
 			e.printStackTrace();
 		}
 	}
-	
+
 	/**
 	 * 淇濆瓨淇℃伅
 	 * 
@@ -124,9 +137,9 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "saveGoodsCoupon")
-	public void saveGoodsCoupon(String callback, String pid, String tags, String tagDesc, PrintWriter out) {
+	public void saveGoodsCoupon(String callback, String pid, String content, PrintWriter out) {
 		try {
-			goodsEvaluateService.saveGoodsCoupon(pid, tags, tagDesc);
+			goodsEvaluateService.saveGoodsCoupon(pid, content);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇濆瓨鎴愬姛"));
 		} catch (GoodsEvaluateException e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -135,19 +148,19 @@
 			e.printStackTrace();
 		}
 	}
-	
+
 	/**
 	 * 淇濆瓨淇℃伅
 	 * 
 	 * @param callback
-	 * @param special
-	 *            0a39676f138c4dcba722e321d43c4284
+	 * @param pid
+	 * @param kind : 1鍗曞搧  2澶氬搧 3娲诲姩
 	 * @param out
 	 */
-	@RequestMapping(value = "saveSingleGoodsCoupon")
-	public void saveSingleGoodsCoupon(String callback, String pid, CommentInfo commentInfo, PrintWriter out) {
+	@RequestMapping(value = "saveCurrencyCoupon")
+	public void saveCurrencyCoupon(String callback, String pid, int kind, CommentInfo commentInfo, PrintWriter out) {
 		try {
-			goodsEvaluateService.saveSingleGoodsCoupon(pid, commentInfo);
+			goodsEvaluateService.saveCurrencyCoupon(pid, kind,commentInfo);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇濆瓨鎴愬姛"));
 		} catch (GoodsEvaluateException e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -176,7 +189,8 @@
 			List<String> list = new ArrayList<String>();
 			if (!StringUtil.isNullOrEmpty(pid)) {
 				GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid);
-				if (goodsEvaluate != null && goodsEvaluate.getImgList() != null && goodsEvaluate.getImgList().size() > 0) {
+				if (goodsEvaluate != null && goodsEvaluate.getImgList() != null
+						&& goodsEvaluate.getImgList().size() > 0) {
 					List<ImgInfo> imgList = goodsEvaluate.getImgList();
 					for (ImgInfo imgInfo : imgList) {
 						ImgEnum type = imgInfo.getType();
@@ -194,24 +208,21 @@
 					picNum = goodsEvaluate.getMainPicNum();
 				}
 			}
-			
+
 			JSONObject data = new JSONObject();
-			data.put("goodsId",  goodsId);
-			data.put("goodsType",  goodsType);
-			data.put("videoUrl",  videoUrl);
-			data.put("videoPic",  videoPic);
-			data.put("picNum",  picNum);
-			data.put("list",  list);
+			data.put("goodsId", goodsId);
+			data.put("goodsType", goodsType);
+			data.put("videoUrl", videoUrl);
+			data.put("videoPic", videoPic);
+			data.put("picNum", picNum);
+			data.put("list", list);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
 		} catch (Exception e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏌ヨ澶辫触"));
 			e.printStackTrace();
 		}
 	}
-	
-	
-	
-	
+
 	/**
 	 * 鑾峰彇淇℃伅
 	 * 
@@ -226,11 +237,13 @@
 			CommentInfo commentInfo = new CommentInfo();
 			if (!StringUtil.isNullOrEmpty(pid)) {
 				GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid);
-				if (goodsEvaluate != null && goodsEvaluate.getComments() != null && goodsEvaluate.getComments().size() > 0) {
-					for (CommentInfo info: goodsEvaluate.getComments()) {
-						if (CommentInfoEnum.currencyCoupon == info.getType()) {
-							commentInfo = info;
-						}
+				if (goodsEvaluate != null && goodsEvaluate.getComments() != null
+						&& goodsEvaluate.getComments().size() > 0) {
+					for (CommentInfo info : goodsEvaluate.getComments()) {
+						if (info != null)
+							if (CommentInfoEnum.currencyCoupon == info.getTypeEnum()) {
+								commentInfo = info;
+							}
 					}
 				}
 			}
@@ -240,8 +253,7 @@
 			e.printStackTrace();
 		}
 	}
-	
-	
+
 	/**
 	 * 鑾峰彇淇℃伅
 	 * 
@@ -256,11 +268,13 @@
 			CommentInfo commentInfo = new CommentInfo();
 			if (!StringUtil.isNullOrEmpty(pid)) {
 				GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid);
-				if (goodsEvaluate != null && goodsEvaluate.getComments() != null && goodsEvaluate.getComments().size() > 0) {
-					for (CommentInfo info: goodsEvaluate.getComments()) {
-						if (CommentInfoEnum.goodsCoupon == info.getType()) {
-							commentInfo = info;
-						}
+				if (goodsEvaluate != null && goodsEvaluate.getComments() != null
+						&& goodsEvaluate.getComments().size() > 0) {
+					for (CommentInfo info : goodsEvaluate.getComments()) {
+						if (info != null)
+							if (CommentInfoEnum.goodsCoupon == info.getTypeEnum()) {
+								commentInfo = info;
+							}
 					}
 				}
 			}
@@ -270,13 +284,14 @@
 			e.printStackTrace();
 		}
 	}
-	
+
 	/**
 	 * 淇濆瓨澶氫釜鍟嗗搧
+	 * 
 	 * @param out
 	 */
 	@RequestMapping(value = "saveMultipleGoods")
-	public void saveMultipleGoods(String callback, String pid,  String videoUrl, String goodsList, 
+	public void saveMultipleGoods(String callback, String pid, String videoUrl, String goodsList,
 			HttpServletRequest request, PrintWriter out) {
 		try {
 			MultipartHttpServletRequest fileRequest = null;
@@ -290,10 +305,76 @@
 		} catch (Exception e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("淇濆瓨澶辫触"));
 			e.printStackTrace();
+			LogHelper.errorDetailInfo(e);
+			LogHelper.test(e);
 		}
 	}
-
 	
+	
+	/**
+	 * 
+	 * @param callback
+	 * @param comments
+	 * @param out
+	 */
+	@RequestMapping(value = "saveGoodsComment")
+	public void saveGoodsComment(String callback, String id, int kind, ListComment comments, PrintWriter out) {
+		try {
+			if (StringUtil.isNullOrEmpty(id)) {
+				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇峰厛淇濆瓨鎺ㄨ崘璇俊鎭�"));
+				return;
+			}
+			if (comments == null) {
+				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏂囨湰鍐呭涓虹┖"));
+				return;
+			}
+			goodsEvaluateService.saveGoodsComment(id, kind, comments.getComment());
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎴愬姛"));
+		} catch (GoodsEvaluateException e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
+		} catch (Exception e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("淇濆瓨澶辫触"));
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * 
+	 * @param callback
+	 * @param comments
+	 * @param out
+	 */
+	@RequestMapping(value = "getGoodsComment")
+	public void getGoodsComment(String callback, String id, PrintWriter out) {
+		try {
+			if (StringUtil.isNullOrEmpty(id)) {
+				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇峰厛淇濆瓨鎺ㄨ崘璇俊鎭�"));
+				return;
+			}
+			
+			List<CommentInfo> newList = new ArrayList<>();
+			GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id);
+			if (goodsEvaluate != null) {
+				List<CommentInfo> comments = goodsEvaluate.getComments();
+				if (comments != null && comments.size() > 0) {
+					for (CommentInfo commentInfo: comments) {
+						CommentInfoEnum typeEnum = commentInfo.getTypeEnum();
+						if (typeEnum == CommentInfoEnum.goodsCoupon) {
+							newList.add(commentInfo);
+						}
+					}
+				}
+			}
+			JSONObject data = new JSONObject();
+			data.put("list", newList);
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
+		} catch (Exception e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("淇濆瓨澶辫触"));
+			e.printStackTrace();
+		}
+	}
+	
+
 	/**
 	 * 鑾峰彇澶氫釜鍟嗗搧淇℃伅
 	 * 
@@ -306,10 +387,11 @@
 			String videoPic = "";
 			List<String> list = new ArrayList<String>();
 			List<String> goodsList = new ArrayList<String>();
-			
+
 			if (!StringUtil.isNullOrEmpty(pid)) {
 				GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid);
-				if (goodsEvaluate != null && goodsEvaluate.getImgList() != null && goodsEvaluate.getImgList().size() > 0) {
+				if (goodsEvaluate != null && goodsEvaluate.getImgList() != null
+						&& goodsEvaluate.getImgList().size() > 0) {
 					List<ImgInfo> imgList = goodsEvaluate.getImgList();
 					for (ImgInfo imgInfo : imgList) {
 						ImgEnum type = imgInfo.getType();
@@ -318,24 +400,24 @@
 							videoUrl = imgInfo.getVideoUrl();
 						} else if (type == ImgEnum.goods) {
 							list.add(imgInfo.getUrl());
-							goodsList.add(imgInfo.getGoods().getGoodsId() + "-"+ imgInfo.getGoods().getGoodsType());
-						} 
+							goodsList.add(imgInfo.getGoods().getGoodsId() + "-" + imgInfo.getGoods().getGoodsType());
+						}
 					}
 				}
 			}
-			
+
 			JSONObject data = new JSONObject();
-			data.put("list",  list);
-			data.put("goodsList",  goodsList);
-			data.put("videoUrl",  videoUrl);
-			data.put("videoPic",  videoPic);
+			data.put("list", list);
+			data.put("goodsList", goodsList);
+			data.put("videoUrl", videoUrl);
+			data.put("videoPic", videoPic);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
 		} catch (Exception e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏌ヨ澶辫触"));
 			e.printStackTrace();
 		}
 	}
-	
+
 	/**
 	 * 淇濆瓨淇℃伅
 	 * 
@@ -345,8 +427,8 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "saveActivityPic")
-	public void saveActivityPic(String callback, String pid, ImgInfo imgInfo, 
-			HttpServletRequest request, PrintWriter out) {
+	public void saveActivityPic(String callback, String pid, ImgInfo imgInfo, HttpServletRequest request,
+			PrintWriter out) {
 		try {
 			MultipartHttpServletRequest fileRequest = null;
 			if (request instanceof MultipartHttpServletRequest) {
@@ -393,18 +475,17 @@
 			}
 
 			JSONObject data = new JSONObject();
-			data.put("videoUrl",  videoUrl);
-			data.put("videoPic",  videoPic);
-			data.put("activityPic",  activityPic);
-			data.put("activityUrl",  activityUrl);
+			data.put("videoUrl", videoUrl);
+			data.put("videoPic", videoPic);
+			data.put("activityPic", activityPic);
+			data.put("activityUrl", activityUrl);
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
 		} catch (Exception e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏌ヨ澶辫触"));
 			e.printStackTrace();
 		}
 	}
-	
-	
+
 	/**
 	 * 淇濆瓨淇℃伅
 	 * 
@@ -414,8 +495,8 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "saveSuCai")
-	public void saveSuCai(String callback, String pid, String videoUrl, String picUrls, 
-			HttpServletRequest request, PrintWriter out) {
+	public void saveSuCai(String callback, String pid, String videoUrl, String picUrls, HttpServletRequest request,
+			PrintWriter out) {
 		try {
 			MultipartHttpServletRequest fileRequest = null;
 			if (request instanceof MultipartHttpServletRequest) {
@@ -428,9 +509,57 @@
 		} catch (Exception e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("淇濆瓨澶辫触"));
 			e.printStackTrace();
+			LogHelper.errorDetailInfo(e);
+			LogHelper.test(e);
 		}
 	}
-	
+
+	/**
+	 * 鑾峰彇淇℃伅
+	 * 
+	 * @param callback
+	 * @param special
+	 *            0a39676f138c4dcba722e321d43c4284
+	 * @param out
+	 */
+	@RequestMapping(value = "getSuCaiPic")
+	public void getSuCaiPic(String callback, String pid, PrintWriter out) {
+		try {
+			String videoUrl = "";
+			String videoPic = "";
+			String activityUrl = "";
+			List<String> list = new ArrayList<String>();
+			if (!StringUtil.isNullOrEmpty(pid)) {
+				GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid);
+				if (goodsEvaluate != null && goodsEvaluate.getImgList() != null
+						&& goodsEvaluate.getImgList().size() > 0) {
+					List<ImgInfo> imgList = goodsEvaluate.getImgList();
+					for (ImgInfo imgInfo : imgList) {
+						ImgEnum type = imgInfo.getType();
+						if (type == ImgEnum.video) {
+							videoPic = imgInfo.getUrl();
+							videoUrl = imgInfo.getVideoUrl();
+						} else if (type == ImgEnum.activity) {
+							activityUrl = imgInfo.getActivityPic();
+						} else if (type == ImgEnum.img) {
+							list.add(imgInfo.getUrl());
+						}
+					}
+				}
+			}
+
+			JSONObject data = new JSONObject();
+			data.put("activityUrl", activityUrl);
+			data.put("videoUrl", videoUrl);
+			data.put("videoPic", videoPic);
+			data.put("list", list);
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
+		} catch (Exception e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏌ヨ澶辫触"));
+			e.printStackTrace();
+		}
+	}
+
 	
 	/**
 	 * 淇濆瓨淇℃伅
@@ -461,8 +590,6 @@
 			e.printStackTrace();
 		}
 	}
-	
-	
 
 	/**
 	 * 鍒犻櫎鍥剧墖浠ュ強淇℃伅
@@ -552,7 +679,6 @@
 		}
 	}
 
-	
 	/**
 	 * 鏌ヨ
 	 * 
@@ -609,6 +735,7 @@
 			e.printStackTrace();
 		}
 	}
+
 	/**
 	 * 鏍规嵁閾炬帴鏌ヨ鍟嗗搧
 	 * 
@@ -619,86 +746,57 @@
 	@RequestMapping(value = "getGoodsByUrl")
 	public void getGoodsByUrl(String callback, String link, PrintWriter out) {
 		try {
-			// CommonGoods commonGoods =
-			// clipboardAnalysisManager.parseLink(link);
-			// if (commonGoods == null) {
-			// JsonUtil.printMode(out, callback,
-			// JsonUtil.loadFalseResult("鏈壘鍒拌鍟嗗搧"));
-			// return;
-			// }
-			//
+			CommonGoods commonGoods = clipboardAnalysisManager.parseLink(link);
+			if (commonGoods == null) {
+				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏈壘鍒拌鍟嗗搧"));
+				return;
+			}
 			GoodsDetailVO goodsDetail = null;
-			
-//			 try {
-//				  BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
-//				  BigDecimal shareRate = hongBaoManageService.getShareRate();
-//				  BigDecimal vipFanLiRate = hongBaoManageService.getVIPFanLiRate();
-//				  ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate,
-//				  shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate);
-//				 TaoBaoGoodsBrief goodsBrief =
-//				 redisManager.getTaoBaoGoodsBrief(596617470742L);
-//				 goodsDetail = GoodsDetailVOFactory.convertTaoBao(goodsBrief,
-//				 params);
-//				 } catch (TaobaoGoodsDownException e) {
-//				 JsonUtil.printMode(out, callback,
-//				 JsonUtil.loadFalseResult("璇ュ晢鍝佸凡涓嬫灦"));
-//				 return;
-//				 }
-				 
+			BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
+			BigDecimal shareRate = hongBaoManageService.getShareRate();
+			BigDecimal vipFanLiRate = hongBaoManageService.getVIPFanLiRate();
+			ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate);
 
-			// if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
-			// try {
-			// TaoBaoGoodsBrief goodsBrief =
-			// redisManager.getTaoBaoGoodsBrief(commonGoods.getGoodsId());
-			// goodsDetail = GoodsDetailVOFactory.convertTaoBao(goodsBrief,
-			// params);
-			// } catch (TaobaoGoodsDownException e) {
-			// JsonUtil.printMode(out, callback,
-			// JsonUtil.loadFalseResult("璇ュ晢鍝佸凡涓嬫灦"));
-			// return;
-			// }
-			// } else if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_JD)
-			// {
-			// JDGoods goodsInfo =
-//			 JDApiUtil.queryGoodsDetail(commonGoods.getGoodsId()); // 楂樼骇鎺ュ彛
-			// if (goodsInfo == null) {
-			// goodsInfo = JDUtil.getGoodsDetail(commonGoods.getGoodsId()); //
-			// 鐖彇缃戦〉
-			// //jdGoods = JDApiUtil.getGoodsDetail(goodsId); // 鏅�氭帴鍙�
-			// }
-			//// JDGoods goodsInfo =
-			// jdGoodsCacheUtil.getGoodsInfo(commonGoods.getGoodsId());
-			// goodsDetail = GoodsDetailVOFactory.convertJDGoods(goodsInfo,
-			// params);
-			// } else if (commonGoods.getGoodsType() ==
-			// Constant.SOURCE_TYPE_PDD) {
-			// PDDGoodsDetail goodsInfo =
-			// pinDuoDuoCacheUtil.getGoodsInfo(commonGoods.getGoodsId());
-			// goodsDetail = GoodsDetailVOFactory.convertPDDGoods(goodsInfo,
-			// params);
-			// }
+			if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
+				try {
+					TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(commonGoods.getGoodsId());
+					String pictUrlWhite = goodsBrief.getPictUrlWhite();
+					if (!StringUtil.isNullOrEmpty(pictUrlWhite)) {
+						goodsBrief.setPictUrl(pictUrlWhite);
+						
+						List<String> picList = new ArrayList<>();
+						picList.add(pictUrlWhite);
+						
+						List<String> imgList = goodsBrief.getImgList();
+						if (imgList != null) {
+							picList.addAll(imgList);
+						}
+						goodsBrief.setImgList(picList);
+					}
+					
+					goodsDetail = GoodsDetailVOFactory.convertTaoBao(goodsBrief, params);
+				} catch (TaobaoGoodsDownException e) {
+					JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇ュ晢鍝佸凡涓嬫灦"));
+					return;
+				}
+			} else if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_JD) {
+				JDGoods goodsInfo = jdGoodsCacheUtil.getGoodsInfo(commonGoods.getGoodsId());
+				goodsDetail = GoodsDetailVOFactory.convertJDGoods(goodsInfo, params);
+			} else if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_PDD) {
+				PDDGoodsDetail goodsInfo = pinDuoDuoCacheUtil.getGoodsInfo(commonGoods.getGoodsId());
+				goodsDetail = GoodsDetailVOFactory.convertPDDGoods(goodsInfo, params);
+			}
 
-			// if (goodsDetail == null) {
-			// JsonUtil.printMode(out, callback,
-			// JsonUtil.loadFalseResult("鏈壘鍒拌鍟嗗搧"));
-			// return;
-			// }
-
-			List<String> imgList = new ArrayList<>();
-			imgList.add(
-					"https://img.alicdn.com/bao/uploaded/i1/2578900982/O1CN01SUiNLE1J7nWMlpy1A_!!0-item_pic.jpg_220x220");
-			imgList.add(
-					"https://img.alicdn.com/bao/uploaded/i1/2398662401/O1CN01I2UoTF1TbhXVwhJrz_!!0-item_pic.jpg_220x220");
-			imgList.add(
-					"https://img.alicdn.com/bao/uploaded/i4/2640238597/O1CN01A5xBr32DNTYWJSDZe_!!0-item_pic.jpg_220x220");
-			imgList.add(
-					"https://img.alicdn.com/bao/uploaded/i3/2640238597/O1CN01H5Q0Ni2DNTYxGAy3V_!!0-item_pic.jpg_220x220");
+			if (goodsDetail == null) {
+				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏈壘鍒拌鍟嗗搧"));
+				return;
+			}
 
 			JSONObject object = new JSONObject();
-			object.put("goodsId", 551062664275L);
-			object.put("goodsType", 1);
-			object.put("picUrl", "https://img.alicdn.com/bao/uploaded/i3/2640238597/O1CN01H5Q0Ni2DNTYxGAy3V_!!0-item_pic.jpg_220x220");
-			object.put("imgList", imgList);
+			object.put("goodsId", goodsDetail.getGoodsId());
+			object.put("goodsType", goodsDetail.getGoodsType());
+			object.put("picUrl", goodsDetail.getPicUrl());
+			object.put("imgList", goodsDetail.getImgList());
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(object));
 		} catch (Exception e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鑾峰彇澶辫触"));
@@ -758,7 +856,7 @@
 			e.printStackTrace();
 		}
 	}
-	
+
 	/**
 	 * 鍒犻櫎淇℃伅
 	 * 
@@ -783,7 +881,6 @@
 			e.printStackTrace();
 		}
 	}
-	
 
 	/**
 	 * 鏌ヨ鍝佽
@@ -824,4 +921,3 @@
 	}
 
 }
-

--
Gitblit v1.8.0