master
wufan 2 months ago
parent 19f9dfc849
commit 6c17b35598

@ -28927,10 +28927,10 @@ namespace TradeManageNew
{
Return_quantity = 1,
ImgUrl = imageUrls.Count > 0 ? imageUrls[0] : null,
ImgUrl2 = imageUrls.Count > 0 ? imageUrls[0] : null,
ImgUrl3 = imageUrls.Count > 0 ? imageUrls[0] : null,
ImgUrl4 = imageUrls.Count > 0 ? imageUrls[0] : null,
ImgUrl5 = imageUrls.Count > 0 ? imageUrls[0] : null,
ImgUrl2 = imageUrls.Count > 1 ? imageUrls[1] : null,
ImgUrl3 = imageUrls.Count > 2 ? imageUrls[2] : null,
ImgUrl4 = imageUrls.Count > 3 ? imageUrls[3] : null,
ImgUrl5 = imageUrls.Count > 4 ? imageUrls[4] : null,
StoreName = orderUsedSalePlatform.WarehouseLocation ==
TradeUsedSale.Enums.WarehouseLocation.East
? "E"
@ -29026,11 +29026,16 @@ namespace TradeManageNew
PaymentMethod = originJsonData.Financial.PaymentMethod,
FinancialStatus = originJsonData.Financial.FinancialStatus,
RefundedAmount = originJsonData.Financial.RefundedAmount,
OriginJson = originJson
OriginJson = originJson,
IsPlaceOrderSuccess = false
};
var dtShopifyUsedSaleOrderId = db.InsertWithInt32Identity(newDtShopifyUsedSaleOrder);
db.BeginTransaction();
try
{
foreach (var item in originJsonData.Items)
{
var newDtShopifyUsedSaleOrderItem =
@ -29051,6 +29056,45 @@ namespace TradeManageNew
};
db.InsertWithInt32Identity(newDtShopifyUsedSaleOrderItem);
var statement = db.DT_OrderUsedSalePlatform.Where(x => x.BarCode == item.ProductCode)
.Set(x => x.Status, TradeUsedSale.Enums.UsedSalePlatformStatus.PendingPickup);
if (item.ShippingMethod == "SP")
{
statement = statement.Set(x => x.ShippingMethod, TradeUsedSale.Enums.ShippingMethod.SelfPickup);
}
if (item.ShippingMethod == "DL")
{
statement = statement.Set(x => x.ShippingMethod, TradeUsedSale.Enums.ShippingMethod.ExpressDelivery);
}
statement.Update();
//Shopify客户端
//删除产品变体
// var shopifyApiClient = new ShopifyAPIClient();
// var productVariantRes = shopifyApiClient.DeleteProductVariantAsync().ConfigureAwait(false)
// .GetAwaiter()
// .GetResult();
db.DT_ShopifyUsedSaleOrder.Where(x => x.Id == dtShopifyUsedSaleOrderId)
.Set(x => x.IsPlaceOrderSuccess, true)
.Set(x => x.PlaceOrderMessage, "更新二手订单信息成功")
.Update();
}
db.CommitTransaction();
}
catch (Exception ex)
{
db.RollbackTransaction();
db.DT_ShopifyUsedSaleOrder.Where(x => x.Id == dtShopifyUsedSaleOrderId)
.Set(x => x.PlaceOrderMessage, $"更新二手订单信息失败,原因:{ex.Message}")
.Update();
}
}

@ -96,5 +96,15 @@ namespace TradeUsedSale.Repositories.Models
/// 原始Json
/// </summary>
public string OriginJson { get; set; }
/// <summary>
/// 是否同步下单信息成功
/// </summary>
public bool IsPlaceOrderSuccess { get; set; }
/// <summary>
/// 下单同步信息
/// </summary>
public string PlaceOrderMessage { get; set; }
}
}
Loading…
Cancel
Save