| | |
| | | import com.yeshi.fanli.util.jd.JDApiUtil; |
| | | import com.yeshi.fanli.util.jd.JDUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil; |
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil; |
| | |
| | | GoodsDetailVO goodsDetailVO = null; |
| | | JDGoods jdGoods = null; |
| | | PDDGoodsDetail pddGoods = null; |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal vipFanLiRate = hongBaoManageService.getVIPFanLiRate(); |
| | | ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate); |
| | | ConfigParamsDTO params = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(goodsId); |
| | |
| | | |
| | | public GoodsDetailVO getGoodsDetailVO(Long goodsId, Integer goodsType) throws GoodsEvaluateException { |
| | | GoodsDetailVO goodsDetail = null; |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal vipFanLiRate = hongBaoManageService.getVIPFanLiRate(); |
| | | ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate); |
| | | ConfigParamsDTO params = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(goodsId); |
| | |
| | | commentInfoNew.setTagList(tagListNew); |
| | | commentNew.add(commentInfoNew); |
| | | continue; |
| | | } else { |
| | | continue; |
| | | } |
| | | } else { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | |
| | | try { |
| | | Date now = new Date(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal vipFanLiRate = hongBaoManageService.getVIPFanLiRate(); |
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, |
| | | vipFanLiRate); |
| | | ConfigParamsDTO params = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | // 是否2个小时之内已更新 |
| | | Date updateTime = goodsEvaluate.getUpdateTime(); |
| | |
| | | |
| | | GoodsDetailVO goods = goodsEvaluate.getGoods(); |
| | | if (goods != null) { |
| | | GoodsDetailVO goodsNew = getGoodsNewInfo(goods.getGoodsId(), goods.getGoodsType(), paramsDTO); |
| | | GoodsDetailVO goodsNew = getGoodsNewInfo(goods.getGoodsId(), goods.getGoodsType(), params); |
| | | if (goodsNew != null) { |
| | | goodsEvaluate.setGoods(goodsNew); |
| | | } else { |
| | |
| | | } |
| | | |
| | | GoodsDetailVO goodsDetailVO = getGoodsNewInfo(simpleGoods.getGoodsId(), simpleGoods.getGoodsType(), |
| | | paramsDTO); |
| | | params); |
| | | if (goodsDetailVO != null) { |
| | | simpleGoods.setPrice(goodsDetailVO.getCouponPrice()); |
| | | simpleGoods.setState(0); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | goodsEvaluate.setImgList(imgList); |
| | | goodsEvaluate.setUpdateTime(new Date()); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal vipFanLiRate = hongBaoManageService.getVIPFanLiRate(); |
| | | ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, params); |
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO); |
| | | // 发布用户 |
| | | ActivityUser user = activityUserService.getRandomByDaTaoKeCid(daTaoKe.getCid()); |
| | | |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public void updateTaoBaoGoods(TaoBaoGoodsBrief goods) { |
| | | try { |
| | | if (goods == null) { |
| | | return; |
| | | } |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_TAOBAO, goods.getAuctionId()); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateJDGoods(JDGoods jdGoods) { |
| | | if (jdGoods == null) { |
| | | return; |
| | | } |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_JD, jdGoods.getSkuId()); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | |
| | | @Override |
| | | public void updatePDDGoods(PDDGoodsDetail pddGoods) { |
| | | if (pddGoods == null) { |
| | | return; |
| | | } |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_PDD, pddGoods.getGoodsId()); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | |
| | | private void updateGoods(List<GoodsEvaluate> listExist, GoodsDetailVO goodsNew) { |
| | | long goodsId = goodsNew.getGoodsId(); |
| | | int goodsType = goodsNew.getGoodsType(); |
| | | for (GoodsEvaluate goodsEvaluate: listExist) { |
| | | GoodsDetailVO goodsDetailVO = goodsEvaluate.getGoods(); |
| | | if (goodsDetailVO != null && goodsDetailVO.getGoodsId() != null |
| | | && goodsDetailVO.getGoodsId() == goodsId && goodsDetailVO.getGoodsType() == goodsType ) { |
| | | goodsEvaluate.setGoods(goodsNew); |
| | | } |
| | | |
| | | // 更新商品信息 |
| | | List<ImgInfo> imgList = goodsEvaluate.getImgList(); |
| | | if (imgList == null || imgList.size() == 0) { |
| | | continue; |
| | | } |
| | | |
| | | for (ImgInfo imgInfo : imgList) { |
| | | SimpleGoods simpleGoods = imgInfo.getGoods(); |
| | | if (simpleGoods == null) { |
| | | continue; |
| | | } |
| | | |
| | | simpleGoods.setState(0); |
| | | simpleGoods.setPrice(goodsDetailVO.getCouponPrice()); |
| | | CouponInfoVO couponInfo = goodsDetailVO.getCouponInfo(); |
| | | if (couponInfo == null) { |
| | | simpleGoods.setPrice(goodsDetailVO.getZkPrice()); |
| | | } else { |
| | | simpleGoods.setPrice(goodsDetailVO.getCouponPrice()); |
| | | simpleGoods.setAmount(couponInfo.getAmount()); |
| | | } |
| | | imgInfo.setGoods(simpleGoods); |
| | | imgInfo.setGoodsVO(goodsDetailVO); |
| | | } |
| | | |
| | | goodsEvaluate.setImgList(imgList); |
| | | goodsEvaluate.setUpdateTime(new Date()); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |