| | |
| | | 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.enums.OrderFromEnum; |
| | | import com.ruoyi.common.core.enums.StartStatusEnum; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.enums.*; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.Checker; |
| | | import com.ruoyi.common.core.utils.page.CollUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.goods.controller.management.dto.GoodsInfoTitleValueDTO; |
| | | import com.ruoyi.goods.controller.management.dto.GoodsSkuDTO; |
| | | import com.ruoyi.goods.controller.management.dto.GoodsSkuQuery; |
| | |
| | | import com.ruoyi.goods.service.IGoodsInfoTitleValueService; |
| | | import com.ruoyi.goods.service.IGoodsSkuService; |
| | | import com.ruoyi.goods.service.IMemberGoodsCollectionService; |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroomGoods; |
| | | import com.ruoyi.system.api.domain.GoodsBrand; |
| | | import com.ruoyi.system.api.domain.GoodsCategory; |
| | | import com.ruoyi.system.api.domain.GoodsFlavorType; |
| | | import com.ruoyi.system.api.domain.GoodsGroupPurchase; |
| | | import com.ruoyi.system.api.domain.GoodsSeckill; |
| | | import com.ruoyi.system.api.domain.GoodsSeries; |
| | | import com.ruoyi.system.api.domain.GoodsSku; |
| | | import com.ruoyi.system.api.domain.Order; |
| | | import com.ruoyi.system.api.domain.*; |
| | | import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO; |
| | | import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO; |
| | | import com.ruoyi.system.api.domain.dto.ListStatusDTO; |
| | |
| | | import com.ruoyi.system.api.domain.vo.getHomeGoodsSkuXxiVO; |
| | | import com.ruoyi.system.api.feignClient.AuctionClient; |
| | | import com.ruoyi.system.api.feignClient.GoodsSkuClient; |
| | | import com.ruoyi.system.api.feignClient.MemberClient; |
| | | import com.ruoyi.system.api.feignClient.OrderClient; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.redisson.api.RLock; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Resource |
| | | private IMemberGoodsCollectionService iMemberGoodsCollectionService; |
| | | |
| | | @Resource |
| | | private MemberClient memberClient; |
| | | |
| | | |
| | | private static final ObjectMapper objectMapper = new ObjectMapper(); |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 保存商品SKU信息。 |
| | |
| | | |
| | | @Override |
| | | public PageDTO<HomeGoodsSkuListVO> getHomeGoodsSkuVOList(HomeGoodsSkuDTO homeGoodsSkuDTO) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | R<Member> memberR = memberClient.getMemberByUserId(userId, SecurityConstants.INNER); |
| | | Member member = memberR.getData(); |
| | | Integer vipClassify = member.getVipClassify(); |
| | | |
| | | Page<GoodsSku> page = new Page<>(); |
| | | page.setSize(homeGoodsSkuDTO.getPageSize()); |
| | | page.setCurrent(homeGoodsSkuDTO.getPageCurr()); |
| | |
| | | wrapper3.last(",IF(isnull(sort_num),1,0), sort_num DESC,create_time DESC" ); |
| | | } |
| | | |
| | | |
| | | Page<GoodsSku> page1 = this.page(page, wrapper3); |
| | | PageDTO<HomeGoodsSkuListVO> articleCommentsVOPageDTO = PageDTO.of(page1, HomeGoodsSkuListVO.class); |
| | | return articleCommentsVOPageDTO; |
| | | for (GoodsSku record : page1.getRecords()) { |
| | | // 获取会员价格 |
| | | BigDecimal vipPrice = getVipPrice(record.getId()); |
| | | record.setPrice(vipPrice); |
| | | } |
| | | return PageDTO.of(page1, HomeGoodsSkuListVO.class); |
| | | |
| | | } |
| | | |
| | |
| | | if (data3!=null) { |
| | | homeGoodsSkuInfoVO.setFlavorType(data3.getFlavorTypeName()); |
| | | } |
| | | homeGoodsSkuInfoVO.setPrice(byId.getPrice()); |
| | | homeGoodsSkuInfoVO.setSoldQuantity(byId.getSoldQuantity()); |
| | | homeGoodsSkuInfoVO.setUnit(byId.getUnit()); |
| | | homeGoodsSkuInfoVO.setSpec(byId.getSpec()); |
| | |
| | | "=============================没有查询到团购信息============================="); |
| | | homeGoodsSkuInfoVO.setIsGoodsGroupPurchase(1); |
| | | } |
| | | |
| | | // 获取会员价格 |
| | | BigDecimal vipPrice = getVipPrice(byId.getId()); |
| | | homeGoodsSkuInfoVO.setPrice(vipPrice); |
| | | |
| | | LambdaQueryWrapper<MemberGoodsCollection> wrapper3= Wrappers.lambdaQuery(); |
| | | wrapper3.eq(MemberGoodsCollection::getDelFlag,0); |
| | |
| | | wrapper4.ge(GoodsBrowseRecord::getCreateTime, newTime7) |
| | | .le(GoodsBrowseRecord::getCreateTime,now ); |
| | | List<GoodsBrowseRecord> list2 = iGoodsBrowseRecordService.list(wrapper4); |
| | | if (list2.size()==0){ |
| | | if (list2.isEmpty()){ |
| | | GoodsBrowseRecord auctionBrowseRecord=new GoodsBrowseRecord(); |
| | | auctionBrowseRecord.setMemberId(homeGoodsSkuDTO.getMemberId()); |
| | | auctionBrowseRecord.setGoodsSkuId(homeGoodsSkuDTO.getGoodsSkuId()); |
| | |
| | | return homeGoodsSkuInfoVO; |
| | | } |
| | | |
| | | private BigDecimal getVipPrice(Long goodsSkuId){ |
| | | |
| | | if (SecurityUtils.isLogin()) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | GoodsSku byId = getById(goodsSkuId); |
| | | Member member = memberClient.getMemberByUserId(userId, SecurityConstants.INNER).getData(); |
| | | Integer vipClassify = member.getVipClassify(); |
| | | if (MemberVipClassifyEnum.NORMAL.getCode().equals(vipClassify)) { |
| | | return byId.getPrice(); |
| | | }else if (MemberVipClassifyEnum.VIP.getCode().equals(vipClassify)){ |
| | | return byId.getVipPrice(); |
| | | }else if (MemberVipClassifyEnum.SUPER_VIP.getCode().equals(vipClassify)){ |
| | | return byId.getSuperVipPrice(); |
| | | } |
| | | }else { |
| | | return getById(goodsSkuId).getPrice(); |
| | | } |
| | | throw new ServiceException("会员等级错误"); |
| | | } |
| | | |
| | | @Override |
| | | public List<getHomeGoodsSkuXxiVO> getHomeGoodsSkuXxi(HomeGoodsSkuDTO homeGoodsSkuDTO) { |
| | | List<getHomeGoodsSkuXxiVO> homeGoodsSkuXxiVOS=new ArrayList<>(); |