feat 档案表下拉列表
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Dlhis.Basic.Organization.Request;
|
||||
using Dlhis.Basic.Organization.Response;
|
||||
using Dlhis.Basic.Organization.Services;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Kurisu.AspNetCore.MVC;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -78,5 +79,26 @@ public class GainfosController : ControllerBase
|
||||
{
|
||||
await _gainfoService.OnboardingAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有字段
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetAllFields")]
|
||||
public List<string> GetAllFields()
|
||||
{
|
||||
return _gainfoService.GetAllFields();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取固定字段信息字段
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetAllFieldData")]
|
||||
public List<string> GetAllFieldData(string fieldName)
|
||||
{
|
||||
return _gainfoService.GetAllFieldData(fieldName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Dlhis.Entity.Basic.Enums;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Request;
|
||||
|
||||
@@ -148,6 +149,24 @@ public class GainfoSaveRequest : IValidatableObject
|
||||
/// </summary>
|
||||
public string CarNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人事范围
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "人事范围")]
|
||||
public string Werks { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 人员号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "人员号")]
|
||||
public string Pernr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "邮箱")]
|
||||
public string Email { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (GainfoStatus.HasValue && GainfoStatus == GainfoStatusEnumType.Leave)
|
||||
|
||||
@@ -15,4 +15,8 @@ public interface IGainfoService : IScopeDependency
|
||||
Task DimissionAsync(GainfoDImissionRequest request);
|
||||
|
||||
Task OnboardingAsync(GainfoDImissionRequest request);
|
||||
|
||||
public List<string> GetAllFieldData(string fieldName);
|
||||
|
||||
public List<string> GetAllFields();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Kurisu.Core.DataAccess.Dto;
|
||||
using Kurisu.SqlSugar.Attributes;
|
||||
using Kurisu.SqlSugar.Extensions;
|
||||
using Kurisu.SqlSugar.Services;
|
||||
using Mapster;
|
||||
|
||||
namespace Dlhis.Basic.Organization.Services.Implements;
|
||||
@@ -14,10 +15,12 @@ public class GainfoService : IGainfoService
|
||||
{
|
||||
|
||||
private readonly IGainfoStore _gainfoStore;
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public GainfoService(IGainfoStore gainfoStore)
|
||||
public GainfoService(IGainfoStore gainfoStore, IDbContext dbContext)
|
||||
{
|
||||
_gainfoStore = gainfoStore;
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -119,6 +122,31 @@ public class GainfoService : IGainfoService
|
||||
await _gainfoStore.InsertAsync(GainfoStatusEnumType.Working, gainfos);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有字段
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<string> GetAllFields()
|
||||
{
|
||||
var entityType = typeof(Gainfofields);
|
||||
var propertyNames = entityType.GetProperties().Select(p => p.Name).ToList();
|
||||
|
||||
return propertyNames;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取固定字段数据
|
||||
/// </summary>
|
||||
/// <param name="fieldName"></param>
|
||||
/// <returns></returns>
|
||||
public List<string> GetAllFieldData(string fieldName)
|
||||
{
|
||||
var columnData = _dbContext.Queryable<Gainfofields>().Select<string>(fieldName).ToList();
|
||||
|
||||
return columnData;
|
||||
}
|
||||
|
||||
//-------------------------------------------help methods ------------------------------------------------
|
||||
|
||||
|
||||
|
||||
53
Src/Dlhis.Entity/Basic/Entity/Gainfofields.cs
Normal file
53
Src/Dlhis.Entity/Basic/Entity/Gainfofields.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
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 Gainfofields : SugarBaseEntity
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 人员类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "人员类型")]
|
||||
public string Class { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 国家代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "国家代码")]
|
||||
public string Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 证件类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "证件类型")]
|
||||
public string Idcls { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 身份证籍贯区
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "身份证籍贯区")]
|
||||
public string Native { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部门编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "部门编码")]
|
||||
public string Appellation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 民族代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "民族代码")]
|
||||
public string Nation { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user