fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -17,12 +17,11 @@ import org.yeshi.utils.JsonUtil; import org.yeshi.utils.taobao.TbImgUtil; import com.yeshi.fanli.dto.share.ShareInfoDTO; import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO; import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup; import com.yeshi.fanli.entity.bus.share.UserShareGoodsHistory; import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord; import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum; import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo; import com.yeshi.fanli.entity.bus.user.UserInfo; import com.yeshi.fanli.entity.bus.user.UserInfoExtra; @@ -31,7 +30,6 @@ import com.yeshi.fanli.entity.system.BusinessSystem; import com.yeshi.fanli.entity.system.SystemClientParams; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra; import com.yeshi.fanli.entity.taobao.TaoBaoLink; import com.yeshi.fanli.entity.taobao.TaoKeAppInfo; import com.yeshi.fanli.exception.ShareGoodsException; @@ -227,7 +225,16 @@ BigDecimal shareMoney = TaoBaoUtil.getShareGoodsHongBaoInfo(taoBaoLink.getGoods(), rate); data.put("shareMoney", "¥" + shareMoney.toString()); // data.put("shareId", userShareGoodsRecordService.saveSingleShareRecord(uid, auctionId)); try { ShareGoodsRecordDTO shareRecord= userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId); data.put("shareId", shareRecord.getRedisKey()); } catch (Exception e) { try { LogHelper.errorDetailInfo(e); } catch (Exception e1) { e1.printStackTrace(); } } out.print(JsonUtil.loadTrueResult(data)); // 异步操作 @@ -256,11 +263,6 @@ }); return; } // catch (UserShareGoodsRecordException e) { // out.print(JsonUtil.loadFalseResult(e.getMsg())); // e.printStackTrace(); // } catch (ShareGoodsException e) { try { monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, e.getCode(), 0, "分享出错")); @@ -388,7 +390,7 @@ @RequestMapping(value = "sharedetail", method = RequestMethod.POST) public void shareDetail(AcceptData acceptData, Long uid, Long auctionId, String type, PrintWriter out) { try { userShareGoodsRecordService.saveDetail(uid, auctionId, type); userShareGoodsRecordService.saveSingleShareRecord(uid, auctionId); out.print(JsonUtil.loadTrueResult("分享成功")); } catch (UserShareGoodsRecordException e) { out.print(JsonUtil.loadFalseResult(e.getMsg())); @@ -407,21 +409,33 @@ * @param out */ @RequestMapping(value = "updaterecord", method = RequestMethod.POST) public void updateRecord(AcceptData acceptData, Long shareId, PrintWriter out) { if (shareId == null) { public void updateRecord(AcceptData acceptData, String shareId, PrintWriter out) { if (StringUtil.isNullOrEmpty(shareId)) { out.print(JsonUtil.loadFalseResult("参数不正确")); } try { userShareGoodsRecordService.updateShareRecord(shareId); out.print(JsonUtil.loadTrueResult("")); } catch (UserShareGoodsRecordException e) { out.print(JsonUtil.loadFalseResult(e.getMsg())); e.printStackTrace(); } catch (Exception e) { out.print(JsonUtil.loadFalseResult("加载失败")); e.printStackTrace(); } // 更新分享生效 executor.execute(new Runnable() { @Override public void run() { try { userShareGoodsRecordService.takeEffectShareRecord(shareId); } catch (UserShareGoodsRecordException eu) { try { LogHelper.errorDetailInfo(eu); } catch (Exception e) { e.printStackTrace(); } } catch (Exception e) { try { LogHelper.errorDetailInfo(e); } catch (Exception e1) { e1.printStackTrace(); } } } }); out.print(JsonUtil.loadTrueResult("分享成功")); } /** @@ -659,16 +673,16 @@ } JSONObject data = new JSONObject(); // 分类id long cid = dynamicInfo.getClassId(); if (cid == 1) { // 热销单品 // 文字内容 String title =""; if (cid == 1 || cid == 2) { // 1 热销单品 2 推荐好货 // 分享文字 String title = null; List<ClientTextStyleVO> listTitle = dynamicInfo.getTitle(); if (listTitle != null && listTitle.size() > 0) { title = ""; for (ClientTextStyleVO textStyleVO : listTitle) { title += textStyleVO.getContent(); } @@ -682,21 +696,10 @@ int index = content.indexOf("¥"); data.put("shareMoney", new BigDecimal(content.substring(index + 1, content.length()))); // 商品分享链接 List<GoodsPicture> imgs2 = dynamicInfo.getImgs(); GoodsPicture goodsPicture = imgs2.get(0); Long auctionId = goodsPicture.getGoods().getAuctionId(); String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(), Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY), auctionId + ""); // 分享提醒 data.put("notifyDesc", configService.get("goods_share_notify")); String shortLink = HttpUtil.getShortLink(url); if (!StringUtil.isNullOrEmpty(shortLink)) { url = shortLink; } data.put("clickUrl", url); // 分享提示图片 // 分享提示语 String imgs = configService.get("goods_share_notify_imgs"); JSONArray array = JSONArray.fromObject(imgs); int p = (int) (array.size() * Math.random()); @@ -704,72 +707,41 @@ data.put("notifyPicture", array.optString(p)); } // 分享出去的图片 String pictUrl = dynamicInfo.getImgs().get(0).getUrl(); data.put("pictUrl", TbImgUtil.getTBSizeImg(pictUrl, 500)); UserExtraTaoBaoInfo extraInfo = userExtraTaoBaoInfoService.getByUid(uid); String relationId = null; if (extraInfo != null && extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null && extraInfo.getRelationValid() == true) { relationId = extraInfo.getRelationId(); } TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId); data.put("pictUrl", TbImgUtil.getTBSizeImg(goodsPicture.getUrl(), 500)); // 淘宝口令 data.put("token", taoBaoLink.getTaoToken()); // 帮助链接 data.put("helpLink","http://apph5.yeshitv.com/apppage/all_help_content.html?id=148&from=singlemessage&isappinstalled=0"); // 分享提醒 data.put("notifyDesc", configService.get("goods_share_notify")); // 分享记录id data.put("shareId", userShareGoodsRecordService.saveSingleShareRecord(uid, auctionId)); } else if (cid == 2) { // 推荐好货 String picUrl = null; List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>(); List<GoodsPicture> listImgs = dynamicInfo.getImgs(); for (GoodsPicture goodsPicture: listImgs) { TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods(); listGoods.add(goods); if (cid == 2) { // 2 推荐好货 ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordDynamic(uid, dynamicInfo.getListGoodsBrief()); data.put("shareId", shareRecord.getRedisKey()); data.put("clickUrl", shareRecord.getShareUrl()); } else { // 分享id ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordDynamic(uid, dynamicInfo.getListGoodsBrief()); data.put("shareId", shareRecord.getRedisKey()); if (picUrl == null) { picUrl = goodsPicture.getUrl(); Long auctionId = dynamicInfo.getImgs().get(0).getGoods().getAuctionId(); // 商品分享链接 String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(), Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY), auctionId + ""); String shortLink = HttpUtil.getShortLink(url); if (!StringUtil.isNullOrEmpty(shortLink)) { url = shortLink; } } // 文字内容 String title =""; List<ClientTextStyleVO> listTitle = dynamicInfo.getTitle(); if (listTitle != null && listTitle.size() > 0) { for (ClientTextStyleVO textStyleVO : listTitle) { title += textStyleVO.getContent(); data.put("clickUrl", url); // 淘宝口令 UserExtraTaoBaoInfo extraInfo = userExtraTaoBaoInfoService.getByUid(uid); String relationId = null; if (extraInfo != null && extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null && extraInfo.getRelationValid() == true) { relationId = extraInfo.getRelationId(); } } data.put("title", title); data.put("content", "我在返利券发现了一个很好的商品,快来看看~"); // 分享奖金 ClientTextStyleVO desc = dynamicInfo.getDesc(); String content = desc.getContent(); int index = content.indexOf("¥"); data.put("shareMoney", new BigDecimal(content.substring(index + 1 , content.length()))); // 分享链接 ShareInfoDTO shareInfo = userShareGoodsRecordService.saveShareRecord(uid, ShareSourceTypeEnum.activity, title, listGoods); data.put("shareId", shareInfo.getShareId()); data.put("clickUrl", shareInfo.getShareUrl()); data.put("pictUrl", TbImgUtil.getTBSizeImg(picUrl, 500)); // 帮助链接 data.put("helpLink","http://apph5.yeshitv.com/apppage/all_help_content.html?id=148&from=singlemessage&isappinstalled=0"); // 分享提醒 data.put("notifyDesc", configService.get("goods_share_notify")); // 分享提醒语 String notifyImgs = configService.get("goods_share_notify_imgs"); JSONArray array = JSONArray.fromObject(notifyImgs); int p = (int) (array.size() * Math.random()); if (p < array.size()) { data.put("notifyPicture", array.optString(p)); TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, auctionId, relationId); data.put("token", taoBaoLink.getTaoToken()); } } else if (cid == 4) { // 邀请分享 @@ -785,9 +757,10 @@ Integer showType = dynamicInfo.getShowType(); if (showType == 0) { // 无图分享 String title =""; String title = null; List<ClientTextStyleVO> listTitle = dynamicInfo.getTitle(); if (listTitle != null && listTitle.size() > 0) { title =""; for (ClientTextStyleVO textStyleVO : listTitle) { title += textStyleVO.getContent(); } fanli/src/main/java/com/yeshi/fanli/dto/share/ShareGoodsRecordDTO.java
New file @@ -0,0 +1,83 @@ package com.yeshi.fanli.dto.share; import java.util.List; import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; public class ShareGoodsRecordDTO { private Long uid; private Long shareId; private String shareUrl; private String sharePictureUrl; private String redisKey; private ShareSourceTypeEnum source; private Long auctionId; private List<TaoBaoGoodsBrief> listGoodsBrief; public Long getUid() { return uid; } public void setUid(Long uid) { this.uid = uid; } public Long getShareId() { return shareId; } public void setShareId(Long shareId) { this.shareId = shareId; } public List<TaoBaoGoodsBrief> getListGoodsBrief() { return listGoodsBrief; } public void setListGoodsBrief(List<TaoBaoGoodsBrief> listGoodsBrief) { this.listGoodsBrief = listGoodsBrief; } public String getRedisKey() { return redisKey; } public void setRedisKey(String redisKey) { this.redisKey = redisKey; } public String getShareUrl() { return shareUrl; } public void setShareUrl(String shareUrl) { this.shareUrl = shareUrl; } public String getSharePictureUrl() { return sharePictureUrl; } public void setSharePictureUrl(String sharePictureUrl) { this.sharePictureUrl = sharePictureUrl; } public Long getAuctionId() { return auctionId; } public void setAuctionId(Long auctionId) { this.auctionId = auctionId; } public ShareSourceTypeEnum getSource() { return source; } public void setSource(ShareSourceTypeEnum source) { this.source = source; } } fanli/src/main/java/com/yeshi/fanli/dto/share/ShareInfoDTO.java
File was deleted fanli/src/main/java/com/yeshi/fanli/entity/dynamic/DynamicInfo.java
@@ -9,6 +9,7 @@ import com.google.gson.annotations.Expose; import com.yeshi.fanli.entity.bus.activity.ActivityUser; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.entity.taobao.TaoBaoShop; import com.yeshi.fanli.vo.msg.ClientTextStyleVO; @@ -95,6 +96,11 @@ @Field("inviteMaterialId") private String inviteMaterialId; // 商品 列表 @Field("listGoodsBrief") private List<TaoBaoGoodsBrief> listGoodsBrief; public String getInviteMaterialId() { return inviteMaterialId; @@ -232,4 +238,12 @@ this.updateTime = updateTime; } public List<TaoBaoGoodsBrief> getListGoodsBrief() { return listGoodsBrief; } public void setListGoodsBrief(List<TaoBaoGoodsBrief> listGoodsBrief) { this.listGoodsBrief = listGoodsBrief; } } fanli/src/main/java/com/yeshi/fanli/service/impl/activity/ActivityServiceImpl.java
@@ -5,7 +5,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import javax.annotation.Resource; @@ -23,13 +22,13 @@ import com.yeshi.fanli.dao.mybatis.activity.RecommendActivityInviteInfoMapper; import com.yeshi.fanli.dao.mybatis.activity.RecommendActivityMapper; import com.yeshi.fanli.dao.mybatis.activity.RecommendActivityTaoBaoGoodsMapper; import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO; import com.yeshi.fanli.entity.bus.activity.ActivityShareResult; import com.yeshi.fanli.entity.bus.activity.ActivityUser; import com.yeshi.fanli.entity.bus.activity.RecommendActivity; import com.yeshi.fanli.entity.bus.activity.RecommendActivityImg; import com.yeshi.fanli.entity.bus.activity.RecommendActivityInviteInfo; import com.yeshi.fanli.entity.bus.activity.RecommendActivityTaoBaoGoods; import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum; import com.yeshi.fanli.entity.goods.CommonGoods; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.exception.ActivityException; @@ -186,9 +185,11 @@ throw new ActivityException(1, "商品下架"); } Map<String, Object> map = userShareGoodsRecordService.save(uid, ShareSourceTypeEnum.activity, title, listGoodsBrief); imgList.add((FileUploadResult) map.get("loadResult")); ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordActivity(uid, listGoodsBrief); FileUploadResult loadResult = new FileUploadResult(); loadResult.setUrl(shareRecord.getSharePictureUrl()); imgList.add(loadResult); result.setImgList(imgList); return result; @@ -270,20 +271,20 @@ JSONObject contentJson2 = new JSONObject(); contentJson2.put("color", fontColor2); contentJson2.put("content", revenue); array.add(contentJson1); array.add(contentJson2); ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordActivity(uid, listGoodsBrief); FileUploadResult loadResult = new FileUploadResult(); loadResult.setUrl(shareRecord.getSharePictureUrl()); JSONObject data = new JSONObject(); Map<String, Object> map = userShareGoodsRecordService.save(uid, ShareSourceTypeEnum.activity, title, listGoodsBrief); data.put("title", title); data.put("revenue", array); data.put("fanMoney", shareMoney); data.put("shareId", map.get("shareId")); data.put("shareImg", map.get("loadResult")); data.put("shareId", shareRecord.getRedisKey()); data.put("shareImg", loadResult); data.put("notifyDesc", configService.get("goods_share_multiple_notify")); return data; fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/DynamicInfoServiceImpl.java
@@ -129,7 +129,7 @@ SimpleDateFormat format = new SimpleDateFormat("MM月dd日"); StringBuffer buffer = new StringBuffer(); buffer.append("------------------------------------------\n"); buffer.append("-------------------\n"); buffer.append("今天 : " + format.format(date)); buffer.append(" "); buffer.append(DateLunarUtil.getWeekd(date) + "\n"); @@ -336,7 +336,8 @@ DaTaoKeDetail daTaoKeDetail = null; // 商品列表 List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>(); // 商品列表 List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>(); // 分享奖金 BigDecimal shareMoney = new BigDecimal(0); @@ -346,8 +347,9 @@ daTaoKeDetail = daTaoKe; } // 分享奖金 TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe); listGoods.add(taoBaoGoodsBrief); TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null); if (!taoBaoGoodsBriefExtra.isCoupon()) { taoBaoGoodsBriefExtra.setState(1); @@ -371,6 +373,7 @@ // 发布用户 dynamicInfo.setUser(activityUserService.getRandomByDaTaoKeCid(cid)); dynamicInfo.setImgs(listPicture); dynamicInfo.setListGoodsBrief(listGoods); ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO(); shareMoneyDesc.setColor("#FFFFFF"); @@ -449,13 +452,16 @@ // 大淘客数据 DaTaoKeDetail daTaoKe = daTaoKeGoodsService.getGoodsNotInList(subclassId, listId, 1).get(0); List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>(); TaoBaoGoodsBrief taoBaoGoodsBrief = TaoBaoUtil.convert(daTaoKe); listGoods.add(taoBaoGoodsBrief); BigDecimal proportion = hongBaoManageService.getFanLiRate(); TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null); if (!taoBaoGoodsBriefExtra.isCoupon()) { taoBaoGoodsBriefExtra.setState(1); } taoBaoGoodsBriefExtra.setTkRate(taoBaoGoodsBrief.getTkRate()); // 分享奖金 BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(taoBaoGoodsBrief); @@ -506,6 +512,7 @@ dynamicInfo.setDesc(shareMoneyDesc); dynamicInfo.setShareType(DynamicInfo.SHARE_TYPE_ONE); dynamicInfo.setShowType(DynamicInfo.SHOW_TYPE_TWO); dynamicInfo.setListGoodsBrief(listGoods); String desc = DaTaoKeUtil.getDesc(daTaoKe); if (!StringUtil.isNullOrEmpty(desc)) { @@ -633,9 +640,22 @@ dynamicVO.setShowType(DynamicInfo.SHOW_TYPE_ZERO); // 介绍内容 SimpleDateFormat format = new SimpleDateFormat("MM月dd日"); StringBuffer buffer = new StringBuffer(); buffer.append("-------------------\n"); buffer.append("今天 : " + format.format(new Date())); buffer.append(" "); buffer.append(DateLunarUtil.getWeekd(new Date()) + "\n"); buffer.append("各位亲爱的你"); buffer.append(" "); buffer.append("早安~\n"); buffer.append("我的邀请码:【邀请码】\n"); buffer.append("购物省钱返利券App:【邀请链接】"); ClientTextStyleVO row1 = new ClientTextStyleVO(); row1.setColor("#333333"); row1.setContent(title); row1.setContent(title + "\n" + buffer.toString()); listtitle.add(row1); dynamicVO.setTitle(listtitle); dynamicInfoDao.insert(dynamicVO); @@ -732,6 +752,7 @@ newExtra.setState(1); } newExtra.setUpdatetime(new Date()); newExtra.setTkRate(goodsBrief.getTkRate()); goodsPicture.setGoods(newExtra); @@ -812,6 +833,7 @@ dynamicInfo.setShareCount(1000 + (int) (Math.random() * 8000)); } List<TaoBaoGoodsBrief> listGoods = new ArrayList<TaoBaoGoodsBrief>(); // 商品列表 List<GoodsPicture> listPicture = new ArrayList<GoodsPicture>(); BigDecimal proportion = hongBaoManageService.getFanLiRate(); @@ -840,6 +862,8 @@ taoBaoGoodsBriefExtra.setState(1); taoBaoGoodsBriefExtra.setCoupon(false); } listGoods.add(taoBaoGoodsBrief); // 商品图片 taoBaoGoodsBriefExtra.setCouponInfo(null); taoBaoGoodsBriefExtra.setUpdatetime(new Date()); @@ -860,7 +884,7 @@ } } dynamicInfo.setImgs(listPicture); dynamicInfo.setListGoodsBrief(listGoods); ClientTextStyleVO shareMoneyDesc = new ClientTextStyleVO(); shareMoneyDesc.setColor("#FFFFFF"); @@ -887,8 +911,6 @@ } } } fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserGoodsStorageServiceImpl.java
@@ -4,22 +4,19 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import java.util.Set; import javax.annotation.Resource; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.springframework.core.task.TaskExecutor; import org.springframework.stereotype.Service; import org.yeshi.utils.JsonUtil; import org.yeshi.utils.entity.FileUploadResult; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.yeshi.fanli.dao.mybatis.user.UserGoodsStorageMapper; import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum; import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO; import com.yeshi.fanli.entity.bus.user.UserGoodsStorage; import com.yeshi.fanli.entity.goods.CommonGoods; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; @@ -38,6 +35,9 @@ import com.yeshi.fanli.util.factory.CommonGoodsFactory; import com.yeshi.fanli.util.taobao.TaoBaoUtil; import com.yeshi.fanli.util.taobao.TaoKeApiUtil; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @Service public class UserGoodsStorageServiceImpl implements UserGoodsStorageService { @@ -323,15 +323,14 @@ totalMoney = MoneyBigDecimalUtil.add(totalMoney, money); } String revenue = listGoodsBrief.size() + "个商品预估分享奖金:¥"+totalMoney; Map<String,Object> map = userShareGoodsRecordService.save(uid, ShareSourceTypeEnum.storage, null, listGoodsBrief); ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsStorage(uid, listGoodsBrief); FileUploadResult uploadResult = new FileUploadResult(); uploadResult.setUrl(shareRecord.getSharePictureUrl()); JSONObject data = new JSONObject(); data.put("revenue", revenue); data.put("shareId", map.get("shareId")); data.put("shareImg", map.get("loadResult")); data.put("revenue", listGoodsBrief.size() + "个商品预估分享奖金:¥"+totalMoney); data.put("shareId", shareRecord.getRedisKey()); data.put("shareImg", uploadResult); data.put("notifyDesc", configService.get("goods_share_multiple_notify")); return data; fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserShareGoodsRecordServiceImpl.java
@@ -4,9 +4,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; @@ -26,7 +24,7 @@ import com.google.gson.GsonBuilder; import com.yeshi.fanli.dao.mybatis.UserInfoMapper; import com.yeshi.fanli.dao.mybatis.share.UserShareGoodsRecordMapper; import com.yeshi.fanli.dto.share.ShareInfoDTO; import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO; import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup; import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord; import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum; @@ -206,8 +204,7 @@ } @Override public void saveDetail(Long uid, Long auctionId, String type) throws UserShareGoodsRecordException { public void saveSingleShareRecord(Long uid, Long auctionId) throws UserShareGoodsRecordException { if (auctionId == null) { throw new UserShareGoodsRecordException(1, "分享商品不能为空"); } @@ -226,170 +223,12 @@ UserShareGoodsRecord userShareGoodsRecord = new UserShareGoodsRecord(); userShareGoodsRecord.setUid(uid); userShareGoodsRecord.setSource(ShareSourceTypeEnum.goodsDetail); userShareGoodsRecord.setShareState(1);// 已分享成功 // 单个商品分享 singleGoodsShare(userShareGoodsRecord, goodsBrief); } userShareGoodsRecord.setShareState(1); @Override public Long saveSingleShareRecord(Long uid, Long auctionId) throws UserShareGoodsRecordException { if (auctionId == null) { throw new UserShareGoodsRecordException(1, "分享商品不能为空"); } if (uid == null) { throw new UserShareGoodsRecordException(1, "用户ID不能为空"); } TaoBaoGoodsBrief goodsBrief = null; try { goodsBrief = redisManager.getTaoBaoGoodsBrief(auctionId); } catch (TaobaoGoodsDownException e) { throw new UserShareGoodsRecordException(1, "商品已下架"); } UserShareGoodsRecord userShareGoodsRecord = new UserShareGoodsRecord(); userShareGoodsRecord.setUid(uid); userShareGoodsRecord.setSource(ShareSourceTypeEnum.goodsDetail); userShareGoodsRecord.setShareState(0); // 单个商品分享 singleGoodsShare(userShareGoodsRecord, goodsBrief); return userShareGoodsRecord.getId(); } @Override public void save(Long uid, ShareSourceTypeEnum source, String title, TaoBaoGoodsBrief taoBaoGoodsBrief) throws UserShareGoodsRecordException { if (taoBaoGoodsBrief == null) { throw new UserShareGoodsRecordException(1, "分享商品不能为空"); } if (uid == null) { throw new UserShareGoodsRecordException(1, "用户ID不能为空"); } if (source == null) { throw new UserShareGoodsRecordException(1, "分享来源不能为空"); } UserShareGoodsRecord userShareGoodsRecord = new UserShareGoodsRecord(); userShareGoodsRecord.setUid(uid); userShareGoodsRecord.setSource(source); userShareGoodsRecord.setTitle(title); // 单个商品分享 singleGoodsShare(userShareGoodsRecord, taoBaoGoodsBrief); } /** * 保存分享记录 * * @param userShareGoodsRecord * 分享记录: uid、picture、source 为必输入 * @throws UserShareGoodsRecordException */ @Override public Map<String, Object> save(Long uid, ShareSourceTypeEnum source, String title, List<TaoBaoGoodsBrief> listGoods) throws UserShareGoodsRecordException { if (listGoods == null || listGoods.size() < 0) { throw new UserShareGoodsRecordException(1, "分享商品数量不足"); } if (uid == null) { throw new UserShareGoodsRecordException(1, "用户ID不能为空"); } if (source == null) { throw new UserShareGoodsRecordException(1, "分享来源不能为空"); } UserShareGoodsRecord userShareGoodsRecord = new UserShareGoodsRecord(); userShareGoodsRecord.setUid(uid); userShareGoodsRecord.setSource(source); userShareGoodsRecord.setTitle(title); // 取一个商品图片作为主图 userShareGoodsRecord.setPicture(listGoods.get(0).getPictUrl()); Date date = new Date(); userShareGoodsRecord.setShareState(0); // 初始未分享 userShareGoodsRecord.setCreateTime(date); userShareGoodsRecord.setUpdateTime(date); userShareGoodsRecordMapper.insertSelective(userShareGoodsRecord); Map<String, Object> map = new HashMap<String, Object>(); // 多个商品分享 FileUploadResult loadResult = multipleGoodsShare(userShareGoodsRecord, listGoods); map.put("loadResult", loadResult); map.put("shareId", userShareGoodsRecord.getId()); return map; } /** * 保存分享记录 * * @param userShareGoodsRecord * 分享记录: uid、picture、source 为必输入 * @throws UserShareGoodsRecordException */ @Override public ShareInfoDTO saveShareRecord(Long uid, ShareSourceTypeEnum source, String title, List<TaoBaoGoodsBrief> listGoods) throws UserShareGoodsRecordException { if (listGoods == null || listGoods.size() == 0) { throw new UserShareGoodsRecordException(1, "分享商品数量不足"); } if (uid == null) { throw new UserShareGoodsRecordException(1, "用户ID不能为空"); } if (source == null) { throw new UserShareGoodsRecordException(1, "分享来源不能为空"); } UserShareGoodsRecord userShareGoodsRecord = new UserShareGoodsRecord(); userShareGoodsRecord.setUid(uid); userShareGoodsRecord.setSource(source); userShareGoodsRecord.setTitle(title); // 取一个商品图片作为主图 userShareGoodsRecord.setPicture(listGoods.get(0).getPictUrl()); Date date = new Date(); userShareGoodsRecord.setShareState(0); // 初始未分享 userShareGoodsRecord.setCreateTime(date); userShareGoodsRecord.setUpdateTime(date); userShareGoodsRecordMapper.insertSelective(userShareGoodsRecord); // 多个商品分享 multipleGoodsShareRecord(userShareGoodsRecord, listGoods); ShareInfoDTO shareInfo = new ShareInfoDTO(); shareInfo.setShareId(userShareGoodsRecord.getId()); shareInfo.setShareUrl(getShareUrl(userShareGoodsRecord)); return shareInfo; } /** * 单个商品分享生成记录 * * @param userShareGoodsRecord * @param taoBaoGoodsBrief */ @Transactional public void singleGoodsShare(UserShareGoodsRecord userShareGoodsRecord, TaoBaoGoodsBrief taoBaoGoodsBrief) { CommonGoods commonGoods = CommonGoodsFactory.create(taoBaoGoodsBrief); commonGoods.setState(taoBaoGoodsBrief.getState()); try { CommonGoods resultCommonGoods = commonGoodsService.addOrUpdateCommonGoods(commonGoods); CommonGoods convertGoods = CommonGoodsFactory.create(goodsBrief); convertGoods.setState(goodsBrief.getState()); CommonGoods resultCommonGoods = commonGoodsService.addOrUpdateCommonGoods(convertGoods); if (resultCommonGoods == null) { return; @@ -400,7 +239,7 @@ if (singleGoods != null) { // 单个商品多次分享 userShareGoodsRecord.setPicture(taoBaoGoodsBrief.getPictUrl()); userShareGoodsRecord.setPicture(goodsBrief.getPictUrl()); userShareGoodsRecord.setId(singleGoods.getRecordId()); userShareGoodsRecord.setUpdateTime(new Date()); userShareGoodsRecordMapper.updateByPrimaryKeySelective(userShareGoodsRecord); @@ -412,7 +251,7 @@ } else { // 单个商品第一次分享 Date date = new Date(); userShareGoodsRecord.setPicture(taoBaoGoodsBrief.getPictUrl()); userShareGoodsRecord.setPicture(goodsBrief.getPictUrl()); userShareGoodsRecord.setCreateTime(date); userShareGoodsRecord.setUpdateTime(date); userShareGoodsRecordMapper.insertSelective(userShareGoodsRecord); @@ -426,17 +265,13 @@ singleGoods.setUpdateTime(date); singleGoods.setCommonGoods(resultCommonGoods); singleGoods.setRecordId(userShareGoodsRecord.getId()); userShareGoodsGroupService.insertSelective(singleGoods); } } catch (CommonGoodsException e) { e.printStackTrace(); } } /** * 多个商品分享生成记录 * @@ -444,12 +279,10 @@ * @param listGoods */ @Transactional public void multipleGoodsShareRecord(UserShareGoodsRecord userShareGoodsRecord, List<TaoBaoGoodsBrief> listGoods) throws UserShareGoodsRecordException { public void multipleGoodsShareRecord(Long shareId, List<TaoBaoGoodsBrief> listGoods) throws UserShareGoodsRecordException { // 分享记录 Date date = new Date(); List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>(); List<UserShareGoodsGroup> listGroup = new ArrayList<UserShareGoodsGroup>(); @@ -472,13 +305,10 @@ shareGoodsGroup.setCreateTime(date); shareGoodsGroup.setUpdateTime(date); shareGoodsGroup.setCommonGoods(resultCommonGoods); shareGoodsGroup.setRecordId(userShareGoodsRecord.getId()); shareGoodsGroup.setRecordId(shareId); listGroup.add(shareGoodsGroup); } catch (CommonGoodsException e) { e.printStackTrace(); continue; } } @@ -486,7 +316,7 @@ userShareGoodsGroupService.insertBatch(listGroup); } } /** * 多个商品分享生成记录 * @@ -541,31 +371,12 @@ return shareImg; } public String getShareUrl (UserShareGoodsRecord shareRecord) { Long uid = shareRecord.getUid(); Long shareId = shareRecord.getId(); String source = shareRecord.getSource().name(); String url = String.format("http://%s/share_mushGoods.html?uid=%s&shareId=%s&source=%s", configService.getH5Host(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY), shareId + "", source + ""); String shortLink = HttpUtil.getShortLink(url); if (!StringUtil.isNullOrEmpty(shortLink)) { url = shortLink; } return url; } /** * 生成分享图 * * @param uid * 用户id * @param shareId * 分享记录id * @param source * 来源 * @param uid 用户id * @param shareId 分享记录id * @param source 来源 * @param listGoods * @return * @throws UserShareGoodsRecordException @@ -793,36 +604,267 @@ } @Override public void updateShareRecord(Long shareId) throws UserShareGoodsRecordException { UserShareGoodsRecord shareRecord = userShareGoodsRecordMapper.selectByPrimaryKey(shareId); if (shareRecord == null) { throw new UserShareGoodsRecordException(1, "分享记录不存在"); } shareRecord.setShareState(1);// 分享生效 updateByPrimaryKeySelective(shareRecord);// 更新商品为已分享 // 更新选品库商品为已分享 executor.execute(new Runnable() { @Override public void run() { List<UserShareGoodsGroup> listgoods = userShareGoodsGroupService.listByRecordId(shareId); if (listgoods != null && listgoods.size() > 0) { for (UserShareGoodsGroup userShareGoodsGroup: listgoods) { CommonGoods commonGoods = userShareGoodsGroup.getCommonGoods(); if (commonGoods == null) { continue; } userGoodsStorageService.updateShareStateByCommonGoodsId(commonGoods.getId()); } } } }); } @Override public long countShareRecordByUid(Long uid) { return userShareGoodsRecordMapper.countQueryByUid(uid, null); } @Override public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId) throws UserShareGoodsRecordException { if (auctionId == null || uid == null || uid <= 0) { throw new UserShareGoodsRecordException(1, "传递参数不正确"); } ShareGoodsRecordDTO recordDTO = new ShareGoodsRecordDTO(); recordDTO.setUid(uid); recordDTO.setAuctionId(auctionId); recordDTO.setSource(ShareSourceTypeEnum.goodsDetail); // 分享id String key = StringUtil.Md5(uid + "#" + auctionId); redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20); recordDTO.setRedisKey(key); return recordDTO; } @Override public ShareGoodsRecordDTO addRecordGoodsStorage(Long uid, List<TaoBaoGoodsBrief> listGoodsBrief) throws UserShareGoodsRecordException { if (uid == null || uid <= 0 || listGoodsBrief == null || listGoodsBrief.size() == 0) { throw new UserShareGoodsRecordException(1, "传递参数不正确"); } // 插入记录 UserShareGoodsRecord record = new UserShareGoodsRecord(); record.setUid(uid); record.setShareState(0); // 初始未分享 record.setSource(ShareSourceTypeEnum.storage); record.setPicture(listGoodsBrief.get(0).getPictUrl()); // 取一个商品图片作为主图 record.setCreateTime(new Date()); userShareGoodsRecordMapper.insertSelective(record); Long id = record.getId(); // 分享链接 String shareUrl = getShareUrl(record); // 分享二维码链接 FileUploadResult uploadResult = drawingSharePicture(uid, id, shareUrl, listGoodsBrief); ShareGoodsRecordDTO recordDTO = new ShareGoodsRecordDTO(); recordDTO.setUid(uid); recordDTO.setShareId(id); recordDTO.setListGoodsBrief(listGoodsBrief); recordDTO.setShareUrl(shareUrl); recordDTO.setSharePictureUrl(uploadResult.getUrl()); recordDTO.setSource(ShareSourceTypeEnum.storage); // 缓存分享商品信息 String key = StringUtil.Md5(uid + "##" + id); recordDTO.setRedisKey(key); redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20); return recordDTO; } @Override public ShareGoodsRecordDTO addRecordActivity(Long uid, List<TaoBaoGoodsBrief> listGoodsBrief) throws UserShareGoodsRecordException { if (uid == null || uid <= 0 || listGoodsBrief == null || listGoodsBrief.size() == 0) { throw new UserShareGoodsRecordException(1, "传递参数不正确"); } // 插入记录 UserShareGoodsRecord record = new UserShareGoodsRecord(); record.setUid(uid); record.setShareState(0); // 初始未分享 record.setSource(ShareSourceTypeEnum.activity); record.setPicture(listGoodsBrief.get(0).getPictUrl()); // 取一个商品图片作为主图 record.setCreateTime(new Date()); userShareGoodsRecordMapper.insertSelective(record); Long id = record.getId(); // 分享链接 String shareUrl = getShareUrl(record); // 分享二维码链接 FileUploadResult uploadResult = drawingSharePicture(uid, id, shareUrl, listGoodsBrief); ShareGoodsRecordDTO recordDTO = new ShareGoodsRecordDTO(); recordDTO.setUid(uid); recordDTO.setShareId(id); recordDTO.setListGoodsBrief(listGoodsBrief); recordDTO.setShareUrl(shareUrl); recordDTO.setSharePictureUrl(uploadResult.getUrl()); recordDTO.setSource(ShareSourceTypeEnum.activity); // 缓存分享商品信息 String key = StringUtil.Md5(uid + "##" + id); recordDTO.setRedisKey(key); redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20); return recordDTO; } @Override public ShareGoodsRecordDTO addRecordDynamic(Long uid, List<TaoBaoGoodsBrief> listGoodsBrief) throws UserShareGoodsRecordException { if (uid == null || uid <= 0 || listGoodsBrief == null || listGoodsBrief.size() == 0) { throw new UserShareGoodsRecordException(1, "传递参数不正确"); } // 插入记录 UserShareGoodsRecord record = new UserShareGoodsRecord(); record.setUid(uid); record.setShareState(0); // 初始未分享 record.setSource(ShareSourceTypeEnum.activity); record.setPicture(listGoodsBrief.get(0).getPictUrl()); // 取一个商品图片作为主图 record.setCreateTime(new Date()); userShareGoodsRecordMapper.insertSelective(record); Long id = record.getId(); // 分享链接 String shareUrl = getShareUrl(record); ShareGoodsRecordDTO recordDTO = new ShareGoodsRecordDTO(); recordDTO.setUid(uid); recordDTO.setShareId(id); recordDTO.setListGoodsBrief(listGoodsBrief); recordDTO.setShareUrl(shareUrl); recordDTO.setSource(ShareSourceTypeEnum.activity); // 缓存分享商品信息 String key = StringUtil.Md5(uid + "##" + id); recordDTO.setRedisKey(key); redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(recordDTO), 60 * 20); return recordDTO; } @Override public void takeEffectShareRecord(String shareKey) throws UserShareGoodsRecordException { if (StringUtil.isNullOrEmpty(shareKey)) { throw new UserShareGoodsRecordException(1, "传递参数不正确"); } ShareGoodsRecordDTO recordDTO = null; String value = redisManager.getCommonString(shareKey); if (!StringUtil.isNullOrEmpty(value)) { recordDTO = JsonUtil.getSimpleGson().fromJson(value, ShareGoodsRecordDTO.class); } if (recordDTO == null) { throw new UserShareGoodsRecordException(1, "分享信息不存在"); } Long shareId = recordDTO.getShareId(); ShareSourceTypeEnum source = recordDTO.getSource(); if (ShareSourceTypeEnum.goodsDetail.equals(source)) { // 商品详情分享 saveSingleShareRecord(recordDTO.getUid(), recordDTO.getAuctionId()); } else if (ShareSourceTypeEnum.activity.equals(source)) { // 动态分享 UserShareGoodsRecord shareRecord = new UserShareGoodsRecord(); shareRecord.setId(shareId); shareRecord.setShareState(1); shareRecord.setUpdateTime(new Date()); updateByPrimaryKeySelective(shareRecord); // 保存商品信息 multipleGoodsShareRecord(shareId, recordDTO.getListGoodsBrief()); } else if (ShareSourceTypeEnum.storage.equals(source)) { // 分享库分享 UserShareGoodsRecord shareRecord = new UserShareGoodsRecord(); shareRecord.setId(shareId); shareRecord.setShareState(1); shareRecord.setUpdateTime(new Date()); updateByPrimaryKeySelective(shareRecord); // 更新选品库商品状态 为已分享 List<UserShareGoodsGroup> listgoods = userShareGoodsGroupService.listByRecordId(shareId); if (listgoods != null && listgoods.size() > 0) { for (UserShareGoodsGroup userShareGoodsGroup : listgoods) { CommonGoods commonGoods = userShareGoodsGroup.getCommonGoods(); if (commonGoods == null) { continue; } userGoodsStorageService.updateShareStateByCommonGoodsId(commonGoods.getId()); } } } } /** * 分享链接 * * @param shareRecord * @return */ public String getShareUrl(UserShareGoodsRecord shareRecord) { Long uid = shareRecord.getUid(); Long shareId = shareRecord.getId(); String source = shareRecord.getSource().name(); String url = String.format("http://%s/share_mushGoods.html?uid=%s&shareId=%s&source=%s", configService.getH5Host(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY), shareId + "", source + ""); String shortLink = HttpUtil.getShortLink(url); if (!StringUtil.isNullOrEmpty(shortLink)) { url = shortLink; } return url; } /** * 生成分享图 * * @param uid 用户id * @param shareId 分享记录id * @param source 来源 * @param listGoods * @return * @throws UserShareGoodsRecordException */ public FileUploadResult drawingSharePicture(Long uid, Long shareId, String url, List<TaoBaoGoodsBrief> listGoods) throws UserShareGoodsRecordException { InputStream erCodeInputStream = null; // 生成链接二维码 try { erCodeInputStream = QRCodeUtil.getInstance(500).encode(url); } catch (Exception e) { e.printStackTrace(); } // 获取到用户的头像 UserInfo user = userInfoMapper.selectByPrimaryKey(uid); if (user == null) { throw new UserShareGoodsRecordException(1, "用户信息不存在"); } InputStream portrait = null; if (!StringUtil.isNullOrEmpty(user.getPortrait())) { try { portrait = HttpUtil.downLoadImg(user.getPortrait()); } catch (HttpException e) { String portraitUrl = userAccountService.repairPortrait(uid); if (StringUtil.isNullOrEmpty(portraitUrl)) throw new UserShareGoodsRecordException(1, "获取头像出错"); else { // 再次获取头像 try { portrait = HttpUtil.downLoadImg(portraitUrl); } catch (HttpException e1) { throw new UserShareGoodsRecordException(1, "获取头像出错"); } } } } InputStream inputStream = ImageUtil.drawGoodsShareBigImg(erCodeInputStream, portrait, listGoods); FileUploadResult shareImg = COSManager.getInstance().uploadInputStream(inputStream, "sharegoods/share_" + uid + "_" + shareId + "_" + System.currentTimeMillis() + ".png"); return shareImg; } } fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserShareGoodsRecordService.java
@@ -1,15 +1,13 @@ package com.yeshi.fanli.service.inter.user; import java.util.List; import java.util.Map; import net.sf.json.JSONObject; import com.yeshi.fanli.dto.share.ShareInfoDTO; import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO; import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord; import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.exception.share.UserShareGoodsRecordException; import net.sf.json.JSONObject; public interface UserShareGoodsRecordService { @@ -52,35 +50,7 @@ */ public List<UserShareGoodsRecord> getMyShareGoodsRecords(long start, int count, Long uid, String source); /** * 多个商品分享 * * @param uid * 用户id * @param source * 来源 * @param title * 标题内容 * @param listGoods * 商品集合 * @throws UserShareGoodsRecordException */ public Map<String, Object> save(Long uid, ShareSourceTypeEnum source, String title, List<TaoBaoGoodsBrief> listGoods) throws UserShareGoodsRecordException; /** * 单个商品分享 * * @param uid * 用户id * @param source * 来源 * @param taoBaoGoodsBrief * 商品 * @throws UserShareGoodsRecordException */ public void save(Long uid, ShareSourceTypeEnum source, String title, TaoBaoGoodsBrief taoBaoGoodsBrief) throws UserShareGoodsRecordException; /** * 查询已分享商品 @@ -101,21 +71,13 @@ public JSONObject getGoodsGroupDetail(Long recordId) throws UserShareGoodsRecordException; /** * 更新分享记录 * 分享记录生效 * * @param shareId * @throws UserShareGoodsRecordException */ public void updateShareRecord(Long shareId) throws UserShareGoodsRecordException; public void takeEffectShareRecord(String shareKey) throws UserShareGoodsRecordException; /** * * @param uid * @param auctionId * @param type * @throws UserShareGoodsRecordException */ public void saveDetail(Long uid, Long auctionId, String type) throws UserShareGoodsRecordException; /** * 分享记录计数 @@ -124,17 +86,6 @@ */ public long countShareRecordByUid(Long uid); /** * 多商品分享 * @param uid * @param source * @param title * @param listGoods * @return * @throws UserShareGoodsRecordException */ public ShareInfoDTO saveShareRecord(Long uid, ShareSourceTypeEnum source, String title, List<TaoBaoGoodsBrief> listGoods) throws UserShareGoodsRecordException; /** @@ -144,5 +95,49 @@ * @param type * @throws UserShareGoodsRecordException */ public Long saveSingleShareRecord(Long uid, Long auctionId) throws UserShareGoodsRecordException; public void saveSingleShareRecord(Long uid, Long auctionId) throws UserShareGoodsRecordException; /** * 商品详情分享 * @param uid * @param auctionId * @return * @throws UserShareGoodsRecordException */ public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId) throws UserShareGoodsRecordException; /** * 选品库商品分享 * @param uid * @param list * @return * @throws UserShareGoodsRecordException */ public ShareGoodsRecordDTO addRecordGoodsStorage(Long uid,List<TaoBaoGoodsBrief> listGoodsBrief) throws UserShareGoodsRecordException; /** * 老版动态分享 * @param uid * @param activityId * @param title * @param listGoodsBrief * @return * @throws UserShareGoodsRecordException */ public ShareGoodsRecordDTO addRecordActivity(Long uid, List<TaoBaoGoodsBrief> listGoodsBrief) throws UserShareGoodsRecordException; /** * 新版动态分享 * @param uid * @param dynamicId * @param title * @param listGoodsBrief * @return * @throws UserShareGoodsRecordException */ public ShareGoodsRecordDTO addRecordDynamic(Long uid, List<TaoBaoGoodsBrief> listGoodsBrief) throws UserShareGoodsRecordException; } fanli/src/main/resource/image/official.png