| | |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.enums.*; |
| | | import com.ruoyi.common.core.enums.AuctionOrderTypeEnum; |
| | | import com.ruoyi.common.core.enums.AuditStatusEnum; |
| | | import com.ruoyi.common.core.enums.BondStatusEnum; |
| | | import com.ruoyi.common.core.enums.CouponUseEnum; |
| | | import com.ruoyi.common.core.enums.OrderFromEnum; |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | | import com.ruoyi.common.core.enums.OrderTypeEnum; |
| | |
| | | import com.ruoyi.order.controller.management.dto.MgtOrderQuery; |
| | | import com.ruoyi.order.controller.management.vo.MgtOrderReturnRequestVO; |
| | | import com.ruoyi.order.controller.management.vo.MgtOrderVO; |
| | | import com.ruoyi.order.domain.MemberInvoiceOrder; |
| | | import com.ruoyi.order.domain.OrderReturnRequest; |
| | | import com.ruoyi.order.domain.Paylog; |
| | | import com.ruoyi.order.mapper.OrderAuctionBondMapper; |
| | |
| | | import com.ruoyi.order.service.IPaylogService; |
| | | import com.ruoyi.order.util.OrderUtil; |
| | | import com.ruoyi.order.util.SinataUtil; |
| | | import com.ruoyi.order.vo.HomeGoodsSkuDTO1; |
| | | import com.ruoyi.order.vo.WdOrderVO; |
| | | import com.ruoyi.system.api.constants.DelayTaskEnum; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | | import com.ruoyi.system.api.domain.CouponMember; |
| | |
| | | import com.ruoyi.system.api.domain.dto.MgtAfterSaleSettingDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import com.ruoyi.system.api.domain.dto.updMembeOneDTO; |
| | | import com.ruoyi.system.api.domain.vo.Express100VO; |
| | | import com.ruoyi.system.api.domain.vo.MemberOrderListVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberOrderNumVO; |
| | | import com.ruoyi.system.api.domain.vo.MemberTiOrderVO; |
| | | import com.ruoyi.system.api.domain.vo.OrderVO; |
| | | import com.ruoyi.system.api.domain.vo.*; |
| | | import com.ruoyi.system.api.feignClient.AuctionClient; |
| | | import com.ruoyi.system.api.feignClient.GoodsSkuClient; |
| | | import com.ruoyi.system.api.feignClient.MemberClient; |
| | |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.function.Function; |
| | |
| | | */ |
| | | @Override |
| | | public Integer getGroupPurchasesGoodsNum(Long id) { |
| | | List<Order> list = this.lambdaQuery().eq(Order::getId, id) |
| | | List<Order> list = this.lambdaQuery().eq(Order::getGoodsSkuId, id) |
| | | .in(Order::getOrderStatus, OrderStatusEnum.TO_BE_SHIPPED, |
| | | OrderStatusEnum.GOODS_TO_BE_RECEIVED, OrderStatusEnum.FINISHED).list(); |
| | | return list.stream().map(Order::getGoodsQuantity).reduce(0, Integer::sum); |
| | |
| | | @Override |
| | | public List<OrderVO> getOrderByGroupPurchaseMemberList(HomeGoodsSkuDTO homeGoodsSkuDTO) { |
| | | return baseMapper.getOrderByGroupPurchaseMemberList(homeGoodsSkuDTO); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderVO> getOrderByGroupPurchaseMemberList1(HomeGoodsSkuDTO homeGoodsSkuDTO) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | |
| | | GoodsGroupPurchase data1 = goodsSkuClient.getGoodsSeckiGoodsGroupPurchaseOne(memberOrderDTO.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | Integer num= data.getGroupSize()*data.getLimitNumber(); |
| | | GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(data1.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | if (goodsSku.getSortNum()<num){ |
| | | if (goodsSku.getStock()<num){ |
| | | throw new ServiceException("该商品库存不足无法团购"); |
| | | } |
| | | |
| | |
| | | } |
| | | wrapper.eq(Order::getIsOrder,1); |
| | | wrapper.eq(Order::getDelFlag,0); |
| | | wrapper.orderByDesc(Order::getCancelTime); |
| | | wrapper.orderByDesc(Order::getCreateTime); |
| | | Page<Order> page1 = this.page(page, wrapper); |
| | | |
| | | PageDTO<MemberOrderListVO> memberOrderListVOPageDTO = PageDTO.of(page1, MemberOrderListVO.class); |
| | |
| | | OrderVO orderVO=new OrderVO(); |
| | | try { |
| | | orderVO = BeanUtils.copyBean(order, OrderVO.class); |
| | | orderVO.setAuctionType(order.getAuctionOrderType()); |
| | | if (orderVO.getOrderFrom().getCode()==3){ |
| | | GoodsGroupPurchase data = GoodsSkuClient.getGoodsSeckiGoodsGroupPurchaseOne(order.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | orderVO.setGroupTime(data.getGroupTime()); |
| | |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | | public PageDTO<WdOrderVO> CtjlGoodsGroupPurchase(HomeGoodsSkuDTO1 homeGoodsSkuDTO1) { |
| | | LambdaQueryWrapper< Order> wrapper1= Wrappers.lambdaQuery(); |
| | | if (homeGoodsSkuDTO1.getSkuName()!=null&&homeGoodsSkuDTO1.getSkuName()!=""){ |
| | | wrapper1.like(Order::getSkuName,homeGoodsSkuDTO1.getSkuName()); |
| | | } |
| | | wrapper1.eq(Order::getMemberId,homeGoodsSkuDTO1.getMemberId()); |
| | | wrapper1.eq(Order::getOrderFrom,3); |
| | | wrapper1.eq(Order::getDelFlag,0); |
| | | wrapper1.eq(Order::getOrderStatus,2); |
| | | Page<Order> page = new Page<>(homeGoodsSkuDTO1.getPageCurr(), homeGoodsSkuDTO1.getPageSize()); |
| | | Page< Order> page1 = this.page(page, wrapper1); |
| | | PageDTO<WdOrderVO> HomeGoodsSeckillVOPageDTO = PageDTO.of(page1, WdOrderVO.class); |
| | | List<WdOrderVO> list2 = HomeGoodsSeckillVOPageDTO.getList(); |
| | | |
| | | for (WdOrderVO goodsGroupPurchaseeVO1:list2) { |
| | | |
| | | Order byId1 = this.getById(goodsGroupPurchaseeVO1.getId()); |
| | | |
| | | GoodsGroupPurchase data = goodsSkuClient.getGoodsSeckiGoodsGroupPurchaseOne(byId1.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | BeanUtils.copyProperties(data,goodsGroupPurchaseeVO1); |
| | | GoodsSku byId = goodsSkuClient.getGoodsSkuOne(data.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | goodsGroupPurchaseeVO1.setGoodsSkuName(byId.getSkuName()); |
| | | goodsGroupPurchaseeVO1.setCoverPic(byId.getCoverPic()); |
| | | goodsGroupPurchaseeVO1.setPrice(byId.getPrice()); |
| | | goodsGroupPurchaseeVO1.setYears(String.valueOf(byId.getYears().getYear())); |
| | | goodsGroupPurchaseeVO1.setIsGoodsGroupPurchase(2); |
| | | if (byId1.getGroupNo()!=null){ |
| | | GoodsGroupPurchaseInfo one1 = goodsSkuClient.getGoodsSeckiGoodsGroupPurchaseInfo2(byId1.getGroupNo(), SecurityConstants.INNER).getData(); |
| | | if (one1!=null) { |
| | | goodsGroupPurchaseeVO1.setCurrentNumber(one1.getCurrentNumber()); |
| | | if (one1.getGroupStatus() == 0) { |
| | | if (one1.getGroupSize() - one1.getCurrentNumber() < 5) { |
| | | goodsGroupPurchaseeVO1.setGroupStatus(GroupStatusEnum.MS_FAILURE); |
| | | } else { |
| | | goodsGroupPurchaseeVO1.setGroupStatus(GroupStatusEnum.TO_FORM_A_GROUP); |
| | | } |
| | | } |
| | | if (one1.getGroupStatus() == 1) { |
| | | goodsGroupPurchaseeVO1.setGroupStatus(GroupStatusEnum.FORMED_INTO_A_GROUP); |
| | | } |
| | | if (one1.getGroupStatus() == 2) { |
| | | goodsGroupPurchaseeVO1.setGroupStatus(GroupStatusEnum.GROUP_FAILURE); |
| | | } |
| | | }else{ |
| | | goodsGroupPurchaseeVO1.setGroupStatus(data.getGroupStatus()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | return HomeGoodsSeckillVOPageDTO; |
| | | } |
| | | |
| | | /** |
| | | * 根据优惠券id集合查询订单列表 |
| | | * |
| | |
| | | updMembeOneDTO.setTotalPoints(Math.max(member.getTotalPoints() - order.getPoints(), 0)); |
| | | memberClient.updMembeOne(updMembeOneDTO, SecurityConstants.INNER); |
| | | } |
| | | if (Objects.nonNull(order.getCouponId())) { |
| | | CouponMemberDTO dto = new CouponMemberDTO(); |
| | | dto.setId(order.getCouponId()); |
| | | dto.setCouponStatus(CouponUseEnum.UNUSED.getCode()); |
| | | promotionClient.updCouponMember(dto, SecurityConstants.INNER); |
| | | } |
| | | } |
| | | |
| | | private boolean handleRefund(PaymentMethodEnum paymentMethod, Paylog paylog, String orderNo) { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<Order> updateOrderStatusByMubres2(String formedGroupMubres) { |
| | | return this.lambdaQuery().eq(Order::getGroupNo, formedGroupMubres).list(); |
| | | } |
| | | } |