From c7458d62739ce287e9fdb071a41dc5c00bb4374f Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 13 三月 2019 17:05:37 +0800
Subject: [PATCH] 增加淘宝商品是否参与推广的链接
---
fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java | 68 ++++++++++++++++++++++++++++++----
1 files changed, 60 insertions(+), 8 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java
index af3f69b..dc1b368 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.lable;
+import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
@@ -16,6 +17,8 @@
import com.yeshi.fanli.dao.mybatis.lable.QualityFactoryMapper;
import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoGoodsBriefMapper;
import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoGoodsBriefRecordMapper;
+import com.yeshi.fanli.entity.bus.lable.Label;
+import com.yeshi.fanli.entity.bus.lable.LabelGoods;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
@@ -25,6 +28,7 @@
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
+
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TbImgUtil;
@@ -240,15 +244,15 @@
@Override
public List<QualityFactory> listRecommendBykey(long start, int count, String key, Integer hasQuan,
- Integer userType, Double startprice, Double endprice, Integer sort) {
+ Integer userType, Double startprice, Double endprice, Double startTkRate, Double endTkRate, Integer sort) {
return qualityFactoryMapper.listRecommendBykey(start, count, key, hasQuan, userType,
- startprice, endprice, sort);
+ startprice, endprice, startTkRate, endTkRate, sort);
}
@Override
public long countRecommendBykey(String key, Integer hasQuan, Integer userType,
- Double startprice, Double endprice) {
- return qualityFactoryMapper.countRecommendBykey(key, hasQuan, userType, startprice, endprice);
+ Double startprice, Double endprice, Double startTkRate, Double endTkRate) {
+ return qualityFactoryMapper.countRecommendBykey(key, hasQuan, userType, startprice, endprice, startTkRate, endTkRate);
}
@@ -256,8 +260,8 @@
* 棣栭〉鏈�搴曢儴@鍟嗗搧淇℃伅娴�
*/
@Override
- @Cacheable(value = "qualityCache",key="'listQueryToRecommend-'+#start+'-'+#proportion+'-'+#fcRate")
- public JSONArray getRecommendToIndex(long start, int count, String proportion, String fcRate) {
+ @Cacheable(value = "qualityCache",key="'listQueryToRecommend-'+#start+'-'+#proportion")
+ public JSONArray getRecommendToIndex(long start, int count, String proportion) {
// 杩斿埄閲戦2鍏冧互涓婏紱
Integer commision = 2;
@@ -298,7 +302,7 @@
String salesCountMidea = String.format("%.1f", sales / 10000);
taoBaoGoodsBrief.setSalesCount(salesCountMidea + "涓�");
} else {
- taoBaoGoodsBrief.setSalesCount(count + "");
+ taoBaoGoodsBrief.setSalesCount(biz30day + "");
}
// 鏀瑰彉鍥剧墖灏哄
@@ -307,7 +311,7 @@
taoBaoGoodsBrief.setPictUrl(TbImgUtil.getTBSize320Img(pictUrl));
}
- array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, fcRate, null)));
+ array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion, null)));
}
return array;
@@ -334,5 +338,53 @@
return countRecommend(pop, commision, couponAmount, tkRate, couponRatio);
}
+ @Override
+ public List<QualityFactory> recommendByAuctionId(Long auctionId){
+
+
+ List<Long> list = new ArrayList<Long>();
+ list.add(auctionId);
+ List<QualityFactory> listTaoBaoGoods = qualityFactoryMapper.listQueryByAuctionId(list);
+
+ if (listTaoBaoGoods == null || listTaoBaoGoods.size() == 0) {
+ return null;
+ }
+
+ QualityFactory qualityFactory = listTaoBaoGoods.get(0);
+ TaoBaoGoodsBrief goodsBrief = qualityFactory.getTaoBaoGoodsBrief();
+ if (goodsBrief == null) {
+ return null;
+ }
+
+ List<LabelGoods> listLab = labelGoodsMapper.queryByGoodsId(0, 200, goodsBrief.getId());
+ if (listLab == null || listLab.size() == 0) {
+ return null;
+ }
+
+ // 鏍囩id
+ List<Long> listId = new ArrayList<Long>();
+ for (LabelGoods labelGoods: listLab) {
+ Label label = labelGoods.getLabel();
+ if (label != null) {
+ listId.add(label.getId());
+ }
+ }
+
+ if (listId.size() == 0) {
+ return null;
+ }
+
+ return qualityFactoryMapper.listQueryBylabIDs(0, 10, listId, goodsBrief.getId(),qualityFactory.getSystemCid());
+ }
+
+ @Override
+ public List<QualityFactory> listFreeGoods(long start, int count, Double tkRate, String lableName) {
+ return qualityFactoryMapper.listFreeGoods(start, count, tkRate, lableName);
+ }
+
+ @Override
+ public long countFreeGoods(Double tkRate, String lableName) {
+ return qualityFactoryMapper.countFreeGoods(tkRate, lableName);
+ }
}
--
Gitblit v1.8.0