| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public ActivityShareResult shareActivityGoods(Long uid, Long activityId) throws ActivityException {
|
| | | public ActivityShareResult shareActivityGoods(Long uid, Long activityId) throws ActivityException,UserShareGoodsRecordException {
|
| | |
|
| | | RecommendActivity activity = recommendActivityMapper.selectByPrimaryKey(activityId);
|
| | |
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | if (listGoodsBrief.size() > 0) {
|
| | | try {
|
| | | FileUploadResult loadResult = userShareGoodsRecordService.save(uid, |
| | | ShareSourceTypeEnum.activity, title, listGoodsBrief);
|
| | | imgList.add(loadResult);
|
| | | |
| | | } catch (UserShareGoodsRecordException e) {
|
| | | throw new ActivityException(1, e.getMsg());
|
| | | }
|
| | | } else {
|
| | | if (listGoodsBrief.size() < 1) {
|
| | | throw new ActivityException(1, "商品下架");
|
| | | }
|
| | |
|
| | | JSONObject resultdata = userShareGoodsRecordService.save(uid, ShareSourceTypeEnum.activity, title, listGoodsBrief);
|
| | | imgList.add((FileUploadResult) resultdata.get("loadResult"));
|
| | | result.setImgList(imgList);
|
| | | |
| | | return result;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public JSONObject shareGoodsV2(Long uid, Long activityId) throws ActivityException {
|
| | | public JSONObject shareGoodsV2(Long uid, Long activityId) throws ActivityException,UserShareGoodsRecordException {
|
| | |
|
| | | RecommendActivity activity = recommendActivityMapper.selectByPrimaryKey(activityId);
|
| | |
|
| | |
| | |
|
| | | result.setTitle(title);
|
| | |
|
| | | List<FileUploadResult> imgList = new ArrayList<>();
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
|
| | | if (activity.getGoodsList() != null) {
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | FileUploadResult loadResult = null;
|
| | | if (listGoodsBrief.size() > 0) {
|
| | | try {
|
| | | loadResult = userShareGoodsRecordService.save(uid, |
| | | ShareSourceTypeEnum.activity, title, listGoodsBrief);
|
| | | imgList.add(loadResult);
|
| | | |
| | | } catch (UserShareGoodsRecordException e) {
|
| | | throw new ActivityException(1, e.getMsg());
|
| | | }
|
| | | } else {
|
| | | if (listGoodsBrief.size() < 1) {
|
| | | throw new ActivityException(1, "商品下架");
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("shareImg", loadResult);
|
| | | |
| | | JSONObject resultdata = userShareGoodsRecordService.save(uid, |
| | | ShareSourceTypeEnum.activity, title, listGoodsBrief);
|
| | | |
| | | data.put("revenue", revenue);
|
| | | data.put("shareId", resultdata.get("shareId"));
|
| | | data.put("shareImg", resultdata.get("loadResult"));
|
| | | data.put("notifyDesc", configService.get("goods_share_notify"));
|
| | |
|
| | | return data;
|