fix 补充部门名称

This commit is contained in:
2024-04-07 19:52:55 +08:00
parent 9ce6e3b5e8
commit 90c070e0e2
2 changed files with 7 additions and 2 deletions

View File

@@ -30,5 +30,8 @@ public class MealUserResponse
/// </summary>
public decimal BalanceOfSubsidies { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DepartmentName { get; set; }
}

View File

@@ -5,6 +5,7 @@ using Kurisu.Core.DataAccess.Dto;
using Kurisu.Core.User.Abstractions;
using Kurisu.SqlSugar.Extensions;
using Kurisu.SqlSugar.Services;
using Microsoft.CodeAnalysis;
namespace Dlhis.Basic.MealUser.Services.Implements;
@@ -25,9 +26,10 @@ public class MealUserService : IMealUserService
var page = await _dbContext.Queryable<GainfoEntity>()
.LeftJoin<GainfoMealEntity>((x, meal) => x.Code == meal.UserCode)
.LeftJoin<DepartmentEntity>((x, meal, dept) => dept.No == x.DepartmentNo)
.WhereIF(request.Search.IsPresent(), (x, meal) => x.Code == request.Search || x.Name == request.Search)
.Where(x => x.Factory == tenantId)
.Select((x, meal) => new MealUserResponse
.Select((x, meal, dept) => new MealUserResponse
{
Balance = meal.Balance,
BalanceOfRecharge = meal.BalanceOfRecharge,