fix 作废明细增加权限控制
This commit is contained in:
@@ -90,6 +90,7 @@ public class BalancesController : ControllerBase
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Authorize(Roles = "admin,tenant-admin")]
|
||||
[HttpPost("obsoluteOutRecord")]
|
||||
[Transactional]
|
||||
public async Task ObsoluteAsync(BalanceRecordObsoluteRequest request)
|
||||
|
||||
@@ -1,35 +1,34 @@
|
||||
namespace Dlhis.Canteen.Order.Response
|
||||
namespace Dlhis.Canteen.Order.Response;
|
||||
|
||||
public class BalanceRecordAnalysisRespones
|
||||
{
|
||||
public class BalanceRecordAnalysisRespones
|
||||
{
|
||||
/// <summary>
|
||||
/// 消费日期
|
||||
/// </summary>
|
||||
public DateOnly CostDate { get; set; }
|
||||
/// <summary>
|
||||
/// 消费日期
|
||||
/// </summary>
|
||||
public DateOnly CostDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 早餐人数
|
||||
/// </summary>
|
||||
public int BreakfastNumberOfPeople { get; set; }
|
||||
/// <summary>
|
||||
/// 早餐人数
|
||||
/// </summary>
|
||||
public int BreakfastNumberOfPeople { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 午餐人数
|
||||
/// </summary>
|
||||
public int LunchNumberOfPeople { get; set; }
|
||||
/// <summary>
|
||||
/// 午餐人数
|
||||
/// </summary>
|
||||
public int LunchNumberOfPeople { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 晚餐人数
|
||||
/// </summary>
|
||||
public int DinnerNumberOfPeople { get; set; }
|
||||
/// <summary>
|
||||
/// 晚餐人数
|
||||
/// </summary>
|
||||
public int DinnerNumberOfPeople { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 宵夜人数
|
||||
/// </summary>
|
||||
public int LateNightNumberOfPeople { get; set; }
|
||||
/// <summary>
|
||||
/// 宵夜人数
|
||||
/// </summary>
|
||||
public int LateNightNumberOfPeople { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 总人数
|
||||
/// </summary>
|
||||
public int TotalNumberOfPeople { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 总人数
|
||||
/// </summary>
|
||||
public int TotalNumberOfPeople { get; set; }
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ public class BalanceService : IBalanceService
|
||||
TenantId = record.TenantId,
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
|
||||
page.Data.ForEach(item =>
|
||||
{
|
||||
item.Amount = Math.Abs(item.Amount);
|
||||
@@ -414,7 +415,7 @@ public class BalanceService : IBalanceService
|
||||
//每个餐次人数
|
||||
BreakfastNumberOfPeople = first.Where(x => x.ShiftType == ShiftEnumType.Breakfast).Select(x => x.UserNo).Distinct().Count(),
|
||||
LunchNumberOfPeople = first.Where(x => x.ShiftType == ShiftEnumType.Lunch).Select(x => x.UserNo).Distinct().Count(),
|
||||
DinnerNumberOfPeople = first.Where(x => x.ShiftType == ShiftEnumType.Lunch).Select(x => x.UserNo).Distinct().Count(),
|
||||
DinnerNumberOfPeople = first.Where(x => x.ShiftType == ShiftEnumType.Dinner).Select(x => x.UserNo).Distinct().Count(),
|
||||
LateNightNumberOfPeople = first.Where(x => x.ShiftType == ShiftEnumType.Nightsnack).Select(x => x.UserNo).Distinct().Count(),
|
||||
|
||||
TotalNumberOfPeople = first.Where(x => x.CostDate.ToString("yyyy-MM-dd") == first.Key).Select(x => x.UserNo).Distinct().Count()
|
||||
@@ -532,7 +533,7 @@ public class BalanceService : IBalanceService
|
||||
.Select((record, ga, department, bplace) => new BalanceRecordUserPageResponse
|
||||
{
|
||||
Id = record.Id,
|
||||
CurrentAmount = record.Amount,
|
||||
CurrentAmount = SqlFunc.Abs(record.Amount),
|
||||
Source = record.Source,
|
||||
No = record.No,
|
||||
BusinessPlaceName = bplace.Name,
|
||||
@@ -549,6 +550,7 @@ public class BalanceService : IBalanceService
|
||||
var monthSum = await _dbContext.Queryable<BalanceRecordEntity>()
|
||||
.Where(x => x.CostDateTime >= monthStart && x.CostDateTime <= monthEnd)
|
||||
.Where(x => x.Type == BalanceRecordTypeEnumType.Out)
|
||||
.Where(x => x.Status == BalanceRecordStatusEnumType.Valid)
|
||||
.Where(x => x.UserCode == jinkoCode)
|
||||
.SumAsync(x => SqlFunc.Abs(x.Amount));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user