fix 处理离职人员
This commit is contained in:
@@ -614,7 +614,14 @@ public class BalanceService : IBalanceService
|
||||
{
|
||||
foreach (var request in requests)
|
||||
{
|
||||
var gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.Code == request.UserCode).SingleAsync();
|
||||
var gainfo = await _dbContext.Queryable<GainfoEntity>()
|
||||
.Where(x => x.Code == request.UserCode)
|
||||
.SingleAsync()
|
||||
?? await _dbContext.Queryable<GainfoEntity>().AS("GainfoLeave")
|
||||
.Where(x => x.Code == request.UserCode)
|
||||
.SingleAsync();
|
||||
|
||||
(gainfo == null).ThrowIfTrue($"工号{request.UserCode}不存在");
|
||||
|
||||
await _dbContext.InsertAsync(new BalanceRecordEntity
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user