fix merge error
This commit is contained in:
@@ -34,19 +34,6 @@ public class DishesCategoriesController : ControllerBase
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取分类树(无权限)
|
||||
/// </summary>
|
||||
/// <param name="businessPlaceCode"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("tree-all")]
|
||||
[IgnoreTenant]
|
||||
public async Task<List<DishesCategoryTreeResponse>> TreeAllAsync(Guid businessPlaceCode)
|
||||
{
|
||||
return await _dishesCategoryService.TreeAllAsync(businessPlaceCode);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取分类树(无权限)
|
||||
/// </summary>
|
||||
|
||||
@@ -52,23 +52,7 @@ public class DishesMenusController : ControllerBase
|
||||
return await _dishesMenuService.GetDishesMenuDetailAsync(businessPlaceCode, customCode, startDate, endDate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据参数获取菜品
|
||||
/// </summary>
|
||||
/// <param name="businessPlaceCode"></param>
|
||||
/// <param name="date"></param>
|
||||
/// <param name="shiftType"></param>
|
||||
/// <param name="categoryCode"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("dishes-selections")]
|
||||
[IgnoreTenant]
|
||||
public async Task<List<DishesDetailResponse>> GetDishesUnderCurrentMenuAsync(Guid businessPlaceCode,
|
||||
DateTime date,
|
||||
ShiftEnumType? shiftType,
|
||||
Guid categoryCode)
|
||||
{
|
||||
return await _dishesMenuService.GetDishesUnderCurrentMenuAsync(businessPlaceCode, date, shiftType, categoryCode);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据参数获取菜品
|
||||
|
||||
@@ -127,30 +127,6 @@ public class DishesCategoryService : IDishesCategoryService
|
||||
private async Task<List<Guid>> GetMyBusinessPlaceCodesAsync()
|
||||
{
|
||||
var mybCodes = (await _businessPlacePermissionsService.GetMyAsync()).Select(x => x.Code).ToList();
|
||||
|
||||
return mybCodes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查营业点权限
|
||||
/// </summary>
|
||||
/// <param name="businessPlaceCode"></param>
|
||||
/// <returns></returns>
|
||||
private async Task CheckBusinessPlacePermissionAsync(Guid businessPlaceCode)
|
||||
{
|
||||
var codes = await GetMyBusinessPlaceCodesAsync();
|
||||
codes.Contains(businessPlaceCode).ThrowIfFalse("无权操作当前营业点");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取我管理的营业点
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task<List<Guid>> GetMyBusinessPlaceCodesAsync()
|
||||
{
|
||||
var mybCodes = (await _businessPlacePermissionsService.GetMyAsync()).Select(x => x.Code).ToList();
|
||||
|
||||
return mybCodes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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