From 88b54772dbcf5ecab1e2316e4e4626ac901b8908 Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期二, 22 一月 2019 15:58:24 +0800
Subject: [PATCH] 邀请码添加返回状态

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoGoodsBriefServiceImpl.java |   94 ++++------------------------------------------
 1 files changed, 9 insertions(+), 85 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoGoodsBriefServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoGoodsBriefServiceImpl.java
index be3d202..3245c55 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoGoodsBriefServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/TaoBaoGoodsBriefServiceImpl.java
@@ -4,7 +4,6 @@
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 import javax.annotation.Resource;
 import javax.transaction.Transactional;
@@ -14,12 +13,11 @@
 import org.hibernate.Session;
 import org.springframework.orm.hibernate4.HibernateCallback;
 import org.springframework.stereotype.Service;
+import org.yeshi.utils.NumberUtil;
 
-import com.yeshi.fanli.dao.config.AddEveryDayTaskDao;
 import com.yeshi.fanli.dao.goods.RecommendSectionGoodsDao;
 import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoGoodsBriefMapper;
 import com.yeshi.fanli.dao.taobao.TaoBaoGoodsBriefDao;
-import com.yeshi.fanli.entity.admin.EveryDayTask;
 import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
 import com.yeshi.fanli.entity.bus.recommend.RecommendSection;
 import com.yeshi.fanli.entity.bus.recommend.RecommendSectionGoods;
@@ -46,7 +44,6 @@
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.taobao.TaoBaoUtil;
 import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
-import org.yeshi.utils.NumberUtil;
 
 @Service
 public class TaoBaoGoodsBriefServiceImpl implements TaoBaoGoodsBriefService {
@@ -69,8 +66,6 @@
 	@Resource
 	private GoodsClassService goodsClassService;
 
-	@Resource
-	private AddEveryDayTaskDao addEveryDayTaskDao;
 
 	@Resource
 	private HongBaoManageService hongBaoManageService;
@@ -169,20 +164,6 @@
 		recommendSectionGoodsService.addRecommendSectionGoods(recommendSection, taobao);
 	}
 
-	/**
-	 * 娣诲姞鍟嗗搧鍒版瘡鏃ヤ换鍔�
-	 */
-	@Override
-	public void addEveryDayTask(long tbid) throws NotExistObjectException, ExistObjectException {
-		TaoBaoGoodsBrief taobao = taoBaoGoodsBriefDao.find(TaoBaoGoodsBrief.class, tbid);
-		if (taobao == null) {
-			throw new NotExistObjectException("涓嶅瓨鍦ㄨ娣樺疂鍟嗗搧");
-		}
-		EveryDayTask everyDaoTask = new EveryDayTask();
-		everyDaoTask.setEtGoods(taobao);
-		everyDaoTask.setEtCreateTime(new Date());
-		addEveryDayTaskDao.create(everyDaoTask);
-	}
 
 	@Transactional
 	public void addClassRecommendGoods(long gcid, long tbid) throws NotExistObjectException, ExistObjectException {
@@ -299,36 +280,32 @@
 
 	@Override
 	public String getGoodsUserHongBao(TaoBaoGoodsBrief goods) {
-		Map<String, String> convertMap = hongBaoManageService.convertMap();
-		String proportion = convertMap.get("hongbao_goods_proportion");
-		return TaoBaoUtil.getGoodsHongBaoInfo(goods, new BigDecimal(proportion));
+		BigDecimal rate = hongBaoManageService.getFanLiRate();
+		return TaoBaoUtil.getGoodsHongBaoInfo(goods, rate);
 	}
 
 	@Override
 	public BigDecimal getShareGoodsUserHongBao(TaoBaoGoodsBrief goods) {
-		Map<String, String> convertMap = hongBaoManageService.convertMap();
-		String proportion = convertMap.get("hongbao_goods_proportion");
-		return TaoBaoUtil.getShareGoodsHongBaoInfo(goods, new BigDecimal(proportion));
+		BigDecimal rate = hongBaoManageService.getShareRate();
+		return TaoBaoUtil.getShareGoodsHongBaoInfo(goods, rate);
 	}
 
 	@Override
 	public List<TaoBaoGoodsBrief> queryByAuctionId(Long auctionId) {
 		return taoBaoGoodsBriefMapper.queryByAuctionId(auctionId);
 	}
-	
+
 	@Override
 	public List<TaoBaoGoodsBrief> listQueryByAuctionId(List<Long> list) {
 		return taoBaoGoodsBriefMapper.queryGoodsByAuctionId(list);
 	}
-	
-	
 
 	@Override
 	public int insertSelective(TaoBaoGoodsBrief taoBaoGoodsBrief) {
 
 		return taoBaoGoodsBriefMapper.insertSelective(taoBaoGoodsBrief);
 	}
-	
+
 	@Override
 	public int insertBatch(List<TaoBaoGoodsBrief> list) {
 
@@ -340,12 +317,7 @@
 		return taoBaoGoodsBriefMapper.selectByPrimaryKey(id);
 	}
 
-	@Override
-	public int updateByPrimaryKey(TaoBaoGoodsBrief taoBaoGoodsBrief) {
-		return taoBaoGoodsBriefMapper.updateByPrimaryKey(taoBaoGoodsBrief);
-	}
-	
-	
+
 	@Override
 	public void updateTBGoodsWithNewInfo(TaoBaoGoodsBrief tb) throws NotExistObjectException {
 		if (tb == null)
@@ -361,48 +333,6 @@
 			}
 		}
 
-	}
-
-	@Override
-	public void updateTaoBaoGoodsByMybatis(TaoBaoGoodsBrief taoBaoGoodsBrief) throws TaobaoGoodsDownException {
-
-		SearchFilter filter = new SearchFilter();
-		filter.setKey("https://item.taobao.com/item.htm?id=" + taoBaoGoodsBrief.getAuctionId());
-		TaoBaoGoodsBrief tb = TaoKeApiUtil.searchGoodsDetail(taoBaoGoodsBrief.getAuctionId());
-		if (tb == null) {
-			return;
-		}
-
-		taoBaoGoodsBrief.setCouponLink(tb.getCouponLink());
-		taoBaoGoodsBrief.setCouponActivityId(tb.getCouponActivityId());
-		taoBaoGoodsBrief.setCouponAmount(tb.getCouponAmount());
-		taoBaoGoodsBrief.setCouponEffectiveStartTime(tb.getCouponEffectiveStartTime());
-		taoBaoGoodsBrief.setCouponEffectiveEndTime(tb.getCouponEffectiveEndTime());
-		taoBaoGoodsBrief.setCouponInfo(tb.getCouponInfo());
-		taoBaoGoodsBrief.setCouponLeftCount(tb.getCouponLeftCount());
-		taoBaoGoodsBrief.setCouponLinkTaoToken(tb.getCouponLinkTaoToken());
-		taoBaoGoodsBrief.setCouponOriLink(tb.getCouponOriLink());
-		taoBaoGoodsBrief.setCouponShortLink(tb.getCouponShortLink());
-		taoBaoGoodsBrief.setCouponStartFee(tb.getCouponStartFee());
-		taoBaoGoodsBrief.setCouponTotalCount(tb.getCouponTotalCount());
-		taoBaoGoodsBrief.setBiz30day(tb.getBiz30day());
-		taoBaoGoodsBrief.setTkRate(tb.getTkRate());
-		taoBaoGoodsBrief.setZkPrice(tb.getZkPrice());
-		taoBaoGoodsBrief.setEventRate(tb.getEventRate());
-		taoBaoGoodsBrief.setTkMktStatus(tb.getTkMktStatus());
-		taoBaoGoodsBrief.setReservePrice(tb.getReservePrice());
-		taoBaoGoodsBrief.setCreatetime(new Date());
-
-		setGoodsBriefDefault(taoBaoGoodsBrief);
-
-		taoBaoGoodsBriefMapper.updateByPrimaryKeySelective(taoBaoGoodsBrief);
-
-	}
-
-	@Override
-	public void updateByPrimaryKeySelective(TaoBaoGoodsBrief taoBaoGoodsBrief) throws TaobaoGoodsDownException {
-		setGoodsBriefDefault(taoBaoGoodsBrief);
-		taoBaoGoodsBriefMapper.updateByPrimaryKeySelective(taoBaoGoodsBrief);
 	}
 
 	@Override
@@ -478,7 +408,7 @@
 
 		if (goodsBrief.getZkPrice() == null)
 			goodsBrief.setZkPrice(defaultZero);
-		
+
 	}
 
 	@Override
@@ -515,10 +445,4 @@
 		return taoBaoGoodsBrief;
 	}
 
-	
-	@Override
-	public void updateBatchSelective(List<TaoBaoGoodsBrief> list) {
-		 taoBaoGoodsBriefMapper.updateBatchSelective(list);
-	}
-	
 }

--
Gitblit v1.8.0