|
@@ -15,6 +15,7 @@ using System.Collections.Generic;
|
|
|
using System.Diagnostics.Eventing.Reader;
|
|
|
using System.Drawing;
|
|
|
using System.Linq.Expressions;
|
|
|
+using System.Text.Json.Nodes;
|
|
|
using TencentCloud.Ocr.V20181119.Models;
|
|
|
|
|
|
namespace OASystem.API.OAMethodLib
|
|
@@ -99,8 +100,36 @@ namespace OASystem.API.OAMethodLib
|
|
|
//工作日日报
|
|
|
workday_userRoots = workday_userRoots.OrderBy(it => it.base_info.date).ToList();
|
|
|
|
|
|
- //获取 请假类型 Sp_Detail.template_id
|
|
|
- string leave_template_id = "C4NzTJCh1onCUK915rRkvy7Fh5Vqz4YbiEV9jrBY1";
|
|
|
+
|
|
|
+ //获取企业打卡规则
|
|
|
+ CorpCheckInRuleView corpCheckInRole = await _qiYeWeChatApiService.GetCheckIn_CorpCheckInOptionAsync();
|
|
|
+ if (corpCheckInRole.errcode != 0)
|
|
|
+ {
|
|
|
+ _result.Msg = "【企业微信】【打卡】【获取企业打卡规则】【Msg】" + corpCheckInRole.errmsg;
|
|
|
+ return _result;
|
|
|
+ }
|
|
|
+
|
|
|
+ int spe_offdays = 0;
|
|
|
+
|
|
|
+ GroupItem group = corpCheckInRole.group.Where(it => it.groupid == 4).FirstOrDefault();
|
|
|
+ if (group != null)
|
|
|
+ {
|
|
|
+ foreach (var item in group.spe_offdays)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (item.begtime_dt>= startDt && item.endtime_dt <= endDt)
|
|
|
+ {
|
|
|
+ TimeSpan ts = item.endtime_dt - item.begtime_dt;
|
|
|
+ spe_offdays += ts.Days;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //获取 请假类型 Sp_Detail.template_id
|
|
|
+ string leave_template_id = "C4NzTJCh1onCUK915rRkvy7Fh5Vqz4YbiEV9jrBY1";
|
|
|
List<VacationLeaveTypeView> vacationLeaveTypes = await GetVacationLeaveTypes(leave_template_id);
|
|
|
if (vacationLeaveTypes.Count <= 0)
|
|
|
{
|
|
@@ -1339,7 +1368,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
|
|
|
#region 应发合计 实发合计 扣款合计(假勤扣款,其他扣款,社保扣款,公积金代扣,个税扣款)
|
|
|
-
|
|
|
+ int workDays = dk_work_days + spe_offdays;
|
|
|
decimal mealTotal = meal_subsidy - meal_deduction; //餐补
|
|
|
decimal salaryTotal = 0.00M;
|
|
|
if (dk_work_days >= work_days)
|
|
@@ -1355,7 +1384,9 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- salaryTotal = (dk_work_days * dailyWage) + mealTotal + pm_wsInfo.OtherHandle; //应发合计
|
|
|
+
|
|
|
+
|
|
|
+ salaryTotal = (workDays * dailyWage) + mealTotal + pm_wsInfo.OtherHandle; //应发合计
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1373,7 +1404,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
pm_wsInfo.StartDate = startDt.ToString("yyyy-MM-dd");
|
|
|
pm_wsInfo.EndDate = endDt.ToString("yyyy-MM-dd");
|
|
|
pm_wsInfo.WorkDays = work_days; //当月应出勤天数
|
|
|
- pm_wsInfo.RegularDays = dk_work_days; //当月正常出勤天数
|
|
|
+ pm_wsInfo.RegularDays = workDays; //当月正常出勤天数
|
|
|
|
|
|
pm_wsInfo.SickLeave = sickLeaveTotal; //病假
|
|
|
pm_wsInfo.SomethingFalse = personalLeaveTotal; //事假
|
|
@@ -1399,8 +1430,6 @@ namespace OASystem.API.OAMethodLib
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -2260,5 +2289,19 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
return workdays;
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取一个类指定的属性值
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="info">object对象</param>
|
|
|
+ /// <param name="field">属性名称</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static object GetPropertyValue(object info, string field)
|
|
|
+ {
|
|
|
+ if (info == null) return null;
|
|
|
+ System.Type t = info.GetType();
|
|
|
+ IEnumerable<System.Reflection.PropertyInfo> property = from pi in t.GetProperties() where pi.Name.ToLower() == field.ToLower() select pi;
|
|
|
+ return property.First().GetValue(info, null);
|
|
|
+ }
|
|
|
}
|
|
|
}
|