|
@@ -65,7 +65,8 @@ namespace OASystem.API.OAMethodLib
|
|
|
_result.Msg = startDt + " - " + endDt + "请假 类型数据 获取失败!";
|
|
|
return _result;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ _result.Msg = string.Empty;
|
|
|
foreach (var pm_wsInfo in pm_WageSheetDattaSources)
|
|
|
{
|
|
|
string itemName = userNames.Where(it => it.Id == pm_wsInfo.UserId).FirstOrDefault().CnName;
|
|
@@ -167,7 +168,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
if (sp_leave_details.Count <= 0)
|
|
|
{
|
|
|
_result.Msg += startDt + " - " + endDt +" "+itemName + " 请假 审批数据获取未获取到!\r\n";
|
|
|
- continue;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
List<Ex_Items> ex_Items = new List<Ex_Items>();
|
|
@@ -219,6 +220,21 @@ namespace OASystem.API.OAMethodLib
|
|
|
CalculateTypeFee(leaveType, date_Range.type, leave_starttime, leave_endtime, amountPayable, work_days, new_duration,
|
|
|
out leave_meals, out thisTypeDeduction);
|
|
|
|
|
|
+ #region 累计类型扣款
|
|
|
+
|
|
|
+
|
|
|
+ if (leaveType == 2)
|
|
|
+ {
|
|
|
+ personalLeaveTotal += thisTypeDeduction;
|
|
|
+ }
|
|
|
+ else if (leaveType == 3)
|
|
|
+ {
|
|
|
+
|
|
|
+ sickLeaveTotal = thisTypeDeduction;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
meal_deduction += leave_meals;
|
|
|
string startEndTiime = startEndTiime = date_Range.new_begin_dt.ToString("yyyy-MM-dd HH:mm") + " - " +
|
|
|
date_Range.new_end_dt.ToString("yyyy-MM-dd HH:mm");
|
|
@@ -227,12 +243,12 @@ namespace OASystem.API.OAMethodLib
|
|
|
{
|
|
|
SubTypeId = leaveType,
|
|
|
SubType = typeName,
|
|
|
- StartTimeDt = date_Range.new_begin_dt,
|
|
|
- EndTimeDt = date_Range.new_end_dt,
|
|
|
+ StartTimeDt = Convert.ToDateTime( date_Range.new_begin_dt.ToString("yyyy-MM-dd HH:mm:ss")),
|
|
|
+ EndTimeDt = Convert.ToDateTime(date_Range.new_end_dt.ToString("yyyy-MM-dd HH:mm:ss")),
|
|
|
Duration = new_duration,
|
|
|
Deduction = thisTypeDeduction,
|
|
|
|
|
|
- Apply_time_dt = sp_item.apply_time_dt,
|
|
|
+ Apply_time_dt = Convert.ToDateTime(sp_item.apply_time_dt.ToString("yyyy-MM-dd HH:mm:ss")),
|
|
|
|
|
|
};
|
|
|
ex_ItemInfos.Add(ex_Item);
|
|
@@ -433,6 +449,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
List<Root> roots_words= checkInDayDataView.datas.Where(it => it.base_info.day_type == 0).ToList();
|
|
|
List<Root> roots_exs = checkInDayDataView.datas.Where(it => it.exception_infos.Count > 0).ToList();
|
|
|
Root roots_ex = roots_exs.Where(it => it.base_info.dateDt == pc_ex_item.sch_checkin_time_dt).FirstOrDefault();
|
|
|
+ if (roots_ex != null) {
|
|
|
List<Exception_infos> exception_infos = roots_ex.exception_infos;
|
|
|
|
|
|
List<Exception_infos> exception_infos1 = checkInDayDataView.datas[29].exception_infos;
|
|
@@ -569,6 +586,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -678,11 +696,14 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
|
|
|
public static void CalculateTypeFee(int leaveType, string date_Range_type, string startTime, string endTime,decimal amountPayable,int work_days,
|
|
|
- int duration, out decimal mealDeduction, out decimal typeDeduction)
|
|
|
+ decimal duration, out decimal mealDeduction, out decimal typeDeduction)
|
|
|
{
|
|
|
typeDeduction = 0;
|
|
|
mealDeduction = 0;
|
|
|
|
|
|
+
|
|
|
+ if (duration == 7) duration = 7.50M;
|
|
|
+
|
|
|
string am_starttime = "08:59";
|
|
|
string am_endtime = "13:01";
|
|
|
|
|
@@ -709,26 +730,26 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
else if (date_Range_type == "hour")
|
|
|
{
|
|
|
- int leave_halfHour = duration / Convert.ToInt32(0.5);
|
|
|
+ decimal leave_halfHour = Convert.ToDecimal(duration) / Convert.ToDecimal(0.5);
|
|
|
typeDeduction = personalkLeave_dailywage_halfhour * leave_halfHour;
|
|
|
- if (duration >= 3)
|
|
|
+ if (duration >= 3 && duration <= 7.5M)
|
|
|
{
|
|
|
|
|
|
if (startTime.CompareTo(am_starttime) > 0 && startTime.CompareTo(am_endtime) < 0)
|
|
|
{
|
|
|
|
|
|
- if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
|
|
|
+ if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) > 0)
|
|
|
{
|
|
|
mealDeduction = 10;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if (duration > 7.5)
|
|
|
+ else if (duration > 7.5M)
|
|
|
{
|
|
|
- int leave_halfHour1 = duration / Convert.ToInt32(0.5);
|
|
|
+ decimal leave_halfHour1 = Convert.ToDecimal(duration) / Convert.ToDecimal(0.5);
|
|
|
typeDeduction = personalkLeave_dailywage_halfhour * leave_halfHour1;
|
|
|
|
|
|
- decimal leaveDays = Convert.ToDecimal(duration / 7.5);
|
|
|
+ decimal leaveDays = duration / 7.5M;
|
|
|
if (leaveDays % 1 == 0)
|
|
|
{
|
|
|
mealDeduction = 10 * leaveDays;
|
|
@@ -765,9 +786,9 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
else if (date_Range_type == "hour")
|
|
|
{
|
|
|
- int sickLeave_halfHour = duration / Convert.ToInt32(0.5);
|
|
|
+ decimal sickLeave_halfHour = duration / 0.5M;
|
|
|
typeDeduction = sickLeave_dailywage_halfhour_deduction *sickLeave_halfHour ;
|
|
|
- if (duration >= 3 && duration <= 7.5)
|
|
|
+ if (duration >= 3 && duration <= 7.5M)
|
|
|
{
|
|
|
|
|
|
if (startTime.CompareTo(am_starttime) > 0 && startTime.CompareTo(am_endtime) < 0)
|
|
@@ -779,12 +800,12 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if (duration > 7.5)
|
|
|
+ else if (duration > 7.5M)
|
|
|
{
|
|
|
- int sickLeave_halfHour1 = duration / Convert.ToInt32(0.5);
|
|
|
+ decimal sickLeave_halfHour1 = duration / 0.5M;
|
|
|
typeDeduction = sickLeave_dailywage_halfhour_deduction * sickLeave_halfHour1;
|
|
|
|
|
|
- decimal leaveDays = Convert.ToDecimal(duration / 7.5);
|
|
|
+ decimal leaveDays = Convert.ToDecimal(duration / 7.5M);
|
|
|
if (leaveDays % 1 == 0)
|
|
|
{
|
|
|
mealDeduction = 10 * leaveDays;
|
|
@@ -841,7 +862,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
|
|
|
|
|
|
- public static void CalculateTypeFeeSub(string date_Range_type, string startTime, string endTime, int duration, out decimal mealDeduction)
|
|
|
+ public static void CalculateTypeFeeSub(string date_Range_type, string startTime, string endTime, decimal duration, out decimal mealDeduction)
|
|
|
{
|
|
|
mealDeduction = 0;
|
|
|
string am_starttime = "08:59";
|
|
@@ -865,13 +886,13 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if (duration >= 7 && duration <= 7.5 )
|
|
|
+ else if (duration >= 7 && duration <= 7.50M )
|
|
|
{
|
|
|
mealDeduction = 10;
|
|
|
}
|
|
|
- else if (duration >= 7.5)
|
|
|
+ else if (duration >= 7.50M)
|
|
|
{
|
|
|
- decimal leaveDays = Convert.ToDecimal(duration / 7.5);
|
|
|
+ decimal leaveDays = Convert.ToDecimal(duration / 7.50M);
|
|
|
|
|
|
if (leaveDays % 1 == 0)
|
|
|
{
|