| | |
| | | import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; |
| | | import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; |
| | | import com.yeshi.fanli.util.*; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.yeshi.utils.BigDecimalUtil; |
| | | import org.yeshi.utils.DateUtil; |
| | | import org.yeshi.utils.HttpUtil; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.*; |
| | | import org.yeshi.utils.taobao.TbImgUtil; |
| | | |
| | | import com.google.gson.Gson; |
| | |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink; |
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo; |
| | | import com.yeshi.common.entity.taobao.TaoKeAppInfo; |
| | | import com.yeshi.fanli.exception.goods.ShareGoodsTextTemplateException; |
| | | import com.yeshi.fanli.exception.share.ShareGoodsException; |
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | | import com.yeshi.fanli.exception.tlj.UserTaoLiJinRecordException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.service.inter.config.ConfigService; |
| | | import com.yeshi.fanli.service.inter.config.SystemClientParamsService; |
| | | import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService; |
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService; |
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService; |
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService; |
| | | import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service; |
| | | import com.yeshi.fanli.service.inter.monitor.MonitorService; |
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService; |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; |
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService; |
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService; |
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService; |
| | |
| | | shareInfo.setNotifyDesc(configService.getValue(ConfigKeyEnum.goodsShareNotify.getKey(),system)); |
| | | |
| | | // 添加分享记录 |
| | | BigDecimal rate = hongBaoManageService.getShareRate(); |
| | | BigDecimal rate = hongBaoManageService.getShareRate(acceptData.getSystem()); |
| | | BigDecimal shareMoney = TaoBaoUtil.getShareGoodsHongBaoInfo(goods, rate); |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString()); |
| | | try { |
| | |
| | | TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(uid, goodsId, relationId,null); |
| | | |
| | | if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) { |
| | | ConfigParamsDTO dto = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version); |
| | | ConfigParamsDTO dto = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,acceptData.getSystem()); |
| | | GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto); |
| | | shareInfo.setGoodsInfo(goodsInfo); |
| | | } |
| | |
| | | shareInfo.setNotifyDesc(configService.getValue(ConfigKeyEnum.goodsShareNotify.getKey(),system)); |
| | | |
| | | // 分享金额 |
| | | BigDecimal rate = hongBaoManageService.getShareRate(); |
| | | BigDecimal rate = hongBaoManageService.getShareRate(acceptData.getSystem()); |
| | | BigDecimal shareMoney = TaoBaoUtil.getShareGoodsHongBaoInfo(taoBaoLink.getGoods(), rate); |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString()); |
| | | |
| | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList( |
| | | getCommentChoiceList(shareInfo.getCommentText(), null, inviteCode, TaoBaoUtil.getGoodsHongBaoMoney( |
| | | taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP), false))); |
| | | taoBaoLink.getGoods(), hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem()), false))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsId + ".html"; |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid + ""); |
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_SHARE + "", uid + ""); |
| | | if (StringUtil.isNullOrEmpty(jumpLink)) { |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, JDApiUtil.POSITION_SHARE + "", uid + ""); |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null,JDApiUtil.POSITION_SHARE + "", uid + ""); |
| | | } |
| | | |
| | | ShareInfoVO shareInfo = new ShareInfoVO(); |
| | |
| | | |
| | | if (needGoods) |
| | | shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods, orderHongBaoMoneyComputeService |
| | | .getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion()))); |
| | | .getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion(),acceptData.getSystem()))); |
| | | |
| | | boolean hasCoupon = false; |
| | | if (couponInfo != null) { |
| | |
| | | shareInfo.setNotifyDesc(configService.getValue(ConfigKeyEnum.goodsShareNotifyJD.getKey(),SystemInfoUtil.getSystem(acceptData))); |
| | | |
| | | // 添加分享记录 |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(acceptData.getSystem()); |
| | | BigDecimal shareMoney = JDUtil.getGoodsFanLiMoney(jdGoods, shareRate); |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString()); |
| | | try { |
| | |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode, |
| | | JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | JDUtil.getGoodsFanLiMoney(jdGoods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem())))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | if (needGoods) { |
| | | shareInfo |
| | | .setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods, |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(), |
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()), |
| | | hongBaoManageService.getShareRate(acceptData.getSystem()), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem())))); |
| | | } |
| | | |
| | | // 创建口令 |
| | |
| | | shareInfo.setNotifyDesc(configService.getValue(ConfigKeyEnum.goodsShareNotifyPDD.getKey(),system)); |
| | | |
| | | // 添加分享记录 |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(acceptData.getSystem()); |
| | | BigDecimal shareMoney = PinDuoDuoUtil.getGoodsFanLiMoney(goods, shareRate); |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString()); |
| | | |
| | |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode, |
| | | PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | PinDuoDuoUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem())))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | if (needGoods) { |
| | | shareInfo |
| | | .setGoodsInfo(GoodsDetailVOFactory.convertVIPGoods(goods, |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(), |
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()), |
| | | hongBaoManageService.getShareRate(acceptData.getSystem()), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem())))); |
| | | } |
| | | |
| | | String template = shareGoodsTextTemplateService.getTextTemplateByVIP(uid); |
| | |
| | | shareInfo.setNotifyDesc(configService.getValue(ConfigKeyEnum.goodsShareNotifyVIP.getKey(),system)); |
| | | |
| | | // 添加分享记录 |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(acceptData.getSystem()); |
| | | BigDecimal shareMoney = VipShopUtil.getGoodsFanLiMoney(goods, shareRate); |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString()); |
| | | |
| | |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode, |
| | | VipShopUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | VipShopUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem())))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | if (needGoods) { |
| | | shareInfo |
| | | .setGoodsInfo(GoodsDetailVOFactory.convertSuningGoods(goods, |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(), |
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(acceptData.getSystem()), |
| | | hongBaoManageService.getShareRate(acceptData.getSystem()), Constant.MAX_REWARD_RATE, |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem())))); |
| | | } |
| | | |
| | | String template = shareGoodsTextTemplateService.getTextTemplateBySuNing(uid); |
| | |
| | | shareInfo.setNotifyDesc(configService.getValue(ConfigKeyEnum.goodsShareNotifySuning.getKey(),system)); |
| | | |
| | | // 添加分享记录 |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(acceptData.getSystem()); |
| | | BigDecimal shareMoney = SuningUtil.getGoodsFanLiMoney(goods, shareRate); |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString()); |
| | | |
| | |
| | | |
| | | // 设置评论文本选项 |
| | | shareInfo.setCommentTextChoiceList(getCommentChoiceList(null, shareInfo.getCommentText(), inviteCode, |
| | | SuningUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | SuningUtil.getGoodsFanLiMoney(goods, hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP,acceptData.getSystem())))); |
| | | |
| | | out.print(JsonUtil.loadTrueResult( |
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo))); |
| | |
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY); |
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET); |
| | | app.setPid(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT); |
| | | TaoBaoGoodsBrief goodsLink = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app); |
| | | TaoBaoGoodsBrief goodsLink = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app,null,null); |
| | | if (goodsLink != null) |
| | | token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), |
| | | StringUtil.isNullOrEmpty(goodsLink.getCouponLink()) ? goodsLink.getAuctionUrl() |
| | |
| | | couponUrl = couponInfo.getLink(); |
| | | } |
| | | String materialId = "https://item.jd.com/" + goodsId + ".html"; |
| | | String shortLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", |
| | | String shortLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_SHARE + "", |
| | | uid + ""); |
| | | |
| | | String content = shareGoodsTextTemplateService.createContentJD(template, goods, shortLink, hasCoupon); |
| | |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion()); |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | |
| | | |
| | | GoodsDetailVO goodsDetail = null; |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion()); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | acceptData.getVersion(),acceptData.getSystem()); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(acceptData.getSystem())); |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoGoodsBrief goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(Long.parseLong(goodsId)); |