fix merge error
This commit is contained in:
@@ -90,31 +90,6 @@ public class OrdersController : ControllerBase
|
||||
}
|
||||
|
||||
//************************************************************** 订餐功能 **********************************************************************************
|
||||
/// <summary>
|
||||
/// 订单聚合数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("aggregation")]
|
||||
[IgnoreTenant]
|
||||
public async Task<Pagination<OrderAggregationResponse>> GetOrdersAggregationAsync([FromQuery] PageDto page)
|
||||
{
|
||||
return await _orderService.GetOrdersAggregationAsync(page);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取消订单
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("user-cancel")]
|
||||
[Transactional]
|
||||
[IgnoreTenant]
|
||||
public async Task CancelOrderAsync(OrderCancelRequest request)
|
||||
{
|
||||
await _bookingOrderService.UserCancelOrderAsync(request);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 取消订单
|
||||
@@ -129,8 +104,6 @@ public class OrdersController : ControllerBase
|
||||
return await _bookingOrderService.BookingAsync(request);
|
||||
}
|
||||
|
||||
//************************************************************** 订餐功能 **********************************************************************************
|
||||
|
||||
/// <summary>
|
||||
/// 订单分页
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
namespace Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
|
||||
namespace Dlhis.Canteen.Order.Response;
|
||||
|
||||
@@ -12,41 +13,41 @@ public class BalanceRecordByUserResponse
|
||||
/// <summary>
|
||||
/// 金额
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 学工号
|
||||
/// </summary>
|
||||
public string UserCode { get; set; }
|
||||
/// <summary>
|
||||
/// 学工号
|
||||
/// </summary>
|
||||
public string UserCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门号
|
||||
/// </summary>
|
||||
public string DepartmentNo { get; set; }
|
||||
/// <summary>
|
||||
/// 部门号
|
||||
/// </summary>
|
||||
public string DepartmentNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源
|
||||
/// </summary>
|
||||
public BalanceRecordSourceEnumType Source { get; set; }
|
||||
/// <summary>
|
||||
/// 来源
|
||||
/// </summary>
|
||||
public BalanceRecordSourceEnumType Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源CN
|
||||
/// </summary>
|
||||
public string SourceCN => Source.GetDescription();
|
||||
/// <summary>
|
||||
/// 来源CN
|
||||
/// </summary>
|
||||
public string SourceCN => Source.GetDescription();
|
||||
|
||||
/// <summary>
|
||||
/// 收入/支出
|
||||
/// </summary>
|
||||
public BalanceRecordTypeEnumType Type { get; set; }
|
||||
/// <summary>
|
||||
/// 收入/支出
|
||||
/// </summary>
|
||||
public BalanceRecordTypeEnumType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 收入/支出
|
||||
/// </summary>
|
||||
public string TypeCN => Type.GetDescription();
|
||||
/// <summary>
|
||||
/// 收入/支出
|
||||
/// </summary>
|
||||
public string TypeCN => Type.GetDescription();
|
||||
|
||||
/// <summary>
|
||||
/// 金额 + - 表示
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// 金额 + - 表示
|
||||
/// </summary>
|
||||
public decimal Amount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -297,37 +297,6 @@ public class BookingOrderService : BaseOrderService, IBookingOrderService
|
||||
}, 5);
|
||||
}
|
||||
|
||||
var balance = await DbContext.Queryable<BalanceRecordEntity>().Where(x => x.No == request.No).SingleAsync();
|
||||
await DbContext.Updateable<BalanceRecordEntity>()
|
||||
.SetColumns(x => x.Status == BalanceRecordStatusEnumType.Obsolute)
|
||||
.SetColumns(x => x.Remark == request.Reason)
|
||||
.SetColumns(x => x.ModifiedTime == now)
|
||||
.SetColumns(x => x.ModifiedBy == userId)
|
||||
.Where(x => x.No == request.No)
|
||||
.ExecuteCommandAsync();
|
||||
|
||||
var amount = Math.Abs(order.Amount);
|
||||
|
||||
//尝试5次
|
||||
await ContinueUpdateAsync(async () =>
|
||||
{
|
||||
var mealInfo = await DbContext.Queryable<GainfoMealEntity>().Where(x => x.UserNo == order.UserNo).FirstAsync();
|
||||
|
||||
var effect = await DbContext.Updateable<GainfoMealEntity>()
|
||||
.SetColumns(x => x.Balance == x.Balance + amount)
|
||||
.SetColumns(x => x.ModifiedTime == now)
|
||||
.SetColumns(x => x.ModifiedBy == userId)
|
||||
.Where(x => x.Id == mealInfo.Id && x.Version == mealInfo.Version)
|
||||
.ExecuteCommandAsync();
|
||||
|
||||
if (effect <= 0)
|
||||
{
|
||||
throw new VersionExceptions("取消订单失败!");
|
||||
}
|
||||
|
||||
}, 5);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 检查我的订餐是否存在,存在抛出异常
|
||||
|
||||
Reference in New Issue
Block a user