Browse Source

计算工资 5.9

leiy 1 year ago
parent
commit
794b207848
1 changed files with 14 additions and 16 deletions
  1. 14 16
      OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs

+ 14 - 16
OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs

@@ -311,7 +311,6 @@ namespace OASystem.API.OAMethodLib
                                 SubTypeId = 7,
                                 SubType = "打卡补卡",
                                 StartTimeDt = Convert.ToDateTime(punch_correction1.time_dt.ToString("yyyy-MM-dd HH:mm:ss")),  //未打卡时间
-                                
                                 Deduction = bukaPrice,
                                 Reason = punch_correction2.text,
                                 unit = string.Empty
@@ -413,13 +412,20 @@ namespace OASystem.API.OAMethodLib
                                     //2:超过 10 分钟(含 10 分钟),不足 60 分钟的迟到 / 早退,按 50 元 / 次处罚;
                                     //3:超过 60 分钟(含 60 分钟),不足 3 小时的迟到 / 早退,且无请假者,按旷工半日处理;超过 3 小时的迟到 / 早退,且无请假者,按旷工一日处理。
 
+                                    long date = roots_ex.base_info.date; //当日工作日期
+                                    long earliest_time = roots_ex.summary_info.earliest_time; //最早打卡时间
+                                    long lastest_time = roots_ex.summary_info.lastest_time; //最晚打卡时间
+                                    long this_date = date + earliest_time;
+                                    DateTime thisDt = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).AddTicks(this_date * 10000000);
+
+                                    string thisDtStr = thisDt.ToString("yyyy-MM-dd");
 
                                     Ex_Item beLate_belate_ex = new Ex_Item()
                                     {
                                         SubTypeId = 4,
                                         SubType = "旷工",
                                         Duration = timelength,
-                                        StartTimeDt = roots_ex.base_info.dateDt,
+                                        StartTimeDt = Convert.ToDateTime(roots_ex.base_info.dateDt.ToString("yyyy-MM-dd")),
                                         unit = "分钟",
                                     };
 
@@ -516,28 +522,23 @@ namespace OASystem.API.OAMethodLib
                                         }
                                         else if (roots_ex.exception_infos.Count == 1)
                                         {
-                                            long date = roots_ex.base_info.date; //当日工作日期
-                                            long earliest_time = roots_ex.summary_info.earliest_time; //最早打卡时间
-                                            long lastest_time = roots_ex.summary_info.lastest_time; //最晚打卡时间
 
                                             if (earliest_time == lastest_time)
                                             {
-                                                long this_date = date + earliest_time;
-                                                DateTime thisDt = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).AddTicks(this_date * 10000000);
-                                                DateTime thisDt1 = Convert.ToDateTime(thisDt.ToString("yyyy-MM-dd") + " 12:00");
+                                                DateTime thisDt1 = Convert.ToDateTime(thisDtStr + " 12:00");
 
                                                 if (thisDt <= thisDt1)  //旷工 下午
                                                 {
                                                     day_deduction = day_miner_unit * 9; //4.5小时
                                                     meal_deduction += 10.00M;
                                                     absenteeism_deduction += day_deduction; //矿工半日
-                                                    beLate_belate_ex.Reason = thisDt.ToString("yyyy-MM-dd") + "下午缺卡/未打卡为旷工 4.5小时";
+                                                    beLate_belate_ex.Reason = thisDtStr + " 下午(18:00)缺卡/未打卡视为下午旷工(4.5小时)";
                                                 }
                                                 else if (thisDt >= thisDt1) //旷工下午
                                                 {
                                                     day_deduction = day_miner_unit * 6; //3小时
                                                     absenteeism_deduction += day_deduction; //矿工半日
-                                                    beLate_belate_ex.Reason = thisDt.ToString("yyyy-MM-dd") + "上午缺卡/未打卡为旷工 3小时";
+                                                    beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)缺卡/未打卡视为上午旷工(3小时)";
                                                 }
                                                 else //矿工一日
                                                 {
@@ -545,24 +546,21 @@ namespace OASystem.API.OAMethodLib
                                                     day_deduction = dailyWage;
                                                     meal_deduction += 10.00M;
                                                     absenteeism_deduction += day_deduction;
-                                                    beLate_belate_ex.Reason = thisDt.ToString("yyyy-MM-dd") + "上午-下午 缺卡/未打卡为旷工 一天";
+                                                    beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
                                                 }
 
-
                                                 beLate_belate_ex.Deduction = day_deduction;
                                                 ex_reissuecard_Items.Add(beLate_belate_ex);
 
                                             }
                                         }
-
-                                        
-
                                     }
                                     else if (exception == 4) //旷工
                                     {
                                         if (timelength > 60 && timelength <= 180)
                                         {
                                             day_deduction = day_miner_unit * 6; //3小时
+                                            beLate_belate_ex.Reason = thisDtStr + " 缺卡/未打视为旷工上午(3小时)";
                                             meal_deduction += 10.00M;
                                             absenteeism_deduction += day_deduction; //矿工半日
 
@@ -570,6 +568,7 @@ namespace OASystem.API.OAMethodLib
                                         else
                                         {
                                             day_deduction = dailyWage;
+                                            beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
                                             meal_deduction += 10.00M;
                                             absenteeism_deduction += day_deduction; //矿工一日
                                         }
@@ -580,7 +579,6 @@ namespace OASystem.API.OAMethodLib
 
                                 }
                             }
-
                         }
                     }