| | |
| | | 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;
|
| | |
| | | long cid = dynamicInfo.getClassId();
|
| | |
|
| | | if (cid == 1 || cid == 2) { // 1 热销单品 2 推荐好货
|
| | | if (cid == 1) {
|
| | | List<GoodsPicture> imgs = dynamicInfo.getImgs();
|
| | | GoodsPicture goodsPicture = imgs.get(0);
|
| | | if (goodsPicture.getGoodState() == 1) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | } else {
|
| | | TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods();
|
| | | try {
|
| | | TaoKeApiUtil.getSimpleGoodsInfo(goods.getAuctionId());
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | // 分享文字
|
| | | String title = null;
|
| | | List<ClientTextStyleVO> listTitle = dynamicInfo.getTitle();
|
| | |
| | |
|
| | | } else { // 有图分享
|
| | | List<GoodsPicture> imgs = dynamicInfo.getImgs();
|
| | | String bgUrl = imgs.get(0).getUrlOriginal();
|
| | | |
| | | GoodsPicture goodsPicture = imgs.get(0);
|
| | | String bgUrl = goodsPicture.getUrlOriginal();
|
| | | |
| | | if (StringUtil.isNullOrEmpty(bgUrl)) {
|
| | | out.print(JsonUtil.loadFalseResult("图片路径不存在"));
|
| | | return;
|
| | |
| | | UserInfo userInfo = userInfoService.selectByPKey(uid);
|
| | | String portrait = userInfo.getPortrait();
|
| | | // 画邀请图片
|
| | | if (StringUtil.isNullOrEmpty(dynamicInfo.getInviteMaterialId())) {
|
| | | String imgLink = spreadUserImgService.drawInviteQrCodeNew(bgUrl,uid, portrait, inviteCode);
|
| | | Long activityId = dynamicInfo.getActivityId();
|
| | | if (activityId != null) {
|
| | | Integer pX = goodsPicture.getPx();; |
| | | Integer pY = goodsPicture.getPy();;
|
| | | Integer size = goodsPicture.getSize();
|
| | | |
| | | String imgLink = spreadUserImgService.drawInviteQrCodeNew(bgUrl,uid, portrait,pX, pY, size, inviteCode);
|
| | | data.put("imgLink", imgLink);
|
| | | } else {
|
| | | String title = imgs.get(0).getTitleOriginal();
|