diff --git a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs index 93590dd6..00e20db7 100644 --- a/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs +++ b/Src/Dlhis.Basic/Organization/Controllers/GainfosController.cs @@ -78,5 +78,26 @@ public class GainfosController : ControllerBase { await _gainfoService.OnboardingAsync(request); } + + /// + /// 获取档案下拉表的所有字段 + /// + /// + [HttpGet("GetAllFields")] + public List GetAllFields() + { + return _gainfoService.GetAllFields(); + } + + /// + /// 获取档案下拉表的固定字段的数据 + /// + /// + /// + [HttpGet("GetAllFieldData")] + public List GetColumnData(string fieldName) + { + return _gainfoService.GetColumnData(fieldName); + } } diff --git a/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs b/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs index 43fbd0f8..fed6c692 100644 --- a/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/IGainfoService.cs @@ -16,4 +16,9 @@ public interface IGainfoService : IScopeDependency Task DimissionAsync(GainfoDImissionRequest request); Task OnboardingAsync(GainfoDImissionRequest request); + + public List GetAllFields(); + + public List GetColumnData(string columnName); + } diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index 97404be6..582f40ce 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -22,6 +22,30 @@ public class GainfoService : IGainfoService _dbContext = dbContext; } + /// + /// 获取档案下拉表的所有字段 + /// + /// + public List GetAllFields() + { + var entityType = typeof(GainfofieldsEntity); + var propertyNames = entityType.GetProperties().Select(p => p.Name).ToList(); + + return propertyNames; + } + /// + /// 获取档案下拉表的固定字段的数据 + /// + /// + /// + public List GetColumnData(string columnName) + { + // 动态获取表的某一列数据 + var columnData = _dbContext.Queryable().Select(columnName).ToList(); + + return columnData; + } + /// /// 档案分页 /// diff --git a/Src/Dlhis.Entity/Basic/Entity/GainfofieldsEntity.cs b/Src/Dlhis.Entity/Basic/Entity/GainfofieldsEntity.cs new file mode 100644 index 00000000..50bd103d --- /dev/null +++ b/Src/Dlhis.Entity/Basic/Entity/GainfofieldsEntity.cs @@ -0,0 +1,34 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Dlhis.Entity.Basic.Entity +{ + /// + /// 档案下拉字段表 + /// + [SugarTable(TableName = "Gainfofields", TableDescription = "档案下拉字段表")] + public class GainfofieldsEntity : SugarBaseEntity + { + [SugarColumn(ColumnDescription = "人员类型")] + public string Class { get; set; } + + [SugarColumn(ColumnDescription = "国家代码")] + public string Country { get; set; } + + [SugarColumn(ColumnDescription = "证件类型")] + public string Idcls { get; set; } + + [SugarColumn(ColumnDescription = "身份证籍贯区")] + public string Native { get; set; } + + [SugarColumn(ColumnDescription = "部门编码")] + public string Appellation { get; set; } + + [SugarColumn(ColumnDescription = "民族代码")] + public string Nation { get; set; } + } +} diff --git a/Src/Dlhis.ScheduledTask/Job/SyncOrgInfoJob.cs b/Src/Dlhis.ScheduledTask/Job/SyncOrgInfoJob.cs index 49b6c85b..3eeb7635 100644 --- a/Src/Dlhis.ScheduledTask/Job/SyncOrgInfoJob.cs +++ b/Src/Dlhis.ScheduledTask/Job/SyncOrgInfoJob.cs @@ -1,5 +1,4 @@ -using Dlhis.Entity.Basic.Entity; -using Dlhis.ScheduledTask.Comparers; +using Dlhis.ScheduledTask.Comparers; using Dlhis.ScheduledTask.Entities; using Kurisu.SqlSugar.Services; using Mapster;