|
|
@ -28717,18 +28717,23 @@ namespace TradeManageNew
|
|
|
|
var products = db.HW_GoodsInfo.Where(x => productIds.Contains(x.GoodsId)).Select(o => new
|
|
|
|
var products = db.HW_GoodsInfo.Where(x => productIds.Contains(x.GoodsId)).Select(o => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ProductId = o.GoodsId,
|
|
|
|
ProductId = o.GoodsId,
|
|
|
|
|
|
|
|
ProductName = o.GoodsName,
|
|
|
|
|
|
|
|
ProductEnName = o.GoodsEnglisgName,
|
|
|
|
o.FirstImgUrl
|
|
|
|
o.FirstImgUrl
|
|
|
|
}).ToList();
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var pageItem in page)
|
|
|
|
foreach (var pageItem in page)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var product = products.FirstOrDefault(x => x.ProductId == pageItem.ProductId);
|
|
|
|
|
|
|
|
|
|
|
|
var resultItem = new OrderUsedSalePlatformPageDto
|
|
|
|
var resultItem = new OrderUsedSalePlatformPageDto
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = pageItem.Id,
|
|
|
|
Id = pageItem.Id,
|
|
|
|
ProductId = pageItem.ProductId,
|
|
|
|
ProductId = pageItem.ProductId,
|
|
|
|
ProductCode = pageItem.ProductCode,
|
|
|
|
ProductCode = pageItem.ProductCode,
|
|
|
|
ProductImageUrl = products.FirstOrDefault(x => x.ProductId == pageItem.ProductId)
|
|
|
|
ProductImageUrl = product?.FirstImgUrl,
|
|
|
|
?.FirstImgUrl,
|
|
|
|
ProductName=product?.ProductName,
|
|
|
|
|
|
|
|
ProductEnName=product?.ProductEnName,
|
|
|
|
SkuId = pageItem.SkuId,
|
|
|
|
SkuId = pageItem.SkuId,
|
|
|
|
SkuCode = pageItem.SkuCode,
|
|
|
|
SkuCode = pageItem.SkuCode,
|
|
|
|
BarCode = pageItem.BarCode,
|
|
|
|
BarCode = pageItem.BarCode,
|
|
|
@ -28768,8 +28773,8 @@ namespace TradeManageNew
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var shopifyOrder = shopifyOrders.FirstOrDefault(x =>
|
|
|
|
var shopifyOrder = shopifyOrders.FirstOrDefault(x =>
|
|
|
|
x.Id == shopifyOrderItem.DtShopifyUsedSaleOrderId);
|
|
|
|
x.Id == shopifyOrderItem.DtShopifyUsedSaleOrderId);
|
|
|
|
|
|
|
|
|
|
|
|
var shopifyOrderDto =new ShopifyUsedSaleOrderInfoDto
|
|
|
|
var shopifyOrderDto = new ShopifyUsedSaleOrderInfoDto
|
|
|
|
{
|
|
|
|
{
|
|
|
|
OrderId = shopifyOrder?.OrderId,
|
|
|
|
OrderId = shopifyOrder?.OrderId,
|
|
|
|
OrderNumber = shopifyOrder?.OrderNumber,
|
|
|
|
OrderNumber = shopifyOrder?.OrderNumber,
|
|
|
@ -28791,6 +28796,7 @@ namespace TradeManageNew
|
|
|
|
Currency = shopifyOrder?.Currency,
|
|
|
|
Currency = shopifyOrder?.Currency,
|
|
|
|
TotalPrice = shopifyOrder?.TotalPrice,
|
|
|
|
TotalPrice = shopifyOrder?.TotalPrice,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
resultItem.ShopifyOrder = shopifyOrderDto;
|
|
|
|
resultItem.ShopifyOrder = shopifyOrderDto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -29579,6 +29585,36 @@ namespace TradeManageNew
|
|
|
|
Datas = null
|
|
|
|
Datas = null
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var getAddressTypeParameter = new FedexValidateAddressModel
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
addressesToValidate = new List<addressesToValidate>()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
new addressesToValidate
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
address = new validateAddress()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
streetLines = new[] { shopifyUsedSaleOrder.Full },
|
|
|
|
|
|
|
|
city = shopifyUsedSaleOrder.City,
|
|
|
|
|
|
|
|
stateOrProvinceCode = shopifyUsedSaleOrder.ProvinceCode,
|
|
|
|
|
|
|
|
countryCode = shopifyUsedSaleOrder.CountryCode,
|
|
|
|
|
|
|
|
postalCode = shopifyUsedSaleOrder.Zip,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
var addressType = GetValidateAddressJump(getAddressTypeParameter, out var getAddressTypeError);
|
|
|
|
|
|
|
|
if (addressType == null || !string.IsNullOrEmpty(getAddressTypeError))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return new APIReturnModel
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Code = 0,
|
|
|
|
|
|
|
|
Message = $"[{orderUsedSalePlatform.BarCode}]获取地址类型失败,请稍后再试",
|
|
|
|
|
|
|
|
Datas = null
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//是否住宅地址
|
|
|
|
|
|
|
|
bool isResidential = !(addressType.ToUpper() == "BUSINESS" || addressType.ToUpper() == "OFFICE");
|
|
|
|
|
|
|
|
|
|
|
|
//获取Fedex运费和面单
|
|
|
|
//获取Fedex运费和面单
|
|
|
|
var fedexCredential = new FedexCredential(isDebugMode: true) { ReadResponseAsString = true };
|
|
|
|
var fedexCredential = new FedexCredential(isDebugMode: true) { ReadResponseAsString = true };
|
|
|
@ -29652,7 +29688,7 @@ namespace TradeManageNew
|
|
|
|
StateOrProvinceCode = shopifyUsedSaleOrder.ProvinceCode,
|
|
|
|
StateOrProvinceCode = shopifyUsedSaleOrder.ProvinceCode,
|
|
|
|
PostalCode = shopifyUsedSaleOrder.Zip,
|
|
|
|
PostalCode = shopifyUsedSaleOrder.Zip,
|
|
|
|
CountryCode = shopifyUsedSaleOrder.CountryCode,
|
|
|
|
CountryCode = shopifyUsedSaleOrder.CountryCode,
|
|
|
|
Residential = null
|
|
|
|
Residential = isResidential
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Contact = new PartyContact
|
|
|
|
Contact = new PartyContact
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -29716,6 +29752,17 @@ namespace TradeManageNew
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var apiRequestInfo = new StringBuilder();
|
|
|
|
var apiRequestInfo = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//住宅地址无法获取Fedex_GROUND渠道 商业地址无法获取Fedex_HOME_DELIVERY
|
|
|
|
|
|
|
|
if (isResidential && serviceType == RequestedShipmentServiceType.FEDEX_GROUND)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isResidential && serviceType == RequestedShipmentServiceType.GROUND_HOME_DELIVERY)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//判断地址类型来跳过部分服务并且收获地址添加是否住宅
|
|
|
|
//判断地址类型来跳过部分服务并且收获地址添加是否住宅
|
|
|
@ -29814,6 +29861,38 @@ namespace TradeManageNew
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string GetValidateAddressJump(FedexValidateAddressModel model, out string msg)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var path = EncryptString(JsonConvert.SerializeObject(model), "ThisIsShopifyKey12365498");
|
|
|
|
|
|
|
|
var path2 = HttpUtility.UrlEncode(path);
|
|
|
|
|
|
|
|
var url = "http://50.196.110.198:8099" + "/api/FedexHelp/getValidateAddress?address=" + path2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using (WebClient client = new WebClient())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string responseContent = client.DownloadString(url);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(responseContent) || responseContent.Contains("Fail"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
msg = responseContent;
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
msg = "";
|
|
|
|
|
|
|
|
var rmodel = JsonConvert.DeserializeObject<FedexValidateAddressReturnModel>(responseContent);
|
|
|
|
|
|
|
|
return rmodel.output.resolvedAddresses[0].classification;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
msg = "失败";
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|