Browse Source

自动出库查询采购账号增加店铺Id条件

qianyi
shanji 3 years ago
parent
commit
2cf157af9a
  1. 1
      BBWY.Server.Business/Order/OrderBusiness.cs
  2. 20
      BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs
  3. 5
      BBWY.Server.Model/Db/Order/OrderDropShipping.cs

1
BBWY.Server.Business/Order/OrderBusiness.cs

@ -709,6 +709,7 @@ namespace BBWY.Server.Business
else
{
orderDropShipping.CreateTime = DateTime.Now;
orderDropShipping.ShopId = dbOrder.ShopId;
insertOrderDropShipping = fsql.Insert(orderDropShipping);
}

20
BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs

@ -382,7 +382,8 @@ namespace BBWY.Server.Business
SkuAmount = purchaseOrderSimpleInfo.ProductAmount,
PurchaseFreight = purchaseOrderSimpleInfo.FreightAmount,
PurchaseOrderId = createOrderResponse.PurchaseOrderId,
PurchasePlatform = createOnlinePurchaseOrderRequest.Platform
PurchasePlatform = createOnlinePurchaseOrderRequest.Platform,
ShopId = dbOrder.ShopId
};
insertOrderDropShipping = fsql.Insert(orderDropShipping);
#endregion
@ -455,6 +456,7 @@ namespace BBWY.Server.Business
string logisticsCompanyListInfo = string.Empty;
string logisticsCompanyId = string.Empty;
string orderId = string.Empty;
long? shopId = null;
OutStockRequest outStockRequest = null;
try
{
@ -466,11 +468,25 @@ namespace BBWY.Server.Business
orderId = orderDropshipping.OrderId;
#endregion
#region 查询订单
if (orderDropshipping.ShopId == null)
{
var order = fsql.Select<Order>(orderId).ToOne();
if (order == null)
throw new Exception("未查询到订单");
shopId = order.ShopId;
}
else
{
shopId = orderDropshipping.ShopId.Value;
}
#endregion
#region 查询采购账号
currentProgress = "查询采购账号";
var purchaseAccount = fsql.Select<PurchaseAccount>().WhereIf(orderDropshipping.PurchaseAccountId != 0, pa => pa.Id == orderDropshipping.PurchaseAccountId)
.WhereIf(orderDropshipping.PurchaseAccountId == 0, pa => pa.AccountName == orderDropshipping.BuyerAccount)
.Where(pa => pa.PurchasePlatformId == callbackPlatform).ToOne();
.Where(pa => pa.PurchasePlatformId == callbackPlatform && pa.ShopId == shopId.Value).ToOne();
if (purchaseAccount == null)
throw new Exception($"未查询到采购账号{orderDropshipping.BuyerAccount}");
#endregion

5
BBWY.Server.Model/Db/Order/OrderDropShipping.cs

@ -70,7 +70,10 @@ namespace BBWY.Server.Model.Db
[Column(StringLength = 200)]
public string SellerAccount { get; set; }
/// <summary>
/// 商家Id
/// </summary>
public long? ShopId { get; set; }
}

Loading…
Cancel
Save