Merge branch 'Bulbasaur' of gitee.com:beijing_hongye_huicheng/lilishop into Bulbasaur
This commit is contained in:
@@ -15,6 +15,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 分销订单入库
|
||||
*
|
||||
@@ -28,7 +30,7 @@ public class DistributionOrderExecute implements OrderStatusChangeEvent, EveryDa
|
||||
@Autowired
|
||||
private DistributionOrderService distributionOrderService;
|
||||
//分销订单持久层
|
||||
@Autowired
|
||||
@Resource
|
||||
private DistributionOrderMapper distributionOrderMapper;
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ import cn.lili.modules.order.order.service.OrderService;
|
||||
import cn.lili.modules.payment.entity.RefundLog;
|
||||
import cn.lili.modules.payment.kit.Payment;
|
||||
import cn.lili.modules.payment.kit.enums.PaymentMethodEnum;
|
||||
import cn.lili.modules.payment.service.PaymentService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -24,9 +22,6 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class PaymentExecute implements OrderStatusChangeEvent {
|
||||
|
||||
//支付日志
|
||||
@Autowired
|
||||
private PaymentService paymentService;
|
||||
//订单
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
@@ -52,7 +52,6 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
||||
|
||||
switch (orderMessage.getNewStatus()) {
|
||||
case PAID: {
|
||||
|
||||
OrderDetailVO order = orderService.queryDetail(orderMessage.getOrderSn());
|
||||
//库存key 和 扣减数量
|
||||
List<String> keys = new ArrayList<>();
|
||||
@@ -78,7 +77,6 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
||||
break;
|
||||
}
|
||||
case CANCELLED: {
|
||||
|
||||
OrderDetailVO order = orderService.queryDetail(orderMessage.getOrderSn());
|
||||
if (order.getOrder().getPayStatus().equals(PayStatusEnum.PAID.name())) {
|
||||
for (OrderItem orderItem : order.getOrderItems()) {
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.lili.event.impl;
|
||||
|
||||
import cn.lili.common.utils.CommonUtil;
|
||||
import cn.lili.event.OrderStatusChangeEvent;
|
||||
import cn.lili.modules.order.order.entity.dos.Order;
|
||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||
import cn.lili.modules.order.order.service.OrderService;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 虚拟商品
|
||||
* @author Bulbasaur
|
||||
* @date: 2021/5/29 9:17 上午
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
public class VerificationOrderExecute implements OrderStatusChangeEvent {
|
||||
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
@Override
|
||||
public void orderChange(OrderMessage orderMessage) {
|
||||
//订单状态为待核验,添加订单添加核验码
|
||||
if(orderMessage.getNewStatus().equals(OrderStatusEnum.TAKE)) {
|
||||
String code = CommonUtil.getRandomNum();
|
||||
orderService.update(new LambdaUpdateWrapper<Order>()
|
||||
.set(Order::getVerificationCode, code)
|
||||
.eq(Order::getSn, orderMessage.getOrderSn()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user