mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:03:27 +08:00
【优化】调整运费计算逻辑为异步处理。
This commit is contained in:
@@ -600,7 +600,8 @@ namespace CoreCms.Net.Services
|
||||
else if (deliveryType == (int)GlobalEnumVars.OrderReceiptType.Logistics)
|
||||
{
|
||||
// 运费判断
|
||||
if (CartFreight(cartDto, areaId) == false)
|
||||
var blFreight = await CartFreight(cartDto, areaId);
|
||||
if (blFreight == false)
|
||||
{
|
||||
jm.data = cartDto;
|
||||
jm.msg = "运费判断";
|
||||
@@ -665,17 +666,18 @@ namespace CoreCms.Net.Services
|
||||
#endregion
|
||||
|
||||
#region 算运费
|
||||
|
||||
/// <summary>
|
||||
/// 算运费
|
||||
/// </summary>
|
||||
/// <param name="cartDto">购物车信息</param>
|
||||
/// <param name="areaId">收货地址id</param>
|
||||
/// <returns></returns>
|
||||
public bool CartFreight(CartDto cartDto, int areaId)
|
||||
public async Task<bool> CartFreight(CartDto cartDto, int areaId)
|
||||
{
|
||||
if (areaId > 0)
|
||||
{
|
||||
cartDto.costFreight = _shipServices.GetShipCost(areaId, cartDto.weight, cartDto.goodsAmount);
|
||||
cartDto.costFreight =await _shipServices.GetShipCost(areaId, cartDto.weight, cartDto.goodsAmount);
|
||||
cartDto.amount = Math.Round(cartDto.amount + cartDto.costFreight, 2);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user