diff --git a/Src/Dlhis.External/OpenApi/Controllers/CanteenController.cs b/Src/Dlhis.External/OpenApi/Controllers/CanteenController.cs index c253cd15..7016ddc8 100644 --- a/Src/Dlhis.External/OpenApi/Controllers/CanteenController.cs +++ b/Src/Dlhis.External/OpenApi/Controllers/CanteenController.cs @@ -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 /// /// [HttpGet("eMealVoucher/records")] + [IgnoreTenant] public async Task> GetEMealVoucherRecordsAsync(string factory, [FromQuery] DateTimePeriod dateTimePeriods) { return await _dbContext.Queryable() @@ -50,4 +53,27 @@ public class CanteenController : ControllerBase }) .ToListAsync(); } + + /// + /// 余额明细 + /// + /// + /// + /// + [HttpGet("balance/records")] + [IgnoreTenant] + public async Task> GetBalanceRecordsAsync(string factory, DateTime time) + { + return await _dbContext.Queryable() + .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(); + } } \ No newline at end of file diff --git a/Src/Dlhis.External/OpenApi/Response/BalanceRecordResponse.cs b/Src/Dlhis.External/OpenApi/Response/BalanceRecordResponse.cs new file mode 100644 index 00000000..335afc79 --- /dev/null +++ b/Src/Dlhis.External/OpenApi/Response/BalanceRecordResponse.cs @@ -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; } +} \ No newline at end of file