|
@@ -278,7 +278,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
beLate_deduction += day_deduction;
|
|
|
}
|
|
|
- else if (timelength >= 10 && timelength <= 60)
|
|
|
+ else if (timelength >= 10 && timelength < 60)
|
|
|
{
|
|
|
string thisStartDt = (TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1))
|
|
|
.AddTicks((date + earliest_time) * 10000000))
|
|
@@ -290,12 +290,12 @@ namespace OASystem.API.OAMethodLib
|
|
|
beLate_belate_ex.SubTypeId = 1;
|
|
|
beLate_belate_ex.SubType = "迟到";
|
|
|
}
|
|
|
- else if (timelength > 60 && timelength <= 180)
|
|
|
+ else if (timelength >= 60 && timelength <= 180)
|
|
|
{
|
|
|
day_deduction = ConvertToDecimal(dailyWage / 2);
|
|
|
meal_deduction += 10.00M;
|
|
|
absenteeism_deduction += day_deduction;
|
|
|
- beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)缺卡/未打卡视为上午旷工(3小时)";
|
|
|
+ beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)缺卡/未打卡视为旷工半天";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -330,7 +330,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
early_deduction += day_deduction;
|
|
|
}
|
|
|
- else if (timelength >= 10 && timelength <= 60)
|
|
|
+ else if (timelength >= 10 && timelength < 60)
|
|
|
{
|
|
|
day_deduction = 50.00M;
|
|
|
early_deduction += day_deduction;
|
|
@@ -341,7 +341,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
beLate_belate_ex.StartTimeDt = Convert.ToDateTime(thisEndDt);
|
|
|
}
|
|
|
- else if (timelength > 60 && timelength <= 180)
|
|
|
+ else if (timelength >= 60 && timelength <= 180)
|
|
|
{
|
|
|
day_deduction = ConvertToDecimal(dailyWage / 2);
|
|
|
meal_deduction += 10.00M;
|
|
@@ -375,7 +375,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
beLate_belate_ex.Duration = 270;
|
|
|
absenteeism_deduction += day_deduction;
|
|
|
- beLate_belate_ex.Reason = thisDtStr + " 下午(18:00)缺卡/未打卡视为下午旷工(4.5小时)";
|
|
|
+ beLate_belate_ex.Reason = thisDtStr + " 下午(18:00)缺卡/未打卡视为旷工半天";
|
|
|
|
|
|
beLate_belate_ex.Deduction = day_deduction;
|
|
|
ex_reissuecard_Items.Add(beLate_belate_ex);
|
|
@@ -386,7 +386,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
meal_deduction += 10.00M;
|
|
|
absenteeism_deduction += day_deduction;
|
|
|
beLate_belate_ex.Duration = 180;
|
|
|
- beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)缺卡/未打卡视为上午旷工(3小时)";
|
|
|
+ beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)缺卡/未打卡视为旷工半天";
|
|
|
|
|
|
beLate_belate_ex.Deduction = day_deduction;
|
|
|
ex_reissuecard_Items.Add(beLate_belate_ex);
|
|
@@ -402,8 +402,6 @@ namespace OASystem.API.OAMethodLib
|
|
|
beLate_belate_ex.Deduction = day_deduction;
|
|
|
ex_reissuecard_Items.Add(beLate_belate_ex);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -411,7 +409,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
day_deduction = dailyWage;
|
|
|
meal_deduction += 10.00M;
|
|
|
absenteeism_deduction += day_deduction;
|
|
|
- beLate_belate_ex.Reason = "上午-下午 缺卡/未打卡为旷工 一天";
|
|
|
+ beLate_belate_ex.Reason = "上午-下午 缺卡/未打卡为旷工一天";
|
|
|
beLate_belate_ex.Deduction = day_deduction;
|
|
|
ex_reissuecard_Items.Add(beLate_belate_ex);
|
|
|
}
|
|
@@ -458,24 +456,22 @@ namespace OASystem.API.OAMethodLib
|
|
|
beLate_belate_ex.Deduction = day_deduction;
|
|
|
ex_reissuecard_Items.Add(beLate_belate_ex);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else if (exception == 4)
|
|
|
{
|
|
|
- if (timelength > 60 && timelength <= 180)
|
|
|
+ if (timelength >= 60 && timelength <= 180)
|
|
|
{
|
|
|
day_deduction = ConvertToDecimal(dailyWage / 2);
|
|
|
- beLate_belate_ex.Reason = thisDtStr + " 缺卡/未打视为旷工上午(3小时)";
|
|
|
+ beLate_belate_ex.Reason = thisDtStr + " 缺卡/未打视为旷工半天";
|
|
|
meal_deduction += 10.00M;
|
|
|
absenteeism_deduction += day_deduction;
|
|
|
}
|
|
|
else if (timelength > 180 && timelength <= 270)
|
|
|
{
|
|
|
day_deduction = ConvertToDecimal(dailyWage / 2);
|
|
|
- beLate_belate_ex.Reason = thisDtStr + " 缺卡/未打视为旷工下午午(4.5小时)";
|
|
|
+ beLate_belate_ex.Reason = thisDtStr + " 缺卡/未打视为旷工半天";
|
|
|
meal_deduction += 10.00M;
|
|
|
absenteeism_deduction += day_deduction;
|
|
|
}
|
|
@@ -490,7 +486,6 @@ namespace OASystem.API.OAMethodLib
|
|
|
beLate_belate_ex.Deduction = day_deduction;
|
|
|
ex_reissuecard_Items.Add(beLate_belate_ex);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -747,10 +742,8 @@ namespace OASystem.API.OAMethodLib
|
|
|
leave_item.IsDeduction = true;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
#region 累计类型扣款
|
|
|
|
|
|
-
|
|
|
if (leaveType == 2)
|
|
|
{
|
|
|
personalLeaveTotal += thisTypeDeduction;
|
|
@@ -797,6 +790,57 @@ namespace OASystem.API.OAMethodLib
|
|
|
List<Sp_Detail> sp_buka_details = new List<Sp_Detail>();
|
|
|
sp_buka_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, acctid, 2, 2);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ List<Sp_Detail> sp_goout_details = new List<Sp_Detail>();
|
|
|
+ sp_goout_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, acctid, 2, 4);
|
|
|
+
|
|
|
+ List<CheckInDataInfo> filtratePrefix_checkInData = new List<CheckInDataInfo>();
|
|
|
+
|
|
|
+
|
|
|
+ if (sp_goout_details.Count > 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ List<string> goOutDts = new List<string>();
|
|
|
+ foreach (var goOutItem in sp_goout_details)
|
|
|
+ {
|
|
|
+ Apply_data? apply_data = goOutItem.apply_data;
|
|
|
+ if (apply_data != null)
|
|
|
+ {
|
|
|
+ List<ContentsItem> contents = apply_data.contents;
|
|
|
+ ContentsItem content_Vacation = contents.Where(it => it.control == "Attendance").FirstOrDefault();
|
|
|
+ ContentsItem content_Textarea = contents.Where(it => it.control == "Textarea").FirstOrDefault();
|
|
|
+
|
|
|
+ if (content_Vacation != null)
|
|
|
+ {
|
|
|
+ var attendance = content_Vacation.value.attendance;
|
|
|
+
|
|
|
+ DateTime goOutDt = attendance.date_range.new_begin_dt;
|
|
|
+ DateTime goOutDtJudge = Convert.ToDateTime(goOutDt.ToString("yyyy-MM-dd"));
|
|
|
+
|
|
|
+ if (startDt >= goOutDtJudge || goOutDtJudge > endDt)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ goOutDts.Add(goOutDt.ToString("yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (goOutDts.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var goOutDtItem in goOutDts)
|
|
|
+ {
|
|
|
+ List<CheckInDataInfo> filtrate_checkInData = new List<CheckInDataInfo>();
|
|
|
+ filtrate_checkInData = checkInData2.Where(it => it.checkin_time_dt.ToString("yyyy-MM-dd").Equals(goOutDtItem)).ToList();
|
|
|
+ if (filtrate_checkInData.Count > 0)
|
|
|
+ {
|
|
|
+ filtratePrefix_checkInData.AddRange(filtrate_checkInData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
int bukaNum = 1;
|
|
|
foreach (var item in sp_buka_details)
|
|
|
{
|
|
@@ -819,7 +863,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- decimal bukaPrice = 0.00M;
|
|
|
+ decimal bukaPrice = 0.00M;
|
|
|
|
|
|
if (user_probationary_bk_decimal == 0)
|
|
|
{
|
|
@@ -834,11 +878,51 @@ namespace OASystem.API.OAMethodLib
|
|
|
else bukaPrice = 50.00M;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
var app_data = item.apply_data;
|
|
|
var punch_correction1 = app_data.contents[0].value.punch_correction;
|
|
|
var punch_correction2 = app_data.contents[1].value;
|
|
|
|
|
|
+ #region 处理未打卡记录表数据 已补卡的数据
|
|
|
+
|
|
|
+ if (filtratePrefix_checkInData.Count > 0)
|
|
|
+ {
|
|
|
+ var filtratePrefix_checkInItems = filtratePrefix_checkInData.Where(it => it.sch_checkin_time_dt.ToString("yyyy-MM-dd")
|
|
|
+ .Equals(punch_correction1.time_dt.ToString("yyyy-MM-dd"))).ToList();
|
|
|
+ if (filtratePrefix_checkInItems.Count > 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ TimeSpan _strWorkingDayAM = DateTime.Parse("09:00").TimeOfDay;
|
|
|
+ TimeSpan _endWorkingDayAM = DateTime.Parse("12:00").TimeOfDay;
|
|
|
+ TimeSpan _strWorkingDayPM = DateTime.Parse("13:30").TimeOfDay;
|
|
|
+ TimeSpan _endWorkingDayPM = DateTime.Parse("18:00").TimeOfDay;
|
|
|
+ TimeSpan _dspNow = punch_correction1.time_dt.TimeOfDay;
|
|
|
+
|
|
|
+
|
|
|
+ var filtratePrefix_checkInItemAMs = filtratePrefix_checkInItems.Where(it => it.sch_checkin_time_dt.TimeOfDay >= _strWorkingDayAM &&
|
|
|
+ it.sch_checkin_time_dt.TimeOfDay <= _endWorkingDayAM ).ToList();
|
|
|
+ if (filtratePrefix_checkInItemAMs.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var filtratePrefix_checkInItem1 in filtratePrefix_checkInItemAMs)
|
|
|
+ {
|
|
|
+ filtratePrefix_checkInData.Remove(filtratePrefix_checkInItem1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ var filtratePrefix_checkInItemPMs = filtratePrefix_checkInItems.Where(it => it.sch_checkin_time_dt.TimeOfDay >= _strWorkingDayPM &&
|
|
|
+ it.sch_checkin_time_dt.TimeOfDay <= _endWorkingDayPM).ToList();
|
|
|
+ if (filtratePrefix_checkInItemPMs.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (var filtratePrefix_checkInItem1 in filtratePrefix_checkInItemPMs)
|
|
|
+ {
|
|
|
+ filtratePrefix_checkInData.Remove(filtratePrefix_checkInItem1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
Ex_Item ex_reissueCard = new Ex_Item()
|
|
|
{
|
|
|
SubTypeId = 7,
|
|
@@ -855,85 +939,35 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- List<Sp_Detail> sp_goout_details = new List<Sp_Detail>();
|
|
|
- sp_goout_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, acctid, 2, 4);
|
|
|
- if (sp_goout_details.Count > 0)
|
|
|
+
|
|
|
+ foreach (var item in filtratePrefix_checkInData)
|
|
|
{
|
|
|
-
|
|
|
- List<string> goOutDts = new List<string>();
|
|
|
- foreach (var goOutItem in sp_goout_details)
|
|
|
- {
|
|
|
- Apply_data? apply_data = goOutItem.apply_data;
|
|
|
- if (apply_data != null)
|
|
|
- {
|
|
|
- List<ContentsItem> contents = apply_data.contents;
|
|
|
- ContentsItem content_Vacation = contents.Where(it => it.control == "Attendance").FirstOrDefault();
|
|
|
- ContentsItem content_Textarea = contents.Where(it => it.control == "Textarea").FirstOrDefault();
|
|
|
+ decimal bukaPrice = 0.00M;
|
|
|
|
|
|
- if (content_Vacation != null)
|
|
|
- {
|
|
|
- var attendance = content_Vacation.value.attendance;
|
|
|
-
|
|
|
- DateTime goOutDt = attendance.date_range.new_begin_dt;
|
|
|
- DateTime goOutDtJudge = Convert.ToDateTime(goOutDt.ToString("yyyy-MM-dd"));
|
|
|
-
|
|
|
- if (startDt >= goOutDtJudge || goOutDtJudge > endDt)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- goOutDts.Add(goOutDt.ToString("yyyy-MM-dd"));
|
|
|
- }
|
|
|
- }
|
|
|
+ if (user_probationary_bk_decimal == 0)
|
|
|
+ {
|
|
|
+ if (bukaNum <= 2) bukaPrice = 0.00M;
|
|
|
+ else if (bukaNum <= 4 && bukaNum > 2) bukaPrice = 10.00M;
|
|
|
+ else bukaPrice = 50.00M;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- List<CheckInDataInfo> filtratePrefix_checkInData = new List<CheckInDataInfo>();
|
|
|
- if (goOutDts.Count > 0)
|
|
|
+ else
|
|
|
{
|
|
|
- foreach (var goOutDtItem in goOutDts)
|
|
|
- {
|
|
|
- List<CheckInDataInfo> filtrate_checkInData = new List<CheckInDataInfo>();
|
|
|
- filtrate_checkInData = checkInData2.Where(it => it.checkin_time_dt.ToString("yyyy-MM-dd").Equals(goOutDtItem)).ToList();
|
|
|
- if (filtrate_checkInData.Count > 0)
|
|
|
- {
|
|
|
- filtratePrefix_checkInData.AddRange(filtrate_checkInData);
|
|
|
- }
|
|
|
- }
|
|
|
+ if (bukaNum <= 2) bukaPrice = 10.00M;
|
|
|
+ else bukaPrice = 50.00M;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- foreach (var item in filtratePrefix_checkInData)
|
|
|
+ Ex_Item ex_reissueCard = new Ex_Item()
|
|
|
{
|
|
|
- decimal bukaPrice = 0.00M;
|
|
|
-
|
|
|
- if (user_probationary_bk_decimal == 0)
|
|
|
- {
|
|
|
- if (bukaNum <= 2) bukaPrice = 0.00M;
|
|
|
- else if (bukaNum <= 4 && bukaNum > 2) bukaPrice = 10.00M;
|
|
|
- else bukaPrice = 50.00M;
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (bukaNum <= 2) bukaPrice = 10.00M;
|
|
|
- else bukaPrice = 50.00M;
|
|
|
- }
|
|
|
-
|
|
|
- Ex_Item ex_reissueCard = new Ex_Item()
|
|
|
- {
|
|
|
- SubTypeId = 7,
|
|
|
- SubType = "打卡补卡",
|
|
|
- StartTimeDt = Convert.ToDateTime(item.checkin_time_dt.ToString("yyyy-MM-dd HH:mm:ss")),
|
|
|
- Deduction = bukaPrice,
|
|
|
- Reason = "[打卡记录]抓取到的未打卡数据!",
|
|
|
- Unit = string.Empty
|
|
|
- };
|
|
|
- unprinted_deduction += bukaPrice;
|
|
|
- ex_reissuecard_Items.Add(ex_reissueCard);
|
|
|
- bukaNum++;
|
|
|
- }
|
|
|
+ SubTypeId = 7,
|
|
|
+ SubType = "打卡补卡",
|
|
|
+ StartTimeDt = Convert.ToDateTime(item.checkin_time_dt.ToString("yyyy-MM-dd HH:mm:ss")),
|
|
|
+ Deduction = bukaPrice,
|
|
|
+ Reason = "[打卡记录]抓取到的未打卡数据!",
|
|
|
+ Unit = string.Empty
|
|
|
+ };
|
|
|
+ unprinted_deduction += bukaPrice;
|
|
|
+ ex_reissuecard_Items.Add(ex_reissueCard);
|
|
|
+ bukaNum++;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1534,7 +1568,52 @@ namespace OASystem.API.OAMethodLib
|
|
|
CalculateTypeFeeSub(leaveDetails, date_Range_type, startTime, endTime, duration, out mealDeduction);
|
|
|
break;
|
|
|
case 9:
|
|
|
- CalculateTypeFeeSub(leaveDetails, date_Range_type, startTime, endTime, duration, out mealDeduction);
|
|
|
+ if (date_Range_type == "halfday")
|
|
|
+ {
|
|
|
+ if (duration >= 0.5M && duration <= 1M)
|
|
|
+ {
|
|
|
+ var njItem = leaveDetails.Where(it => it.StartDt.ToString("yyyy-MM-dd") == startTime.ToString("yyyy-MM-dd") &&
|
|
|
+ it.EndDt.ToString("yyyy-MM-dd") == endTime.ToString("yyyy-MM-dd")).ToList();
|
|
|
+ if (njItem.Count > 1)
|
|
|
+ {
|
|
|
+ if (njItem[0].StartDt == startTime)
|
|
|
+ {
|
|
|
+ mealDeduction = 10;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mealDeduction = 10;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var njManyDaysItem = leaveDetails.Where(it => it.StartDt.ToString("yyyy-MM-dd") == startTime.ToString("yyyy-MM-dd")).ToList();
|
|
|
+ if (njManyDaysItem.Count > 1)
|
|
|
+ {
|
|
|
+ var njManyDaysItem1 = njManyDaysItem.Where(it => it.StartDt != startTime).ToList();
|
|
|
+ if (njManyDaysItem1.Count > 0)
|
|
|
+ {
|
|
|
+ if (njManyDaysItem1[0].Unit.Equals("天"))
|
|
|
+ {
|
|
|
+ mealDeduction = 10 * Math.Floor(duration);
|
|
|
+ }
|
|
|
+ else if (njManyDaysItem1[0].Unit.Equals("小时") && njManyDaysItem1[0].New_Duration >= 3)
|
|
|
+ {
|
|
|
+ mealDeduction = 10 * Math.Floor(duration);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mealDeduction = 10 * Math.Ceiling(duration);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mealDeduction = 10 * Math.Ceiling(duration);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
|
|
|
}
|
|
@@ -1841,7 +1920,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
if (date_Range_type == "halfday")
|
|
|
{
|
|
|
- mealDeduction = 10;
|
|
|
+ mealDeduction = duration * 10;
|
|
|
}
|
|
|
else if (date_Range_type == "hour")
|
|
|
{
|