From ae18b82458f50dd07ea5afff9b8cd0be4608fb45 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 02 四月 2020 17:01:50 +0800
Subject: [PATCH] 删除团队奖励相关代码
---
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java | 185 +++++++++++++++++++++++++++++++++++++++-------
1 files changed, 156 insertions(+), 29 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 1bbe06c..e5108b2 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
@@ -24,8 +24,10 @@
import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
import com.yeshi.fanli.entity.dynamic.ImgInfo;
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.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
@@ -33,17 +35,22 @@
import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.manger.ClipboardAnalysisManager;
+import com.yeshi.fanli.service.manger.IClipboardAnalysisResult;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
+import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
+import com.yeshi.fanli.util.factory.CommonGoodsFactory;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
-import com.yeshi.fanli.util.jd.JDApiUtil;
-import com.yeshi.fanli.util.jd.JDUtil;
+import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
+import com.yeshi.fanli.vo.common.JumpDetailContentVO;
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
+import com.yeshi.fanli.vo.msg.TokenVO;
+import com.yeshi.fanli.vo.search.GoodsDocParseResultVO;
import net.sf.json.JSONObject;
@@ -75,6 +82,9 @@
@Resource
private HongBaoManageService hongBaoManageService;
+ private CommonGoods commonGoods;
+
+
/**
* 淇濆瓨淇℃伅
*
@@ -105,8 +115,7 @@
* 淇濆瓨淇℃伅
*
* @param callback
- * @param special
- * 0a39676f138c4dcba722e321d43c4284
+ * @param special 0a39676f138c4dcba722e321d43c4284
* @param out
*/
@RequestMapping(value = "saveSingleGoods")
@@ -117,8 +126,11 @@
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) {
@@ -131,8 +143,7 @@
* 淇濆瓨淇℃伅
*
* @param callback
- * @param special
- * 0a39676f138c4dcba722e321d43c4284
+ * @param special 0a39676f138c4dcba722e321d43c4284
* @param out
*/
@RequestMapping(value = "saveGoodsCoupon")
@@ -152,14 +163,14 @@
* 淇濆瓨淇℃伅
*
* @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()));
@@ -173,8 +184,7 @@
* 鑾峰彇淇℃伅
*
* @param callback
- * @param special
- * 0a39676f138c4dcba722e321d43c4284
+ * @param special 0a39676f138c4dcba722e321d43c4284
* @param out
*/
@RequestMapping(value = "getSingleGoodsinfo")
@@ -226,8 +236,7 @@
* 鑾峰彇淇℃伅
*
* @param callback
- * @param special
- * 0a39676f138c4dcba722e321d43c4284
+ * @param special 0a39676f138c4dcba722e321d43c4284
* @param out
*/
@RequestMapping(value = "getCurrencyCoupon")
@@ -257,8 +266,7 @@
* 鑾峰彇淇℃伅
*
* @param callback
- * @param special
- * 0a39676f138c4dcba722e321d43c4284
+ * @param special 0a39676f138c4dcba722e321d43c4284
* @param out
*/
@RequestMapping(value = "getSingleGoodsCoupon")
@@ -301,6 +309,71 @@
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();
+ 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();
@@ -354,8 +427,7 @@
* 淇濆瓨淇℃伅
*
* @param callback
- * @param special
- * 0a39676f138c4dcba722e321d43c4284
+ * @param special 0a39676f138c4dcba722e321d43c4284
* @param out
*/
@RequestMapping(value = "saveActivityPic")
@@ -380,8 +452,7 @@
* 鑾峰彇淇℃伅
*
* @param callback
- * @param special
- * 0a39676f138c4dcba722e321d43c4284
+ * @param special 0a39676f138c4dcba722e321d43c4284
* @param out
*/
@RequestMapping(value = "getActivityPic")
@@ -422,8 +493,7 @@
* 淇濆瓨淇℃伅
*
* @param callback
- * @param special
- * 0a39676f138c4dcba722e321d43c4284
+ * @param special 0a39676f138c4dcba722e321d43c4284
* @param out
*/
@RequestMapping(value = "saveSuCai")
@@ -442,6 +512,7 @@
JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("淇濆瓨澶辫触"));
e.printStackTrace();
LogHelper.errorDetailInfo(e);
+ LogHelper.test(e);
}
}
@@ -449,8 +520,7 @@
* 鑾峰彇淇℃伅
*
* @param callback
- * @param special
- * 0a39676f138c4dcba722e321d43c4284
+ * @param special 0a39676f138c4dcba722e321d43c4284
* @param out
*/
@RequestMapping(value = "getSuCaiPic")
@@ -491,7 +561,6 @@
}
}
-
/**
* 淇濆瓨淇℃伅
*
@@ -677,7 +746,11 @@
@RequestMapping(value = "getGoodsByUrl")
public void getGoodsByUrl(String callback, String link, PrintWriter out) {
try {
- CommonGoods commonGoods = clipboardAnalysisManager.parseLink(link);
+ //CommonGoods commonGoods = clipboardAnalysisManager.parseLink(link);
+ // 鏍规嵁鍙d护閾炬帴鑾峰彇鍟嗗搧
+ getGoods(link);
+
+ CommonGoods commonGoods = getCommonGoods();
if (commonGoods == null) {
JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏈壘鍒拌鍟嗗搧"));
return;
@@ -691,6 +764,20 @@
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("璇ュ晢鍝佸凡涓嬫灦"));
@@ -718,7 +805,37 @@
} catch (Exception e) {
JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鑾峰彇澶辫触"));
e.printStackTrace();
+ } finally {
+ setCommonGoods(null);
}
+
+ }
+
+ private void getGoods(String text) {
+ Long uid = Constant.LINK_TOKEN_VERIFY_UID;
+ clipboardAnalysisManager.parse("android", "55", text, uid, new IClipboardAnalysisResult() {
+ @Override
+ public void onResult(GoodsDocParseResultVO result) {}
+
+ @Override
+ public void onResult(String result) {}
+
+ @Override
+ public void onResult(CommonGoods goods) {
+ setCommonGoods(goods);
+ }
+
+ @Override
+ public void onResult(TokenVO tokenVO) {
+ }
+ @Override
+ public void none() {
+ }
+
+ @Override
+ public void needLogin(String msg) {
+ }
+ });
}
/**
@@ -837,4 +954,14 @@
}
}
+ public CommonGoods getCommonGoods() {
+ return commonGoods;
+ }
+
+ public void setCommonGoods(CommonGoods commonGoods) {
+ this.commonGoods = commonGoods;
+ }
+
+
+
}
--
Gitblit v1.8.0