fix 优化gainfo

This commit is contained in:
2024-03-26 12:40:34 +08:00
parent b617e6cdc9
commit 521543a79e
4 changed files with 46 additions and 21 deletions

View File

@@ -25,11 +25,6 @@ public class GainfoDetailResponse
/// </summary>
public string Code { get; set; }
/// <summary>
/// 部门
/// </summary>
public string DepartmentNo { get; set; }
/// <summary>
/// 部门名称
/// </summary>
@@ -71,7 +66,7 @@ public class GainfoDetailResponse
public string Address { get; set; }
/// <summary>
/// 生日
/// 出生日期
/// </summary>
public DateTime Birthday { get; set; }
@@ -95,6 +90,11 @@ public class GainfoDetailResponse
/// </summary>
public string Degree { get; set; }
/// <summary>
/// 职级
/// </summary>
public string Title { get; set; }
/// <summary>
/// 人事范围
/// </summary>

View File

@@ -424,7 +424,7 @@ public class GainfoService : IGainfoService
{
var info = await _gainfoStore.Queryable(request.Status)
.LeftJoin<DepartmentEntity>((ga, de) => ga.DepartmentNo == de.No)
.LeftJoin<PositionEntity>((ga, de, pos) => ga.Position == pos.Name)
.LeftJoin<PositionEntity>((ga, de, pos) => ga.PositionNo == pos.No)
.Where(ga => ga.No == request.No)
.Select((ga, de, pos) => new GainfoDetailResponse
{
@@ -432,25 +432,27 @@ public class GainfoService : IGainfoService
SapNo = ga.SapNo,
Name = ga.Name,
Code = ga.Code,
DepartmentName = de.Name,
IdClass = ga.IdClass,
IdNo = ga.IdNo,
Gender = ga.Gender,
Address = ga.Address,
Birthday = ga.Birthday,
Phone = ga.Phone,
Position = ga.Position,
Grade = pos.Grade,
Grade = ga.Grade,
Title = ga.Title,
Degree = ga.Degree,
Werks = ga.Werks,
CostId = ga.CostId,
Marital = ga.Marital == "Single" ? "未婚" : "已婚",
Marital = "未知",
NativeName = ga.Native,
CountryName = ga.CountryNo,
NationName = ga.Nation,
ClassName = ga.IdClass,
Factory = ga.Factory,
OnboardingDate = ga.CreateTime,
DepartmentName = de.Name,
Position = pos.Name,
})
.SingleAsync();
@@ -460,14 +462,18 @@ public class GainfoService : IGainfoService
var types = await _dbContext.Queryable<BasicTypeEntity>().Where(x => searchTypes.Contains(x.Type)).ToListAsync();
info.NativeName = types.Where(x => x.Type == "native").FirstOrDefault(x => x.Code == info.NativeName)?.Display;
info.CountryName = types.Where(x => x.Type == "country").FirstOrDefault(x => x.Code == info.CountryName)?.Display;
info.CountryName = types.Where(x => x.Type == "country").FirstOrDefault(x => x.Code == info.CountryName)?.Display ?? "中国";
info.NationName = types.Where(x => x.Type == "nation").FirstOrDefault(x => x.Code == info.NationName)?.Display;
info.ClassName = types.Where(x => x.Type == "cls").FirstOrDefault(x => x.Code == info.ClassName)?.Display;
info.ClassName = types.Where(x => x.Type == "cls").FirstOrDefault(x => x.Code == info.ClassName)?.Display ?? "身份证";
if (request.WithFace)
{
info.Face = await _dbContext.ChangeDb("face").Queryable<GainfoFaceEntity>().Where(x => x.UserCode == info.Code).Select(x => x.Face).SingleAsync();
}
var tenantsResult = await _tenantApi.GetTenantsInternalAsync();
var tenants = tenantsResult.Data;
info.FactoryName = tenants.FirstOrDefault(x => x.Code == info.Factory)?.Name;
}
return info;

View File

@@ -89,11 +89,11 @@ public class GainfoEntity : SugarBaseEntity
[SugarColumn(ColumnDescription = "身份证地址")]
public string Address { get; set; }
/// <summary>
/// 已婚/未婚
/// </summary>
[SugarColumn(ColumnDescription = "已婚/未婚")]
public string Marital { get; set; }
///// <summary>
///// 已婚/未婚
///// </summary>
//[SugarColumn(ColumnDescription = "已婚/未婚")]
//public string Marital { get; set; }
/// <summary>
/// 部门编码
@@ -123,7 +123,19 @@ public class GainfoEntity : SugarBaseEntity
/// 岗位
/// </summary>
[SugarColumn(ColumnDescription = "岗位")]
public string Position { get; set; }
public string PositionNo { get; set; }
/// <summary>
/// 职等
/// </summary>
[SugarColumn(ColumnDescription = "职等")]
public string Grade { get; set; }
/// <summary>
/// 职级
/// </summary>
[SugarColumn(ColumnDescription = "职级")]
public string Title { get; set; }
/// <summary>
/// 卡号

View File

@@ -174,7 +174,9 @@ public class SyncPersonJob
Nation = item.nation,
Phone = item.phone,
Degree = item.email,
Position = item.web,
Grade = item.ZZ_ZD,
Title = item.Z_ZJ,
PositionNo = item.STELL,
Remark = item.remark,
Werks = item.WERKS,
CostId = item.KOSTL,
@@ -200,6 +202,9 @@ public class SyncPersonJob
email = item.email,
WERKS = item.WERKS,
KOSTL = item.KOSTL,
STELL = item.STELL,
Z_ZJ = item.Z_ZJ,
ZZ_ZD = item.ZZ_ZD,
ZZ_GZDJDNM = item.ZZ_GZDJDNM,
ZZ_GZDCQNM = item.ZZ_GZDCQNM,
})
@@ -217,7 +222,9 @@ public class SyncPersonJob
{
SapNo = item.PERNR,
Name = item.gname,
Position = item.web,
PositionNo = item.STELL,
Grade = item.ZZ_ZD,
Title = item.Z_ZJ,
Phone = item.phone,
DepartmentNo = item.appellation,
Remark = item.remark,