feat 钱包和钱包余额查询
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using Dlhis.Canteen.Setting.Response;
|
||||
using Dlhis.Entity.Canteen.Entities;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Services;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Canteen.Setting.Services.Implements;
|
||||
|
||||
public class WalletService : IWalletService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public WalletService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<WalletResponse>> GetListAsync()
|
||||
{
|
||||
return await _dbContext.Queryable<WalletEntity>()
|
||||
.GroupBy(x => new { x.Code, x.Name })
|
||||
.Select(x => new WalletResponse
|
||||
{
|
||||
Code = x.Code,
|
||||
Name = x.Name,
|
||||
Factories = SqlFunc.Subqueryable<WalletEntity>().Where(p => p.Code == x.Code).ToList(p => p.Factory)
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user