From 6895adfbf9188881f1cb0d53dc819f1429b38ee3 Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@MS-20170306HGUF>
Date: 星期六, 29 二月 2020 11:28:29 +0800
Subject: [PATCH] 发圈bug
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java | 62 ++++++++++++++++---------------
1 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
index 3c6bcc9..95f49a4 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java
@@ -49,6 +49,7 @@
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.goods.ScanHistoryV2;
import com.yeshi.fanli.entity.system.BusinessSystem;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.system.SystemClientParams;
import com.yeshi.fanli.entity.taobao.ClientTBPid;
import com.yeshi.fanli.entity.taobao.PidUser;
@@ -99,7 +100,7 @@
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
-import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
+import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
@@ -111,6 +112,7 @@
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
+import com.yeshi.fanli.util.RedisKeyEnum;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
@@ -241,7 +243,7 @@
private TaoBaoShopService taoBaoShopService;
@Resource
- private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
+ private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
@Resource
private UserMoneyExtraService userMoneyExtraService;
@@ -679,11 +681,11 @@
// taoBaoGoodsBriefExtra.setAuctionUrl(null);
data.put("taobao", taobaoJson);
- String info = configService.get("detail_prompt");
+ String info = configService.get(ConfigKeyEnum.detailPrompt.getKey());
data.put("info", info);
- String onlyInfo = configService.get("only_info");
+ String onlyInfo = configService.get(ConfigKeyEnum.onlyInfo.getKey());
data.put("only", onlyInfo);
- data.put("helpUrl", configService.get("old_goods_detail_help_url"));
+ data.put("helpUrl", configService.get(ConfigKeyEnum.oldGoodsDetailHelpUrl.getKey()));
int showType = taoBaoGoodsBriefExtra.getShowType();
String price = "";
@@ -698,7 +700,7 @@
data.put("shareTitle", taoBaoGoodsBriefExtra.getTitle());
data.put("shareContent", "楼" + price + "鍏�");
data.put("shareImg", taoBaoGoodsBriefExtra.getPictUrl());
- String html = configService.get("downAPP");
+ String html = configService.get(ConfigKeyEnum.downAPP.getKey());
data.put("downAPP", html);
String shareSinaContent = configService.get("shareSinaContent");
data.put("shareSina",
@@ -1073,7 +1075,7 @@
return;
}
- List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.getRelationGoodsRecommend(id, 6);
+ List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.guessLikeByAuctionId(id, 6);
if (goodsList == null)
goodsList = new ArrayList<>();
@@ -1305,8 +1307,7 @@
*
*/
// if (Constant.IS_OUTNET) {
- String key = "linkParse-" + acceptData.getDevice() + "-" + id;
-
+ String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.taobaolinkParse, acceptData.getDevice() + "-" + id);
String value = redisManager.getCommonString(key);
if (!StringUtil.isNullOrEmpty(value)) {
out.print(JsonUtil.loadFalseResult(11, "璇锋眰棰戠巼闄愬埗"));
@@ -1415,7 +1416,7 @@
if (!StringUtil.isNullOrEmpty(imei) || !StringUtil.isNullOrEmpty(idfa)) {
long startTime = java.lang.System.currentTimeMillis();
- TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa);
+ TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa,"");
if (result != null && result.getTaoBaoGoodsBriefs() != null) {
// 绛涢��
@@ -1427,7 +1428,7 @@
// filter
try {
- gList = daTaoKeGoodsDetailService.filterTaoBaoGoods(gList);
+ gList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(gList);
} catch (Exception e) {
}
@@ -1595,7 +1596,8 @@
if (!StringUtil.isNullOrEmpty(specialCard)) {
try {
- listswiper = swiperPictureService.getByBannerCard(swiperCard);
+ listswiper = swiperPictureService.getByBannerCardAndVersion(swiperCard, acceptData.getPlatform(),
+ Integer.parseInt(acceptData.getVersion()));
if (listswiper == null) {
listswiper = new ArrayList<SwiperPicture>();
@@ -1673,7 +1675,7 @@
JSONObject invite = new JSONObject();
JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("invite");
invite.put("jumpDetail", jumpDetail);
- invite.put("picture", configService.get("home_invite_banner"));
+ invite.put("picture", configService.get(ConfigKeyEnum.homeInviteBanner.getKey()));
if ("ios".equalsIgnoreCase(acceptData.getPlatform())
&& configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
@@ -1715,7 +1717,7 @@
JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex);
// 2銆侀《閮ㄨ疆鎾浘
- List<SwiperPicture> topPicList = getSwiperByCard("index_top");
+ List<SwiperPicture> topPicList = getSwiperByCard("index_top", acceptData);
if (topPicList == null) {
topPicList = new ArrayList<SwiperPicture>();
}
@@ -1727,7 +1729,7 @@
&& configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
// 濡傛灉IOS褰撳墠鐗堟湰澶勪簬瀹℃牳鐘舵�佸氨涓嶈繑鍥�
} else {
- invitePicList = getSwiperByCard("index_invite");
+ invitePicList = getSwiperByCard("index_invite", acceptData);
}
if (invitePicList == null) {
@@ -1738,7 +1740,7 @@
// 4銆両OS鐨勫簳閮ㄧ綉椤甸摼鎺�
String platform = acceptData.getPlatform();
if ("ios".equalsIgnoreCase(platform)) {
- root.put("htmlLink", configService.get("index_html_link_ios"));
+ root.put("htmlLink", configService.get(ConfigKeyEnum.indexHtmlLinkIos.getKey()));
}
root.put("spikeGoods", getSpikeGoodsContent(acceptData));
@@ -1768,15 +1770,16 @@
return null;
}
- List<SwiperPicture> invitePicList = getSwiperByCard("index_invite");
+ List<SwiperPicture> invitePicList = getSwiperByCard("index_invite", acceptData);
return invitePicList;
}
- public List<SwiperPicture> getSwiperByCard(String card) {
+ public List<SwiperPicture> getSwiperByCard(String card, AcceptData acceptData) {
List<SwiperPicture> swiperList = null;
try {
- swiperList = swiperPictureService.getByBannerCard(card);
+ swiperList = swiperPictureService.getByBannerCardAndVersion(card, acceptData.getPlatform(),
+ Integer.parseInt(acceptData.getVersion()));
} catch (Exception e) {
try {
LogHelper.errorDetailInfo(e);
@@ -1825,8 +1828,8 @@
nextTime.set(Calendar.MILLISECOND, 0);
JSONArray array = null;
- String timekey = String.format("spikeGoods_hour-%s-%s", acceptData.getPlatform(), acceptData.getVersion());
- String cachekey = String.format("spikeGoodsList-%s-%s", acceptData.getPlatform(), acceptData.getVersion());
+ String timekey = RedisKeyEnum.getRedisKey(RedisKeyEnum.spikeGoodsHour,acceptData.getPlatform() +"-"+acceptData.getVersion());
+ String cachekey = RedisKeyEnum.getRedisKey(RedisKeyEnum.spikeGoodsList,acceptData.getPlatform() +"-"+acceptData.getVersion());
String timeValue = redisManager.getCommonString(timekey);
if (timeValue == null || !timeValue.equals(hour + "")) {
@@ -1863,7 +1866,7 @@
.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
goods.put("jumpDetail", jumpDetail);
JSONObject params = new JSONObject();
- params.put("url", configService.get("spike_goods_link") + "?id=" + taoBaoGoodsBrief.getAuctionId());
+ params.put("url", configService.get(ConfigKeyEnum.spikeGoodsLink.getKey()) + "?id=" + taoBaoGoodsBrief.getAuctionId());
goods.put("params", params);
// 1.5.4鍙婁互鍚庤繑鍥�
@@ -1885,7 +1888,7 @@
root.put("listgoods", array);
JSONObject params = new JSONObject();
- params.put("url", configService.get("spike_goods_link"));
+ params.put("url", configService.get(ConfigKeyEnum.spikeGoodsLink.getKey()));
root.put("params", params);
root.put("jumpDetail", jumpDetail);
@@ -2071,7 +2074,7 @@
// 澶ф窐瀹㈠晢鍝佽繃婊�
try {
- goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
+ goods = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods);
} catch (Exception e) {
LogHelper.errorDetailInfo(e);
}
@@ -2250,7 +2253,7 @@
data.put("shareUrl", shareUrl);
data.put("shareUsers", listShareUser);
data.put("couponUsers", listCouponUser);
- data.put("detailWebUrl", "http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id);
+ data.put("detailWebUrl", "http://apph5.banliapp.com/apppage/goods_img.html?id=" + id);
String noRebateHelpLink = null;
@@ -2342,7 +2345,7 @@
}
} else if (from != null && from.equals("taolijin_buy")) {
- noRebateHelpLink = configService.get("zigoulijian_nofanli_help");
+ noRebateHelpLink = configService.get(ConfigKeyEnum.zigoulijianNofanliHelp.getKey());
// 鏌ヨ鍒嗕韩搴�
TLJBuyGoods buyGoods = tljBuyGoodsService.selectByAuctionIdAndDay(goods.getAuctionId(),
TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
@@ -2371,7 +2374,7 @@
if (!StringUtil.isNullOrEmpty(noRebateHelpLink)) {
data.put("noRebateHelpLink", noRebateHelpLink);
} else {
- data.put("noRebateHelpLink", configService.get("no_rebate_help_link"));
+ data.put("noRebateHelpLink", configService.get(ConfigKeyEnum.noRebateHelpLink.getKey()));
}
// 鍙栨秷鍒嗕韩娲诲姩
@@ -2467,7 +2470,7 @@
try {
- List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.getRelationGoodsRecommend(id, 10);
+ List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.guessLikeByAuctionId(id, 10);
// 鍒濆鍖�
if (goodsList == null) {
goodsList = new ArrayList<TaoBaoGoodsBrief>();
@@ -2552,9 +2555,8 @@
*/
@RequestMapping(value = "getSpecialActivities")
public void getSpecialActivities(AcceptData acceptData, Long uid, PrintWriter out, String callback) {
- int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
List<Special> listSpecial = specialService.listByVersion(0, Integer.MAX_VALUE, "special_activities",
- platformCode, Integer.parseInt(acceptData.getVersion()));
+ acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
List<Special> list = new ArrayList<Special>();
if (listSpecial != null) {
--
Gitblit v1.8.0