/// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public async Task DeleteAsync(UserInfo user, HumanInfoAdjustment humanInfoAdjustment, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            if (humanInfoAdjustment == null)
            {
                throw new ArgumentNullException(nameof(humanInfoAdjustment));
            }
            humanInfoAdjustment.DeleteTime = DateTime.Now;
            humanInfoAdjustment.DeleteUser = user.Id;
            humanInfoAdjustment.IsDeleted  = true;
            Context.Attach(humanInfoAdjustment);
            var entry = Context.Entry(humanInfoAdjustment);

            entry.Property(x => x.IsDeleted).IsModified  = true;
            entry.Property(x => x.DeleteUser).IsModified = true;
            entry.Property(x => x.DeleteTime).IsModified = true;
            try
            {
                await Context.SaveChangesAsync(cancellationToken);
            }
            catch (DbUpdateException)
            {
                throw;
            }
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        public async Task <HumanInfoAdjustment> UpdateAsync(UserInfo user, HumanInfoAdjustment humanInfoAdjustment, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (humanInfoAdjustment == null)
            {
                throw new ArgumentNullException(nameof(humanInfoAdjustment));
            }
            var old = HumanInfoAdjustments.Where(a => a.Id == humanInfoAdjustment.Id).SingleOrDefault();

            if (old == null)
            {
                throw new Exception("更新的对象不存在");
            }
            old.AdjustmentTime            = humanInfoAdjustment.AdjustmentTime;
            old.BaseWages                 = humanInfoAdjustment.BaseWages;
            old.CommunicationAllowance    = humanInfoAdjustment.CommunicationAllowance;
            old.DepartmentId              = humanInfoAdjustment.DepartmentId;
            old.EmploymentInjuryInsurance = humanInfoAdjustment.EmploymentInjuryInsurance;
            old.EndowmentInsurance        = humanInfoAdjustment.EndowmentInsurance;
            old.GrossPay                    = humanInfoAdjustment.GrossPay;
            old.HousingProvidentFund        = humanInfoAdjustment.HousingProvidentFund;
            old.HousingProvidentFundAccount = humanInfoAdjustment.HousingProvidentFundAccount;
            old.InsuredAddress              = humanInfoAdjustment.InsuredAddress;
            old.InsuredTime                 = humanInfoAdjustment.InsuredTime;
            old.IsGiveUp                    = humanInfoAdjustment.IsGiveUp;
            old.IsHave                  = humanInfoAdjustment.IsHave;
            old.IsSignCommitment        = humanInfoAdjustment.IsSignCommitment;
            old.MaternityInsurance      = humanInfoAdjustment.MaternityInsurance;
            old.MedicalInsurance        = humanInfoAdjustment.MedicalInsurance;
            old.MedicalInsuranceAccount = humanInfoAdjustment.MedicalInsuranceAccount;
            old.OtherAllowance          = humanInfoAdjustment.OtherAllowance;
            old.Position                = humanInfoAdjustment.Position;
            old.PostWages               = humanInfoAdjustment.PostWages;
            old.ProbationaryPay         = humanInfoAdjustment.ProbationaryPay;
            old.SocialSecurityAccount   = humanInfoAdjustment.SocialSecurityAccount;
            old.TrafficAllowance        = humanInfoAdjustment.TrafficAllowance;
            old.UnemploymentInsurance   = humanInfoAdjustment.UnemploymentInsurance;

            old.UpdateTime = DateTime.Now;
            old.UpdateUser = user.Id;
            Context.Update(old);
            try
            {
                await Context.SaveChangesAsync(cancellationToken);
            }
            catch (DbUpdateException) { throw; }
            return(humanInfoAdjustment);
        }
        /// <summary>
        /// 更新人事调薪异动审核状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task UpdateExamineStatus(string id, ExamineStatusEnum status, CancellationToken cancellationToken = default(CancellationToken))
        {
            HumanInfoAdjustment humanInfoAdjustment = new HumanInfoAdjustment()
            {
                Id            = id,
                UpdateTime    = DateTime.Now,
                ExamineStatus = status
            };

            Context.Attach(humanInfoAdjustment);
            var entry = Context.Entry(humanInfoAdjustment);

            entry.Property(x => x.ExamineStatus).IsModified = true;
            entry.Property(x => x.UpdateTime).IsModified    = true;
            try
            {
                await Context.SaveChangesAsync(cancellationToken);
            }
            catch (DbUpdateException) { throw; }
        }
 /// <summary>
 /// 新增
 /// </summary>
 /// <returns></returns>
 public async Task <HumanInfoAdjustment> CreateAsync(UserInfo user, HumanInfoAdjustment humanInfoAdjustment, CancellationToken cancellationToken = default(CancellationToken))
 {
     if (humanInfoAdjustment == null)
     {
         throw new ArgumentNullException(nameof(humanInfoAdjustment));
     }
     if (string.IsNullOrEmpty(humanInfoAdjustment.Id))
     {
         humanInfoAdjustment.Id = Guid.NewGuid().ToString();
     }
     humanInfoAdjustment.CreateTime = DateTime.Now;
     humanInfoAdjustment.CreateUser = user.Id;
     humanInfoAdjustment.IsDeleted  = false;
     Context.Add(humanInfoAdjustment);
     try
     {
         await Context.SaveChangesAsync(cancellationToken);
     }
     catch (DbUpdateException) { throw; }
     return(humanInfoAdjustment);
 }