| | |
| | | package com.yeshi.fanli.service.impl.lable;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.lable.LabelGoodsMapper;
|
| | | 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.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | | import net.sf.json.JSONArray;
|
| | |
|
| | | @Service
|
| | | public class QualityGoodsServiceImpl implements QualityGoodsService {
|
| | |
| | | private TaoBaoGoodsBriefMapper taoBaoGoodsBriefMapper;
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefRecordMapper taoBaoGoodsBriefRecordMapper;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoClassRelationMapper taoBaoClassRelationMapper;
|
| | |
| | | return qualityFactoryMapper.countQueryByFlashSale();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 今日必抢 - 9k9
|
| | | * @param start
|
| | | * @param count
|
| | | * @param systemCid
|
| | | * @param labId
|
| | | * @param sortField
|
| | | * @return
|
| | | */
|
| | | @Override
|
| | | public List<QualityFactory> listQueryEverydayRob(long start, int count, Long cid, Long labId, Integer sortField,Double startCouponAmount,Double endCouponAmount) {
|
| | | return qualityFactoryMapper.listQueryEverydayRob(start, count, cid, labId, sortField,startCouponAmount,endCouponAmount);
|
| | | public List<QualityFactory> listFlashSaleRandGoods() {
|
| | | return qualityFactoryMapper.listFlashSaleRandGoods();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countQueryEverydayRob(Long cid, Long labId, Double startCouponAmount,Double endCouponAmount) {
|
| | | return qualityFactoryMapper.countQueryEverydayRob(cid, labId,startCouponAmount,endCouponAmount);
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 小金额查询:9.9/19.9/29.9/49.9
|
| | |
| | | * @return
|
| | | */
|
| | | @Override
|
| | | @Cacheable(value = "quality9K9Cache",key="'listQuerySmallAmount-'+#start+'-'+#key+'-'+#labId+'-'+#cids")
|
| | | public List<QualityFactory> listQuerySmallAmount(long start, int count, String key, Long labId, String cids) {
|
| | | return qualityFactoryMapper.listQuery(start, count, key, null, labId, cids,1);
|
| | | @Cacheable(value = "quality9K9Cache",key="'get9k9ClassGoods-'+#start+'-'+#biz30day+'-'+#zkPrice+'-'+#minQuanPrice+'-'+#maxQuanPrice+'-'+#cids")
|
| | | public List<QualityFactory> get9k9ClassGoods(long start, int count, Integer biz30day, BigDecimal zkPrice,
|
| | | BigDecimal minQuanPrice, BigDecimal maxQuanPrice, String cids) {
|
| | | return qualityFactoryMapper.get9k9ClassGoods(start, count, biz30day, zkPrice, minQuanPrice, maxQuanPrice, cids);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 对应小金额查询:9.9/19.9/29.9/49.9
|
| | | */
|
| | | @Override
|
| | | @Cacheable(value = "quality9K9Cache",key="'countQuerySmallAmount-'+#key+'-'+#labId+'-'+#cids")
|
| | | public long countQuerySmallAmount(String key, Long labId, String cids) {
|
| | | return qualityFactoryMapper.countQuery(key, null, labId, cids,1);
|
| | | @Cacheable(value = "quality9K9Cache",key="'count9k9ClassGoods-'+#biz30day+'-'+#zkPrice+'-'+#minQuanPrice+'-'+#maxQuanPrice+'-'+#cids")
|
| | | public long count9k9ClassGoods(Integer biz30day, BigDecimal zkPrice, BigDecimal minQuanPrice, |
| | | BigDecimal maxQuanPrice, String cids) {
|
| | | return qualityFactoryMapper.count9k9ClassGoods(biz30day, zkPrice, minQuanPrice, maxQuanPrice, cids);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | @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);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | * 首页最底部@商品信息流
|
| | | */
|
| | | @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;
|
| | |
| | | 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;
|
| | |
| | |
|
| | | return qualityFactoryMapper.listQueryBylabIDs(0, 10, listId, goodsBrief.getId(),qualityFactory.getSystemCid());
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<QualityFactory> listFreeGoods(long start, int count) {
|
| | | return qualityFactoryMapper.listFreeGoods(start, count);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countFreeGoods() {
|
| | | return qualityFactoryMapper.countFreeGoods();
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<QualityFactory> listByShopId(long start, int count, Long shopId) {
|
| | | return qualityFactoryMapper.listByShopId(start, count, shopId);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countByShopId(Long shopId) {
|
| | | return qualityFactoryMapper.countByShopId(shopId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<QualityFactory> listQueryEverydayRob(long start, int count, BigDecimal zkPrice, |
| | | BigDecimal minQuanPrice, BigDecimal maxQuanPrice) {
|
| | | return qualityFactoryMapper.listQueryEverydayRob(start, count, zkPrice, minQuanPrice, maxQuanPrice);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countQueryEverydayRob(BigDecimal zkPrice, BigDecimal minQuanPrice, BigDecimal maxQuanPrice) {
|
| | | return qualityFactoryMapper.countQueryEverydayRob(zkPrice, minQuanPrice, maxQuanPrice);
|
| | | }
|
| | | }
|