| | |
| | | IRepository<EnterpriseEmployeeContract> repEnterpriseEmployeeContract, |
| | | IRepository<ElectronSignSetting> repElectronSignSetting, |
| | | IRepository<ContractTemplate> repContractTemplate, |
| | | IRepository<EnterpriseCost> repEnterpriseCost |
| | | IRepository<EnterpriseCost> repEnterpriseCost, |
| | | IRepository<TaskInfoUser> repTaskInfoUser |
| | | ) : |
| | | IRequestHandler<ImportEnterpriseEmployeesCommand, ImportEnterpriseEmployeesCommandResult>, |
| | | IRequestHandler<EditEnterpriseEmployeeCommand, Guid>, |
| | |
| | | private readonly IRepository<ElectronSignSetting> repElectronSignSetting = repElectronSignSetting; |
| | | private readonly IRepository<ContractTemplate> repContractTemplate = repContractTemplate; |
| | | private readonly IRepository<EnterpriseCost> repEnterpriseCost = repEnterpriseCost; |
| | | private readonly IRepository<TaskInfoUser> repTaskInfoUser = repTaskInfoUser; |
| | | |
| | | /// <summary> |
| | | /// 导入灵工信息 |
| | |
| | | .OrderByDescending(it => it.CreatedTime) |
| | | .Where(it => it.EnterpriseEmployeeId == entity.Id) |
| | | .FirstOrDefaultAsync(); |
| | | if (entity == null) throw Oops.Oh(EnumErrorCodeType.s404, "合同"); |
| | | if (contract == null) throw Oops.Oh(EnumErrorCodeType.s404, "合同"); |
| | | contract.UserSignContractStatus = EnumTaskUserSignContractStatus.Stop; |
| | | contract.EnterpriseSignContractStatus = EnumTaskUserSignContractStatus.Stop; |
| | | await repEnterpriseEmployeeContract.UpdateAsync(contract); |
| | | |
| | | var taskUsers = await repTaskInfoUser.AsQueryable() |
| | | .Where(it => it.EnterpriseEmployeeId == entity.Id && it.HireStatus == EnumTaskUserHireStatus.Pass) |
| | | .ToListAsync(); |
| | | if (taskUsers.IsNotNull()) |
| | | { |
| | | foreach (var taskUser in taskUsers) |
| | | { |
| | | taskUser.HireStatus = EnumTaskUserHireStatus.Wait; |
| | | } |
| | | await repTaskInfoUser.UpdateAsync(taskUsers); |
| | | } |
| | | |
| | | return entity.Id; |
| | | } |
| | | } |