fix 增加网格员名称名称
This commit is contained in:
@@ -199,13 +199,12 @@ public class WorkGridsController : ControllerBase
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("user/attendance/page-all")]
|
||||
[IgnoreTenant]
|
||||
public async Task<Pagination<WorkGridScheduleAttendancePageResponse>> GetAllAttendancePageAsync([FromQuery] WorkGridScheduleAttendancePageRequest request)
|
||||
{
|
||||
return await _workGridScheduleService.GetAllAttendancePageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// 网格人员考勤记录补传
|
||||
/// </summary>
|
||||
/// <param name="logIds"></param>
|
||||
|
||||
@@ -92,6 +92,21 @@ public class WorkGridScheduleAttendancePageResponse
|
||||
}
|
||||
}
|
||||
|
||||
public string LeaderUserCode
|
||||
{
|
||||
get
|
||||
{
|
||||
if (WorkGridInfoObj != null)
|
||||
{
|
||||
return WorkGridInfoObj?.WorkGrid?.LeaderUserCode;
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public string LeaderUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是异常记录
|
||||
/// </summary>
|
||||
|
||||
@@ -315,7 +315,7 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
request.UserCode = request.Search;
|
||||
}
|
||||
|
||||
return await _dbContext.Queryable<DeviceUploadLogEntity>()
|
||||
var page = await _dbContext.Queryable<DeviceUploadLogEntity>()
|
||||
.LeftJoin<DeviceEntity>((log, d) => log.DeviceUniqueNo == d.UniqueNo)
|
||||
.LeftJoin<GainfoEntity>((log, d, ga) => log.UserUniqueNo == ga.Code)
|
||||
.WhereIF(request.DateTimePeriod.HasValue(), log => log.RaiseDateTime >= request.DateTimePeriod.Start
|
||||
@@ -346,6 +346,22 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
WorkGridInfo = log.WorkGridInfo,
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
|
||||
|
||||
var leaderUserCodes = page.Data.Select(x => x.LeaderUserCode).Distinct().ToList();
|
||||
var gainfos = await _dbContext.Queryable<GainfoEntity>().Where(x => leaderUserCodes.Contains(x.Code)).Select(x => new { x.Code, x.Name }).ToListAsync();
|
||||
|
||||
page.Data.ForEach(x =>
|
||||
{
|
||||
var gainfo = gainfos.FirstOrDefault(p => p.Code == x.LeaderUserCode);
|
||||
if (gainfo != null)
|
||||
{
|
||||
x.LeaderUserName = gainfo.Name;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
},
|
||||
"SwaggerOptions": {
|
||||
"Enable": true,
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"ClientId": "4fb184324eac4180",
|
||||
"ClientSecret": "8ac8f235152f1524",
|
||||
"Authority": "http://localhost:5000",
|
||||
"ClientId": "98958aa485d38412",
|
||||
"ClientSecret": "52589e011f02fe19",
|
||||
"Scopes": {
|
||||
"openid": "openid",
|
||||
"profile": "profile",
|
||||
@@ -37,8 +37,8 @@
|
||||
}
|
||||
},
|
||||
"IdentityServerOptions": {
|
||||
"Authority": "https://yikatong.isawesome.cn/oauth2",
|
||||
"RequireHttpsMetadata": true,
|
||||
"Authority": "http://localhost:5000",
|
||||
"RequireHttpsMetadata": false,
|
||||
"Issuer": "identity.isawesome.cn",
|
||||
"Audience": "",
|
||||
"Pat": {
|
||||
|
||||
Reference in New Issue
Block a user