| | |
| | | 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;
|
| | |
| | | });
|
| | | return;
|
| | | } catch (ShareGoodsException e) {
|
| | | LogHelper.errorDetailInfo(e, "分享出错:uid:"+uid+"auctionId:"+auctionId, "");
|
| | | // 分享出错报警
|
| | | try {
|
| | | monitorService.addClientAPIMonitor(MonitorFactory.createClientAPI(request, e.getCode(), 0, "分享出错"));
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "updaterecord", method = RequestMethod.POST)
|
| | | public void updateRecord(AcceptData acceptData, String shareId, PrintWriter out) {
|
| | | public void updateRecord(AcceptData acceptData, String shareId, String type, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(shareId)) {
|
| | | out.print(JsonUtil.loadFalseResult("参数不正确"));
|
| | | }
|
| | |
| | | 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();
|
| | |
| | | for (ClientTextStyleVO textStyleVO : listTitle) {
|
| | | title += textStyleVO.getContent();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | if(StringUtil.isNullOrEmpty(title)) {
|
| | | title = "给你推荐精选好物优惠券,购物前先领券,别错过优惠哦~";
|
| | | }
|
| | | data.put("title", title);
|
| | | data.put("content", "我在返利券发现了一个很好的商品,快来看看~");
|
| | |
| | |
|
| | | } 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();
|