| | |
| | | import com.yeshi.fanli.service.inter.user.QrCodeService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService; |
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService; |
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager; |
| | | import com.yeshi.fanli.util.Constant; |
| | |
| | | |
| | | @Resource |
| | | private CommonShareInfoService commonShareInfoService; |
| | | |
| | | @Resource |
| | | private UserCloudService userCloudService; |
| | | |
| | | @Resource(name = "taskExecutor") |
| | | private TaskExecutor executor; |
| | |
| | | if (!VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | listNew.addAll(list); |
| | | } else if (list.size() > 0) { // 活动图片不允许跳转 |
| | | |
| | | // 云发单是否开启 |
| | | String cloudState = configService.getByVersion(ConfigKeyEnum.robotCloudOpen.getKey(), acceptData.getPlatform(), |
| | | Integer.parseInt(acceptData.getVersion())); |
| | | boolean cloudOpen = false; |
| | | if (!StringUtil.isNullOrEmpty(cloudState) && "1".equals(cloudState)) { |
| | | cloudOpen = true; |
| | | } |
| | | |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | if (goodsEvaluate.getType() != EvaluateEnum.activity) { |
| | | EvaluateEnum evaluateEnum = goodsEvaluate.getType(); |
| | | // 单品 活动可以一键云发单 |
| | | if (cloudOpen && evaluateEnum == EvaluateEnum.activity || evaluateEnum == EvaluateEnum.single ) { |
| | | goodsEvaluate.setCloud(true); |
| | | } |
| | | |
| | | if (evaluateEnum != EvaluateEnum.activity) { |
| | | listNew.add(goodsEvaluate); |
| | | continue; |
| | | } |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "evaluateShare", method = RequestMethod.POST) |
| | | public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, Long goodsId, Integer goodsType, |
| | | PrintWriter out) { |
| | | public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, String goodsId, |
| | | Integer goodsType, PrintWriter out) { |
| | | try { |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | |
| | | return; |
| | | } |
| | | |
| | | if (type == 1 && (goodsId == null || goodsType == null)) { |
| | | if (type == 1 && (StringUtil.isNullOrEmpty(goodsId) || goodsType == null)) { |
| | | out.print(JsonUtil.loadFalseResult("商品参数不能为空")); |
| | | return; |
| | | } |
| | |
| | | if (type == 1) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getGoodsVO() != null) |
| | | if (imgInfo.getGoodsVO().getGoodsId().longValue() == goodsId.longValue() |
| | | if (imgInfo.getGoodsVO().getGoodsId().equalsIgnoreCase(goodsId) |
| | | && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, |
| | | imgInfo.getUrl()); |
| | |
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoLink taoBaoLink = null; |
| | | try { |
| | | taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(user.getId(), goodsVO.getGoodsId(), relationId); |
| | | taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(user.getId(), Long.parseLong(goodsVO.getGoodsId()), |
| | | relationId); |
| | | } catch (ShareGoodsException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | 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()); |
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsVO.getGoodsId())); |
| | | if (jdGoods == null) { |
| | | return null; |
| | | } |
| | |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", |
| | | user.getId() + ""); |
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) { |
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsVO.getGoodsId(), PinDuoDuoApiUtil.PID_SHARE + "", |
| | | user.getId() + ""); |
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(Long.parseLong(goodsVO.getGoodsId()), |
| | | PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + ""); |
| | | } |
| | | |
| | | FileUploadResult uploadResult = qrCodeService.drawDynamicGoodsPoster(jumpLink, user.getPortrait(), inviteCode, |
| | |
| | | } else { |
| | | 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"); |
| | | newText = 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(); |
| | |
| | | if (!StringUtil.isNullOrEmpty(special.getPicture())) { |
| | | imgs.add(special.getPicture()); |
| | | } |
| | | |
| | | title = special.getName(); |
| | | |
| | | desc = special.getRemark(); |
| | | startTime = special.getStartTime(); |
| | | endTime = special.getEndTime(); |
| | |
| | | if (!StringUtil.isNullOrEmpty(swiper.getSrc())) { |
| | | imgs.add(swiper.getSrc()); |
| | | } |
| | | desc = swiper.getRemark(); |
| | | |
| | | title = swiper.getTitle(); |
| | | desc = swiper.getDesc(); |
| | | startTime = swiper.getStartTime(); |
| | | endTime = swiper.getEndTime(); |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |