fix 变更返回的人员数据
This commit is contained in:
@@ -23,7 +23,18 @@ public class GainfoService : IGainfoService
|
||||
|
||||
public async Task<List<GainfoOpenResponse>> GetAllGainfosAsync()
|
||||
{
|
||||
var factories = new[] { "2401", "301", "302", "303", "304", "305", "306", "307" };
|
||||
var factories = new[]
|
||||
{
|
||||
"1201", "1701", "1801",
|
||||
"1901", "1902", "201",
|
||||
"2001", "2301", "2401",
|
||||
"301", "302", "303",
|
||||
"304", "305", "306",
|
||||
"307", "401", "501",
|
||||
"502", "503", "504",
|
||||
"505", "701", "601",
|
||||
"1601"
|
||||
};
|
||||
|
||||
var gainfos = await _dbContext.Queryable<GainfoEntity>()
|
||||
.LeftJoin<DepartmentEntity>((x, d) => x.DepartmentNo == d.No)
|
||||
@@ -40,27 +51,29 @@ public class GainfoService : IGainfoService
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
var gainfoLeaves = await _dbContext.Queryable<GainfoEntity>().AS("GainfoLeave")
|
||||
.LeftJoin<DepartmentEntity>((x, d) => x.DepartmentNo == d.No)
|
||||
.Where(x => factories.Contains(x.Factory))
|
||||
.Where(x => SqlFunc.Subqueryable<GainfoEntity>()
|
||||
.Where(p => factories.Contains(p.Factory))
|
||||
.Where(p => p.Code == x.Code)
|
||||
.NotAny()
|
||||
)
|
||||
.Select((x, d) => new GainfoOpenResponse
|
||||
{
|
||||
Code = x.Code,
|
||||
DepartmentNo = x.DepartmentNo,
|
||||
DepartmentName = d.Name,
|
||||
Name = x.Name,
|
||||
Gender = x.Gender,
|
||||
Factory = x.Factory,
|
||||
Status = GainfoStatusEnumType.Leave,
|
||||
})
|
||||
.ToListAsync();
|
||||
// var gainfoLeaves = await _dbContext.Queryable<GainfoEntity>().AS("GainfoLeave")
|
||||
// .LeftJoin<DepartmentEntity>((x, d) => x.DepartmentNo == d.No)
|
||||
// .Where(x => factories.Contains(x.Factory))
|
||||
// .Where(x => SqlFunc.Subqueryable<GainfoEntity>()
|
||||
// .Where(p => factories.Contains(p.Factory))
|
||||
// .Where(p => p.Code == x.Code)
|
||||
// .NotAny()
|
||||
// )
|
||||
// .Select((x, d) => new GainfoOpenResponse
|
||||
// {
|
||||
// Code = x.Code,
|
||||
// DepartmentNo = x.DepartmentNo,
|
||||
// DepartmentName = d.Name,
|
||||
// Name = x.Name,
|
||||
// Gender = x.Gender,
|
||||
// Factory = x.Factory,
|
||||
// Status = GainfoStatusEnumType.Leave,
|
||||
// })
|
||||
// .ToListAsync();
|
||||
//
|
||||
// return gainfos.Concat(gainfoLeaves).ToList();
|
||||
|
||||
return gainfos.Concat(gainfoLeaves).ToList();
|
||||
return gainfos;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user