From dd44750a973d3e67c690d5489723c695ed1d09ca Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 27 Feb 2024 18:25:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=A1=A3=E6=A1=88=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BA=BA=E8=84=B8base64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/GainfosController.cs | 6 +- .../Request/GainfoDetailRequest.cs | 38 ++-- .../Response/GainfoDetailResponse.cs | 175 +++++++++--------- .../Organization/Services/IGainfoService.cs | 4 +- .../Services/Implements/GainfoService.cs | 14 +- 5 files changed, 124 insertions(+), 113 deletions(-) diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs index 435e51c5..e51d85a5 100644 --- a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs +++ b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs @@ -154,7 +154,7 @@ public class GainfosController : ControllerBase [HttpGet("list")] public async Task> GetGainfoListTaskAsync([FromQuery] GainfoListRequest request) { - return await _gainfoService.GetGainfoListTaskAsync(request); + return await _gainfoService.GetGainfoListAsync(request); } /// @@ -163,9 +163,9 @@ public class GainfosController : ControllerBase /// /// [HttpGet("detail")] - public async Task GetGainfoDetailTaskAsync([FromQuery] GainfoDetailRequest request) + public async Task GetGainfoDetailAsync([FromQuery] GainfoDetailRequest request) { - return await _gainfoService.GetGainfoDetailTaskAsync(request); + return await _gainfoService.GetGainfoDetailAsync(request); } } diff --git a/Src/Dlhis.Basic/Organization/Request/GainfoDetailRequest.cs b/Src/Dlhis.Basic/Organization/Request/GainfoDetailRequest.cs index dde7384a..8de96bae 100644 --- a/Src/Dlhis.Basic/Organization/Request/GainfoDetailRequest.cs +++ b/Src/Dlhis.Basic/Organization/Request/GainfoDetailRequest.cs @@ -1,23 +1,25 @@ using Dlhis.Entity.Basic.Enums; -using Kurisu.Core.DataAccess.Dto; -using SqlSugar; using System.ComponentModel.DataAnnotations; -namespace Dlhis.Basic.Organization.Request -{ - public class GainfoDetailRequest : PageDto - { - /// - /// 档案类型 - /// - [Required] - [EnumDataType(typeof(GainfoStatusEnumType))] - public GainfoStatusEnumType Status { get; set; } +namespace Dlhis.Basic.Organization.Request; - /// - /// 档案号 - /// - [Required] - public string No { get; set; } - } +public class GainfoDetailRequest +{ + /// + /// 档案类型 + /// + [Required] + [EnumDataType(typeof(GainfoStatusEnumType))] + public GainfoStatusEnumType Status { get; set; } + + /// + /// 档案号 + /// + [Required] + public string No { get; set; } + + /// + /// 是否需要人脸信息 + /// + public bool WithFace { get; set; } } diff --git a/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs b/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs index 565d53dc..88f70f3f 100644 --- a/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs +++ b/Src/Dlhis.Basic/Organization/Response/GainfoDetailResponse.cs @@ -1,109 +1,112 @@ using Dlhis.Entity.Basic.Enums; -using SqlSugar; -using SqlSugar.DbConvert; -namespace Dlhis.Basic.Organization.Response +namespace Dlhis.Basic.Organization.Response; + +public class GainfoDetailResponse { - public class GainfoDetailResponse - { - /// - /// 档案号 - /// - public string No { get; set; } + /// + /// 档案号 + /// + public string No { get; set; } - /// - /// SAP内部编号 - /// - public string SapNo { get; set; } + /// + /// SAP内部编号 + /// + public string SapNo { get; set; } - /// - /// 姓名 - /// - public string Name { get; set; } + /// + /// 姓名 + /// + public string Name { get; set; } - /// - /// 学工号 - /// - public string Code { get; set; } + /// + /// 学工号 + /// + public string Code { get; set; } - /// - /// 部门名称 - /// - public string DepartmentName { get; set; } + /// + /// 部门名称 + /// + public string DepartmentName { get; set; } - /// - /// 证件类型代码 - /// - public string IdClass { get; set; } + /// + /// 证件类型代码 + /// + public string IdClass { get; set; } - /// - /// 身份证号 - /// - public string IdNo { get; set; } + /// + /// 身份证号 + /// + public string IdNo { get; set; } - /// - /// 性别 - /// - public GenderEnumType Gender { get; set; } + /// + /// 性别 + /// + public GenderEnumType Gender { get; set; } - /// - /// 身份证籍贯 - /// - public string NativeName { get; set; } + /// + /// 身份证籍贯 + /// + public string NativeName { get; set; } - /// - /// 身份证地址 - /// - public string Address { get; set; } + /// + /// 身份证地址 + /// + public string Address { get; set; } - /// - /// 生日 - /// - public DateTime Birthday { get; set; } + /// + /// 生日 + /// + public DateTime Birthday { get; set; } - /// - /// 手机号码 - /// - public string Phone { get; set; } + /// + /// 手机号码 + /// + public string Phone { get; set; } - /// - /// 岗位 - /// - public string Position { get; set; } + /// + /// 岗位 + /// + public string Position { get; set; } - /// - /// 职等 - /// - public string Grade { get; set; } + /// + /// 职等 + /// + public string Grade { get; set; } - /// - /// 学历 - /// - public string Degree { get; set; } + /// + /// 学历 + /// + public string Degree { get; set; } - /// - /// 人事范围 - /// - public string Werks { get; set; } + /// + /// 人事范围 + /// + public string Werks { get; set; } - /// - /// 成本中心 - /// - public string CostId { get; set; } + /// + /// 成本中心 + /// + public string CostId { get; set; } - /// - /// 已婚/未婚 - /// - public string Marital { get; set; } + /// + /// 已婚/未婚 + /// + public string Marital { get; set; } - /// - /// 国家 - /// - public string CountryName { get; set; } + /// + /// 国家 + /// + public string CountryName { get; set; } - /// - /// 民族代码 - /// - public string NationName { get; set; } - } + /// + /// 民族代码 + /// + public string NationName { get; set; } + + + /// + /// 人脸base64 + /// + public string Face { get; set; } } diff --git a/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs b/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs index 768aa36b..b40f3678 100644 --- a/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs @@ -29,7 +29,7 @@ public interface IGainfoService : IScopeDependency Task> GetFaceByUserCodesAsync(GetFaceByUserCodesRequest request); - Task> GetGainfoListTaskAsync(GainfoListRequest request); + Task> GetGainfoListAsync(GainfoListRequest request); - Task GetGainfoDetailTaskAsync(GainfoDetailRequest request); + Task GetGainfoDetailAsync(GainfoDetailRequest request); } diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index 85656105..69b10816 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -332,7 +332,7 @@ public class GainfoService : IGainfoService /// /// /// - public async Task> GetGainfoListTaskAsync(GainfoListRequest request) + public async Task> GetGainfoListAsync(GainfoListRequest request) { var page = await _gainfoStore.Queryable(request.Status) .LeftJoin((ga, de) => ga.DepartmentNo == de.No) @@ -360,14 +360,14 @@ public class GainfoService : IGainfoService /// /// /// - public async Task GetGainfoDetailTaskAsync(GainfoDetailRequest request) + public async Task GetGainfoDetailAsync(GainfoDetailRequest request) { var info = await _gainfoStore.Queryable(request.Status) .LeftJoin((ga, de) => ga.DepartmentNo == de.No) .LeftJoin((ga, de, type) => ga.Native == type.Code && type.Type == "native") .LeftJoin((ga, de, type, posi) => ga.Position == posi.Name) .LeftJoin((ga, de, type, posi, type2) => ga.CountryNo == type2.Code && type2.Type == "country") - .LeftJoin((ga, de, type, posi, type2, type3) => ga.Nation == type3.Code && type3.Type == "nation") + .LeftJoin((ga, de, type, posi, type2, type3) => ga.Nation == type3.Code && type3.Type == "nation") .Where(ga => ga.No == request.No) .Select((ga, de, type, posi, type2, type3) => new GainfoDetailResponse { @@ -391,7 +391,13 @@ public class GainfoService : IGainfoService Marital = ga.Marital, CountryName = type2.Display, NationName = type3.Display, - }).FirstAsync(); + }) + .FirstAsync(); + + if (info != null) + { + info.Face = await _dbContext.ChangeDb("face").Queryable().Where(x => x.UserCode == info.Code).Select(x => x.Face).SingleAsync(); + } return info; }