| | |
| | | using Furion.HttpRemote; |
| | | using Mapster; |
| | | using MediatR; |
| | | using Microsoft.AspNetCore.Components.Forms; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using MiniExcelLibs; |
| | | using NetTopologySuite.Index.HPRtree; |
| | |
| | | /// 灵工命令处理器 |
| | | /// </summary> |
| | | public class EnterpriseEmployeesCommandHandler( |
| | | IMediator mediator, |
| | | IRepository<EnterpriseEmployee> rep, |
| | | IRepository<User> repUser, |
| | | IRepository<EnterpriseEmployeeContract> repEnterpriseEmployeeContract |
| | | ) : |
| | | IRequestHandler<ImportEnterpriseEmployeesCommand, ImportEnterpriseEmployeesCommandResult>, |
| | | IRequestHandler<EditEnterpriseEmployeeCommand, Guid>, |
| | | IRequestHandler<InviteEnterpriseEmployeeElectronSignCommand, Guid> |
| | | IRequestHandler<InviteElectronSignCommand, Guid> |
| | | { |
| | | private readonly IMediator mediator = mediator; |
| | | private readonly IRepository<EnterpriseEmployee> rep = rep; |
| | | private readonly IRepository<User> repUser = repUser; |
| | | private readonly IRepository<EnterpriseEmployeeContract> repEnterpriseEmployeeContract = repEnterpriseEmployeeContract; |
| | |
| | | /// <param name="request"></param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | public async Task<Guid> Handle(InviteEnterpriseEmployeeElectronSignCommand request, CancellationToken cancellationToken) |
| | | public async Task<Guid> Handle(InviteElectronSignCommand request, CancellationToken cancellationToken) |
| | | { |
| | | var logier = JwtUtils.GetCurrentLogier(); |
| | | var entity = await rep.AsQueryable() |
| | |
| | | if (entity.UserSignContractStatus == EnumTaskUserSignContractStatus.Pass) throw Oops.Oh(EnumErrorCodeType.s400, "已签约"); |
| | | if (entity.UserSignContractStatus == EnumTaskUserSignContractStatus.Effect) throw Oops.Oh(EnumErrorCodeType.s400, "已生效"); |
| | | if (entity.UserSignContractStatus == EnumTaskUserSignContractStatus.Wait) throw Oops.Oh(EnumErrorCodeType.s400, "已邀请"); |
| | | await mediator.Send(new CheckContractTemplateCommand |
| | | { |
| | | Id = request.Id |
| | | }, cancellationToken); |
| | | entity.ContractTemplateId = request.Id; |
| | | entity.UserSignContractStatus = EnumTaskUserSignContractStatus.Wait; |
| | | entity.UserSignContractTime = null; |