| | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.enums.AuctionOrderTypeEnum; |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | import com.ruoyi.goods.controller.management.dto.GoodsSkuQuery; |
| | | import com.ruoyi.goods.controller.management.vo.GoodsInfoTitleValueVO; |
| | | import com.ruoyi.goods.controller.management.vo.GoodsSkuVO; |
| | | import com.ruoyi.goods.domain.GoodsBrowseRecord; |
| | | import com.ruoyi.goods.domain.GoodsInfoTitleValue; |
| | | import com.ruoyi.goods.domain.MemberGoodsCollection; |
| | | import com.ruoyi.goods.mapper.GoodsGroupPurchaseMapper; |
| | | import com.ruoyi.goods.mapper.GoodsSeckillMapper; |
| | | import com.ruoyi.goods.mapper.GoodsSkuMapper; |
| | | import com.ruoyi.goods.service.IGoodsBrowseRecordService; |
| | | import com.ruoyi.goods.service.IGoodsInfoTitleValueService; |
| | | import com.ruoyi.goods.service.IGoodsSkuService; |
| | | import com.ruoyi.goods.service.IMemberGoodsCollectionService; |
| | |
| | | private final GoodsSeckillMapper goodsSeckillMapper; |
| | | private final GoodsGroupPurchaseMapper goodsGroupPurchaseMapper; |
| | | private final RedissonClient redissonClient; |
| | | |
| | | @Resource |
| | | private IGoodsBrowseRecordService iGoodsBrowseRecordService; |
| | | |
| | | |
| | | @Resource |
| | | private OrderClient orderClient; |
| | |
| | | }else{ |
| | | homeGoodsSkuInfoVO.setIsCollection(1); |
| | | } |
| | | LambdaQueryWrapper<GoodsGroupPurchase> queryWrapper2 =new LambdaQueryWrapper<>(); |
| | | queryWrapper2.eq(GoodsGroupPurchase::getListingStatus, |
| | | ListingStatusEnum.ON_SHELVES) |
| | | .eq(GoodsGroupPurchase::getGoodsSkuId, byId.getId()); |
| | | GoodsGroupPurchase goodsGroupPurchase2 = goodsGroupPurchaseMapper.selectOne(queryWrapper2); |
| | | if (goodsGroupPurchase2!=null){ |
| | | HomeGoodsSkuDTO homeGoodsSkuDTO1 =new HomeGoodsSkuDTO(); |
| | | homeGoodsSkuDTO1.setGoodsSkuId(goodsGroupPurchase.getId()); |
| | | homeGoodsSkuDTO1.setMemberId(homeGoodsSkuDTO.getMemberId()); |
| | | List<OrderVO> data4 = orderClient.getOrderByGroupPurchaseMemberList(homeGoodsSkuDTO1, SecurityConstants.INNER).getData(); |
| | | if (data4!=null){ |
| | | homeGoodsSkuInfoVO.setGroupPurchaseGoods(2); |
| | | }else{ |
| | | homeGoodsSkuInfoVO.setGroupPurchaseGoods(1); |
| | | } |
| | | |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime newTime7 = now.minusDays(7); |
| | | |
| | | LambdaQueryWrapper<GoodsBrowseRecord> wrapper4=Wrappers.lambdaQuery(); |
| | | wrapper4.eq(GoodsBrowseRecord::getDelFlag,0); |
| | | wrapper4.eq(GoodsBrowseRecord::getGoodsSkuId,homeGoodsSkuDTO.getGoodsSkuId()); |
| | | wrapper4.eq(GoodsBrowseRecord::getMemberId,homeGoodsSkuDTO.getMemberId()); |
| | | wrapper4.ge(GoodsBrowseRecord::getCreateTime, now) |
| | | .le(GoodsBrowseRecord::getCreateTime, newTime7); |
| | | List<GoodsBrowseRecord> list1 = iGoodsBrowseRecordService.list(wrapper4); |
| | | if (list1.size()==0){ |
| | | GoodsBrowseRecord auctionBrowseRecord=new GoodsBrowseRecord(); |
| | | auctionBrowseRecord.setMemberId(homeGoodsSkuDTO.getMemberId()); |
| | | auctionBrowseRecord.setGoodsSkuId(homeGoodsSkuDTO.getGoodsSkuId()); |
| | | iGoodsBrowseRecordService.save(auctionBrowseRecord); |
| | | } |
| | | |
| | | |
| | | return homeGoodsSkuInfoVO; |
| | | } |
| | | |