|
@@ -12,10 +12,7 @@ import com.xingxi.api.common.ApiException;
|
|
|
import com.xingxi.api.common.UserContext;
|
|
import com.xingxi.api.common.UserContext;
|
|
|
import com.xingxi.api.data.domain.OrderDTO;
|
|
import com.xingxi.api.data.domain.OrderDTO;
|
|
|
import com.xingxi.api.data.domain.OrderDetailDTO;
|
|
import com.xingxi.api.data.domain.OrderDetailDTO;
|
|
|
-import com.xingxi.api.data.mapper.WxApiOrderMapper;
|
|
|
|
|
-import com.xingxi.api.data.mapper.WxApiPaymentInfoMapper;
|
|
|
|
|
-import com.xingxi.api.data.mapper.WxApiProdInventoryMapper;
|
|
|
|
|
-import com.xingxi.api.data.mapper.WxApiProductMapper;
|
|
|
|
|
|
|
+import com.xingxi.api.data.mapper.*;
|
|
|
import com.xingxi.api.model.*;
|
|
import com.xingxi.api.model.*;
|
|
|
import com.xingxi.api.service.OrderServiceI;
|
|
import com.xingxi.api.service.OrderServiceI;
|
|
|
import com.xingxi.business.Order.domain.Order;
|
|
import com.xingxi.business.Order.domain.Order;
|
|
@@ -32,6 +29,7 @@ import com.xingxi.business.ProdInventory.domain.ProdInventory;
|
|
|
import com.xingxi.business.ProdInventory.domain.ProdInventoryBill;
|
|
import com.xingxi.business.ProdInventory.domain.ProdInventoryBill;
|
|
|
import com.xingxi.business.ProdInventory.mapper.ProdInventoryBillMapper;
|
|
import com.xingxi.business.ProdInventory.mapper.ProdInventoryBillMapper;
|
|
|
import com.xingxi.business.UserAddress.domain.UserAddress;
|
|
import com.xingxi.business.UserAddress.domain.UserAddress;
|
|
|
|
|
+import com.xingxi.business.UserAddress.mapper.UserAddressMapper;
|
|
|
import com.xingxi.common.core.domain.entity.SysUser;
|
|
import com.xingxi.common.core.domain.entity.SysUser;
|
|
|
import com.xingxi.common.enums.*;
|
|
import com.xingxi.common.enums.*;
|
|
|
import com.xingxi.common.exception.BusinessException;
|
|
import com.xingxi.common.exception.BusinessException;
|
|
@@ -49,6 +47,7 @@ import com.xingxi.master.product.mapper.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -104,6 +103,9 @@ class OrderApiServiceImpl implements OrderServiceI {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PaymentInfoMapper paymentInfoMapper;
|
|
private PaymentInfoMapper paymentInfoMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private WxApiUserAddressMapper wxApiUserAddressMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public OrderQueryResponse list(UserContext userContext, OrderQueryRequest request) {
|
|
public OrderQueryResponse list(UserContext userContext, OrderQueryRequest request) {
|
|
|
|
|
|
|
@@ -162,7 +164,7 @@ class OrderApiServiceImpl implements OrderServiceI {
|
|
|
|
|
|
|
|
// 订单信息
|
|
// 订单信息
|
|
|
List<OrderItemDTO> orderItemDTOS = request.getOrderItemDTOS();
|
|
List<OrderItemDTO> orderItemDTOS = request.getOrderItemDTOS();
|
|
|
- UserAddress userAddressDTO = request.getUserAddress();
|
|
|
|
|
|
|
+ UserAddress userAddressDTO = wxApiUserAddressMapper.selectUserAddressByUserAddressId(request.getUserAddressId());
|
|
|
|
|
|
|
|
String orderNo = IdUtils.snowFlake();
|
|
String orderNo = IdUtils.snowFlake();
|
|
|
String orderStatus = EOrderStatus.ORDERED.getVal();
|
|
String orderStatus = EOrderStatus.ORDERED.getVal();
|
|
@@ -174,12 +176,12 @@ class OrderApiServiceImpl implements OrderServiceI {
|
|
|
order.setOrderStatus(orderStatus);
|
|
order.setOrderStatus(orderStatus);
|
|
|
order.setBuyerId(userId);
|
|
order.setBuyerId(userId);
|
|
|
|
|
|
|
|
- order.setRecProv(request.getUserAddress().getProvince());
|
|
|
|
|
- order.setRecCity(request.getUserAddress().getCity());
|
|
|
|
|
- order.setRecDistrict(request.getUserAddress().getDistrict());
|
|
|
|
|
- order.setRecAddress(request.getUserAddress().getAddress());
|
|
|
|
|
- order.setRecName(request.getUserAddress().getRecipient());
|
|
|
|
|
- order.setRecMobile(request.getUserAddress().getMobile());
|
|
|
|
|
|
|
+ order.setRecProv(userAddressDTO.getProvince());
|
|
|
|
|
+ order.setRecCity(userAddressDTO.getCity());
|
|
|
|
|
+ order.setRecDistrict(userAddressDTO.getDistrict());
|
|
|
|
|
+ order.setRecAddress(userAddressDTO.getAddress());
|
|
|
|
|
+ order.setRecName(userAddressDTO.getRecipient());
|
|
|
|
|
+ order.setRecMobile(userAddressDTO.getMobile());
|
|
|
order.setRemark(request.getRemark());
|
|
order.setRemark(request.getRemark());
|
|
|
order.setDelFlag(EDelFlag.NO.getVal());
|
|
order.setDelFlag(EDelFlag.NO.getVal());
|
|
|
order.setCreateUser(userId.toString());
|
|
order.setCreateUser(userId.toString());
|
|
@@ -213,7 +215,7 @@ class OrderApiServiceImpl implements OrderServiceI {
|
|
|
ProdVendor condPv = new ProdVendor();
|
|
ProdVendor condPv = new ProdVendor();
|
|
|
condPv.setDelFlag(EDelFlag.NO.getVal());
|
|
condPv.setDelFlag(EDelFlag.NO.getVal());
|
|
|
condPv.setProdId(merchantProd.getProdId());
|
|
condPv.setProdId(merchantProd.getProdId());
|
|
|
- condPv.setProdAttrId(merchantProd.getProdAttrId());
|
|
|
|
|
|
|
+// condPv.setProdAttrId(merchantProd.getProdAttrId());
|
|
|
|
|
|
|
|
List<ProdVendor> prodVendorList = prodVendorMapper.selectProdVendorList(condPv);
|
|
List<ProdVendor> prodVendorList = prodVendorMapper.selectProdVendorList(condPv);
|
|
|
if (prodVendorList.isEmpty()) {
|
|
if (prodVendorList.isEmpty()) {
|
|
@@ -287,7 +289,7 @@ class OrderApiServiceImpl implements OrderServiceI {
|
|
|
inventoryBill.setUpdateUser(userId.toString());
|
|
inventoryBill.setUpdateUser(userId.toString());
|
|
|
inventoryBill.setUpdateTime(orderTime);
|
|
inventoryBill.setUpdateTime(orderTime);
|
|
|
|
|
|
|
|
- cnt = prodInventoryBillMapper.insertProdInventoryBill(inventoryBill);
|
|
|
|
|
|
|
+ cnt = prodInventoryBillMapper.insertProdInventoryBill(inventoryBill);
|
|
|
if (cnt <= 0) {
|
|
if (cnt <= 0) {
|
|
|
log.error("创建订单失败");
|
|
log.error("创建订单失败");
|
|
|
throw new BusinessException("创建订单失败");
|
|
throw new BusinessException("创建订单失败");
|