| | |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | // 商品信息过滤
|
| | | listGoodsBrief = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(listGoodsBrief);
|
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
|
| | | boolean stateSale = false; // 默认停售
|
| | |
| | | package com.yeshi.fanli.dto.jd;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | public class JDCommissionInfo {
|
| | | private BigDecimal commission;//佣金
|
| | | private BigDecimal commissionShare;//佣金比例
|
| | | public class JDCommissionInfo implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | private BigDecimal commission;// 佣金
|
| | | private BigDecimal commissionShare;// 佣金比例
|
| | |
|
| | | public BigDecimal getCommissionShare() {
|
| | | return commissionShare;
|
| | | }
|
| | | public BigDecimal getCommissionShare() {
|
| | | return commissionShare;
|
| | | }
|
| | |
|
| | | public void setCommissionShare(BigDecimal commissionShare) {
|
| | | this.commissionShare = commissionShare;
|
| | | }
|
| | | public void setCommissionShare(BigDecimal commissionShare) {
|
| | | this.commissionShare = commissionShare;
|
| | | }
|
| | |
|
| | | public BigDecimal getCommission() {
|
| | | return commission;
|
| | | }
|
| | | public BigDecimal getCommission() {
|
| | | return commission;
|
| | | }
|
| | |
|
| | | public void setCommission(BigDecimal commission) {
|
| | | this.commission = commission;
|
| | | }
|
| | | public void setCommission(BigDecimal commission) {
|
| | | this.commission = commission;
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.entity.dynamic;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | | public class GoodsPicture {
|
| | | public class GoodsPicture implements Serializable{
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | // 图片链接
|
| | | @Expose
|
| | | private String url;
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | count = taoBaoShopService.countBrandShopinfo(cid);
|
| | | }
|
| | |
|
| | | // 淘宝商品信息过滤
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo);
|
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | for (TaoBaoShopVO taoBaoShopVO : listInfo) {
|
| | |
|
| | |
| | | List<TaoBaoGoodsBriefExtra> listGoods = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief();
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | listGoods.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null));
|
| | | listGoods.add(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsMap.get(taoBaoGoodsBrief.getAuctionId()),
|
| | | proportion.toString(), null));
|
| | | }
|
| | | taoBaoShopVO.setListGoods(listGoods);
|
| | | }
|
| | |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(listInfo));
|
| | |
|
| | | return data;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取过滤商品
|
| | | * |
| | | * @param listInfo
|
| | | * @return
|
| | | */
|
| | | private Map<Long, TaoBaoGoodsBrief> getFilterTaoBaoGoods(List<TaoBaoShopVO> listInfo) {
|
| | | // 过滤商品
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | for (TaoBaoShopVO taoBaoShopVO : listInfo) {
|
| | | goodsList.addAll(taoBaoShopVO.getListGoodsBrief());
|
| | | }
|
| | | goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>();
|
| | | for (TaoBaoGoodsBrief goods : goodsList)
|
| | | goodsMap.put(goods.getAuctionId(), goods);
|
| | | return goodsMap;
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | |
|
| | | // 淘宝商品信息过滤
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo);
|
| | |
|
| | | for (TaoBaoShopVO taoBaoShopVO : listInfo) {
|
| | |
|
| | | Integer userType = taoBaoShopVO.getUserType();
|
| | |
| | |
|
| | | List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>();
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief();
|
| | |
|
| | | // 商品添加到更新队列
|
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief);
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
|
| | | shareRate);
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory
|
| | | .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()), null, fanLiRate, shareRate);
|
| | | listGoods.add(goodsDetailVO);
|
| | | }
|
| | | taoBaoShopVO.setListGoodsVO(listGoods);
|
| | |
| | | package com.yeshi.fanli.service.impl.dynamic;
|
| | |
|
| | | import java.lang.reflect.InvocationTargetException;
|
| | | import java.math.BigDecimal;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | | private Map<Long, TaoBaoGoodsBrief> getFilterGoodsMap(List<DynamicInfo> list) {
|
| | | // 提取过滤商品
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | for (DynamicInfo dynamicInfo : list) {
|
| | | List<GoodsPicture> gpList = dynamicInfo.getImgs();
|
| | | if (gpList != null)
|
| | | for (GoodsPicture gp : gpList) {
|
| | | if (gp != null && gp.getGoods() != null) {
|
| | | TaoBaoGoodsBriefExtra newGoods = new TaoBaoGoodsBriefExtra();
|
| | | try {
|
| | | PropertyUtils.copyProperties(newGoods, gp.getGoods());
|
| | | goodsList.add(newGoods);
|
| | | } catch (IllegalAccessException e) {
|
| | | e.printStackTrace();
|
| | | } catch (InvocationTargetException e) {
|
| | | e.printStackTrace();
|
| | | } catch (NoSuchMethodException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
|
| | | Map<Long, TaoBaoGoodsBrief> map = new HashMap<>();
|
| | | if (goodsList != null)
|
| | | for (TaoBaoGoodsBrief goods : goodsList)
|
| | | map.put(goods.getAuctionId(), goods);
|
| | | return map;
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "dynamicCache", key = "'queryV2-'+#platform+'-'+#version+'-'+#start+'-'+#count+'-'+#cid+'-'+#subId")
|
| | | public List<DynamicInfo> queryV2(int platform, int version, int start, int count, Long cid, Long subId) {
|
| | |
| | | // 需要更新的商品
|
| | | List<TaoBaoGoodsBrief> taoBaoGoodsUpdateList = new ArrayList<>();
|
| | | if (list != null && list.size() > 0) {
|
| | | // 提取商品
|
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterGoodsMap(list);
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | for (DynamicInfo dynamicInfo : list) {
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | // 过滤券信息与资金信息
|
| | | goods.setCouponAmount(goodsMap.get(goods.getAuctionId()).getCouponAmount());
|
| | | goods.setZkPrice(goodsMap.get(goods.getAuctionId()).getZkPrice());
|
| | | goods.setCouponStartFee(goodsMap.get(goods.getAuctionId()).getCouponStartFee());
|
| | | goods.setTkRate(goodsMap.get(goods.getAuctionId()).getTkRate());
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBaoGoodsBriefExtra(goods, fanLiRate,
|
| | | shareRate);
|
| | |
|
| | | goodsNew.setGoodsVO(detailVO);
|
| | | goodsNew.setGoods(null);
|
| | |
|
| | |
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaobaoMeterialService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | |
|
| | | @Resource
|
| | | private QualityGoodsService qualityGoodsService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | | private static List<CommonContentNav> getCommonNav() {
|
| | | List<CommonContentNav> navList = new ArrayList<>();
|
| | |
| | | @Cacheable(value = "commonContentCache", key = "#type+'-'+#cid+'-'+#page+'-'+#pageSize")
|
| | | @Override
|
| | | public CommonContentResult getContentList(CommonContentTypeEnum type, String cid, int page, int pageSize) {
|
| | | CommonContentResult result = null;
|
| | | if (type == CommonContentTypeEnum._9k9) {
|
| | | return get9K9Content(cid, page, pageSize);
|
| | | result = get9K9Content(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.juJia) {
|
| | | return getJuJiaShengHuoContent(cid, page, pageSize);
|
| | | result = getJuJiaShengHuoContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.muYin) {
|
| | | return getMuYinJingXuanContent(cid, page, pageSize);
|
| | | result = getMuYinJingXuanContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.meiShi) {
|
| | | return getYouXuanMeiShiContent(cid, page, pageSize);
|
| | | result = getYouXuanMeiShiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.chuanYiDaPei) {
|
| | | return getChuanYiDaPeiContent(cid, page, pageSize);
|
| | | result = getChuanYiDaPeiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.meiZhuangGehu) {
|
| | | return getMeiZhuangGeHuContent(cid, page, pageSize);
|
| | | result = getMeiZhuangGeHuContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.jingPinXieBao) {
|
| | | return getJingPinXieBaoContent(cid, page, pageSize);
|
| | | result = getJingPinXieBaoContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.chaoNanReMai) {
|
| | | return getChaoNanReMaiContent(cid, page, pageSize);
|
| | | result = getChaoNanReMaiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.shuMaShouJi) {
|
| | | return getShuMaShouJiContent(cid, page, pageSize);
|
| | | result = getShuMaShouJiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.yunDongKuXie) {
|
| | | return getYunDongKuXieContent(cid, page, pageSize);
|
| | | result = getYunDongKuXieContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.qiCheHuWai) {
|
| | | return getQiCheHuWaiContent(cid, page, pageSize);
|
| | | result = getQiCheHuWaiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.chaoPinReMai) {
|
| | | return getChaoPinReMaiContent(cid, page, pageSize);
|
| | | result = getChaoPinReMaiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.chaoSheng) {
|
| | | return getCaoShengContent(cid, page, pageSize);
|
| | | result = getCaoShengContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.haoQuan) {
|
| | | return getHaoQuanContent(cid, page, pageSize);
|
| | | result = getHaoQuanContent(cid, page, pageSize);
|
| | | }
|
| | | return null;
|
| | | if (result != null) {// 商品信息过滤
|
| | | List<TaoBaoGoodsBrief> goodsList = taoBaoGoodsUpdateService
|
| | | .filterImportantTaoBaoGoods(result.getGoodsList());
|
| | | result.setGoodsList(goodsList);
|
| | | }
|
| | |
|
| | | return result;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.recommend.HomeRecommendGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private TLJBuyGoodsService tljBuyGoodsService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> listGoodsByPage(Long uid, String device, String imei, String idfa, int page) {
|
| | |
| | | if (goodsList != null && goodsList.size() > 0)
|
| | | saveObjList(goodsList, name, key);
|
| | |
|
| | | // 商品信息过滤
|
| | | goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.lable.LabelService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | 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.util.RedisManager;
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | |
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | for (QualityFactory qf : list)
|
| | | goodsList.add(qf.getTaoBaoGoodsBrief());
|
| | | //过滤商品信息
|
| | | goodsList=taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
|
| | | goodsList = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);// 过滤大淘客标题
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | if (i < goodsList.size())
|
| | |
| | | public void fanli(HongBaoV2 hb1) throws TaoBaoWeiQuanException {
|
| | | // 查询最新的红包数据
|
| | | hb1 = hongBaoV2Mapper.selectByPrimaryKeyForUpdate(hb1.getId());
|
| | | // 正常用户才能到账
|
| | | UserInfo mainUser = userInfoMapper.selectByPrimaryKey(hb1.getUserInfo().getId());
|
| | | if (mainUser == null || mainUser.getState() != UserInfo.STATE_NORMAL) {
|
| | | return;
|
| | | }
|
| | | // 查询红包相关联的订单
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByHongBaoId(hb1.getId());
|
| | | if (hongBaoOrder == null) {
|
| | |
| | | || co.getSourceType() == Constant.SOURCE_TYPE_PDD) {
|
| | | hongBaoList.remove(i);
|
| | | i--;
|
| | | } else {// 上级用户不是正常用户,订单均不能到账
|
| | | UserInfo userInfo = userInfoMapper.selectByPrimaryKey(item.getUserInfo().getId());
|
| | | if (userInfo == null || userInfo.getState() != UserInfo.STATE_NORMAL) {
|
| | | hongBaoList.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | |
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | | @Override
|
| | | public void addShareHotGoods(ShareHotGoods goods) {
|
| | |
| | | for (ShareHotGoods shg : list)
|
| | | goodsList.add(shg.getGoods());
|
| | | }
|
| | |
|
| | | //过滤基本商品信息
|
| | | goodsList=taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
|
| | |
|
| | | // 过滤下线商品
|
| | | goodsList = taoBaoGoodsBriefService.filterOffLineGoods(goodsList);
|
| | | // 添加大淘客信息
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | |
| | | // }
|
| | | // return newList;
|
| | | // }
|
| | | |
| | | return list;
|
| | | }
|
| | |
|
| | |
| | | for (TLJBuyGoods shg : list)
|
| | | goodsList.add(shg.getGoods());
|
| | | }
|
| | | //过滤基本商品信息
|
| | | goodsList=taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
|
| | | // 过滤下线商品
|
| | | goodsList = taoBaoGoodsBriefService.filterOffLineGoods(goodsList);
|
| | | // 添加大淘客信息
|
| | |
| | |
|
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> filterImportantTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList) {
|
| | | Map<Long, TaoBaoGoodsBrief> finalMap = new HashMap<>();
|
| | | // 原始数据全覆盖
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | finalMap.put(goods.getAuctionId(), goods);
|
| | | }
|
| | |
|
| | | List<TaoBaoGoodsBrief> tempGoodsList = new ArrayList<>();
|
| | | tempGoodsList.addAll(goodsList);
|
| | | // 先从redis里面取覆盖
|
| | | for (int i = 0; i < tempGoodsList.size(); i++) {
|
| | | TaoBaoGoodsBrief goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(tempGoodsList.get(i).getAuctionId());
|
| | | if (goods != null) {
|
| | | // 商品过滤不允许出错
|
| | | try {
|
| | | Map<Long, TaoBaoGoodsBrief> finalMap = new HashMap<>();
|
| | | // 原始数据全覆盖
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | finalMap.put(goods.getAuctionId(), goods);
|
| | | tempGoodsList.remove(i--);
|
| | | }
|
| | | }
|
| | |
|
| | | // 再从mongodb中取覆盖
|
| | | List<Long> auctionIds = new ArrayList<>();
|
| | | for (TaoBaoGoodsBrief goods : tempGoodsList) {
|
| | | auctionIds.add(goods.getAuctionId());
|
| | | }
|
| | | List<TaoBaoGoodsBrief> mList = taoBaoGoodsUpdateDao.listByAuctionIds(auctionIds);
|
| | | if (mList != null)
|
| | | for (TaoBaoGoodsBrief goods : mList) {
|
| | | if (goods.getUpdatetime().getTime() > System.currentTimeMillis() - 1000 * 60 * 60 * 24L)// 在1天内更新的数据才参与过滤
|
| | | List<TaoBaoGoodsBrief> tempGoodsList = new ArrayList<>();
|
| | | tempGoodsList.addAll(goodsList);
|
| | | // 先从redis里面取覆盖
|
| | | for (int i = 0; i < tempGoodsList.size(); i++) {
|
| | | TaoBaoGoodsBrief goods = taoBaoGoodsCacheUtil
|
| | | .getCommonTaoBaoGoodsInfo(tempGoodsList.get(i).getAuctionId());
|
| | | if (goods != null) {
|
| | | finalMap.put(goods.getAuctionId(), goods);
|
| | | tempGoodsList.remove(i--);
|
| | | }
|
| | | }
|
| | |
|
| | | List<TaoBaoGoodsBrief> finalList = new ArrayList<>();
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | TaoBaoGoodsBrief newGoods = finalMap.get(goods.getAuctionId());
|
| | | // 过滤价格,返利比例,券信息
|
| | | goods.setZkPrice(newGoods.getZkPrice());
|
| | | goods.setTkRate(newGoods.getTkRate());
|
| | | goods.setCouponAmount(goods.getCouponAmount());
|
| | | goods.setCouponActivityId(newGoods.getCouponActivityId());
|
| | | goods.setCouponEffectiveEndTime(newGoods.getCouponEffectiveEndTime());
|
| | | goods.setCouponEffectiveStartTime(newGoods.getCouponEffectiveStartTime());
|
| | | goods.setCouponStartFee(newGoods.getCouponStartFee());
|
| | | goods.setCouponTotalCount(newGoods.getCouponTotalCount());
|
| | | goods.setCouponLeftCount(newGoods.getCouponLeftCount());
|
| | | // 再从mongodb中取覆盖
|
| | | List<Long> auctionIds = new ArrayList<>();
|
| | | for (TaoBaoGoodsBrief goods : tempGoodsList) {
|
| | | auctionIds.add(goods.getAuctionId());
|
| | | }
|
| | | List<TaoBaoGoodsBrief> mList = taoBaoGoodsUpdateDao.listByAuctionIds(auctionIds);
|
| | | if (mList != null)
|
| | | for (TaoBaoGoodsBrief goods : mList) {
|
| | | if (goods.getUpdatetime().getTime() > System.currentTimeMillis() - 1000 * 60 * 60 * 24L)// 在1天内更新的数据才参与过滤
|
| | | finalMap.put(goods.getAuctionId(), goods);
|
| | | }
|
| | |
|
| | | finalList.add(goods);
|
| | | List<TaoBaoGoodsBrief> finalList = new ArrayList<>();
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | TaoBaoGoodsBrief newGoods = finalMap.get(goods.getAuctionId());
|
| | | // 过滤价格,返利比例,券信息
|
| | | goods.setZkPrice(newGoods.getZkPrice());
|
| | | goods.setTkRate(newGoods.getTkRate());
|
| | | goods.setCouponAmount(newGoods.getCouponAmount());
|
| | | goods.setCouponActivityId(newGoods.getCouponActivityId());
|
| | | goods.setCouponEffectiveEndTime(newGoods.getCouponEffectiveEndTime());
|
| | | goods.setCouponEffectiveStartTime(newGoods.getCouponEffectiveStartTime());
|
| | | goods.setCouponStartFee(newGoods.getCouponStartFee());
|
| | | goods.setCouponTotalCount(newGoods.getCouponTotalCount());
|
| | | goods.setCouponLeftCount(newGoods.getCouponLeftCount());
|
| | |
|
| | | finalList.add(goods);
|
| | | }
|
| | | return finalList;
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | return finalList;
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | * 重要的淘宝商品信息更新
|
| | | */
|
| | | public void doImportantTaoBaoGoodsUpdateJob() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | Map<String, Long> map = CMQManager.getInstance().consumeTBImpGoodsUpdateMsg(16);
|
| | | if (map != null) {
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | try {
|
| | | long startTime = System.currentTimeMillis();
|
| | | TaoBaoGoodsBrief goods = TaoKeApiUtil.searchGoodsDetail(map.get(key));
|
| | | // 更新一条数据需要的时间
|
| | | taoBaoGoodsUpdateService.updateTaoBaoGoods(goods);
|
| | | long time = System.currentTimeMillis() - startTime;
|
| | | LogHelper.test("淘宝重要商品库更新时间:" + time);
|
| | | } catch (Exception e) {
|
| | | // 开启2个线程做更新
|
| | | for (int i = 0; i < 2; i++)
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | Map<String, Long> map = CMQManager.getInstance().consumeTBImpGoodsUpdateMsg(16);
|
| | | if (map != null) {
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | long startTime = System.currentTimeMillis();
|
| | | TaoBaoGoodsBrief goods = TaoKeApiUtil.searchGoodsDetail(map.get(key));
|
| | | // 更新一条数据需要的时间
|
| | | taoBaoGoodsUpdateService.updateTaoBaoGoods(goods);
|
| | | long time = System.currentTimeMillis() - startTime;
|
| | | LogHelper.test("淘宝重要商品库更新时间:" + time);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | } finally {
|
| | | CMQManager.getInstance().deleteTBImpGoodsUpdateMsg(key);
|
| | | }
|
| | | } finally {
|
| | | CMQManager.getInstance().deleteTBImpGoodsUpdateMsg(key);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | });
|
| | |
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private static DaTaoKeDetailV2 parseDaTaoKeDetailV2(JSONObject json) {
|
| | | DaTaoKeDetailV2 detail = gson.fromJson(json.toString(), DaTaoKeDetailV2.class);
|
| | | detail.setCreateTime(new Date(TimeUtil.convertToTimeTemp(json.optString("createTime"), "yyyy-MM-dd HH:mm:ss")));
|
| | | if (StringUtil.isNullOrEmpty(json.optString("createTime"))) {
|
| | | detail.setCreateTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(json.optString("onSaleTime"), "yyyy-MM-dd HH:mm:ss")));
|
| | | } else {
|
| | | detail.setCreateTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(json.optString("createTime"), "yyyy-MM-dd HH:mm:ss")));
|
| | | }
|
| | | return detail;
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.vo.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class MoneyInfoVO {
|
| | | public class MoneyInfoVO implements Serializable{
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | @Expose
|
| | | private String fanliMoney;// 返利金额
|
| | | @Expose
|
| | |
| | | package com.yeshi.fanli.vo.msg;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class ClientTextStyleVO {
|
| | | public class ClientTextStyleVO implements Serializable{
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | @Expose
|
| | | private String content;
|
| | | @Expose
|