希望前辈们帮我重构一下这段代码
#region 计算考勤扣款(请假)/// <summary>
/// 计算考勤扣款(请假)
/// </summary>
/// <param name="empLoyeeId">员工</param>
/// <param name="basicCount">社保基数</param>
/// <param name="incomeTax">个调税</param>
/// <param name="bigillHelp">大病救助</param>
/// <param name="salarySum">核定总额</param>
/// <param name="baseSalalry">基本工资</param>
/// <returns></returns>
public decimal GetSequestrateMoney(Guid empLoyeeId, decimal basicCount, decimal incomeTax, decimal bigillHelp, decimal salarySum, decimal baseSalalry)
{
decimal money = 0M;
if (this.EmployeeAppraiseReportList == null || this.EmployeeAppraiseReportList.Count < 0)
{
return money;
}
foreach (EmployeeAppraiseReportInfo employeeAppraiseReport in this.EmployeeAppraiseReportList)
{
DateTime startDate = employeeAppraiseReport.StartDate;
DateTime endDate = employeeAppraiseReport.EndDate;
List<Guid> emp = new PaymentConditionsService().GetEmpCompareDate(startDate, endDate);
foreach (Guid userids in emp)
{
if (!userids.Equals(employeeAppraiseReport.EmployeeId))
{
continue;
}
}
if (!empLoyeeId.Equals(employeeAppraiseReport.EmployeeId))
{
continue;
}
foreach (MicroCodeItemInfo micLevaeInfoitem in this.LevaeItemList)
{
if (!employeeAppraiseReport.LeaveTimeDic.ContainsKey(micLevaeInfoitem.CodeItemValue) || employeeAppraiseReport.LeaveTimeDic[micLevaeInfoitem.CodeItemValue] <= 0)
{
continue;
}
CheckOnSetExpressionInfo checkonset = PaymentConditionsService.GetCheckonsetInfoByLeave(this.CheckOnSetList, AppraiseItem.Leave, micLevaeInfoitem.CodeItemValue);
if (checkonset == null)
{
continue;
}
decimal hours = CommonFun.StrToDecimal(employeeAppraiseReport.LeaveTimeDic[micLevaeInfoitem.CodeItemValue].ToString());//得到每种请假的小时
money += new CreateSalaryService().GetSalaryCheckoOnMoneyByLeaveOrOverTime(salarySum
, baseSalalry
, PaymentConditionsService.CheckDays(createOn)
, PaymentConditionsService.CheckDaysWithoutWeekend(createOn)
, GetPreWorkTime(empLoyeeId)
, basicCount
, incomeTax
, bigillHelp
, GetActualWorkTime(empLoyeeId)
, checkonset) * hours;
}
break;
}
return money;
}
#endregion
#region 计算旷工
/// <summary>
/// 计算旷工
/// </summary>
/// <param name="empLoyeeId">员工</param>
/// <param name="basicCount">社保基数</param>
/// <param name="incomeTax">个调税</param>
/// <param name="bigillHelp">大病救助</param>
/// <param name="salarySum">核定总额</param>
/// <param name="baseSalalry">基本工资</param>
/// <returns></returns>
public decimal GetAbsenceMoney(Guid empLoyeeId, decimal basicCount, decimal incomeTax, decimal bigillHelp, decimal salarySum, decimal baseSalalry)
{
decimal money = 0M;
if (this.EmployeeAppraiseReportList == null || this.EmployeeAppraiseReportList.Count < 0)
{
return money;
}
foreach (EmployeeAppraiseReportInfo employeeAppraiseReport in this.EmployeeAppraiseReportList)
{
DateTime startDate = employeeAppraiseReport.StartDate;
DateTime endDate = employeeAppraiseReport.EndDate;
List<Guid> emp = new PaymentConditionsService().GetEmpCompareDate(startDate, endDate);
foreach (Guid userids in emp)
{
if (!userids.Equals(employeeAppraiseReport.EmployeeId))
{
continue;
}
}
if (!empLoyeeId.Equals(employeeAppraiseReport.EmployeeId))
{
continue;
}
decimal hours = CommonFun.StrToDecimal(employeeAppraiseReport.AbsenceTime.ToString());//旷工时间
money = new CreateSalaryService().GetSalaryCheckoOnMoney(salarySum
, baseSalalry
, PaymentConditionsService.CheckDays(createOn)
, PaymentConditionsService.CheckDaysWithoutWeekend(createOn)
, GetPreWorkTime(empLoyeeId)
, basicCount
, incomeTax
, bigillHelp
, GetActualWorkTime(empLoyeeId)
, (int)AppraiseItem.Absence) * hours;
break;
}
return money;
}
#endregion