| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.entity.common.JumpDetailV2; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo.CommentInfoEnum; |
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate.EvaluateEnum; |
| | |
| | | |
| | | @Resource |
| | | private ShareGoodsService shareGoodsService; |
| | | |
| | | |
| | | @Resource |
| | | private DailyCountMomentsService dailyCountMomentsService; |
| | | |
| | | |
| | | @Resource(name = "taskExecutor") |
| | | private TaskExecutor executor; |
| | | |
| | | |
| | | private final static long TYPE_REXIAO = 1;// 热销 |
| | | private final static long TYPE_TUIJIAN = 2;// 推荐 |
| | |
| | | if (special.getState() == 1L) { |
| | | list.remove(i--); |
| | | } else { |
| | | if (special.getStartTime() != null && special.getEndTime() != null) |
| | | special.setTimeTask(true); |
| | | else |
| | | special.setTimeTask(false); |
| | | |
| | | if (special.isTimeTask()) { |
| | | if (special.getStartTime() != null && special.getEndTime() != null) { |
| | | if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) { |
| | | list.remove(i--); |
| | | } else// 设置倒计时 |
| | |
| | | return new JsonPrimitive(""); |
| | | } else { |
| | | // 保留2位小数 |
| | | return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value)+""); |
| | | return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value) + ""); |
| | | } |
| | | } |
| | | }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | |
| | | if (imgInfo.getGoodsVO() != null) |
| | | if (imgInfo.getGoodsVO().getGoodsId().longValue() == goodsId.longValue() |
| | | && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, imgInfo.getUrl()); |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, |
| | | imgInfo.getUrl()); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | |
| | | } else if (type == 2 || type == 3) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getGoodsVO() != null) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, imgInfo.getUrl() ); |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, |
| | | imgInfo.getUrl()); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | |
| | | else if (imgInfo.getType() == ImgEnum.activity) |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) { |
| | | list.add(imgInfo.getActivityPic()); |
| | | }else if(!StringUtil.isNullOrEmpty(imgInfo.getUrl())){ |
| | | } else if (!StringUtil.isNullOrEmpty(imgInfo.getUrl())) { |
| | | list.add(imgInfo.getUrl()); |
| | | } |
| | | } |
| | |
| | | if (type == 3) { |
| | | shareCount++; |
| | | goodsEvaluateService.addShareNum(id); |
| | | |
| | | |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |
| | |
| | | } |
| | | } |
| | | |
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode, String mainPic) { |
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode, |
| | | String mainPic) { |
| | | String jumpLink = null; |
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoLink taoBaoLink = null; |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | jumpLink = ShareControllerV2.getERCodeContentNew( |
| | | configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey()), taoBaoLink.getGoods(), |
| | | configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), taoBaoLink.getGoods(), |
| | | TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken())); |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsVO.getGoodsId()); |
| | |
| | | } |
| | | |
| | | String newText = text; // 非通用券需要验证 |
| | | if ((comment != null && comment.getTypeEnum() != CommentInfoEnum.currencyCoupon) |
| | | || goodsEvaluate.getType() == EvaluateEnum.activity) { |
| | | if (comment != null && (comment.getNeedSpin() == null || comment.getNeedSpin())) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | |
| | | return; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // 替换价格 |
| | | if (goodsEvaluate.getType() == EvaluateEnum.single) { |
| | | GoodsDetailVO goods = goodsEvaluate.getGoods(); |
| | | newText = newText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) +""); |
| | | newText = newText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + ""); |
| | | if (!goods.isHasCoupon()) { |
| | | newText = newText.replace("领券抢购", "抢购"); |
| | | newText = newText.replace("【券后价】[券后价]元", ""); |
| | | } else { |
| | | newText = newText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice())+""); |
| | | newText = newText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()) + ""); |
| | | } |
| | | newText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | } |
| | | |
| | | |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | |
| | | |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |