| | |
| | | import com.ruoyi.goods.controller.management.dto.GoodsSeckillQuery; |
| | | import com.ruoyi.goods.controller.management.dto.GoodsSeckillUpd; |
| | | import com.ruoyi.goods.controller.management.vo.GoodsSeckillVO; |
| | | import com.ruoyi.goods.domain.MemberGoodsCollection; |
| | | import com.ruoyi.goods.mapper.GoodsSeckillMapper; |
| | | import com.ruoyi.goods.service.IGoodsSeckillService; |
| | | import com.ruoyi.goods.service.IGoodsSkuService; |
| | | import com.ruoyi.goods.service.IMemberGoodsCollectionService; |
| | | import com.ruoyi.goods.service.async.AsyncMethodService; |
| | | import com.ruoyi.system.api.constants.DelayTaskEnum; |
| | | import com.ruoyi.system.api.constants.NotificationTypeConstant; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | | * 商品秒杀表 服务实现类 |
| | |
| | | private final AsyncMethodService asyncMethodService; |
| | | // 创建一个静态共享的ObjectMapper实例以重用 |
| | | private static final ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | @Resource |
| | | private IMemberGoodsCollectionService iMemberGoodsCollectionService; |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addGoodsSeckill(GoodsSeckillDTO dto) { |
| | |
| | | homeGoodsSeckillInfoVO.setStartTime(byId.getStartTime()); |
| | | homeGoodsSeckillInfoVO.setEndTime(byId.getEndTime()); |
| | | homeGoodsSeckillInfoVO.setStartStatus(byId.getStartStatus()); |
| | | |
| | | LambdaQueryWrapper<MemberGoodsCollection> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(MemberGoodsCollection::getDelFlag,0); |
| | | wrapper3.eq(MemberGoodsCollection::getMemberId,homeGoodsSkuDTO.getMemberId()); |
| | | wrapper3.eq(MemberGoodsCollection::getTargetId,homeGoodsSkuDTO.getGoodsSkuId()); |
| | | wrapper3.eq(MemberGoodsCollection::getType,3); |
| | | List<MemberGoodsCollection> list = iMemberGoodsCollectionService.list(wrapper3); |
| | | if (list.size()>0){ |
| | | homeGoodsSeckillInfoVO.setIsCollection(2); |
| | | }else{ |
| | | homeGoodsSeckillInfoVO.setIsCollection(1); |
| | | } |
| | | return homeGoodsSeckillInfoVO; |
| | | } |
| | | } |