| | |
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | 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.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.ActivityException;
|
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | |
| | | 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;
|
| | |
| | | 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("notifyDesc", configService.get("goods_share_multiple_notify"));
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | data.put("shareImg", loadResult);
|
| | | data.put("notifyDesc", configService.get(ConfigKeyEnum.goodsShareMultipleNotify.getKey()));
|
| | |
|
| | | return data;
|
| | |
|
| | |
| | | return activityUserMapper.selectList();
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity addShareGoodsRecommendActivity(Long activityUid, List<Long> goodsList,
|
| | | RecommendActivity activity) throws ActivityException , Exception{
|
| | |
| | | return activity;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity addInviteImgRecommendActivity(Long activityUid, RecommendActivity activity, String url,
|
| | | int px, int py, int erCodeSize) throws ActivityException, Exception {
|
| | |
| | | return activity;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity addTextAndImgRecommendActivity(Long activityUid, List<String> imgList,
|
| | | RecommendActivity activity) throws ActivityException, Exception {
|
| | |
| | | return recommendActivityMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity updateShareGoodsRecommendActivity(Long activityUid,
|
| | | List<Long> goodsList, RecommendActivity activity) throws ActivityException , Exception{
|
| | |
| | | updateActivity.setTotalGetMoney("预估分享奖金:¥" + taotaoMoney.toString());
|
| | | recommendActivityMapper.updateByPrimaryKeySelective(updateActivity);
|
| | |
|
| | | // 1.5.4 动态信息更新
|
| | | RecommendActivity exist = recommendActivityMapper.selectByPrimaryKey(activity.getId());
|
| | | if (exist.getState() != null && exist.getState() == 1) {
|
| | | try {
|
| | | ActivityUser activityUser = activityUserService.selectByPrimaryKey(activityUid);
|
| | | exist.setActivityUser(activityUser);
|
| | | exist.setGoodsList(listgoods);
|
| | | dynamicInfoService.saveActivityRecommend(exist);
|
| | | dynamicInfoService.insertActivityRecommend(exist);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | return activity;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity updateInviteImgRecommendActivity(Long activityUid, RecommendActivity activity, String url,
|
| | | int px, int py, int erCodeSize) throws ActivityException , Exception{
|
| | |
| | | if (exist.getState() != null && exist.getState() == 1) {
|
| | | try {
|
| | | ActivityUser activityUser = activityUserService.selectByPrimaryKey(activityUid);
|
| | | dynamicInfoService.insertInviteMaterial(exist.getTitle(), url, activity.getId(), activityUser);
|
| | | activity.setActivityUser(activityUser);
|
| | | activity.setInviteInfo(recommendActivityInviteInfo);
|
| | | List<String> imageList = new ArrayList<String>();
|
| | | imageList.add(url);
|
| | | activity.setImageList(imageList);
|
| | | dynamicInfoService.insertInviteActivity(activity);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | return activity;
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public RecommendActivity updateTextAndImgRecommendActivity(Long activityUid, List<String> imgList,
|
| | | RecommendActivity activity) throws ActivityException , Exception{
|
| | |
| | | return recommendActivityMapper.getRecommendActivityEffectiveCount();
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void upgradeShareGoodsRecommendActivity(Long id) throws ActivityException {
|
| | | // 获取商品
|