fix 优化档案详情查询
This commit is contained in:
@@ -424,13 +424,9 @@ public class GainfoService : IGainfoService
|
||||
{
|
||||
var info = await _gainfoStore.Queryable(request.Status)
|
||||
.LeftJoin<DepartmentEntity>((ga, de) => ga.DepartmentNo == de.No)
|
||||
.LeftJoin<BasicTypeEntity>((ga, de, type) => ga.Native == type.Code && type.Type == "native")
|
||||
.LeftJoin<PositionEntity>((ga, de, type, posi) => ga.Position == posi.Name)
|
||||
.LeftJoin<BasicTypeEntity>((ga, de, type, posi, type2) => ga.CountryNo == type2.Code && type2.Type == "country")
|
||||
.LeftJoin<BasicTypeEntity>((ga, de, type, posi, type2, type3) => ga.Nation == type3.Code && type3.Type == "nation")
|
||||
.LeftJoin<BasicTypeEntity>((ga, de, type, posi, type2, type3, type4) => ga.IdClass == type4.Code && type4.Type == "cls")
|
||||
.LeftJoin<PositionEntity>((ga, de, pos) => ga.Position == pos.Name)
|
||||
.Where(ga => ga.No == request.No)
|
||||
.Select((ga, de, type, posi, type2, type3, type4) => new GainfoDetailResponse
|
||||
.Select((ga, de, pos) => new GainfoDetailResponse
|
||||
{
|
||||
No = ga.No,
|
||||
SapNo = ga.SapNo,
|
||||
@@ -440,26 +436,34 @@ public class GainfoService : IGainfoService
|
||||
IdClass = ga.IdClass,
|
||||
IdNo = ga.IdNo,
|
||||
Gender = ga.Gender,
|
||||
NativeName = type.Display,
|
||||
Address = ga.Address,
|
||||
Birthday = ga.Birthday,
|
||||
Phone = ga.Phone,
|
||||
Position = ga.Position,
|
||||
Grade = posi.Grade,
|
||||
Grade = pos.Grade,
|
||||
Degree = ga.Degree,
|
||||
Werks = ga.Werks,
|
||||
CostId = ga.CostId,
|
||||
Marital = ga.Marital == "Single" ? "未婚" : "已婚",
|
||||
CountryName = type2.Display,
|
||||
NationName = type3.Display,
|
||||
ClassName = type4.Display,
|
||||
NativeName = ga.Native,
|
||||
CountryName = ga.CountryNo,
|
||||
NationName = ga.Nation,
|
||||
ClassName = ga.IdClass,
|
||||
Factory = ga.Factory,
|
||||
OnboardingDate = ga.CreateTime,
|
||||
})
|
||||
.FirstAsync();
|
||||
.SingleAsync();
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
var searchTypes = new List<string>() { "native", "country", "nation", "cls" };
|
||||
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.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;
|
||||
|
||||
if (request.WithFace)
|
||||
{
|
||||
info.Face = await _dbContext.ChangeDb("face").Queryable<GainfoFaceEntity>().Where(x => x.UserCode == info.Code).Select(x => x.Face).SingleAsync();
|
||||
|
||||
Reference in New Issue
Block a user