| | |
| | | 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.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.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.DaTaoKeGoodsDetailService;
|
| | | 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 com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
|
| | |
| | | private TaoBaoClassRelationMapper taoBaoClassRelationMapper;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | 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")
|
| | |
| | | @Cacheable(value = "qualityCache", key = "'listQueryByClassId-'+#start+'-'+#cid")
|
| | | public List<QualityFactory> listQueryByClassId(long start, int count, Long cid) {
|
| | | 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 = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);// 过滤大淘客标题
|
| | | // 过滤商品信息
|
| | | 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));
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | goodsList = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);
|
| | | goodsList = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goodsList);
|
| | | } catch (Exception e) {
|
| | | }
|
| | |
|
| | |
| | | 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;
|
| | | // 佣金比例高的: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")
|
| | | public long countRecommendToIndex(String proportion) {
|