fix 脏数据处理
This commit is contained in:
@@ -95,28 +95,35 @@ public class GainfoOutsourceService : IGainfoOutsourceService
|
||||
|
||||
public async Task<GainfoOutSourceExternalInfoResponse> GetExternalInfoAsync(string userNo)
|
||||
{
|
||||
var data = await _dbContext.Queryable<OutsourceEntity>()
|
||||
.LeftJoin<GainfoEntity>((a, b) => a.Code == b.Code)
|
||||
.LeftJoin<GainfoEntity>((a, b, c) => a.SapCode == c.Code)
|
||||
.Where((a, b, c) => b.No == userNo)
|
||||
.Select((a, b, c) => new GainfoOutSourceExternalInfoResponse
|
||||
{
|
||||
UserCode = b.Code,
|
||||
Supplier = a.Supplier,
|
||||
SapCode = a.SapCode,
|
||||
SapPhone = a.SapPhone,
|
||||
SapName = c.Name,
|
||||
EntryDate = b.EntryDate,
|
||||
ResignationDate = b.ResignationDate,
|
||||
Factory = b.Factory
|
||||
})
|
||||
.SingleAsync();
|
||||
try
|
||||
{
|
||||
var data = await _dbContext.Queryable<OutsourceEntity>()
|
||||
.LeftJoin<GainfoEntity>((a, b) => a.Code == b.Code)
|
||||
.LeftJoin<GainfoEntity>((a, b, c) => a.SapCode == c.Code)
|
||||
.Where((a, b, c) => b.No == userNo)
|
||||
.Select((a, b, c) => new GainfoOutSourceExternalInfoResponse
|
||||
{
|
||||
UserCode = b.Code,
|
||||
Supplier = a.Supplier,
|
||||
SapCode = a.SapCode,
|
||||
SapPhone = a.SapPhone,
|
||||
SapName = c.Name,
|
||||
EntryDate = b.EntryDate,
|
||||
ResignationDate = b.ResignationDate,
|
||||
Factory = b.Factory
|
||||
})
|
||||
.SingleAsync();
|
||||
|
||||
data.IsWhiteListInAutoResign = await _dbContext.Queryable<OutsourceWhiteListEntity>()
|
||||
.Where(x => x.UserCode == data.UserCode)
|
||||
.AnyAsync();
|
||||
data.IsWhiteListInAutoResign = await _dbContext.Queryable<OutsourceWhiteListEntity>()
|
||||
.Where(x => x.UserCode == data.UserCode)
|
||||
.AnyAsync();
|
||||
|
||||
return data;
|
||||
return data;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user