|
@@ -80,7 +80,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
|
|
|
CheckInDataView checkInDataView = new CheckInDataView();
|
|
|
- checkInDataView = await _qiYeWeChatApiService.GetCheckinDataAsync(qyWhchatIdList, 2,startDt, endDt);
|
|
|
+ checkInDataView = await _qiYeWeChatApiService.GetCheckinDataAsync(qyWhchatIdList, 3,startDt, endDt);
|
|
|
if (checkInDataView.errcode != 0)
|
|
|
{
|
|
|
_result.Msg = "【企业微信】【打卡】【获取时间段内所有日打卡记录】【Msg】" + checkInDataView.errmsg;
|
|
@@ -203,6 +203,11 @@ namespace OASystem.API.OAMethodLib
|
|
|
checkInData1 = checkInDataView.checkindata;
|
|
|
List<CheckInDataInfo> checkInDatas = new List<CheckInDataInfo>();
|
|
|
checkInDatas = checkInData1.Where(it => it.userid == acctid).ToList();
|
|
|
+
|
|
|
+ List<CheckInDataInfo> checkInData2 = new List<CheckInDataInfo>();
|
|
|
+ checkInData2 = checkInDatas.Where(it => it.exception_type.Equals("未打卡")).ToList();
|
|
|
+
|
|
|
+
|
|
|
|
|
|
#region 迟到 早退 旷工
|
|
|
|
|
@@ -434,109 +439,119 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- foreach (var checkInData in checkInDatas)
|
|
|
- {
|
|
|
-
|
|
|
- decimal timelength = 0.00M;
|
|
|
- string thisTime = string.Format(@"12:00:00");
|
|
|
- string wcdkTime = checkInData.checkin_time_dt.ToString("HH:mm:ss");
|
|
|
- DateTime wcdkDt = Convert.ToDateTime(wcdkTime);
|
|
|
-
|
|
|
- if (Convert.ToDateTime(thisTime) > wcdkDt)
|
|
|
- {
|
|
|
- DateTime amDt = Convert.ToDateTime("09:00:00");
|
|
|
- timelength = (decimal)(wcdkDt - amDt).TotalMinutes;
|
|
|
- if (wcdkDt <= amDt)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- DateTime pmDt = Convert.ToDateTime("18:00:00");
|
|
|
- DateTime pmDt1 = Convert.ToDateTime("13:30:00");
|
|
|
- timelength = (decimal)(pmDt1 - wcdkDt).TotalMinutes;
|
|
|
- if (wcdkDt >= pmDt)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (timelength < 1)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- timelength = ConvertToDecimal(timelength);
|
|
|
- decimal day_deduction = 0.00M;
|
|
|
-
|
|
|
- Ex_Item beLate_belate_ex = new Ex_Item()
|
|
|
- {
|
|
|
- SubTypeId = 4,
|
|
|
- SubType = "旷工",
|
|
|
- Duration = timelength,
|
|
|
- StartTimeDt = checkInData.checkin_time_dt,
|
|
|
- Unit = "分钟",
|
|
|
- Reason = "[外出打卡]"
|
|
|
- };
|
|
|
-
|
|
|
- if (timelength >= 1 && timelength < 10)
|
|
|
- {
|
|
|
- user_cd_zt_num++;
|
|
|
- beLate_belate_ex.SubTypeId = 1;
|
|
|
- beLate_belate_ex.SubType = "迟到";
|
|
|
- string thisStartDt = wcdkDt.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
- beLate_belate_ex.StartTimeDt = Convert.ToDateTime(thisStartDt);
|
|
|
-
|
|
|
- if (user_cd_zt_num >= 3)
|
|
|
- {
|
|
|
- day_deduction = 50.00M;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- day_deduction = 0.00M;
|
|
|
- }
|
|
|
- beLate_belate_ex.Reason += "迟到/早退";
|
|
|
- beLate_deduction += day_deduction;
|
|
|
- }
|
|
|
- else if (timelength >= 10 && timelength <= 60)
|
|
|
- {
|
|
|
- beLate_belate_ex.SubType = "迟到";
|
|
|
- string thisStartDt = wcdkDt.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
- beLate_belate_ex.StartTimeDt = Convert.ToDateTime(thisStartDt);
|
|
|
-
|
|
|
- day_deduction = 50.00M;
|
|
|
- beLate_deduction += day_deduction;
|
|
|
- beLate_belate_ex.SubTypeId = 1;
|
|
|
- beLate_belate_ex.Reason += "迟到/早退";
|
|
|
- }
|
|
|
- else if (timelength > 60 && timelength <= 180)
|
|
|
- {
|
|
|
- day_deduction = ConvertToDecimal(((dailyWage / 7.50M) * 3.00M));
|
|
|
- meal_deduction += 10.00M;
|
|
|
- absenteeism_deduction += day_deduction;
|
|
|
- beLate_belate_ex.Reason += " 迟到/早退(60分钟) 视为旷工上午(3小时)";
|
|
|
- }
|
|
|
- else if (timelength > 180 && timelength <= 270)
|
|
|
- {
|
|
|
- day_deduction = ConvertToDecimal(((dailyWage / 7.50M) * 4.50M));
|
|
|
- meal_deduction += 10.00M;
|
|
|
- absenteeism_deduction += day_deduction;
|
|
|
- beLate_belate_ex.Reason += " 迟到/早退(60分钟) 视为旷工下午(4.5小时)";
|
|
|
- }
|
|
|
- else if(timelength > 270)
|
|
|
- {
|
|
|
- day_deduction = ConvertToDecimal(dailyWage);
|
|
|
- absenteeism_deduction += day_deduction;
|
|
|
- meal_deduction += 10.00M;
|
|
|
- beLate_belate_ex.Reason += " 迟到/早退 视为旷工一天(7.5小时)";
|
|
|
- }
|
|
|
-
|
|
|
- beLate_belate_ex.Deduction = day_deduction;
|
|
|
- ex_reissuecard_Items.Add(beLate_belate_ex);
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ #region 外出打卡 计算旷工迟到
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ #endregion
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -763,6 +778,41 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ foreach (var item in checkInData2)
|
|
|
+ {
|
|
|
+ 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++;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if (ex_reissuecard_Items.Count > 0)
|