|
@@ -1,9 +1,12 @@
|
|
|
-using OASystem.API.OAMethodLib.QiYeWeChatAPI;
|
|
|
+using Google.Protobuf.WellKnownTypes;
|
|
|
+using OASystem.API.OAMethodLib.QiYeWeChatAPI;
|
|
|
using OASystem.Domain;
|
|
|
using OASystem.Domain.Entities.PersonnelModule;
|
|
|
using OASystem.Domain.ViewModels.PersonnelModule;
|
|
|
using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
|
+using System;
|
|
|
+using System.Linq.Expressions;
|
|
|
using TencentCloud.Ocr.V20181119.Models;
|
|
|
|
|
|
namespace OASystem.API.OAMethodLib
|
|
@@ -44,6 +47,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
CheckInView checkIn = await _qiYeWeChatApiService.GetCheckin_MonthDataAsync(startDt, endDt);
|
|
|
if (checkIn.errcode != 0)
|
|
@@ -54,23 +58,15 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
List<Data> checkInDatas = checkIn.datas;
|
|
|
|
|
|
-
|
|
|
- List<Sp_Detail> sp_leave_details = new List<Sp_Detail>();
|
|
|
- sp_leave_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, 2, 1);
|
|
|
- if (sp_leave_details.Count <= 0)
|
|
|
+
|
|
|
+ string leave_template_id = "C4NzTJCh1onCUK915rRkvy7Fh5Vqz4YbiEV9jrBY1";
|
|
|
+ List<VacationLeaveTypeView> vacationLeaveTypes = await GetVacationLeaveTypes(leave_template_id);
|
|
|
+ if (vacationLeaveTypes.Count <= 0)
|
|
|
{
|
|
|
- string errMsg = startDt + " - " + endDt + "请假 审批数据获取失败!";
|
|
|
+ _result.Msg = startDt + " - " + endDt + "请假 类型数据 获取失败!";
|
|
|
return _result;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- List<Sp_Detail> sp_reissuecard_details = new List<Sp_Detail>();
|
|
|
- sp_reissuecard_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, 2, 2);
|
|
|
- if (sp_reissuecard_details.Count <= 0)
|
|
|
- {
|
|
|
- string errMsg = startDt + " - " + endDt + "打卡补卡 审批数据获取失败!";
|
|
|
- return _result;
|
|
|
- }
|
|
|
|
|
|
foreach (var pm_wsInfo in pm_WageSheetDattaSources)
|
|
|
{
|
|
@@ -105,6 +101,16 @@ namespace OASystem.API.OAMethodLib
|
|
|
if (checkInData == null) { continue; }
|
|
|
string acctid = checkInData.base_info.acctid;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ List<Sp_Detail> sp_reissuecard_details = new List<Sp_Detail>();
|
|
|
+ sp_reissuecard_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, acctid, 2, 2);
|
|
|
+ if (sp_reissuecard_details.Count <= 0)
|
|
|
+ {
|
|
|
+ _result.Msg += startDt + " - " + endDt + " " + itemName + " 打卡补卡 审批数据获取未获取到!\r\n";
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
Summary_Info? summary_Info = checkInData.summary_info;
|
|
|
if (summary_Info == null) { continue; }
|
|
@@ -120,7 +126,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
decimal amountPayable = pm_wsInfo.Basic + pm_wsInfo.Floats + pm_wsInfo.PostAllowance + pm_wsInfo.GarmentWashSubsidies + pm_wsInfo.CommunicationSubsidies +
|
|
|
pm_wsInfo.TrafficSubsidies + pm_wsInfo.InformationSecurityFee + pm_wsInfo.OperationBonus + pm_wsInfo.SpecialAllowance + pm_wsInfo.OtherSubsidies + pm_wsInfo.GroupCost;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
decimal dailyWage = amountPayable / work_days;
|
|
|
|
|
|
|
|
@@ -168,13 +174,19 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
#region 请假类型金额/餐补 处理
|
|
|
|
|
|
- List<Sp_Detail> sp_leave_item_infosData = sp_leave_details.Where(it => it.applyer.userid == acctid).ToList();
|
|
|
+ List<Sp_Detail> sp_leave_details = new List<Sp_Detail>();
|
|
|
+ sp_leave_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, acctid, 2 , 1);
|
|
|
+ if (sp_leave_details.Count <= 0)
|
|
|
+ {
|
|
|
+ _result.Msg += startDt + " - " + endDt +" "+itemName + " 请假 审批数据获取未获取到!\r\n";
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
List<Ex_Items> ex_Items = new List<Ex_Items>();
|
|
|
Ex_Items ex_Items_jq = new Ex_Items() { Type = "假勤" };
|
|
|
List<Ex_Item> ex_ItemInfos = new List<Ex_Item>();
|
|
|
|
|
|
- foreach (Sp_Detail sp_item in sp_leave_item_infosData)
|
|
|
+ foreach (Sp_Detail sp_item in sp_leave_details)
|
|
|
{
|
|
|
Apply_data? apply_data = sp_item.apply_data;
|
|
|
if (apply_data != null)
|
|
@@ -188,172 +200,60 @@ namespace OASystem.API.OAMethodLib
|
|
|
Vacation vacation = content_Vacation.value.vacation;
|
|
|
Attendance attendance = vacation.attendance;
|
|
|
Selector selector = vacation.selector;
|
|
|
- }
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ List<OptionsItem> optionsItems = selector.options;
|
|
|
+ List<TitleItem> value = optionsItems[0].value;
|
|
|
+
|
|
|
+ int leaveType = int.Parse(optionsItems[0].key);
|
|
|
+ Date_range date_Range = attendance.date_range;
|
|
|
+
|
|
|
+ decimal thisTypeDeduction = 0.00M;
|
|
|
+ string leave_starttime = date_Range.new_begin_dt.ToString("HH:mm");
|
|
|
+ string leave_endtime = date_Range.new_end_dt.ToString("HH:mm");
|
|
|
+
|
|
|
+ string typeName = string.Empty;
|
|
|
+ int leaveTypeId = leaveType;
|
|
|
+ var leaveTypeData = vacationLeaveTypes.Where(it => it.id == leaveTypeId).FirstOrDefault();
|
|
|
+
|
|
|
+ if (leaveTypeData != null) { typeName = leaveTypeData.name; }
|
|
|
+
|
|
|
+
|
|
|
+ int new_duration = 0;
|
|
|
+ if (date_Range.type == "halfday")
|
|
|
+ {
|
|
|
+ new_duration =date_Range.new_duration / 86400;
|
|
|
+ }
|
|
|
+ else if (date_Range.type == "hour")
|
|
|
+ {
|
|
|
+ new_duration =date_Range.new_duration / 3600;
|
|
|
+ }
|
|
|
+ decimal leave_meals = 0.00M;
|
|
|
+ CalculateTypeFee(leaveType, date_Range.type, leave_starttime, leave_endtime, amountPayable, work_days, new_duration,
|
|
|
+ out leave_meals, out thisTypeDeduction);
|
|
|
+
|
|
|
+ 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");
|
|
|
+
|
|
|
+ Ex_Item ex_Item = new Ex_Item()
|
|
|
+ {
|
|
|
+ SubTypeId = leaveType,
|
|
|
+ SubType = typeName,
|
|
|
+ Start_end_time_dt = startEndTiime,
|
|
|
+ Duration = new_duration,
|
|
|
+ Deduction = thisTypeDeduction,
|
|
|
+
|
|
|
+ Apply_time_dt = sp_item.apply_time_dt,
|
|
|
+
|
|
|
+ };
|
|
|
+ ex_ItemInfos.Add(ex_Item);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (ex_ItemInfos.Count > 0)
|
|
|
{
|
|
|
- ex_Items_jq.Ex_ItemInfo = ex_ItemInfos.OrderBy(it => it.SubTypeId).ThenBy(it => it.Start_time_dt).ToList();
|
|
|
+ ex_Items_jq.Ex_ItemInfo = ex_ItemInfos.OrderBy(it => it.SubTypeId).ThenBy(it => it.Apply_time_dt).ToList();
|
|
|
ex_Items.Add(ex_Items_jq);
|
|
|
}
|
|
|
|
|
@@ -572,12 +472,314 @@ namespace OASystem.API.OAMethodLib
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
+
|
|
|
_result.Code = 0;
|
|
|
_result.Data = pm_WageSheetDattaSources;
|
|
|
|
|
|
return _result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static async Task<List<VacationLeaveTypeView>> GetVacationLeaveTypes(string template_id)
|
|
|
+ {
|
|
|
+ List<VacationLeaveTypeView> vacationLeaveTypes = new List<VacationLeaveTypeView>();
|
|
|
+
|
|
|
+ TemplateDetailView templateDetailView = new TemplateDetailView();
|
|
|
+ templateDetailView = await _qiYeWeChatApiService.GetTemplateDetailAsync(template_id);
|
|
|
+ if (templateDetailView.errcode != 0)
|
|
|
+ {
|
|
|
+ return vacationLeaveTypes;
|
|
|
+ }
|
|
|
+ List<VacationItemInfo> VacationItemInfos = templateDetailView.vacation_list.item;
|
|
|
+
|
|
|
+ foreach (var item in VacationItemInfos)
|
|
|
+ {
|
|
|
+ ValueItem valueInfo = item.name.Where(it => it.lang == "zh_CN").FirstOrDefault();
|
|
|
+ if (valueInfo != null)
|
|
|
+ {
|
|
|
+ vacationLeaveTypes.Add(
|
|
|
+ new VacationLeaveTypeView()
|
|
|
+ {
|
|
|
+ id = item.id,
|
|
|
+ name = valueInfo.text
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return vacationLeaveTypes;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 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)
|
|
|
+ {
|
|
|
+ typeDeduction = 0;
|
|
|
+ mealDeduction = 0;
|
|
|
+
|
|
|
+ string am_starttime = "08:59";
|
|
|
+ string am_endtime = "13:01";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ decimal personalkLeave_dailywage_day = amountPayable / work_days;
|
|
|
+
|
|
|
+
|
|
|
+ decimal halfHour = Convert.ToDecimal(7.5) / Convert.ToDecimal(0.5);
|
|
|
+
|
|
|
+ switch (leaveType)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+
|
|
|
+ decimal personalkLeave_dailywage_halfhour = personalkLeave_dailywage_day / halfHour;
|
|
|
+
|
|
|
+ if (date_Range_type == "halfday")
|
|
|
+ {
|
|
|
+ mealDeduction = 10;
|
|
|
+ typeDeduction = personalkLeave_dailywage_day;
|
|
|
+ }
|
|
|
+ else if (date_Range_type == "hour")
|
|
|
+ {
|
|
|
+ int leave_halfHour = duration / Convert.ToInt32(0.5);
|
|
|
+ typeDeduction = personalkLeave_dailywage_halfhour * leave_halfHour;
|
|
|
+ if (duration >= 3)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (startTime.CompareTo(am_starttime) > 0 && startTime.CompareTo(am_endtime) < 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
|
|
|
+ {
|
|
|
+ mealDeduction = 10;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (duration > 7.5)
|
|
|
+ {
|
|
|
+ int leave_halfHour1 = duration / Convert.ToInt32(0.5);
|
|
|
+ typeDeduction = personalkLeave_dailywage_halfhour * leave_halfHour1;
|
|
|
+
|
|
|
+ decimal leaveDays = Convert.ToDecimal(duration / 7.5);
|
|
|
+ if (leaveDays % 1 == 0)
|
|
|
+ {
|
|
|
+ mealDeduction = 10 * leaveDays;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mealDeduction = 10 * Convert.ToInt32(leaveDays);
|
|
|
+
|
|
|
+
|
|
|
+ int lastHours = (Convert.ToDateTime(endTime) - Convert.ToDateTime("09:00")).Hours;
|
|
|
+ if (lastHours >= 3)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
|
|
|
+ {
|
|
|
+ mealDeduction += 10;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+
|
|
|
+
|
|
|
+ decimal chengDuMinimumWage_halrHour = _chengDuMinimumWage / work_days / halfHour;
|
|
|
+ decimal sickLeave_dailywage_halfhour_deduction = personalkLeave_dailywage_day - chengDuMinimumWage_halrHour;
|
|
|
+
|
|
|
+ if (date_Range_type == "halfday")
|
|
|
+ {
|
|
|
+ mealDeduction = 10;
|
|
|
+ typeDeduction = sickLeave_dailywage_halfhour_deduction * halfHour;
|
|
|
+ }
|
|
|
+ else if (date_Range_type == "hour")
|
|
|
+ {
|
|
|
+ int sickLeave_halfHour = duration / Convert.ToInt32(0.5);
|
|
|
+ typeDeduction = sickLeave_dailywage_halfhour_deduction *sickLeave_halfHour ;
|
|
|
+ if (duration >= 3 && duration <= 7.5)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (startTime.CompareTo(am_starttime) > 0 && startTime.CompareTo(am_endtime) < 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
|
|
|
+ {
|
|
|
+ mealDeduction = 10;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (duration > 7.5)
|
|
|
+ {
|
|
|
+ int sickLeave_halfHour1 = duration / Convert.ToInt32(0.5);
|
|
|
+ typeDeduction = sickLeave_dailywage_halfhour_deduction * sickLeave_halfHour1;
|
|
|
+
|
|
|
+ decimal leaveDays = Convert.ToDecimal(duration / 7.5);
|
|
|
+ if (leaveDays % 1 == 0)
|
|
|
+ {
|
|
|
+ mealDeduction = 10 * leaveDays;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mealDeduction = 10 * Convert.ToInt32(leaveDays);
|
|
|
+
|
|
|
+
|
|
|
+ int lastHours = (Convert.ToDateTime(endTime) - Convert.ToDateTime("09:00")).Hours;
|
|
|
+ if (lastHours >= 3)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
|
|
|
+ {
|
|
|
+ mealDeduction += 10;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static void CalculateTypeFeeSub(string date_Range_type, string startTime, string endTime, int duration, out decimal mealDeduction)
|
|
|
+ {
|
|
|
+ mealDeduction = 0;
|
|
|
+ string am_starttime = "08:59";
|
|
|
+ string am_endtime = "13:01";
|
|
|
+
|
|
|
+ if (date_Range_type == "halfday")
|
|
|
+ {
|
|
|
+ mealDeduction = 10;
|
|
|
+ }
|
|
|
+ else if (date_Range_type == "hour")
|
|
|
+ {
|
|
|
+ if (duration >= 3 && duration < 7)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (startTime.CompareTo(am_starttime) > 0 && startTime.CompareTo(am_endtime) < 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
|
|
|
+ {
|
|
|
+ mealDeduction = 10;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (duration >= 7 && duration <= 7.5 )
|
|
|
+ {
|
|
|
+ mealDeduction = 10;
|
|
|
+ }
|
|
|
+ else if (duration >= 7.5)
|
|
|
+ {
|
|
|
+ decimal leaveDays = Convert.ToDecimal(duration / 7.5);
|
|
|
+
|
|
|
+ if (leaveDays % 1 == 0)
|
|
|
+ {
|
|
|
+ mealDeduction = 10 * leaveDays;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mealDeduction = 10 * Convert.ToInt32(leaveDays);
|
|
|
+
|
|
|
+
|
|
|
+ int lastHours = (Convert.ToDateTime(endTime) - Convert.ToDateTime("09:00")).Hours;
|
|
|
+ if (lastHours >= 3)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
|
|
|
+ {
|
|
|
+ mealDeduction += 10;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static async Task<List<VacationLeaveTypeView>> GetVacationReissueCardTypes(string template_id)
|
|
|
+ {
|
|
|
+ List<VacationLeaveTypeView> vacationLeaveTypes = new List<VacationLeaveTypeView>();
|
|
|
+
|
|
|
+ TemplateDetailView templateDetailView = new TemplateDetailView();
|
|
|
+ templateDetailView = await _qiYeWeChatApiService.GetTemplateDetailAsync(template_id);
|
|
|
+ if (templateDetailView.errcode != 0)
|
|
|
+ {
|
|
|
+ return vacationLeaveTypes;
|
|
|
+ }
|
|
|
+ List<VacationItemInfo> VacationItemInfos = templateDetailView.vacation_list.item;
|
|
|
+
|
|
|
+ foreach (var item in VacationItemInfos)
|
|
|
+ {
|
|
|
+ ValueItem valueInfo = item.name.Where(it => it.lang == "zh_CN").FirstOrDefault();
|
|
|
+ if (valueInfo != null)
|
|
|
+ {
|
|
|
+ vacationLeaveTypes.Add(
|
|
|
+ new VacationLeaveTypeView()
|
|
|
+ {
|
|
|
+ id = item.id,
|
|
|
+ name = valueInfo.text
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return vacationLeaveTypes;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|