|  | @@ -10,17 +10,17 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  package com.yami.shop.api.listener;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
	
		
			
				|  |  |  import com.yami.shop.bean.app.dto.ShopCartItemDto;
 | 
	
		
			
				|  |  |  import com.yami.shop.bean.app.dto.ShopCartOrderDto;
 | 
	
		
			
				|  |  |  import com.yami.shop.bean.app.param.OrderParam;
 | 
	
		
			
				|  |  |  import com.yami.shop.bean.dto.TzTransportDto;
 | 
	
		
			
				|  |  |  import com.yami.shop.bean.enums.DvyType;
 | 
	
		
			
				|  |  |  import com.yami.shop.bean.event.ConfirmOrderEvent;
 | 
	
		
			
				|  |  | -import com.yami.shop.bean.model.*;
 | 
	
		
			
				|  |  | +import com.yami.shop.bean.model.Product;
 | 
	
		
			
				|  |  | +import com.yami.shop.bean.model.Sku;
 | 
	
		
			
				|  |  | +import com.yami.shop.bean.model.UserAddr;
 | 
	
		
			
				|  |  |  import com.yami.shop.bean.order.ConfirmOrderOrder;
 | 
	
		
			
				|  |  |  import com.yami.shop.common.exception.GlobalException;
 | 
	
		
			
				|  |  | -import com.yami.shop.common.exception.YamiShopBindException;
 | 
	
		
			
				|  |  |  import com.yami.shop.common.util.Arith;
 | 
	
		
			
				|  |  |  import com.yami.shop.delivery.comment.service.TransportManagerService;
 | 
	
		
			
				|  |  |  import com.yami.shop.security.api.util.SecurityUtils;
 | 
	
	
		
			
				|  | @@ -30,15 +30,11 @@ import com.yami.shop.service.SkuService;
 | 
	
		
			
				|  |  |  import com.yami.shop.service.UserAddrService;
 | 
	
		
			
				|  |  |  import lombok.AllArgsConstructor;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.ObjectUtils;
 | 
	
		
			
				|  |  | -import org.checkerframework.checker.units.qual.A;
 | 
	
		
			
				|  |  |  import org.springframework.context.event.EventListener;
 | 
	
		
			
				|  |  |  import org.springframework.core.annotation.Order;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Component;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -import java.time.LocalDateTime;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  | -import java.util.Objects;
 | 
	
		
			
				|  |  | -import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * 确认订单信息时的默认操作
 | 
	
	
		
			
				|  | @@ -65,28 +61,17 @@ public class ConfirmOrderListener {
 | 
	
		
			
				|  |  |      @EventListener(ConfirmOrderEvent.class)
 | 
	
		
			
				|  |  |      @Order(ConfirmOrderOrder.DEFAULT)
 | 
	
		
			
				|  |  |      public void defaultConfirmOrderEvent(ConfirmOrderEvent event) {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          ShopCartOrderDto shopCartOrderDto = event.getShopCartOrderDto();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          OrderParam orderParam = event.getOrderParam();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          String userId = SecurityUtils.getUser().getUserId();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        // 订单的地址信息
 | 
	
		
			
				|  |  |          UserAddr userAddr = userAddrService.getUserAddrByUserId(orderParam.getAddrId(), userId);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          double total = 0.0;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          int totalCount = 0;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          double transfee = 0.0;
 | 
	
		
			
				|  |  |          shopCartOrderDto.setTotalWeight(Double.valueOf(0));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 重新计算运费时用到
 | 
	
		
			
				|  |  |          List<ShopCartItemDto> shopCartItems = event.getShopCartItems();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          for (ShopCartItemDto shopCartItem : event.getShopCartItems()) {
 | 
	
		
			
				|  |  |              // 获取商品信息
 | 
	
		
			
				|  |  |              Product product = productService.getProductByProdId(shopCartItem.getProdId());
 | 
	
	
		
			
				|  | @@ -136,7 +121,6 @@ public class ConfirmOrderListener {
 | 
	
		
			
				|  |  |                              transfee = Arith.add(transfee, Arith.mul(transfee, num));
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    System.out.println(transfee);
 | 
	
		
			
				|  |  |                      break;
 | 
	
		
			
				|  |  |                  case 2: //夫妻店,B端只走物流
 | 
	
		
			
				|  |  |                      orderParam.setDvyType(DvyType.DELIVERY.value());
 |