Merge branch 'development' of https://git.dlhis.com/liguoyang/jinko.yikatong into development

This commit is contained in:
cheche
2024-03-05 15:45:24 +08:00
9 changed files with 158 additions and 136 deletions

View File

@@ -59,14 +59,11 @@ public class GainfoService : IGainfoService
{
request.DepartmentNos = await GetRecursionDepartmentNosAsync(request.DepartmentNos);
var tenant = _currentUser.GetStringTenantId();
var page = await _gainfoStore.Queryable(request.Status)
.WhereIF(request.DepartmentNos.IsPresent(), gainfo => request.DepartmentNos.Contains(gainfo.DepartmentNo))
.WhereIF(request.Search.IsPresent(), gainfo =>
gainfo.Name.Contains(request.Search)
|| gainfo.Code.Contains(request.Search))
.Where(gainfo => gainfo.Werks == tenant)
.Select<GainfoPageResponse>()
.ToPageListAsync(request);
@@ -148,11 +145,19 @@ public class GainfoService : IGainfoService
public async Task<GainfoCurrentResponse> CurrentUserInfoAsync()
{
var identityId = _currentUser.GetIntSubjectId();
var code = _currentUser.GetUserClaim("jinko-code");
var gainfo = await _gainfoStore.Queryable().Where(x => x.Code == code).FirstAsync()
?? await _gainfoStore.Queryable().Where(x => x.IdentityUserId == identityId).FirstAsync();
var gainfo = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
if (gainfo == null)
{
return null;
}
var info = await _gainfoStore.Queryable(GainfoStatusEnumType.Working)
.LeftJoin<DepartmentEntity>((ga, department) => ga.DepartmentNo == department.No)
.LeftJoin<CanteenUserEntity>((ga, department, mealUser) => ga.No == mealUser.UserNo)
.Where((ga, department) => ga.IdentityUserId == identityId)
.Where((ga, department) => ga.Id == gainfo.Id)
.Select((ga, department, mealUser) => new GainfoCurrentResponse
{
UserNo = ga.No,
@@ -169,7 +174,7 @@ public class GainfoService : IGainfoService
})
.FirstAsync();
return gainfo;
return info;
}
public async Task<IActionResult> GetFaceAsync(string token)
@@ -368,9 +373,9 @@ public class GainfoService : IGainfoService
.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<BasicTypeEntity>((ga, de, type, posi, type2, type3, type4) => ga.IdClass == type4.Code && type4.Type == "cls")
.Where(ga => ga.No == request.No)
.Select((ga, de, type, posi, type2, type3,type4) => new GainfoDetailResponse
.Select((ga, de, type, posi, type2, type3, type4) => new GainfoDetailResponse
{
No = ga.No,
SapNo = ga.SapNo,
@@ -389,7 +394,7 @@ public class GainfoService : IGainfoService
Degree = ga.Degree,
Werks = ga.Werks,
CostId = ga.CostId,
Marital = ga.Marital== "Single" ? "未婚":"已婚",
Marital = ga.Marital == "Single" ? "未婚" : "已婚",
CountryName = type2.Display,
NationName = type3.Display,
ClassName = type4.Display,

View File

@@ -25,7 +25,7 @@
"LogConnectionString": "server=192.168.199.124;port=3306;userid=root;password=dlhis123;database=log;charset=utf8mb4;",
"Timeout": 30,
"SlowSqlTime": 1,
"EnableSqlLog": false
"EnableSqlLog": true
},
"SwaggerOptions": {
"Enable": true,