feat 余额明细
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
using Dlhis.External.OpenApi.Response;
|
||||
using Kurisu.AspNetCore.CustomClass;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -27,6 +29,7 @@ public class CanteenController : ControllerBase
|
||||
/// <param name="dateTimePeriods"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("eMealVoucher/records")]
|
||||
[IgnoreTenant]
|
||||
public async Task<List<EMealVoucherRecordResponse>> GetEMealVoucherRecordsAsync(string factory, [FromQuery] DateTimePeriod dateTimePeriods)
|
||||
{
|
||||
return await _dbContext.Queryable<EMealVoucherEntity>()
|
||||
@@ -50,4 +53,27 @@ public class CanteenController : ControllerBase
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 余额明细
|
||||
/// </summary>
|
||||
/// <param name="factory"></param>
|
||||
/// <param name="time"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("balance/records")]
|
||||
[IgnoreTenant]
|
||||
public async Task<List<BalanceRecordResponse>> GetBalanceRecordsAsync(string factory, DateTime time)
|
||||
{
|
||||
return await _dbContext.Queryable<BalanceRecordEntity>()
|
||||
.Where(x => x.CostDateTime == time && x.TenantId == factory && x.Status == BalanceRecordStatusEnumType.Valid)
|
||||
.Select(x => new BalanceRecordResponse
|
||||
{
|
||||
UserCode = x.UserCode,
|
||||
CostDateTime = x.CostDateTime,
|
||||
Amount = x.Amount,
|
||||
Type = x.Type,
|
||||
Remark = x.Remark
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
16
Src/Dlhis.External/OpenApi/Response/BalanceRecordResponse.cs
Normal file
16
Src/Dlhis.External/OpenApi/Response/BalanceRecordResponse.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Dlhis.Entity.Canteen.Enums;
|
||||
|
||||
namespace Dlhis.External.OpenApi.Response;
|
||||
|
||||
public class BalanceRecordResponse
|
||||
{
|
||||
public string UserCode { get; set; }
|
||||
|
||||
public DateTime CostDateTime { get; set; }
|
||||
|
||||
public decimal Amount { get; set; }
|
||||
|
||||
public BalanceRecordTypeEnumType Type { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user