feat 档案表固定字段下拉列表及数据
This commit is contained in:
@@ -78,5 +78,26 @@ public class GainfosController : ControllerBase
|
||||
{
|
||||
await _gainfoService.OnboardingAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取档案下拉表的所有字段
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetAllFields")]
|
||||
public List<string> GetAllFields()
|
||||
{
|
||||
return _gainfoService.GetAllFields();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取档案下拉表的固定字段的数据
|
||||
/// </summary>
|
||||
/// <param name="fieldName"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetAllFieldData")]
|
||||
public List<string> GetColumnData(string fieldName)
|
||||
{
|
||||
return _gainfoService.GetColumnData(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,4 +16,9 @@ public interface IGainfoService : IScopeDependency
|
||||
Task DimissionAsync(GainfoDImissionRequest request);
|
||||
|
||||
Task OnboardingAsync(GainfoDImissionRequest request);
|
||||
|
||||
public List<string> GetAllFields();
|
||||
|
||||
public List<string> GetColumnData(string columnName);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,30 @@ public class GainfoService : IGainfoService
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取档案下拉表的所有字段
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<string> GetAllFields()
|
||||
{
|
||||
var entityType = typeof(GainfofieldsEntity);
|
||||
var propertyNames = entityType.GetProperties().Select(p => p.Name).ToList();
|
||||
|
||||
return propertyNames;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取档案下拉表的固定字段的数据
|
||||
/// </summary>
|
||||
/// <param name="columnName"></param>
|
||||
/// <returns></returns>
|
||||
public List<string> GetColumnData(string columnName)
|
||||
{
|
||||
// 动态获取表的某一列数据
|
||||
var columnData = _dbContext.Queryable<GainfofieldsEntity>().Select<string>(columnName).ToList();
|
||||
|
||||
return columnData;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 档案分页
|
||||
/// </summary>
|
||||
|
||||
34
Src/Dlhis.Entity/Basic/Entity/GainfofieldsEntity.cs
Normal file
34
Src/Dlhis.Entity/Basic/Entity/GainfofieldsEntity.cs
Normal file
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// 档案下拉字段表
|
||||
/// </summary>
|
||||
[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; }
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user