fix 离职导致不显示问题

This commit is contained in:
2025-05-13 10:30:42 +08:00
parent b80ea0a771
commit ea1832894e

View File

@@ -161,6 +161,10 @@ public class WorkGridService : IWorkGridService
.Where(p => p.Code == x.LeaderUserCode && p.Factory == factory)
.Any()
||
SqlFunc.Subqueryable<GainfoLeaveEntity>()
.Where(p => p.Code == x.LeaderUserCode && p.Factory == factory)
.Any()
||
SqlFunc.Subqueryable<WorkGridUserEntity>()
.LeftJoin<GainfoEntity>((p, pga) => p.UserCode == pga.Code)
.Where(p => p.WorkGridCode == x.Code)
@@ -198,7 +202,7 @@ public class WorkGridService : IWorkGridService
workGrid.ThrowIfNull($"{from}管理的网格不存在");
var beforeGainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.Code == from).SingleAsync();
beforeGainfo??=await _dbContext.Queryable<GainfoLeaveEntity>().Where(x => x.Code == from).SingleAsync();
beforeGainfo ??= await _dbContext.Queryable<GainfoLeaveEntity>().Where(x => x.Code == from).SingleAsync();
beforeGainfo.ThrowIfNull($"{from}人员不存在");
var gainfo = await _dbContext.Queryable<GainfoEntity>().Where(x => x.Code == to).SingleAsync();