From 744594ef1a2f530fc3e86ea9dc48b62247f79420 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 19 五月 2020 17:13:23 +0800 Subject: [PATCH] 饿了么绘图,添加口碑 --- fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityGoodsServiceImpl.java | 376 +++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 260 insertions(+), 116 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 f5bc677..6e38263 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,13 +1,15 @@ 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; @@ -15,18 +17,26 @@ 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.dto.ConfigParamsDTO; +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; import com.yeshi.fanli.service.inter.lable.LabelService; import com.yeshi.fanli.service.inter.lable.QualityGoodsService; +import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService; +import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; +import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService; import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService; +import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service; import com.yeshi.fanli.util.RedisManager; import com.yeshi.fanli.util.StringUtil; +import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; import com.yeshi.fanli.util.taobao.TaoBaoUtil; -import org.yeshi.utils.JsonUtil; -import org.yeshi.utils.taobao.TbImgUtil; +import com.yeshi.fanli.vo.goods.GoodsDetailVO; + +import net.sf.json.JSONArray; @Service public class QualityGoodsServiceImpl implements QualityGoodsService { @@ -47,56 +57,48 @@ private TaoBaoUnionConfigService taoBaoUnionConfigService; @Resource - private TaoBaoGoodsBriefRecordMapper taoBaoGoodsBriefRecordMapper; - - @Resource private TaoBaoClassRelationMapper taoBaoClassRelationMapper; + @Resource + private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service; + + @Resource + private HongBaoManageService hongBaoManageService; - + @Resource + private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService; + + @Resource + private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService; + @Override - @Cacheable(value = "qualityCache",key="'listQueryByCouponAmount-'+#start+'-'+#key+'-'+#endAmount+'-'+#startPropor") - public List<QualityFactory> listQueryByCouponAmount(long start, int count, Integer key, - Integer endAmount, Integer startPropor){ + @Cacheable(value = "qualityCache", key = "'listQueryByCouponAmount-'+#start+'-'+#key+'-'+#endAmount+'-'+#startPropor") + public List<QualityFactory> listQueryByCouponAmount(long start, int count, Integer key, Integer endAmount, + Integer startPropor) { return qualityFactoryMapper.listQueryByCouponAmount(start, count, key, endAmount, startPropor); } - + @Override - @Cacheable(value = "qualityCache",key="'countQueryByCouponAmount-'+#key+'-'+#endAmount+'-'+#startPropor") - public long countQueryByCouponAmount(Integer key, Integer endAmount, Integer startPropor){ + @Cacheable(value = "qualityCache", key = "'countQueryByCouponAmount-'+#key+'-'+#endAmount+'-'+#startPropor") + public long countQueryByCouponAmount(Integer key, Integer endAmount, Integer startPropor) { return qualityFactoryMapper.countQueryByCouponAmount(key, endAmount, startPropor); } - @Override - @Cacheable(value = "qualityCache",key="'listQueryByFlashSale-'+#start") + @Cacheable(value = "qualityCache", key = "'listQueryByFlashSale-'+#start") public List<QualityFactory> listQueryByFlashSale(long start, int count) { return qualityFactoryMapper.listQueryByFlashSale(start, count); } @Override - //@Cacheable(value = "qualityCache",key="'countQueryByFlashSale-'") + // @Cacheable(value = "qualityCache",key="'countQueryByFlashSale-'") public long countQueryByFlashSale() { 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); - } @Override - public long countQueryEverydayRob(Long cid, Long labId, Double startCouponAmount,Double endCouponAmount) { - return qualityFactoryMapper.countQueryEverydayRob(cid, labId,startCouponAmount,endCouponAmount); + public List<QualityFactory> listFlashSaleRandGoods() { + return qualityFactoryMapper.listFlashSaleRandGoods(); } /** @@ -112,18 +114,20 @@ * @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); } /** @@ -135,16 +139,16 @@ * @param labId * @return */ - public List<QualityFactory> listQueryByKeyAndlabIDs(long start, int count,String key, List<Long> listId, Integer sort, - Long systemCid, Integer hasQuan, Integer userType, Integer biz30day,Integer startprice, Integer endprice) { - return qualityFactoryMapper.listQueryByKeyAndlabIDs(start, count, key, listId, sort,systemCid, hasQuan, userType, - biz30day, startprice, endprice); + public List<QualityFactory> listQueryByKeyAndlabIDs(long start, int count, String key, List<Long> listId, + Integer sort, Long systemCid, Integer hasQuan, Integer userType, Integer biz30day, Integer startprice, + Integer endprice) { + return qualityFactoryMapper.listQueryByKeyAndlabIDs(start, count, key, listId, sort, systemCid, hasQuan, + userType, biz30day, startprice, endprice); } - public long countQueryKeyAndlabIDs(String key, List<Long> listId, Long systemCid, Integer hasQuan, Integer userType, - Integer biz30day,Integer startprice, Integer endprice) { - return qualityFactoryMapper.countQueryKeyAndlabIDs(key, listId,systemCid, hasQuan, userType, biz30day, + Integer biz30day, Integer startprice, Integer endprice) { + return qualityFactoryMapper.countQueryKeyAndlabIDs(key, listId, systemCid, hasQuan, userType, biz30day, startprice, endprice); } @@ -158,17 +162,16 @@ * @return */ @Override - public List<QualityFactory> listQueryByKey(long start, int count, String key, Integer sort,Long systemCid, - Integer hasQuan, Integer userType, Integer biz30day,Integer startprice, Integer endprice) { - return qualityFactoryMapper.listQueryByKey(start, count, key, sort, systemCid,hasQuan, userType, biz30day, + public List<QualityFactory> listQueryByKey(long start, int count, String key, Integer sort, Long systemCid, + Integer hasQuan, Integer userType, Integer biz30day, Integer startprice, Integer endprice) { + return qualityFactoryMapper.listQueryByKey(start, count, key, sort, systemCid, hasQuan, userType, biz30day, startprice, endprice); } - public long countQueryByKey(String key, Long systemCid,Integer hasQuan, Integer userType, - Integer biz30day,Integer startprice, Integer endprice) { - - return qualityFactoryMapper.countQueryByKey(key, systemCid,hasQuan, userType, biz30day, - startprice, endprice); + public long countQueryByKey(String key, Long systemCid, Integer hasQuan, Integer userType, Integer biz30day, + Integer startprice, Integer endprice) { + + return qualityFactoryMapper.countQueryByKey(key, systemCid, hasQuan, userType, biz30day, startprice, endprice); } /** @@ -181,154 +184,295 @@ * @return */ @Override - @Cacheable(value = "qualityCache",key="'listQueryByClassId-'+#start+'-'+#cid") + @Cacheable(value = "qualityCache", key = "'listQueryByClassId-'+#start+'-'+#cid") public List<QualityFactory> listQueryByClassId(long start, int count, Long cid) { - return qualityFactoryMapper.listQuery(start, count, null, cid, null, null, 1); + List<QualityFactory> list = qualityFactoryMapper.listQuery(start, count, null, cid, null, null, 1); + + if (list == null) { + list = new ArrayList<QualityFactory>(); + } + + List<TaoBaoGoodsBrief> goodsList = new ArrayList<>(); + for (QualityFactory qf : list) + goodsList.add(qf.getTaoBaoGoodsBrief()); + // 杩囨护鍟嗗搧淇℃伅 + goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList); + goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList);// 杩囨护澶ф窐瀹㈡爣棰� + for (int i = 0; i < list.size(); i++) { + if (i < goodsList.size()) + list.get(i).setTaoBaoGoodsBrief(goodsList.get(i)); + + } + return list; } @Override - @Cacheable(value = "qualityCache",key="'countQueryClassId-'+#cid") + @Cacheable(value = "qualityCache", key = "'countQueryClassId-'+#cid") public long countQueryClassId(Long cid) { return qualityFactoryMapper.countQuery(null, cid, null, null, 1); } - - + @Override - @Cacheable(value = "qualityCache",key="'listQueryByRebateAmount-'+#start+'-'+#proportion+'-'+#endAmount+'-'+#endAmount+'-'+#tkRate") - public List<QualityFactory> listQueryByRebateAmount(long start, int count,String proportion, - Integer startAmount, Integer endAmount, double tkRate){ + @Cacheable(value = "qualityCache", key = "'listQueryByRebateAmount-'+#start+'-'+#proportion+'-'+#endAmount+'-'+#endAmount+'-'+#tkRate") + public List<QualityFactory> listQueryByRebateAmount(long start, int count, String proportion, Integer startAmount, + Integer endAmount, double tkRate) { return qualityFactoryMapper.listQueryByRebateAmount(start, count, proportion, startAmount, endAmount, tkRate); } - + @Override - @Cacheable(value = "qualityCache",key="'countQueryByRebateAmount-'+#proportion+'-'+#endAmount+'-'+#endAmount+'-'+#tkRate") - public long countQueryByRebateAmount(String proportion, Integer startAmount, Integer endAmount, double tkRate){ + @Cacheable(value = "qualityCache", key = "'countQueryByRebateAmount-'+#proportion+'-'+#endAmount+'-'+#endAmount+'-'+#tkRate") + public long countQueryByRebateAmount(String proportion, Integer startAmount, Integer endAmount, double tkRate) { return qualityFactoryMapper.countQueryByRebateAmount(proportion, startAmount, endAmount, tkRate); } - - - + @Override - //@Cacheable(value = "qualityCache",key="'queryToCouponColumn-'+#start") + // @Cacheable(value = "qualityCache",key="'queryToCouponColumn-'+#start") @Cacheable(value = "taoBaoCouponCache", key = "'queryToCouponColumn'+#start") - public List<QualityFactory> queryToCouponColumn(long start, int count){ + public List<QualityFactory> queryToCouponColumn(long start, int count) { return qualityFactoryMapper.queryToCouponColumn(start, count); } - + @Override - //@Cacheable(value = "qualityCache",key="'countQueryToCouponColumn'") + // @Cacheable(value = "qualityCache",key="'countQueryToCouponColumn'") @Cacheable(value = "taoBaoCouponCache", key = "'countQueryToCouponColumn'") - public long countQueryToCouponColumn(){ + public long countQueryToCouponColumn() { return qualityFactoryMapper.countQueryToCouponColumn(); } - /** * 棣栭〉鏈�搴曢儴@鍟嗗搧淇℃伅娴� */ @Override - public List<QualityFactory> listRecommend(long start, int count, Double proportion, Integer commision, Integer couponAmount, - double tkRate, Double couponRatio) { - return qualityFactoryMapper.listRecommendToIndex(start, count, proportion, commision, couponAmount, tkRate, couponRatio); + public List<QualityFactory> listRecommend(long start, int count, Double proportion, Integer commision, + Integer couponAmount, double tkRate, Double couponRatio) { + return qualityFactoryMapper.listRecommendToIndex(start, count, proportion, commision, couponAmount, tkRate, + couponRatio); } @Override - public long countRecommend(Double proportion, Integer commision, Integer couponAmount, double tkRate, Double couponRatio) { + public long countRecommend(Double proportion, Integer commision, Integer couponAmount, double tkRate, + Double couponRatio) { return qualityFactoryMapper.countRecommendToIndex(proportion, commision, couponAmount, tkRate, couponRatio); } @Override - public List<QualityFactory> listRecommendBykey(long start, int count, String key) { - return qualityFactoryMapper.listRecommendBykey(start, count, key); + public List<QualityFactory> listRecommendBykey(long start, int count, String key, Integer hasQuan, Integer userType, + Double startprice, Double endprice, Double startTkRate, Double endTkRate, Integer sort) { + return qualityFactoryMapper.listRecommendBykey(start, count, key, hasQuan, userType, startprice, endprice, + startTkRate, endTkRate, sort); } @Override - public long countRecommendBykey(String key) { - return qualityFactoryMapper.countRecommendBykey(key); + public long countRecommendBykey(String key, Integer hasQuan, Integer userType, 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; + Integer commision = 2; // 浼樻儬鍒搁潰棰濋珮浜�5鍏冧互涓� Integer couponAmount = 5; // 浣i噾姣斾緥楂樼殑:5%浠ヤ笂锛� double tkRate = 5.0; - // 浼樻儬鐜囬珮浜�10%浠ヤ笂锛堜紭鎯犵巼=浼樻儬鍒搁潰棰�/鍟嗗搧鍦ㄥ敭浠�*100%锛� + // 浼樻儬鐜囬珮浜�10%浠ヤ笂锛堜紭鎯犵巼=浼樻儬鍒搁潰棰�/鍟嗗搧鍦ㄥ敭浠�*100%锛� Double couponRatio = 10.0; - + Double pop = 50.0; if (!StringUtil.isNullOrEmpty(proportion)) { pop = Double.parseDouble(proportion); } - - List<QualityFactory> listQuery = - listRecommend(start, count, pop, commision, couponAmount, tkRate, couponRatio); - + + List<QualityFactory> listQuery = listRecommend(start, count, pop, commision, couponAmount, tkRate, couponRatio); + if (listQuery == null || listQuery.size() == 0) { return null; } - - + JSONArray array = new JSONArray(); Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create(); - //閬嶅巻鍒楄〃鏁版嵁 + // 閬嶅巻鍒楄〃鏁版嵁 + // + List<TaoBaoGoodsBrief> goodsList = new ArrayList<>(); for (QualityFactory quality : listQuery) { + if (quality.getTaoBaoGoodsBrief() != null) + goodsList.add(quality.getTaoBaoGoodsBrief()); + } - TaoBaoGoodsBrief taoBaoGoodsBrief = quality.getTaoBaoGoodsBrief(); + try { + goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList); + } catch (Exception e) { + } - if (taoBaoGoodsBrief == null) { - continue; - } - + for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) { int biz30day = taoBaoGoodsBrief.getBiz30day(); if (biz30day >= 10000) { double sales = biz30day; String salesCountMidea = String.format("%.1f", sales / 10000); taoBaoGoodsBrief.setSalesCount(salesCountMidea + "涓�"); } else { - taoBaoGoodsBrief.setSalesCount(count + ""); + taoBaoGoodsBrief.setSalesCount(biz30day + ""); } - - // 鏀瑰彉鍥剧墖灏哄 + + // 鏀瑰彉鍥剧墖灏哄 String pictUrl = taoBaoGoodsBrief.getPictUrl(); if (!StringUtil.isNullOrEmpty(pictUrl) && !pictUrl.contains("320x320")) { 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; + } + + /** + * 棣栭〉鏈�搴曢儴@鍟嗗搧淇℃伅娴� + */ + @Override + @Cacheable(value = "qualityCache", key = "'getRecommendToIndexV2-'+#start+'-'+#platform+'-'+#version") + public JSONArray getRecommendToIndexV2(long start, int count, String platform, String version) { + + // 杩斿埄閲戦2鍏冧互涓婏紱 + Integer commision = 2; + // 浼樻儬鍒搁潰棰濋珮浜�5鍏冧互涓� + Integer couponAmount = 5; + // 浣i噾姣斾緥楂樼殑:5%浠ヤ笂锛� + double tkRate = 5.0; + // 浼樻儬鐜囬珮浜�10%浠ヤ笂锛堜紭鎯犵巼=浼樻儬鍒搁潰棰�/鍟嗗搧鍦ㄥ敭浠�*100%锛� + Double couponRatio = 10.0; + + BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); + Double pop = 50.0; + if (fanLiRate != null) { + pop = Double.parseDouble(fanLiRate.toString()); + } + + List<QualityFactory> listQuery = listRecommend(start, count, pop, commision, couponAmount, tkRate, couponRatio); + + if (listQuery == null || listQuery.size() == 0) { + return null; + } + + JSONArray array = new JSONArray(); + Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create(); + // 閬嶅巻鍒楄〃鏁版嵁 + // + List<TaoBaoGoodsBrief> goodsList = new ArrayList<>(); + for (QualityFactory quality : listQuery) { + if (quality.getTaoBaoGoodsBrief() != null) + goodsList.add(quality.getTaoBaoGoodsBrief()); + } + + try { + goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList); + } catch (Exception e) { + } + + ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version); + + for (TaoBaoGoodsBrief taoBaoGoodsBrief : goodsList) { + GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO); + array.add(gson.toJson(detailVO)); } return array; } @Override - @Cacheable(value = "qualityCache",key="'countRecommendToIndex-'+#proportion") + @Cacheable(value = "qualityCache", key = "'countRecommendToIndex-'+#proportion") public long countRecommendToIndex(String proportion) { - + // 杩斿埄閲戦2鍏冧互涓婏紱 - Integer commision = 2; + Integer commision = 2; // 浼樻儬鍒搁潰棰濋珮浜�5鍏冧互涓� Integer couponAmount = 5; // 浣i噾姣斾緥楂樼殑:5%浠ヤ笂锛� double tkRate = 5.0; - // 浼樻儬鐜囬珮浜�10%浠ヤ笂锛堜紭鎯犵巼=浼樻儬鍒搁潰棰�/鍟嗗搧鍦ㄥ敭浠�*100%锛� + // 浼樻儬鐜囬珮浜�10%浠ヤ笂锛堜紭鎯犵巼=浼樻儬鍒搁潰棰�/鍟嗗搧鍦ㄥ敭浠�*100%锛� Double couponRatio = 10.0; - + Double pop = 50.0; if (!StringUtil.isNullOrEmpty(proportion)) { pop = Double.parseDouble(proportion); } - + 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) { + 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); + } } -- Gitblit v1.8.0