diff --git a/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs b/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs index 6ffc95a7..6a3488fa 100644 --- a/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs +++ b/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs @@ -1,5 +1,7 @@ using Dlhis.Entity.Basic.Enums; using Kurisu.AspNetCore.Utils.Extensions; +using SqlSugar; +using System.ComponentModel.DataAnnotations; namespace Dlhis.Basic.Organization.Response; @@ -25,6 +27,11 @@ public class GainfoDetailResponse /// public string Code { get; set; } + /// + /// 部门 + /// + public string DepartmentNo { get; set; } + /// /// 部门名称 /// @@ -121,5 +128,23 @@ public class GainfoDetailResponse /// public string Face { get; set; } + /// + /// 在职状态 + /// + public string Status { get; set; } + /// + /// 厂区 + /// + public string Factory { get; set; } + + /// + /// 厂区名称 + /// + public string FactoryName { get; set; } + + /// + /// 入职日期 + /// + public DateTime OnboardingDate { get; set; } } diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index 4b61a811..089e6d40 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -28,6 +28,7 @@ public class GainfoService : IGainfoService private readonly IServiceProvider _serviceProvider; private readonly IConfiguration _configuration; private readonly ILogger _logger; + private readonly IDepartmentService _departmentService; public GainfoService(IGainfoStore gainfoStore, IDbContext dbContext, @@ -36,7 +37,8 @@ public class GainfoService : IGainfoService RedisCache redisCache, IServiceProvider serviceProvider, IConfiguration configuration, - ILogger logger) + ILogger logger, + IDepartmentService departmentService = null) { _gainfoStore = gainfoStore; _dbContext = dbContext; @@ -46,6 +48,7 @@ public class GainfoService : IGainfoService _serviceProvider = serviceProvider; _configuration = configuration; _logger = logger; + _departmentService = departmentService; } /// @@ -420,8 +423,17 @@ public class GainfoService : IGainfoService CountryName = type2.Display, NationName = type3.Display, ClassName = type4.Display, + Factory = ga.Factory, + OnboardingDate = ga.CreateTime, }) .FirstAsync(); + info.Status = request.Status.GetDescription(); + var trees = await _departmentService.GetTreeAsync(); + var res = trees.First(x => x.No == info.Factory); + if (res != null) + { + info.FactoryName = res.Name; + } if (info != null) { diff --git a/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs b/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs index 9dd25f9d..1602bfe9 100644 --- a/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs +++ b/Src/Dlhis.Canteen/Order/Services/Implements/BalanceService.cs @@ -158,7 +158,7 @@ public class BalanceService : IBalanceService obj.LateNightPrice = LateNightNumberOfPeople == 0 ? 0 : Math.Round(obj.LateNightAmount / LateNightNumberOfPeople, 2); // 总人数 总金额 - obj.TotalNumberOfPeople = obj.BreakfastNumberOfPeople + obj.LunchNumberOfPeople + obj.DinnerNumberOfPeople + obj.LateNightNumberOfPeople; + obj.TotalNumberOfPeople = costIdGroup.Select(x => x.UserNo).Distinct().Count(); obj.TotalAmount = obj.BreakfastAmount + obj.LunchAmount + obj.DinnerAmount + obj.LateNightAmount; lst.Add(obj); @@ -292,7 +292,7 @@ public class BalanceService : IBalanceService obj.LateNightPrice = LateNightNumberOfPeople == 0 ? 0 : Math.Round(obj.LateNightAmount / LateNightNumberOfPeople, 2); // 总人数 总金额 - obj.TotalNumberOfPeople = obj.BreakfastNumberOfPeople + obj.LunchNumberOfPeople + obj.DinnerNumberOfPeople + obj.LateNightNumberOfPeople; + obj.TotalNumberOfPeople = departmentGroup.Select(x => x.UserNo).Distinct().Count(); obj.TotalAmount = obj.BreakfastAmount + obj.LunchAmount + obj.DinnerAmount + obj.LateNightAmount; lst.Add(obj); } @@ -372,7 +372,7 @@ public class BalanceService : IBalanceService obj.LateNightPrice = LateNightNumberOfPeople == 0 ? 0 : Math.Round(obj.LateNightAmount / LateNightNumberOfPeople, 2); // 总人数 总金额 - obj.TotalNumberOfPeople = obj.BreakfastNumberOfPeople + obj.LunchNumberOfPeople + obj.DinnerNumberOfPeople + obj.LateNightNumberOfPeople; + obj.TotalNumberOfPeople = originTenantIdGroup.Select(x => x.UserNo).Distinct().Count(); obj.TotalAmount = obj.BreakfastAmount + obj.LunchAmount + obj.DinnerAmount + obj.LateNightAmount; lst.Add(obj); } @@ -421,7 +421,9 @@ public class BalanceService : IBalanceService obj.LunchNumberOfPeople = first.Where(x => x.ShiftType == shiftCodeDict["Lunch"]).Select(x => x.UserNo).Distinct().Count(); obj.DinnerNumberOfPeople = first.Where(x => x.ShiftType == shiftCodeDict["Dinner"]).Select(x => x.UserNo).Distinct().Count(); obj.LateNightNumberOfPeople = first.Where(x => x.ShiftType == shiftCodeDict["LateNight"]).Select(x => x.UserNo).Distinct().Count(); - obj.TotalNumberOfPeople = obj.BreakfastNumberOfPeople + obj.LunchNumberOfPeople + obj.DinnerNumberOfPeople + obj.LateNightNumberOfPeople; + + obj.TotalNumberOfPeople = first.Where(x => x.CostDate.ToString("yyyy-MM-dd") == first.Key).Select(x => x.UserNo).Distinct().Count(); + lst.Add(obj); } // 分页操作