fix 脏数据处理

This commit is contained in:
2025-12-12 10:09:11 +08:00
parent 2f9c452083
commit 151ce72ae7

View File

@@ -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;
}
}