| | |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.system.api.constants.NotificationTypeConstant; |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | 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.GoodsSeries; |
| | | import com.ruoyi.system.api.domain.GoodsSku; |
| | | import com.ruoyi.system.api.domain.Member; |
| | | import com.ruoyi.system.api.domain.MemberAddress; |
| | | import com.ruoyi.system.api.domain.OrderAuctionBond; |
| | | import com.ruoyi.system.api.domain.*; |
| | | import com.ruoyi.system.api.domain.dto.AuctionGoodsListDTO; |
| | | import com.ruoyi.system.api.domain.dto.AuctionGoodsListPageDTO; |
| | | import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO; |
| | |
| | | import io.seata.spring.annotation.GlobalTransactional; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | |
| | | @Override |
| | | public PageDTO<MgtAuctionGoodsVO> getAuctionGoodsPage(MgtAuctionGoodsQuery query) { |
| | | Set<Long> goodsSkuIdList = null; |
| | | Page<AuctionGoods> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | if (StringUtils.isNotEmpty(query.getGoodsSkuName())) { |
| | | List<GoodsSku> goodsSku = goodsSkuClient.getGoodsByName(query.getGoodsSkuName(), |
| | | SecurityConstants.INNER) |
| | | .getData(); |
| | | SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isEmpty(goodsSku)) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | goodsSkuIdList = goodsSku.stream().map(GoodsSku::getId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | } |
| | | Page<AuctionGoods> page = this.lambdaQuery() |
| | | page = this.lambdaQuery() |
| | | .select(AuctionGoods::getId, AuctionGoods::getGoodsSkuId, |
| | | AuctionGoods::getListingStatus, AuctionGoods::getStartStatus, |
| | | AuctionGoods::getStartTime, AuctionGoods::getEndTime, |
| | |
| | | query.getStartStatus()) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page.getTotal(), page.getPages()); |
| | | return PageDTO.empty(page); |
| | | } |
| | | // 查询商品信息 |
| | | Set<Long> goodsIdList = page.getRecords().stream().map(AuctionGoods::getGoodsSkuId) |
| | |
| | | return null; |
| | | }).filter(Objects::nonNull).collect(Collectors.toList()); |
| | | // 远程调用订单服务修改订单状态 |
| | | orderClient.updateOrderAuctionBondStatus(ids, BondStatusEnum.PAID); |
| | | orderClient.updateOrderAuctionBondStatus(ids, BondStatusEnum.PAID,SecurityConstants.INNER); |
| | | } |
| | | } |
| | | } |
| | |
| | | auctionGoodsVO.setStartTime(auctionGoods.getStartTime()); |
| | | auctionGoodsVO.setStartingPrice(auctionGoods.getStartingPrice()); |
| | | auctionGoodsVO.setStartStatus(auctionGoods.getStartStatus()); |
| | | auctionGoodsVO.setAuctionStock(auctionGoods.getAuctionStock()); |
| | | GoodsSku goodsSkuOne = goodsSkuClient.getGoodsSkuOne(auctionGoods.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | auctionGoodsVO.setUnit(goodsSkuOne.getUnit()); |
| | | auctionGoodsVO.setSpec(goodsSkuOne.getSpec()); |
| | |
| | | auctionGoodsinfoVO.setStartTime(byId.getStartTime()); |
| | | auctionGoodsinfoVO.setEndTime(byId.getEndTime()); |
| | | auctionGoodsinfoVO.setUnit(goodsSkuOne.getUnit()); |
| | | auctionGoodsinfoVO.setBond(byId.getBond()); |
| | | auctionGoodsinfoVO.setDescription(goodsSkuOne.getDescription()); |
| | | auctionGoodsinfoVO.setYears(String.valueOf(goodsSkuOne.getYears())); |
| | | GoodsBrand data = goodsSkuClient.getBrandOne(goodsSkuOne.getBrandId(), SecurityConstants.INNER).getData(); |
| | |
| | | auctionGoodsinfoVO.setShareTitle(goodsSkuOne.getShareTitle()); |
| | | auctionGoodsinfoVO.setSpecUnit(goodsSkuOne.getSpecUnit()); |
| | | auctionGoodsinfoVO.setDetail(goodsSkuOne.getDetail()); |
| | | auctionGoodsinfoVO.setBond(byId.getBond()); |
| | | auctionGoodsinfoVO.setYears(String.valueOf(goodsSkuOne.getYears())); |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.eq(AuctionBidRecord::getMemberId,auctionGoodsListDTO.getMemberId()); |
| | |
| | | auctionGoodsinfoVO.setPresentBid(list1.getLastBidAmount()); |
| | | if (list1.getStatus().getCode()==2){ |
| | | auctionGoodsinfoVO.setIsStatus(2); |
| | | |
| | | OrderDTO orderDTO =new OrderDTO(); |
| | | orderDTO.setMemberId(auctionGoodsListDTO.getMemberId()); |
| | | orderDTO.setGoodsSkuId(byId.getId()); |
| | | Order data4 = orderClient.getOrderOne1(orderDTO, SecurityConstants.INNER).getData(); |
| | | if (data4!=null){ |
| | | auctionGoodsinfoVO.setOrderId(data4.getId()); |
| | | auctionGoodsinfoVO.setOrderNo(data4.getOrderNo()); |
| | | } |
| | | }else{ |
| | | auctionGoodsinfoVO.setIsStatus(1); |
| | | } |
| | |
| | | }else { |
| | | auctionGoodsinfoVO.setIsCollection(1); |
| | | } |
| | | List<OrderAuctionBond> datas = auctionClient.getAuctionGoodsOrderAuctionBondList(auctionGoodsListDTO, SecurityConstants.INNER).getData(); |
| | | List<OrderAuctionBond> datas = orderClient.getAuctionGoodsOrderAuctionBondList(auctionGoodsListDTO, SecurityConstants.INNER).getData(); |
| | | if (datas.size()>0){ |
| | | auctionGoodsinfoVO.setIsApply(2); |
| | | }else{ |
| | |
| | | } |
| | | |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | String formattedDate = now.format(formatter); |
| | | LocalDateTime parseTime = LocalDateTime.parse(formattedDate, formatter); |
| | | LocalDateTime newTime7 = now.minusDays(7); |
| | | String formattedDate7 = newTime7.format(formatter); |
| | | LocalDateTime parseTime7 = LocalDateTime.parse(formattedDate7, formatter); |
| | | |
| | | LambdaQueryWrapper<AuctionBrowseRecord> wrapper3=Wrappers.lambdaQuery(); |
| | | wrapper3.eq(AuctionBrowseRecord::getDelFlag,0); |
| | | wrapper3.eq(AuctionBrowseRecord::getTargetId,auctionGoodsListDTO.getGoodsSkuId()); |
| | | wrapper3.eq(AuctionBrowseRecord::getMemberId,auctionGoodsListDTO.getMemberId()); |
| | | wrapper3.ge(AuctionBrowseRecord::getCreateTime, parseTime7) |
| | | .le(AuctionBrowseRecord::getCreateTime, parseTime); |
| | | wrapper3.ge(AuctionBrowseRecord::getCreateTime, newTime7) |
| | | .le(AuctionBrowseRecord::getCreateTime, now); |
| | | List<AuctionBrowseRecord> list = iAuctionBrowseRecordService.list(wrapper3); |
| | | if (list.size()==0){ |
| | | AuctionBrowseRecord auctionBrowseRecord=new AuctionBrowseRecord(); |
| | |
| | | public PageDTO<AuctionGoodsListVO> getWdAuctionSalesList(AuctionGoodsListDTO auctionGoodsListDTO) { |
| | | MemberAuctionSalesroomDTO memberAuctionSalesroomDTO =new MemberAuctionSalesroomDTO(); |
| | | memberAuctionSalesroomDTO.setMemberId(auctionGoodsListDTO.getMemberId()); |
| | | List<OrderAuctionBond> data = auctionClient.getAuctionGoodsOrderAuctionBondList(auctionGoodsListDTO, SecurityConstants.INNER).getData(); |
| | | List<OrderAuctionBond> data = orderClient.getAuctionGoodsOrderAuctionBondList(auctionGoodsListDTO, SecurityConstants.INNER).getData(); |
| | | Set<Long> goodsSkuIdList = null; |
| | | if (data!=null){ |
| | | goodsSkuIdList = data.stream().map(OrderAuctionBond::getAuctionSalesroomId) |
| | |
| | | .equals(AuctionStartStatusEnum.IN_AUCTION)) { |
| | | this.lambdaUpdate().set(AuctionGoods::getStartStatus, AuctionStartStatusEnum.ENDED) |
| | | .eq(AuctionGoods::getId, id); |
| | | // TODO 退保证金 |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_GOODS); |
| | | map.put("notification_time", LocalDateTime.now()); |