| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // 上传文件替换 |
| | | if (fileRequest != null) { |
| | | for (int i = 0; i < 9; i++) { |
| | |
| | | } |
| | | |
| | | /* |
| | | * // 无券不能自动 生成评论 CouponInfoVO couponInfo1 = goodsDetailVO.getCouponInfo(); if |
| | | * (couponInfo1 == null) { addComment = false; } |
| | | * // 无券不能自动 生成评论 CouponInfoVO couponInfo1 = |
| | | * goodsDetailVO.getCouponInfo(); if (couponInfo1 == null) { addComment |
| | | * = false; } |
| | | */ |
| | | |
| | | String commentText = ""; |
| | |
| | | commentText = template.replace("[链接]", jumpLink); |
| | | } |
| | | |
| | | // commentText = commentText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getZkPrice())+""); |
| | | // if (!goodsDetailVO.isHasCoupon()) { |
| | | // commentText = commentText.replace("领券抢购", "抢购"); |
| | | // commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | // } else { |
| | | // commentText = commentText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getCouponPrice())+""); |
| | | // } |
| | | // |
| | | // commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", |
| | | // "\r\n"); |
| | | // commentText = commentText.replace("[原价]", |
| | | // MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getZkPrice())+""); |
| | | // if (!goodsDetailVO.isHasCoupon()) { |
| | | // commentText = commentText.replace("领券抢购", "抢购"); |
| | | // commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | // } else { |
| | | // commentText = commentText.replace("[券后价]", |
| | | // MoneyBigDecimalUtil.getWithNoZera(goodsDetailVO.getCouponPrice())+""); |
| | | // } |
| | | // |
| | | // commentText = commentText.replace("\r\n\r\n", |
| | | // "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", |
| | | // "\r\n"); |
| | | |
| | | CommentInfo commentInfo = new CommentInfo(); |
| | | commentInfo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // 上传文件替换 |
| | | if (fileRequest != null) { |
| | | for (int i = 0; i < 9; i++) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | int totalImg = 0; |
| | | for (String pic : listpic) { |
| | | ImgInfo imgInfo0 = new ImgInfo(); |
| | |
| | | return goodsEvaluateDao.count(key, state, dynamicType); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void addRanDomShareCount() { |
| | | // 发圈 |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(0, Integer.MAX_VALUE, 1); |
| | | if (list != null) { |
| | | for (GoodsEvaluate goodsEvaluate: list) { |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | Integer shareNum = goodsEvaluate.getShareNum(); |
| | | if (shareNum == null) { |
| | | shareNum = 0; |
| | |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | |
| | | |
| | | // 素材 |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(0, Integer.MAX_VALUE, 2); |
| | | if (list != null) { |
| | | for (GoodsEvaluate goodsEvaluate: list) { |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | Integer shareNum = goodsEvaluate.getShareNum(); |
| | | if (shareNum == null) { |
| | | shareNum = 0; |
| | |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Cacheable(value = "dynamicCache", key = "'queryValidEvaluateCache-'+#start") |
| | | public List<GoodsEvaluate> queryValidEvaluateCache(int start, int count) { |
| | |
| | | public void run() { |
| | | // 更新信息 |
| | | updateGoodInfo(list); |
| | | |
| | | |
| | | // 删除已过期 |
| | | removeOverdue(); |
| | | } |
| | |
| | | if (goods != null) { |
| | | String content = commentInfoNew.getContent(); |
| | | if (!StringUtil.isNullOrEmpty(content)) { |
| | | content = content.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice())+""); |
| | | content = content.replace("[原价]", |
| | | MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + ""); |
| | | if (goods.isHasCoupon()) { |
| | | content = content.replace("[券后价]",MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice())+""); |
| | | content = content.replace("[券后价]", |
| | | MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()) + ""); |
| | | } else { |
| | | singleCoupn = false; |
| | | content = content.replace("领券抢购", "抢购"); |
| | | content = content.replace("【券后价】[券后价]元", ""); |
| | | } |
| | | content = content.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | // 替换淘宝官方活动 |
| | | List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(content); |
| | | for (String st : activityIdList) |
| | | content = content.replace(st, ""); |
| | | |
| | | commentInfoNew.setContent(content); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (typeEnum != null && typeEnum == EvaluateEnum.activity) { |
| | | // 替换淘宝官方活动 |
| | | String content = commentInfoNew.getContent(); |
| | | List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(content); |
| | | for (String st : activityIdList) |
| | | content = content.replace(st, ""); |
| | | commentInfoNew.setContent(content); |
| | | } |
| | | |
| | | CommentInfoEnum typeComment = commentInfoNew.getTypeEnum(); |
| | | if (typeComment != null && typeComment == CommentInfoEnum.goodsCoupon) { |
| | | GoodsDetailVO goods = evaluateNew.getGoods(); |
| | |
| | | @Override |
| | | public void run() { |
| | | updateGoodInfo(listOBJ); |
| | | |
| | | |
| | | // 删除已过期 |
| | | removeOverdue(); |
| | | } |
| | |
| | | |
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(1L, goodsVO.getGoodsId(), "0"); |
| | | |
| | | // TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(Constant.LINK_TOKEN_VERIFY_UID, goodsVO.getGoodsId(), null); |
| | | // TaoBaoLink taoBaoLink = |
| | | // shareGoodsService.getTaoBaoLinkForShare(Constant.LINK_TOKEN_VERIFY_UID, |
| | | // goodsVO.getGoodsId(), null); |
| | | String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); |
| | | String commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | |
| | |
| | | String template = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()); |
| | | String commentText = template.replace("[淘口令]", TaoBaoUtil.filterTaoToken(token)); |
| | | |
| | | commentText = commentText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goodsVO.getZkPrice())+""); |
| | | commentText = commentText.replace("[原价]", |
| | | MoneyBigDecimalUtil.getWithNoZera(goodsVO.getZkPrice()) + ""); |
| | | if (!goodsVO.isHasCoupon()) { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | } else { |
| | | commentText = commentText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goodsVO.getCouponPrice())+""); |
| | | commentText = commentText.replace("[券后价]", |
| | | MoneyBigDecimalUtil.getWithNoZera(goodsVO.getCouponPrice()) + ""); |
| | | } |
| | | commentText = commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n") |
| | | .replace("\r\n\r\n", "\r\n"); |
| | |
| | | if (!StringUtil.isNullOrEmpty(evaluateText)) { |
| | | text2 += evaluateText; |
| | | } |
| | | |
| | | |
| | | String dtitle = daTaoKe.getDtitle(); |
| | | if (!StringUtil.isNullOrEmpty(dtitle)) { |
| | | text2 = text2 + dtitle +"\n"; |
| | | text2 = text2 + dtitle + "\n"; |
| | | } else if (!StringUtil.isNullOrEmpty(evaluateText)) { |
| | | text2 += "\n"; |
| | | } |
| | | text2 += "先领【"+ couponAmount +"元优惠券】下单"; |
| | | |
| | | text2 += "先领【" + couponAmount + "元优惠券】下单"; |
| | | |
| | | CommentInfo commentInfo2 = new CommentInfo(); |
| | | commentInfo2.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | commentInfo2.setContent(text2); |
| | | commentInfo2.setTypeEnum(CommentInfoEnum.goodsCoupon); |
| | | commentInfo2.setType(""); |
| | | |
| | | |
| | | |
| | | List<CommentInfo> commentsNew = new ArrayList<>(); |
| | | commentsNew.add(commentInfo); |
| | | commentsNew.add(commentInfo2); |
| | | goodsEvaluate.setComments(commentsNew); |
| | | |
| | | |
| | | goodsEvaluate.setGoods(goodsVO); |
| | | } |
| | | imgList.add(imgInfo); |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateTaoBaoGoods(TaoBaoGoodsBrief goods) { |
| | | try { |
| | | if (goods == null) { |
| | | return; |
| | | } |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_TAOBAO, goods.getAuctionId()); |
| | | 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) { |
| | |
| | | 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) { |
| | |
| | | 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) { |
| | | for (GoodsEvaluate goodsEvaluate : listExist) { |
| | | GoodsDetailVO goodsDetailVO = goodsEvaluate.getGoods(); |
| | | if (goodsDetailVO != null && goodsDetailVO.getGoodsId() != null |
| | | && goodsDetailVO.getGoodsId() == goodsId && goodsDetailVO.getGoodsType() == goodsType) { |
| | | 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) { |
| | |
| | | |
| | | for (ImgInfo imgInfo : imgList) { |
| | | SimpleGoods simpleGoods = imgInfo.getGoods(); |
| | | if (simpleGoods == null || simpleGoods.getGoodsId() != goodsId |
| | | if (simpleGoods == null || simpleGoods.getGoodsId() != goodsId |
| | | || goodsType != simpleGoods.getGoodsType()) { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | simpleGoods.setState(0); |
| | | simpleGoods.setPrice(goodsNew.getCouponPrice()); |
| | | CouponInfoVO couponInfo = goodsNew.getCouponInfo(); |
| | |
| | | simpleGoods.setPrice(goodsNew.getCouponPrice()); |
| | | simpleGoods.setAmount(couponInfo.getAmount()); |
| | | } |
| | | |
| | | |
| | | imgInfo.setGoods(simpleGoods); |
| | | imgInfo.setGoodsVO(goodsNew); |
| | | } |
| | | |
| | | |
| | | goodsEvaluate.setImgList(imgList); |
| | | goodsEvaluate.setUpdateTime(new Date()); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void removeOverdue() { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryOverdue(); |
| | | if (list == null || list.size() == 0) { |
| | |
| | | long nm = 1000 * 60;// 一分钟的毫秒数 |
| | | long nh = 1000 * 60 * 60;// 一小时的毫秒数 |
| | | long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数 |
| | | |
| | | |
| | | long time = java.lang.System.currentTimeMillis(); |
| | | for (GoodsEvaluate goodsEvaluate: list) { |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | long diff = time - goodsEvaluate.getEndTime().getTime(); |
| | | long min = diff % nd % nh / nm; |
| | | |
| | | long min = diff % nd % nh / nm; |
| | | |
| | | // 过期超过10分钟就删除 |
| | | if (min > 10) { |
| | | goodsEvaluateDao.remove(goodsEvaluate); |