| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException;
|
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager;
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | 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.service.manger.msg.RocketMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.ImageToBase64;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
| | | @Resource
|
| | | private PinDuoDuoCacheUtil pinDuoDuoCacheUtil;
|
| | |
|
| | | @Resource
|
| | | private QrCodeService qrCodeService;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Resource
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | @Resource
|
| | | private ShareGoodsTextTemplateService shareGoodsTextTemplateService;
|
| | |
|
| | | @Resource
|
| | | private CommonGoodsService commonGoodsService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudSendRecordService userCloudSendRecordService;
|
| | |
| | | @Resource
|
| | | private UserCloudManageService userCloudManageService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | | @Resource
|
| | | private RocketMQManager rocketMQManager;
|
| | |
|
| | | @Resource
|
| | | private UserOtherMsgNotificationService userOtherMsgNotificationService;
|
| | |
| | | @Resource
|
| | | private PushService pushService;
|
| | |
|
| | | @Resource
|
| | | private UserSystemMsgService userSystemMsgService;
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoLinkManager taoBaoLinkManager;
|
| | |
|
| | | @Override
|
| | | public UserCloud getValidByUid(Long uid) {
|
| | |
| | | listImg.add(imgInfo.getUrl());
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | String wxId = userCloud.getWxId();
|
| | | Integer robotId = userCloud.getRobotId();
|
| | |
| | | if (macsend)
|
| | | sendContent.setTitle(title);
|
| | | }
|
| | |
|
| | | SystemEnum system=userInfoService.getUserSystem(uid);
|
| | | // 发送图片
|
| | | int num = 1;
|
| | | String picNum = configService.get(ConfigKeyEnum.robotCloudGroupPictureNum.getKey());
|
| | | String picNum = configService.getValue(ConfigKeyEnum.robotCloudGroupPictureNum.getKey(),system);
|
| | | if (!StringUtil.isNullOrEmpty(picNum)) {
|
| | | num = Integer.parseInt(picNum);
|
| | | }
|
| | |
| | | * 淘宝商品信息处理
|
| | | *
|
| | | * @param user
|
| | | * @param inviteCode
|
| | | * @param robotId
|
| | | * @param wxId
|
| | | * @param goodsId
|
| | |
| | | List<UserCloudGroup> listOpen, String pid) throws UserCloudException {
|
| | | TaoBaoLink taoBaoLink = null;
|
| | | try {
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(user.getId(), goodsId, relationId);
|
| | | } catch (ShareGoodsException e) {
|
| | | taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(user.getId(), goodsId, relationId,null);
|
| | | } catch (TaoBaoConvertLinkException e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new UserCloudException(1, "该商品已下架");
|
| | | }
|
| | |
| | | }
|
| | | String sales = TaoBaoUtil.getSaleCount(goods.getBiz30day());
|
| | |
|
| | | SystemEnum system=userInfoService.getUserSystem(user.getId());
|
| | |
|
| | | // 获取推荐语
|
| | | String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, goods.getTitle(), sales,
|
| | | couponAmount, description);
|
| | | couponAmount, description,system);
|
| | | // 获取评论语
|
| | | String commentText = shareGoodsTextTemplateService.getCommentTextByTaoToken(coupon, taoBaoLink.getTaoToken(),
|
| | | goods.getZkPrice().toString(), quanPrice);
|
| | | goods.getZkPrice().toString(), quanPrice,system);
|
| | |
|
| | | // 异步执行发送
|
| | | executor.execute(new Runnable() {
|
| | |
| | |
|
| | | String sales = JDUtil.getSaleCount(jdGoods.getInOrderCount30Days());
|
| | |
|
| | | SystemEnum system=userInfoService.getUserSystem(user.getId());
|
| | |
|
| | | // 获取推荐语
|
| | | String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, jdGoods.getSkuName(), sales,
|
| | | couponAmount, null);
|
| | | couponAmount, null,system);
|
| | |
|
| | | // 获取评论语
|
| | | BigDecimal price = jdGoods.getPrice();
|
| | |
| | | }
|
| | | String zkPrice = BigDecimalUtil.getWithNoZera(price).toString();
|
| | | String commentText = shareGoodsTextTemplateService.getCommentTextByLink(coupon, jumpLink, zkPrice, quanPrice,
|
| | | ConfigKeyEnum.quickShareJDCommentText);
|
| | | ConfigKeyEnum.quickShareJDCommentText,system);
|
| | |
|
| | | // 异步执行发送
|
| | | executor.execute(new Runnable() {
|
| | |
| | | sales = "0";
|
| | | }
|
| | |
|
| | | SystemEnum system=userInfoService.getUserSystem(user.getId());
|
| | |
|
| | | // 获取推荐语
|
| | | String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, goods.getGoodsName(), sales,
|
| | | couponAmount, null);
|
| | | couponAmount, null,system);
|
| | |
|
| | | // 获取评论语
|
| | | String zkPrice = MoneyBigDecimalUtil.div(new BigDecimal(goods.getMinGroupPrice()), new BigDecimal(100))
|
| | | .setScale(2).toString();
|
| | | String commentText = shareGoodsTextTemplateService.getCommentTextByLink(coupon, jumpLink, zkPrice, quanPrice,
|
| | | ConfigKeyEnum.quickSharePDDCommentText);
|
| | | ConfigKeyEnum.quickSharePDDCommentText,system);
|
| | |
|
| | | List<String> list = null;
|
| | | String[] goodsGalleryUrls = goods.getGoodsGalleryUrls();
|
| | |
| | | boolean coupon = false;
|
| | | String quanPrice = "";
|
| | | String couponAmount = "";
|
| | | SystemEnum system=userInfoService.getUserSystem(user.getId());
|
| | | // 获取推荐语
|
| | | String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, goods.getGoodsName(), null,
|
| | | couponAmount, null);
|
| | | couponAmount, null,system);
|
| | | // 获取评论语
|
| | | String commentText = shareGoodsTextTemplateService.getCommentTextByLink(coupon, jumpLink,
|
| | | goods.getMarketPrice(), quanPrice, ConfigKeyEnum.quickShareVIPCommentText);
|
| | | goods.getMarketPrice(), quanPrice, ConfigKeyEnum.quickShareVIPCommentText,system);
|
| | |
|
| | | // 异步执行发送
|
| | | executor.execute(new Runnable() {
|
| | |
| | | coupon = true;
|
| | | }
|
| | |
|
| | | SystemEnum system=userInfoService.getUserSystem(user.getId());
|
| | |
|
| | | // 获取推荐语
|
| | | String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon,
|
| | | goods.getCommodityInfo().getCommodityName(), sales, couponAmount, null);
|
| | | goods.getCommodityInfo().getCommodityName(), sales, couponAmount, null,system);
|
| | |
|
| | | // 生成快捷分享内容
|
| | | String template = configService.get(ConfigKeyEnum.quickShareSuNingCommentText.getKey());
|
| | | String template = configService.getValue(ConfigKeyEnum.quickShareSuNingCommentText.getKey(),system);
|
| | | String commentText = shareGoodsTextTemplateService.createQuickShareTextSuNing(template, goods, jumpLink);
|
| | |
|
| | | List<String> imgList = new ArrayList<>();
|
| | |
| | | if (macsend)
|
| | | sendContent.setTitle(title);
|
| | | }
|
| | |
|
| | | SystemEnum system=userInfoService.getUserSystem(uid);
|
| | | // 发送图片
|
| | | int num = 1;
|
| | | String picNum = configService.get(ConfigKeyEnum.robotCloudGroupPictureNum.getKey());
|
| | | String picNum = configService.getValue(ConfigKeyEnum.robotCloudGroupPictureNum.getKey(),system);
|
| | | if (!StringUtil.isNullOrEmpty(picNum)) {
|
| | | num = Integer.parseInt(picNum);
|
| | | }
|
| | |
| | | UserCloudMQMsg msg = new UserCloudMQMsg(uid, evaluateId, UserCloudMQMsg.TYPE_EVALUATE);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userCloud,
|
| | | msg);
|
| | | producer.send(message);
|
| | | rocketMQManager.sendNormalMsg(message, null);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | UserCloudMQMsg msg = new UserCloudMQMsg(uid, UserCloudMQMsg.TYPE_PUSH);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userCloud, msg);
|
| | | message.setStartDeliverTime(java.lang.System.currentTimeMillis() + 1000 * 60 * 10);
|
| | | producer.send(message);
|
| | | rocketMQManager.sendNormalMsg(message, null);
|
| | | }
|
| | |
|
| | | // 更新已提醒
|