From 39a54c860830baa9fb42d0e3e90843f455f7d05e Mon Sep 17 00:00:00 2001 From: rentaiming <806181062@qq.com> Date: 星期一, 03 六月 2024 10:03:58 +0800 Subject: [PATCH] 修改循环注入 --- ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java | 43 ++++++++++++++++++++++++++++++++++++++----- 1 files changed, 38 insertions(+), 5 deletions(-) diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java index 520643c..334950d 100644 --- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java +++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java @@ -1,18 +1,24 @@ package com.ruoyi.order.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.enums.OrderStatusEnum; -import com.ruoyi.order.domain.pojo.Order; -import com.ruoyi.order.domain.pojo.OrderMall; +import com.ruoyi.order.domain.OrderMall; import com.ruoyi.order.mapper.OrderMapper; import com.ruoyi.order.service.IOrderMallService; import com.ruoyi.order.service.IOrderService; import com.ruoyi.order.util.OrderUtil; +import com.ruoyi.system.api.domain.Order; +import com.ruoyi.system.api.domain.OrderAuctionBond; +import com.ruoyi.system.api.domain.dto.HomeGoodsSkuDTO; import com.ruoyi.system.api.domain.dto.OrderDTO; import java.util.List; import java.util.Set; import java.util.stream.Collectors; import javax.annotation.Resource; + +import com.ruoyi.system.api.domain.vo.OrderVO; import org.springframework.stereotype.Service; /** @@ -27,8 +33,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements IOrderService { - @Resource - private IOrderService orderService; + @Resource private IOrderMallService orderMallService; @Override @@ -48,8 +53,15 @@ order.setReceiverCity(OrderDTO.getReceiverCity()); order.setReceiverDetailAddress(OrderDTO.getReceiverDetailAddress()); order.setBound(OrderDTO.getBound()); - orderService.save(order); + this.save(order); } + + /** + * 获取某个商品的已购会员数 + * + * @param id 秒杀商品id + * @return 已购会员数 + */ @Override public Integer getSeckillMembers(Long id) { return baseMapper.getSeckillMembers(id); @@ -72,4 +84,25 @@ OrderStatusEnum.GOODS_TO_BE_RECEIVED, OrderStatusEnum.FINISHED).list(); return list.stream().map(Order::getGoodsQuantity).reduce(0, Integer::sum); } + + /** + * 根据团购商品id获取团购商品订单 + * + * @param id 团购商品id + * @return 订单列表 + */ + @Override + public List<Order> getOrderByGroupPurchaseId(Long id) { + return baseMapper.getOrderByGroupPurchaseId(id); + } + + @Override + public Order getOrderByGroupPurchaseMemberId(HomeGoodsSkuDTO homeGoodsSkuDTO) { + return baseMapper.getOrderByGroupPurchaseMemberId(homeGoodsSkuDTO); + } + + @Override + public List<OrderVO> getOrderByGroupPurchaseMemberList(HomeGoodsSkuDTO homeGoodsSkuDTO) { + return baseMapper.getOrderByGroupPurchaseMemberList(homeGoodsSkuDTO); + } } -- Gitblit v1.7.1