sunpengfei
2025-08-22 baed9bce4ccb41668f3740d77a7b664918e6403b
FlexJobApi.UserServer.Application/EnterpriseEmployees/Queries/EnterpriseEmployeeQueryHandler.cs
@@ -19,7 +19,8 @@
        ) :
        IRequestHandler<GetEnterpriseEmployeesQuery, GetEnterpriseEmployeesQueryResult>,
        IRequestHandler<GetEnterpriseEmployeeQuery, GetEnterpriseEmployeeQueryResult>,
        IRequestHandler<GetEnterpriseEmployeeElectronSignsQuery, GetEnterpriseEmployeeElectronSignsQueryResult>
        IRequestHandler<GetEnterpriseEmployeeElectronSignsQuery, GetEnterpriseEmployeeElectronSignsQueryResult>,
        IRequestHandler<GetEnterpriseEmployeeElectronSignQuery, GetEnterpriseEmployeeElectronSignQueryResult>
    {
        private readonly IRepository<EnterpriseEmployee> rep = rep;
@@ -170,5 +171,30 @@
            });
            return await request.PageModel.GetPagedListAsync<GetEnterpriseEmployeeElectronSignsQueryResult, GetEnterpriseEmployeeElectronSignsQueryResultItem>(s, cancellationToken);
        }
        /// <summary>
        /// 查询个人用户签约详情
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task<GetEnterpriseEmployeeElectronSignQueryResult> Handle(GetEnterpriseEmployeeElectronSignQuery request, CancellationToken cancellationToken)
        {
            var logier = JwtUtils.GetCurrentLogier();
            var q = rep.AsQueryable().AsNoTracking()
                .Where(it => it.UserId == logier.Id);
            if (request.Id.HasValue)
            {
                q = q.Where(it => it.Id == request.Id);
            }
            if (request.Code.IsNotNull())
            {
                q = q.Where(it => it.ContractTemplate.Code == request.Code);
            }
            var model = await q.GetDetail<EnterpriseEmployee, GetEnterpriseEmployeeElectronSignQueryResult>();
            return model;
        }
    }
}