| | |
| | | import com.yeshi.fanli.dao.mybatis.share.UserShareGoodsRecordMapper;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | 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.UserShareGoodsRecord;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserGoodsStorageService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserGoodsStorageService userGoodsStorageService;
|
| | | |
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public int insert(UserShareGoodsRecord record) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType) throws UserShareGoodsRecordException {
|
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType, boolean isTaolijin) throws UserShareGoodsRecordException {
|
| | | if (auctionId == null || uid == null || uid <= 0) {
|
| | | throw new UserShareGoodsRecordException(1, "传递参数不正确");
|
| | | }
|
| | |
| | | recordDTO.setUid(uid);
|
| | | recordDTO.setAuctionId(auctionId);
|
| | | recordDTO.setGoodsType(goodsType);
|
| | | recordDTO.setTaolijin(isTaolijin);
|
| | | recordDTO.setSource(ShareSourceTypeEnum.goodsDetail);
|
| | |
|
| | | // 分享id
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void takeEffectShareRecord(String shareKey) throws UserShareGoodsRecordException {
|
| | | public void takeEffectShareRecord(AcceptData acceptData, String shareKey) throws UserShareGoodsRecordException {
|
| | | if (StringUtil.isNullOrEmpty(shareKey)) {
|
| | | throw new UserShareGoodsRecordException(1, "传递参数不正确");
|
| | | }
|
| | |
| | | throw new UserShareGoodsRecordException(1, "分享信息不存在");
|
| | | }
|
| | |
|
| | | Long uid = recordDTO.getUid();
|
| | | boolean taolijin = recordDTO.isTaolijin();
|
| | | boolean singleGoods = true;
|
| | | Long shareId = recordDTO.getShareId();
|
| | | ShareSourceTypeEnum source = recordDTO.getSource();
|
| | | if (ShareSourceTypeEnum.goodsDetail.equals(source)) {
|
| | |
| | | shareRecord.setUpdateTime(new Date());
|
| | | updateByPrimaryKeySelective(shareRecord);
|
| | |
|
| | | List<CommonGoods> listGoods = recordDTO.getListGoods();
|
| | | if (listGoods != null && listGoods.size() > 1) |
| | | singleGoods = false;
|
| | | |
| | | // 保存商品信息
|
| | | multipleGoodsShareRecord(shareId, recordDTO.getListGoods());
|
| | |
|
| | | } else if (ShareSourceTypeEnum.storage.equals(source)) {
|
| | | // 分享库分享
|
| | | singleGoods = false;
|
| | | |
| | | UserShareGoodsRecord shareRecord = new UserShareGoodsRecord();
|
| | | shareRecord.setId(shareId);
|
| | | shareRecord.setShareState(1);
|
| | |
| | |
|
| | | // 清理缓存
|
| | | redisManager.removeCommonString(shareKey);
|
| | | |
| | | if (singleGoods) {
|
| | | if (taolijin) {
|
| | | integralGetService.addShareTLJGoods(uid);
|
| | | } else {
|
| | | integralGetService.addShareSingleGoods(uid);
|
| | | }
|
| | | } else {
|
| | | integralGetService.addShareMultipleGoods(uid);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|