|
|
@ -10,6 +10,7 @@ using Newtonsoft.Json.Linq; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq.Expressions; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
@ -195,6 +196,7 @@ namespace BBWY.Server.Business |
|
|
|
var orderDropShipping = new OrderDropShipping() |
|
|
|
{ |
|
|
|
OrderId = createOnlinePurchaseOrderRequest.OrderId, |
|
|
|
PurchaseAccountId = createOnlinePurchaseOrderRequest.PurchaseAccountId, |
|
|
|
BuyerAccount = createOnlinePurchaseOrderRequest.BuyerAccount, |
|
|
|
SellerAccount = createOnlinePurchaseOrderRequest.SellerAccount, |
|
|
|
CreateTime = DateTime.Now, |
|
|
@ -251,8 +253,11 @@ namespace BBWY.Server.Business |
|
|
|
|
|
|
|
#region 查询采购账号
|
|
|
|
currentProgress = "查询采购账号"; |
|
|
|
var purchaseAccount = fsql.Select<PurchaseAccount>().Where(pa => pa.AccountName == orderDropshipping.BuyerAccount && |
|
|
|
pa.PurchasePlatformId == callbackPlatform).ToOne(); |
|
|
|
var purchaseAccountExp = orderDropshipping.PurchaseAccountId != 0 ? |
|
|
|
new Func<PurchaseAccount, bool>(pa => pa.Id == orderDropshipping.PurchaseAccountId) : |
|
|
|
new Func<PurchaseAccount, bool>(pa => pa.AccountName == orderDropshipping.BuyerAccount); |
|
|
|
var purchaseAccount = fsql.Select<PurchaseAccount>().Where(pa => purchaseAccountExp(pa)) |
|
|
|
.Where(pa => pa.PurchasePlatformId == callbackPlatform).ToOne(); |
|
|
|
if (purchaseAccount == null) |
|
|
|
throw new Exception($"未查询到采购账号{orderDropshipping.BuyerAccount}"); |
|
|
|
#endregion
|
|
|
|