This commit is contained in:
“wanyongkang”
2021-04-24 15:48:27 +08:00
parent 91a476850a
commit 70d4e9a6a3
3 changed files with 27 additions and 27 deletions

View File

@@ -422,7 +422,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
if (ret.Code != ResultCode.C_SUCCESS) return ret;
using (var tran = await m_DbContext.Database.BeginTransactionAsync())
using (var tran1 = await m_DbContext.Database.BeginTransactionAsync())
{
try
{
@@ -430,12 +430,12 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
await this.Add(order);
if (request.CouponId > 0)
await m_CouponService.Use(request.CouponId, order.OrderNo, userId, 1);
tran.Commit();
tran1.Commit();
}
catch (Exception ex)
{
LogHelper.Error("CreateOrder", ex.Message);
tran.Rollback();
tran1.Rollback();
return new ApiResult<ProductOrderEntity>(ResultCode.C_UNKNOWN_ERROR, "提交订单失败");
}
}
@@ -666,7 +666,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
};
accountEntitys.Add(accountEntity);
});
using (var tran = await m_DbContext.Database.BeginTransactionAsync())
using (var tran2 = await m_DbContext.Database.BeginTransactionAsync())
{
try
{
@@ -675,13 +675,13 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
order.StartTime = DateTime.Now;
order.EndTime = DateTime.Now.AddDays(order.DayCount);
await this.Update(order);
tran.Commit();
tran2.Commit();
}
catch (Exception ex)
{
LogHelper.Error("处理订单创建账号", ex);
isOk = false;
tran.Rollback();
tran2.Rollback();
}
}
if (isOk)
@@ -757,7 +757,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
account.ProductName = order.ProductName;
account.AccountType = (int)order.OrderType;
});
using (var tran = await m_DbContext.Database.BeginTransactionAsync())
using (var tran3 = await m_DbContext.Database.BeginTransactionAsync())
{
try
{
@@ -766,13 +766,13 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
order.StartTime = DateTime.Now;
order.EndTime = DateTime.Now.AddDays(order.DayCount);
await this.Update(order);
tran.Commit();
tran3.Commit();
}
catch (Exception ex)
{
LogHelper.Error("处理续费订单", ex);
isOk = false;
tran.Rollback();
tran3.Rollback();
}
}
if (isOk)