PayrollComputation.cs 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089
  1. using Google.Protobuf.WellKnownTypes;
  2. using NPOI.OpenXmlFormats.Spreadsheet;
  3. using NPOI.SS.Formula.Functions;
  4. using OASystem.API.OAMethodLib.QiYeWeChatAPI;
  5. using OASystem.Domain;
  6. using OASystem.Domain.Entities.PersonnelModule;
  7. using OASystem.Domain.ViewModels.PersonnelModule;
  8. using OASystem.Domain.ViewModels.QiYeWeChat;
  9. using OASystem.Infrastructure.Repositories.Groups;
  10. using System;
  11. using System.Diagnostics.Eventing.Reader;
  12. using System.Linq.Expressions;
  13. using TencentCloud.Ocr.V20181119.Models;
  14. namespace OASystem.API.OAMethodLib
  15. {
  16. /// <summary>
  17. /// 工资计算
  18. /// </summary>
  19. public static class PayrollComputation
  20. {
  21. private static Result _result = new Result();
  22. private static readonly IQiYeWeChatApiService _qiYeWeChatApiService = AutofacIocManager.Instance.GetService<IQiYeWeChatApiService>();
  23. private static readonly UsersRepository _usersRep = AutofacIocManager.Instance.GetService<UsersRepository>();
  24. private static readonly IMapper _mapper = AutofacIocManager.Instance.GetService<IMapper>();
  25. private static readonly decimal _chengDuMinimumWage = 2100.00M;
  26. /// <summary>
  27. /// 计算工资
  28. /// </summary>
  29. /// <param name="pm_WageSheetDattaSources"></param>
  30. /// <param name="userNames"></param>
  31. /// <param name="thisYearMonth"></param>
  32. /// <param name="startDt"></param>
  33. /// <param name="endDt"></param>
  34. /// <returns></returns>
  35. public static async Task<Result> SalaryCalculatorAsync(
  36. List<Pm_WageSheet> pm_WageSheetDattaSources, List<UserNameView> userNames, int userId, string thisYearMonth, DateTime startDt, DateTime endDt)
  37. {
  38. if (pm_WageSheetDattaSources.Count <= 0)
  39. {
  40. _result.Msg = "计算工资传入数据为空!";
  41. return _result;
  42. }
  43. if (userNames.Count <= 0)
  44. {
  45. var nameData = await _usersRep.GetUserNameList(1);
  46. userNames = nameData.Data;
  47. }
  48. //获取所有打卡数据
  49. CheckInView checkIn = await _qiYeWeChatApiService.GetCheckin_MonthDataAsync(startDt, endDt); //时间段内所有 打卡数据
  50. if (checkIn.errcode != 0)
  51. {
  52. _result.Msg = "【企业微信】【打卡】【获取所有月打卡数据】【Msg】" + checkIn.errmsg;
  53. return _result;
  54. }
  55. List<Data> checkInDatas = checkIn.datas;
  56. //获取 请假类型 Sp_Detail.template_id
  57. string leave_template_id = "C4NzTJCh1onCUK915rRkvy7Fh5Vqz4YbiEV9jrBY1";
  58. List<VacationLeaveTypeView> vacationLeaveTypes = await GetVacationLeaveTypes(leave_template_id);
  59. if (vacationLeaveTypes.Count <= 0)
  60. {
  61. _result.Msg = startDt + " - " + endDt + "请假 类型数据 获取失败!";
  62. return _result;
  63. }
  64. _result.Msg = string.Empty;
  65. try
  66. {
  67. foreach (var pm_wsInfo in pm_WageSheetDattaSources)
  68. {
  69. string itemName = userNames.Where(it => it.Id == pm_wsInfo.UserId).FirstOrDefault().CnName;
  70. //补贴 金额
  71. decimal meal_subsidy = 0.00M; // 午餐(午餐10元/天) 补贴 * 计算方式:单日上午请假时长(小时)大于或者等于三小时 没有餐补
  72. //事假 病假 总金额
  73. decimal personalLeaveTotal = 0.00M, // 事假 日薪 *计算方式:日平均工资 = 月工资/当月应出勤天数。
  74. sickLeaveTotal = 0.00M; // 病假 日薪 *计算方式:日平均工资 = 成都市最低工资标准的80%/当月应出勤天数。 短期病假=当月15天内
  75. //扣款金额
  76. decimal beLate_deduction = 0.00M, // 迟到 扣款金额 *计算方式:
  77. // 一个自然月内,不足 10 分钟的迟到/早退,不超过 2 次的部分,不做处罚;3 次及以上,按50元 / 次处罚;
  78. // 超过 10 分钟(含 10 分钟),不足 60 分钟的迟到/早退,按 50 元/次处罚;
  79. // 超过 60 分钟(含 60 分钟),不足 3 小时的迟到/早退,且无请假者,按旷工半日处理;超过3 小时的迟到 / 早退,且无请假者,按旷工一日处理。
  80. early_deduction = 0.00M, // 早退 扣款金额
  81. absenteeism_deduction = 0.00M, // 旷工 扣款金额 *计算方式:旷工扣发当日工资
  82. unprinted_deduction = 0.00M, // 未打卡 扣款金额 *计算方式:
  83. // 试用期员工每月有 2 次 补卡机会,超过 2 次不足 5 次的部分,按 10 元 / 次处罚,5 次及以上的漏卡,按 50 元 / 次处罚;
  84. // 正式员工每月 3 次以内的补卡,按 10 元 / 次处罚,3 次及以上的漏卡,按 50 元 / 次处罚。
  85. sickLeave_deduction = 0.00M, // 病假
  86. other_deduction = 0.00M; // 其他 扣款金额
  87. decimal meal_deduction = 0.00M; // 餐补 扣款金额
  88. decimal reissuecard_deduction = 0.00M; // 补卡 扣款金额
  89. //打卡数据
  90. Data? checkInData = checkInDatas.Where(it => it.base_info.name == itemName).FirstOrDefault();
  91. if (checkInData == null) { continue; }
  92. string acctid = checkInData.base_info.acctid; //用户Id
  93. //当月总计数据
  94. Summary_Info? summary_Info = checkInData.summary_info;
  95. if (summary_Info == null) { continue; }
  96. int work_days = summary_Info.work_days -1; //应出勤天数
  97. int regular_days = summary_Info.regular_days - 1; //正常出勤天数
  98. meal_subsidy = work_days * 10; //应发放餐补
  99. #region 计算日工资 正常日薪 事假日薪 病假日薪
  100. //月 - 应发工资
  101. decimal amountPayable = pm_wsInfo.Basic + pm_wsInfo.Floats + pm_wsInfo.PostAllowance + pm_wsInfo.InformationSecurityFee + pm_wsInfo.OtherSubsidies;
  102. // 日薪 = *计算方式:日平均工资 = 月工资/当月应出勤天数。
  103. decimal dailyWage = ConvertToDecimal(amountPayable / work_days);
  104. // 病假日薪 *计算方式:日平均工资 = 成都市最低工资标准的80%/当月应出勤天数。 短期病假=当月15天内
  105. decimal sickLeave_dailywage = ConvertToDecimal(_chengDuMinimumWage / work_days);
  106. //病假 一天扣款
  107. sickLeave_deduction = dailyWage - sickLeave_dailywage;
  108. #endregion
  109. int annualLeaveNum = 0, //年假
  110. personalLeaveNum = 0, //事假
  111. sickLeaveNum = 0, //病假
  112. lieuLeaveNum = 0, //调休假
  113. marriageLeaveNum = 0, //婚嫁
  114. maternityLeaveNum = 0, //产假
  115. paternityLeaveNum = 0, //陪产假
  116. funeralLeaveNum = 0, //丧假
  117. reissueCardNum = 0, //补卡 次数
  118. evectionNum = 0, //出差 次数
  119. outIngNum = 0, //外出 次数
  120. outWorkNum = 0, //外勤 次数
  121. otherLeaveNum = 0; //其他
  122. #region 假勤 处理 1-请假;2-补卡;3-出差;4-外出;100-外勤;
  123. List<Sp_Item>? sp_items = checkInData.sp_items.Where(it => it.count != 0).ToList();
  124. if (sp_items != null && sp_items.Count > 0)
  125. {
  126. annualLeaveNum = Fallibilitydispose(sp_items, 1, "年假");
  127. personalLeaveNum = Fallibilitydispose(sp_items, 1, "事假");
  128. sickLeaveNum = Fallibilitydispose(sp_items, 1, "病假");
  129. lieuLeaveNum = Fallibilitydispose(sp_items, 1, "调休假");
  130. marriageLeaveNum = Fallibilitydispose(sp_items, 1, "婚嫁");
  131. maternityLeaveNum = Fallibilitydispose(sp_items, 1, "产假");
  132. paternityLeaveNum = Fallibilitydispose(sp_items, 1, "陪产假");
  133. funeralLeaveNum = Fallibilitydispose(sp_items, 1, "丧假");
  134. otherLeaveNum = Fallibilitydispose(sp_items, 1, "其他");
  135. reissueCardNum = Fallibilitydispose(sp_items, 2, "补卡次数");
  136. evectionNum = Fallibilitydispose(sp_items, 3, "出差");
  137. outIngNum = Fallibilitydispose(sp_items, 4, "外出");
  138. outWorkNum = Fallibilitydispose(sp_items, 3, "外勤");
  139. }
  140. #region 请假类型金额/餐补 处理
  141. List<Sp_Detail> sp_leave_details = new List<Sp_Detail>();
  142. sp_leave_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, acctid, 2, 1); //时间段内所有 已同意的 请假 审批数据
  143. if (sp_leave_details.Count <= 0)
  144. {
  145. _result.Msg += startDt + " - " + endDt + " " + itemName + " 请假 审批数据获取未获取到!\r\n";
  146. //continue;
  147. }
  148. List<Ex_Items> ex_Items = new List<Ex_Items>();//假勤 And 打卡备注集合
  149. Ex_Items ex_Items_jq = new Ex_Items() { Type = "假勤" }; //假勤
  150. List<Ex_Item> ex_ItemInfos = new List<Ex_Item>();
  151. foreach (Sp_Detail sp_item in sp_leave_details)
  152. {
  153. Apply_data? apply_data = sp_item.apply_data;
  154. if (apply_data != null)
  155. {
  156. List<ContentsItem> contents = apply_data.contents;
  157. ContentsItem content_Vacation = contents.Where(it => it.control == "Vacation").FirstOrDefault(); //请假类型
  158. ContentsItem content_Textarea = contents.Where(it => it.control == "Textarea").FirstOrDefault(); //多行文本
  159. if (content_Vacation != null)
  160. {
  161. Vacation vacation = content_Vacation.value.vacation;
  162. Attendance attendance = vacation.attendance; //假勤组件
  163. Selector selector = vacation.selector; //请假类型
  164. List<OptionsItem> optionsItems = selector.options; //key 请假类型 id
  165. List<TitleItem> value = optionsItems[0].value; // value 文本描述值
  166. int leaveType = int.Parse(optionsItems[0].key); //key 请假子类型 id
  167. Date_range date_Range = attendance.date_range;
  168. //筛选 不在工作日内的假勤申请
  169. if (startDt >= date_Range.new_begin_dt && date_Range.new_end_dt <= endDt)
  170. {
  171. continue;
  172. }
  173. decimal thisTypeDeduction = 0.00M;//当前类型扣款
  174. string leave_starttime = date_Range.new_begin_dt.ToString("HH:mm");
  175. string leave_endtime = date_Range.new_end_dt.ToString("HH:mm");
  176. string typeName = string.Empty;
  177. string unit = string.Empty;
  178. int leaveTypeId = leaveType;
  179. var leaveTypeData = vacationLeaveTypes.Where(it => it.id == leaveTypeId).FirstOrDefault();
  180. if (leaveTypeData != null) { typeName = leaveTypeData.name; }
  181. string startTime = string.Empty;
  182. string endTime = string.Empty;
  183. //计算请假类型扣款金额
  184. decimal new_duration = 0.00M;
  185. if (date_Range.type == "halfday")
  186. {
  187. new_duration = Convert.ToDecimal(date_Range.new_duration) / 86400M;
  188. unit = "天";
  189. startTime = date_Range.new_begin_dt.ToString("yyyy-MM-dd") + " 09:00";
  190. endTime = date_Range.new_begin_dt.ToString("yyyy-MM-dd") + " 18:00";
  191. }
  192. else if (date_Range.type == "hour")
  193. {
  194. new_duration = Convert.ToDecimal(date_Range.new_duration) / 3600M;
  195. unit = "小时";
  196. startTime = date_Range.new_begin_dt.ToString("yyyy-MM-dd HH:mm:ss");
  197. endTime = date_Range.new_end_dt.ToString("yyyy-MM-dd HH:mm:ss");
  198. }
  199. decimal leave_meals = 0.00M;
  200. //计算餐补 假勤类型扣款
  201. CalculateTypeFee(leaveType, date_Range.type, leave_starttime, leave_endtime, amountPayable, work_days, new_duration,
  202. out leave_meals, out thisTypeDeduction);
  203. #region 累计类型扣款
  204. //1年假;2事假;3病假;4调休假;5婚假;6产假;7陪产假;8其他;9丧假
  205. if (leaveType == 2) //事假
  206. {
  207. personalLeaveTotal += thisTypeDeduction;
  208. }
  209. else if (leaveType == 3) //病假
  210. {
  211. sickLeaveTotal = thisTypeDeduction;
  212. }
  213. #endregion
  214. meal_deduction += leave_meals;
  215. Ex_Item ex_Item = new Ex_Item()
  216. {
  217. SubTypeId = leaveType,
  218. SubType = typeName,
  219. StartTimeDt = Convert.ToDateTime(startTime),
  220. EndTimeDt = Convert.ToDateTime(endTime),
  221. Duration = new_duration,
  222. Unit = unit,
  223. Deduction = thisTypeDeduction,
  224. //Reason = apply_data.reason,
  225. Apply_time_dt = Convert.ToDateTime(sp_item.apply_time_dt.ToString("yyyy-MM-dd HH:mm:ss")),
  226. //Approval_name = sp_item.approval_name,
  227. };
  228. ex_ItemInfos.Add(ex_Item);
  229. }
  230. }
  231. }
  232. if (ex_ItemInfos.Count > 0)
  233. {
  234. ex_Items_jq.Ex_ItemInfo = ex_ItemInfos.OrderBy(it => it.SubTypeId).ThenBy(it => it.Apply_time_dt).ToList();
  235. ex_Items.Add(ex_Items_jq);
  236. }
  237. #endregion
  238. #endregion
  239. Ex_Items ex_Items_dk = new Ex_Items() { Type = "打卡" }; //打卡
  240. List<Ex_Item> ex_reissuecard_Items = new List<Ex_Item>();
  241. #region 打卡补卡 补卡次数 处理
  242. if (reissueCardNum > 0)
  243. {
  244. List<Sp_Detail> sp_buka_details = new List<Sp_Detail>();
  245. sp_leave_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, acctid, 2, 2); //时间段内所有 已同意的 请假 审批数据
  246. int bukaNum = 1;
  247. foreach (var item in sp_leave_details)
  248. {
  249. decimal bukaPrice = 0.00M;
  250. if (bukaNum <= 2)
  251. {
  252. bukaPrice = 10.00M;
  253. }
  254. else {
  255. bukaPrice = 50.00M;
  256. }
  257. var app_data = item.apply_data;
  258. var punch_correction1 = app_data.contents[0].value.punch_correction; //未打卡时间
  259. var punch_correction2 = app_data.contents[1].value;
  260. Ex_Item ex_reissueCard = new Ex_Item()
  261. {
  262. SubTypeId = 7,
  263. SubType = "打卡补卡",
  264. StartTimeDt = Convert.ToDateTime(punch_correction1.time_dt.ToString("yyyy-MM-dd HH:mm:ss")), //未打卡时间
  265. Deduction = bukaPrice,
  266. Reason = punch_correction2.text,
  267. Unit = string.Empty
  268. };
  269. unprinted_deduction += bukaPrice;
  270. ex_reissuecard_Items.Add(ex_reissueCard);
  271. bukaNum++;
  272. }
  273. }
  274. #endregion
  275. List<Sp_Detail> sp_reissuecard_details = new List<Sp_Detail>();
  276. //统计迟到次数
  277. int beLateNum = 0, // 1-迟到;
  278. leaveEarlyNum = 0, // 2-早退;
  279. dummyDeckNum = 0, // 3-缺卡;
  280. minerNum = 0, // 4-旷工;
  281. locationAnomalyNum = 0, // 5-地点异常;
  282. unitExNum = 0; // 6-设备异常;
  283. if (summary_Info.except_days > 0)
  284. {
  285. List<Exception_Info>? ex_infos = checkInData.exception_infos;
  286. if (ex_infos != null && ex_infos.Count >= 0)
  287. {
  288. beLateNum = ExceptionStatistics(ex_infos, 1);
  289. leaveEarlyNum = ExceptionStatistics(ex_infos, 2);
  290. dummyDeckNum = ExceptionStatistics(ex_infos, 3);
  291. minerNum = ExceptionStatistics(ex_infos, 4);
  292. locationAnomalyNum = ExceptionStatistics(ex_infos, 5);
  293. unitExNum = ExceptionStatistics(ex_infos, 6);
  294. }
  295. }
  296. //打卡记录
  297. CheckInDataView checkInDataView = new CheckInDataView();
  298. checkInDataView = await _qiYeWeChatApiService.GetCheckinDataAsync(new List<string>() { acctid }, 3, startDt, endDt);
  299. if (checkInDataView.errcode != 0)
  300. {
  301. _result.Msg += startDt + " - " + endDt + " " + itemName + " 打卡记录 " + checkInDataView.errmsg + " \r\n";
  302. }
  303. //筛选时间异常的打卡记录
  304. List<CheckInDataInfo> checkInDataInfos = checkInDataView.checkindata.Where(it => !string.IsNullOrEmpty(it.exception_type)).ToList();
  305. //处理 未打卡的记录是否已经通过假勤审批
  306. List<CheckInDataInfo> leave_checkInDataInfos = new List<CheckInDataInfo>();
  307. if (checkInDataInfos.Count > 0)
  308. {
  309. foreach (var leaveItem in ex_ItemInfos)
  310. {
  311. if (leaveItem.StartTimeDt.ToString("yyyy-MM-dd").Equals(leaveItem.EndTimeDt.ToString("yyyy-MM-dd"))) //单天
  312. {
  313. leave_checkInDataInfos.AddRange(checkInDataInfos.Where(it => it.checkin_time_dt.ToString("yyyy-MM-dd") == leaveItem.StartTimeDt.ToString("yyyy-MM-dd")).ToList());
  314. }
  315. else //多天
  316. {
  317. leave_checkInDataInfos.AddRange(checkInDataInfos.Where(it => it.checkin_time_dt >= leaveItem.StartTimeDt && it.checkin_time_dt <= leaveItem.EndTimeDt).ToList());
  318. }
  319. }
  320. }
  321. //处理 时间异常的记录是否已经通过补卡审批
  322. List<CheckInDataInfo> pullcard_checkInDataInfos = new List<CheckInDataInfo>();
  323. if (leave_checkInDataInfos.Count > 0)
  324. {
  325. //获取异常打卡数据 并且 未通过假勤审批
  326. pullcard_checkInDataInfos = checkInDataInfos.Except(leave_checkInDataInfos).ToList();
  327. if (pullcard_checkInDataInfos.Count > 0)
  328. {
  329. CheckInDayDataView checkInDayDataView = await _qiYeWeChatApiService.GetCheckInDayDataAsync(new List<string>() { acctid }, startDt, endDt);
  330. if (checkInDayDataView.errcode != 0)
  331. {
  332. _result.Msg += startDt + " - " + endDt + " " + itemName + " 异常信息数据获取未获取到!\r\n";
  333. }
  334. List<Root> roots_words = checkInDayDataView.datas.Where(it => it.base_info.day_type == 0).ToList(); //获取工作日日报信息
  335. List<Root> roots_exs = checkInDayDataView.datas.Where(it => it.exception_infos.Count > 0).ToList();
  336. int user_cd_zt_num = 0;
  337. foreach (var roots_ex in roots_exs)
  338. {
  339. foreach (var exception_info in roots_ex.exception_infos)
  340. {
  341. decimal timelength = ConvertToDecimal( (Convert.ToDecimal(exception_info.duration) / 3600.00M) * 60.00M); //时长 分钟
  342. if (timelength == 9) timelength = 7.50M;
  343. int exception = exception_info.exception; //异常类型
  344. decimal day_miner_unit = ConvertToDecimal(dailyWage / 15); //以0.5小时为单位
  345. //1:一个自然月内,不足 10 分钟的迟到/早退,不超过 2 次的部分,不做处罚;3 次及以上,按50 元 / 次处罚;
  346. //2:超过 10 分钟(含 10 分钟),不足 60 分钟的迟到 / 早退,按 50 元 / 次处罚;
  347. //3:超过 60 分钟(含 60 分钟),不足 3 小时的迟到 / 早退,且无请假者,按旷工半日处理;超过 3 小时的迟到 / 早退,且无请假者,按旷工一日处理。
  348. long date = roots_ex.base_info.date; //当日工作日期
  349. long earliest_time = roots_ex.summary_info.earliest_time; //最早打卡时间
  350. long lastest_time = roots_ex.summary_info.lastest_time; //最晚打卡时间
  351. long this_date = date + earliest_time;
  352. DateTime thisDt = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).AddTicks(this_date * 10000000);
  353. string thisDtStr = thisDt.ToString("yyyy-MM-dd");
  354. Ex_Item beLate_belate_ex = new Ex_Item()
  355. {
  356. SubTypeId = 4,
  357. SubType = "旷工",
  358. Duration = timelength,
  359. StartTimeDt = Convert.ToDateTime(roots_ex.base_info.dateDt.ToString("yyyy-MM-dd HH:mm:ss")),
  360. Unit = "分钟",
  361. };
  362. decimal day_deduction = 0.00M;
  363. //1 - 迟到;2 - 早退;3 - 缺卡;4 - 旷工;5 - 地点异常;6 - 设备异常
  364. if (exception == 1) //迟到
  365. {
  366. if (timelength < 10)
  367. {
  368. user_cd_zt_num++;
  369. beLate_belate_ex.SubTypeId = 1;
  370. beLate_belate_ex.SubType = "迟到";
  371. if (reissueCardNum >= 3)
  372. {
  373. day_deduction = 50.00M;
  374. }
  375. else
  376. {
  377. day_deduction = 0.00M;
  378. }
  379. beLate_deduction += day_deduction; //迟到扣款 总额
  380. }
  381. else if (timelength >= 10 && timelength <= 60)
  382. {
  383. day_deduction = 50.00M;
  384. beLate_deduction += day_deduction; //迟到扣款 总额
  385. beLate_belate_ex.SubTypeId = 1;
  386. beLate_belate_ex.SubType = "迟到";
  387. }
  388. else if (timelength > 60 && timelength <= 180)
  389. {
  390. day_deduction = day_miner_unit * 6; //3小时
  391. meal_deduction += 10.00M; //餐补扣款
  392. absenteeism_deduction += day_deduction; //矿工半日
  393. }
  394. else
  395. {
  396. day_deduction = dailyWage;
  397. absenteeism_deduction += day_deduction; //矿工一日
  398. meal_deduction += 10.00M;
  399. }
  400. beLate_belate_ex.Deduction = day_deduction;
  401. ex_reissuecard_Items.Add(beLate_belate_ex);
  402. }
  403. else if (exception == 2) //早退
  404. {
  405. if (timelength < 10)
  406. {
  407. user_cd_zt_num++;
  408. beLate_belate_ex.SubTypeId = 2;
  409. beLate_belate_ex.SubType = "早退";
  410. if (reissueCardNum >= 3)
  411. {
  412. day_deduction = 50.00M;
  413. }
  414. else {
  415. day_deduction = 0.00M;
  416. }
  417. early_deduction += day_deduction; //早退扣款 总计
  418. }
  419. else if (timelength >= 10 && timelength <= 60)
  420. {
  421. day_deduction = 50.00M;
  422. early_deduction += day_deduction; //早退扣款 总计
  423. beLate_belate_ex.SubTypeId = 2;
  424. beLate_belate_ex.SubType = "早退";
  425. }
  426. else if (timelength > 60 && timelength <= 180)
  427. {
  428. day_deduction = day_miner_unit * 6; //3小时
  429. absenteeism_deduction += day_deduction; //矿工半日
  430. }
  431. else
  432. {
  433. day_deduction = dailyWage;
  434. meal_deduction += 10.00M;
  435. absenteeism_deduction += day_deduction; //矿工一日
  436. }
  437. beLate_belate_ex.Deduction = day_deduction;
  438. ex_reissuecard_Items.Add(beLate_belate_ex);
  439. }
  440. else if (exception == 3) //缺卡
  441. {
  442. if (roots_ex.exception_infos.Count == 2)
  443. {
  444. day_deduction = dailyWage;
  445. meal_deduction += 10.00M;
  446. absenteeism_deduction += day_deduction;
  447. beLate_belate_ex.Reason = "上午-下午 缺卡/未打卡为旷工 一天";
  448. beLate_belate_ex.Deduction = day_deduction;
  449. ex_reissuecard_Items.Add(beLate_belate_ex);
  450. }
  451. else if (roots_ex.exception_infos.Count == 1)
  452. {
  453. if (earliest_time == lastest_time)
  454. {
  455. DateTime thisDt1 = Convert.ToDateTime(thisDtStr + " 12:00");
  456. //ex_ItemInfos
  457. Ex_Item zt_jq = new Ex_Item();
  458. zt_jq = ex_ItemInfos.Where(it => it.StartTimeDt.ToString("yyyy-MM-dd") == thisDtStr).FirstOrDefault();
  459. if (thisDt <= thisDt1) //旷工 下午
  460. {
  461. if (zt_jq != null) if (zt_jq.EndTimeDt == Convert.ToDateTime(thisDtStr + " 18:00")) continue; //排除已有假期的缺卡
  462. day_deduction = day_miner_unit * 9; //4.5小时
  463. meal_deduction += 10.00M;
  464. absenteeism_deduction += day_deduction; //矿工半日
  465. beLate_belate_ex.Reason = thisDtStr + " 下午(18:00)缺卡/未打卡视为下午旷工(4.5小时)";
  466. beLate_belate_ex.Deduction = day_deduction;
  467. ex_reissuecard_Items.Add(beLate_belate_ex);
  468. }
  469. else if (thisDt >= thisDt1) //旷工下午
  470. {
  471. if (zt_jq != null) if (zt_jq.EndTimeDt == Convert.ToDateTime(thisDtStr + " 09:00")) continue; //排除已有假期的缺卡
  472. day_deduction = day_miner_unit * 6; //3小时
  473. absenteeism_deduction += day_deduction; //矿工半日
  474. beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)缺卡/未打卡视为上午旷工(3小时)";
  475. beLate_belate_ex.Deduction = day_deduction;
  476. ex_reissuecard_Items.Add(beLate_belate_ex);
  477. }
  478. else //矿工一日
  479. {
  480. day_deduction = dailyWage;
  481. meal_deduction += 10.00M;
  482. absenteeism_deduction += day_deduction;
  483. beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
  484. beLate_belate_ex.Deduction = day_deduction;
  485. ex_reissuecard_Items.Add(beLate_belate_ex);
  486. }
  487. }
  488. }
  489. }
  490. else if (exception == 4) //旷工
  491. {
  492. if (timelength > 60 && timelength <= 180)
  493. {
  494. day_deduction = day_miner_unit * 6; //3小时
  495. beLate_belate_ex.Reason = thisDtStr + " 缺卡/未打视为旷工上午(3小时)";
  496. meal_deduction += 10.00M;
  497. absenteeism_deduction += day_deduction; //矿工半日
  498. }
  499. else
  500. {
  501. day_deduction = dailyWage;
  502. beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
  503. meal_deduction += 10.00M;
  504. absenteeism_deduction += day_deduction; //矿工一日
  505. }
  506. beLate_belate_ex.Deduction = day_deduction;
  507. ex_reissuecard_Items.Add(beLate_belate_ex);
  508. }
  509. }
  510. }
  511. }
  512. }
  513. if (ex_reissuecard_Items.Count > 0)
  514. {
  515. ex_Items_dk.Ex_ItemInfo = ex_reissuecard_Items;
  516. ex_Items_dk.Ex_ItemInfo = ex_reissuecard_Items.OrderBy(it => it.SubTypeId).ThenBy(it => it.StartTimeDt).ToList();
  517. ex_Items.Add(ex_Items_dk);
  518. }
  519. #region 应发合计 实发合计 扣款合计(假勤扣款,其他扣款,社保扣款,公积金代扣,个税扣款)
  520. decimal mealTotal = meal_subsidy - meal_deduction; //餐补
  521. decimal salaryTotal = amountPayable + mealTotal; //应发合计
  522. //扣款合计 不含个税
  523. decimal eductionTotal = sickLeaveTotal + personalLeaveTotal + beLate_deduction + early_deduction + absenteeism_deduction + unprinted_deduction + other_deduction +
  524. pm_wsInfo.WithholdingInsurance + pm_wsInfo.ReservedFunds + pm_wsInfo.OtherDeductions;
  525. decimal actualReleaseTotal = salaryTotal - eductionTotal; //实发合计 * 不含个税
  526. #endregion
  527. #region 处理当月工资数据
  528. pm_wsInfo.YearMonth = thisYearMonth;
  529. pm_wsInfo.StartDate = startDt.ToString("yyyy-MM-dd");
  530. pm_wsInfo.EndDate = endDt.AddDays(-1).ToString("yyyy-MM-dd");
  531. pm_wsInfo.WorkDays = work_days; //当月应出勤天数
  532. pm_wsInfo.RegularDays = regular_days; //当月正常出勤天数
  533. pm_wsInfo.SickLeave = sickLeaveTotal; //病假
  534. pm_wsInfo.SomethingFalse = personalLeaveTotal; //事假
  535. pm_wsInfo.LateTo = beLate_deduction; //迟到
  536. pm_wsInfo.LeaveEarly = early_deduction; //早退
  537. pm_wsInfo.Absenteeism = absenteeism_deduction; //旷工
  538. pm_wsInfo.NotPunch = unprinted_deduction; //未打卡
  539. pm_wsInfo.OtherDeductions = other_deduction; //其他
  540. pm_wsInfo.Ex_ItemsRemark = JsonConvert.SerializeObject(ex_Items); //
  541. pm_wsInfo.Mealsupplement = mealTotal; //餐补
  542. pm_wsInfo.Should = salaryTotal; //应发合计
  543. pm_wsInfo.TotalDeductions = eductionTotal; //扣款合计
  544. pm_wsInfo.TotalRealHair = actualReleaseTotal; //实发合计
  545. pm_wsInfo.AfterTax = actualReleaseTotal - pm_wsInfo.WithholdingTax; //税后工资
  546. pm_wsInfo.LastUpdateUserId = userId;
  547. pm_wsInfo.LastUpdateDt = DateTime.Now;
  548. pm_wsInfo.CreateUserId = userId;
  549. pm_wsInfo.CreateTime = DateTime.Now;
  550. pm_wsInfo.DeleteUserId = null;
  551. pm_wsInfo.DeleteTime = null;
  552. #endregion
  553. }
  554. }
  555. catch (Exception ex)
  556. {
  557. _result.Msg = ex.Message;
  558. return _result;
  559. }
  560. _result.Code = 0;
  561. _result.Data = pm_WageSheetDattaSources;
  562. return _result;
  563. }
  564. /// <summary>
  565. /// decimal 保留两位小数 不四舍五入
  566. /// </summary>
  567. /// <param name="number"></param>
  568. /// <returns></returns>
  569. private static decimal ConvertToDecimal(decimal number)
  570. {
  571. return Convert.ToDecimal(number.ToString("0.00"));
  572. }
  573. /// <summary>
  574. /// 获取请假类型
  575. /// </summary>
  576. /// <param name="template_id"></param>
  577. /// <returns></returns>
  578. public static async Task<List<VacationLeaveTypeView>> GetVacationLeaveTypes(string template_id)
  579. {
  580. List<VacationLeaveTypeView> vacationLeaveTypes = new List<VacationLeaveTypeView>();
  581. TemplateDetailView templateDetailView = new TemplateDetailView();
  582. templateDetailView = await _qiYeWeChatApiService.GetTemplateDetailAsync(template_id);
  583. if (templateDetailView.errcode != 0)
  584. {
  585. Serilog.Log.Error("【企业微信】【审批】【获取假勤类型的审批】【Msg】"+ templateDetailView.errmsg);
  586. return vacationLeaveTypes;
  587. }
  588. List<VacationItemInfo> VacationItemInfos = templateDetailView.vacation_list.item;
  589. foreach (var item in VacationItemInfos)
  590. {
  591. ValueItem valueInfo = item.name.Where(it => it.lang == "zh_CN").FirstOrDefault();
  592. if (valueInfo != null)
  593. {
  594. vacationLeaveTypes.Add(
  595. new VacationLeaveTypeView()
  596. {
  597. id = item.id,
  598. name = valueInfo.text
  599. });
  600. }
  601. }
  602. return vacationLeaveTypes;
  603. }
  604. /// <summary>
  605. /// 计算类型费用
  606. /// </summary>
  607. /// <param name="leaveType">
  608. /// 1年假;2事假;3病假;4调休假;5婚假;6产假;7陪产假;8其他;9丧假
  609. /// </param>
  610. /// <param name="date_Range_type">
  611. /// halfday 全天
  612. /// hour 小时
  613. /// </param>
  614. /// <param name="startTime"></param>
  615. /// <param name="endTime"></param>
  616. /// <param name="duration"></param>
  617. /// <param name="mealDeduction"></param>
  618. /// <param name="typeDeduction"></param>
  619. public static void CalculateTypeFee(int leaveType, string date_Range_type, string startTime, string endTime,decimal amountPayable,int work_days,
  620. decimal duration, out decimal mealDeduction, out decimal typeDeduction)
  621. {
  622. typeDeduction = 0;
  623. mealDeduction = 0;
  624. string am_starttime = "08:59";
  625. string am_endtime = "13:01";
  626. decimal personalkLeave_dailywage_day = ConvertToDecimal( amountPayable / work_days); //日薪 = 事假日薪 *计算方式:日平均工资 = 当月应发工资 /当月应出勤天数。
  627. //半小时单位
  628. decimal halfHour = Convert.ToDecimal(7.5) / Convert.ToDecimal(0.5);
  629. switch (leaveType)
  630. {
  631. case 1: //年假
  632. CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
  633. break;
  634. case 2: //2事假
  635. // 事假日薪 *计算方式:日平均工资 = 当月应发工资 /当月应出勤天数。
  636. decimal personalkLeave_dailywage_halfhour = ConvertToDecimal( personalkLeave_dailywage_day / halfHour); //事假单位 0.5小时
  637. if (date_Range_type == "halfday")
  638. {
  639. mealDeduction = 10; //餐补扣款
  640. typeDeduction = personalkLeave_dailywage_day;
  641. }
  642. else if (date_Range_type == "hour")
  643. {
  644. decimal leave_halfHour = Convert.ToDecimal(duration) / Convert.ToDecimal(0.5);
  645. typeDeduction = personalkLeave_dailywage_halfhour * leave_halfHour;
  646. if (duration >= 3 && duration <= 7.5M) //单天请假三小时 && 请假时间在上午 则没有餐补
  647. {
  648. //处理开始时间
  649. if (startTime.CompareTo(am_starttime) > 0 && startTime.CompareTo(am_endtime) < 0)
  650. {
  651. //处理结束时间
  652. //if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) > 0)
  653. //{
  654. mealDeduction = 10; //餐补扣款
  655. //}
  656. }
  657. }
  658. else if (duration > 7.5M) //多天计算
  659. {
  660. decimal leave_halfHour1 = Convert.ToDecimal(duration) / Convert.ToDecimal(0.5);
  661. typeDeduction = personalkLeave_dailywage_halfhour * leave_halfHour1;
  662. decimal leaveDays = duration / 7.5M;
  663. if (leaveDays % 1 == 0)
  664. {
  665. mealDeduction = 10 * leaveDays; //餐补扣款
  666. }
  667. else
  668. {
  669. mealDeduction = 10 * Convert.ToInt32(leaveDays);
  670. //得到最后一天的请假时间 是否有餐补
  671. int lastHours = (Convert.ToDateTime(endTime) - Convert.ToDateTime("09:00")).Hours;
  672. if (lastHours >= 3)
  673. {
  674. //处理结束时间
  675. if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
  676. {
  677. mealDeduction += 10; //餐补扣款
  678. }
  679. }
  680. }
  681. }
  682. }
  683. break;
  684. case 3: //3病假
  685. // 病假日薪 *计算方式:日平均工资 = 成都市最低工资标准的80% /当月应出勤天数。 短期病假=当月15天内
  686. decimal chengDuMinimumWage_halrHour = ConvertToDecimal( _chengDuMinimumWage / work_days) / halfHour;
  687. decimal sickLeave_dailywage_halfhour_deduction = personalkLeave_dailywage_day - chengDuMinimumWage_halrHour; //病假单位 0.5小时 扣款金额
  688. if (date_Range_type == "halfday")
  689. {
  690. mealDeduction = 10; //餐补扣款
  691. typeDeduction = sickLeave_dailywage_halfhour_deduction * halfHour;
  692. }
  693. else if (date_Range_type == "hour")
  694. {
  695. decimal sickLeave_halfHour = duration / 0.5M;
  696. typeDeduction = sickLeave_dailywage_halfhour_deduction *sickLeave_halfHour ;
  697. if (duration >= 3 && duration <= 7.5M) //单天请假三小时 && 请假时间在上午 则没有餐补
  698. {
  699. //处理开始时间
  700. if (startTime.CompareTo(am_starttime) > 0 && startTime.CompareTo(am_endtime) < 0)
  701. {
  702. //处理结束时间
  703. if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
  704. {
  705. mealDeduction = 10; //餐补扣款
  706. }
  707. }
  708. }
  709. else if (duration > 7.5M) //多天计算
  710. {
  711. decimal sickLeave_halfHour1 = duration / 0.5M;
  712. typeDeduction = sickLeave_dailywage_halfhour_deduction * sickLeave_halfHour1;
  713. decimal leaveDays = Convert.ToDecimal(duration / 7.5M);
  714. if (leaveDays % 1 == 0)
  715. {
  716. mealDeduction = 10 * leaveDays; //餐补扣款
  717. }
  718. else
  719. {
  720. mealDeduction = 10 * Convert.ToInt32(leaveDays);
  721. //得到最后一天的请假时间 是否有餐补
  722. int lastHours = (Convert.ToDateTime(endTime) - Convert.ToDateTime("09:00")).Hours;
  723. if (lastHours >= 3)
  724. {
  725. //处理结束时间
  726. if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
  727. {
  728. mealDeduction += 10; //餐补扣款
  729. }
  730. }
  731. }
  732. }
  733. }
  734. break;
  735. case 4: //4调休假
  736. CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
  737. break;
  738. case 5: //5婚假
  739. CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
  740. break;
  741. case 6: //6产假
  742. CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
  743. break;
  744. case 7: //7陪产假
  745. CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
  746. break;
  747. case 8: //8其他
  748. CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
  749. break;
  750. case 9: //9丧假
  751. CalculateTypeFeeSub(date_Range_type, startTime, endTime, duration, out mealDeduction);
  752. break;
  753. }
  754. }
  755. /// <summary>
  756. /// 计算类型费用
  757. /// </summary>
  758. /// <param name="date_Range_type">
  759. /// halfday 全天
  760. /// hour 小时
  761. /// </param>
  762. /// <param name="startTime"></param>
  763. /// <param name="endTime"></param>
  764. /// <param name="duration"></param>
  765. /// <param name="mealDeduction"></param>
  766. public static void CalculateTypeFeeSub(string date_Range_type, string startTime, string endTime, decimal duration, out decimal mealDeduction)
  767. {
  768. mealDeduction = 0;
  769. string am_starttime = "08:59";
  770. string am_endtime = "13:01";
  771. if (date_Range_type == "halfday")
  772. {
  773. mealDeduction = 10; //餐补扣款
  774. }
  775. else if (date_Range_type == "hour")
  776. {
  777. if (duration >= 3 && duration < 7) //单天请假三小时 && 请假时间在上午 则没有餐补
  778. {
  779. //处理开始时间
  780. if (startTime.CompareTo(am_starttime) > 0 && startTime.CompareTo(am_endtime) < 0)
  781. {
  782. //处理结束时间
  783. if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
  784. {
  785. mealDeduction = 10; //餐补扣款
  786. }
  787. }
  788. }
  789. else if (duration >= 7 && duration <= 7.50M )
  790. {
  791. mealDeduction = 10; //餐补扣款
  792. }
  793. else if (duration >= 7.50M) //多天计算
  794. {
  795. decimal leaveDays = Convert.ToDecimal(duration / 7.50M);
  796. if (leaveDays % 1 == 0)
  797. {
  798. mealDeduction = 10 * leaveDays; //餐补扣款
  799. }
  800. else
  801. {
  802. mealDeduction = 10 * Convert.ToInt32(leaveDays);
  803. //得到最后一天的请假时间 是否有餐补
  804. int lastHours = (Convert.ToDateTime(endTime) - Convert.ToDateTime("09:00")).Hours;
  805. if (lastHours >= 3)
  806. {
  807. //处理结束时间
  808. if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
  809. {
  810. mealDeduction += 10; //餐补扣款
  811. }
  812. }
  813. }
  814. }
  815. }
  816. }
  817. /// <summary>
  818. /// 获取打卡补卡类型
  819. /// </summary>
  820. /// <param name="template_id"></param>
  821. /// <returns></returns>
  822. public static async Task<List<VacationLeaveTypeView>> GetVacationReissueCardTypes(string template_id)
  823. {
  824. List<VacationLeaveTypeView> vacationLeaveTypes = new List<VacationLeaveTypeView>();
  825. TemplateDetailView templateDetailView = new TemplateDetailView();
  826. templateDetailView = await _qiYeWeChatApiService.GetTemplateDetailAsync(template_id);
  827. if (templateDetailView.errcode != 0)
  828. {
  829. return vacationLeaveTypes;
  830. }
  831. List<VacationItemInfo> VacationItemInfos = templateDetailView.vacation_list.item;
  832. foreach (var item in VacationItemInfos)
  833. {
  834. ValueItem valueInfo = item.name.Where(it => it.lang == "zh_CN").FirstOrDefault();
  835. if (valueInfo != null)
  836. {
  837. vacationLeaveTypes.Add(
  838. new VacationLeaveTypeView()
  839. {
  840. id = item.id,
  841. name = valueInfo.text
  842. });
  843. }
  844. }
  845. return vacationLeaveTypes;
  846. }
  847. /// <summary>
  848. /// 打卡数据
  849. /// 假勤数据 统计
  850. /// </summary>
  851. /// <param name="datas">数据源</param>
  852. /// <param name="type">
  853. /// 1-请假;2-补卡;3-出差;4-外出;100-外勤;
  854. /// </param>
  855. /// <param name="subTypeName">
  856. /// 年假 事假 病假 调休假 婚嫁 产假 陪产假 丧假 补卡次数 出差 外出数 外勤 其他
  857. /// </param>
  858. /// <returns></returns>
  859. private static int Fallibilitydispose(List<Sp_Item> datas, int type, string? subTypeName)
  860. {
  861. int num = 0;
  862. Sp_Item _Info = datas.Where(it => it.type == type && it.name == subTypeName).FirstOrDefault();
  863. if (_Info != null) { num = _Info.count; }
  864. return num;
  865. }
  866. /// <summary>
  867. /// 打卡数据
  868. /// 异常数据 统计
  869. /// </summary>
  870. /// <returns></returns>
  871. private static int ExceptionStatistics(List<Exception_Info> datas, int type)
  872. {
  873. int num = 0;
  874. Exception_Info _Info = datas.Where(it => it.exception == type).FirstOrDefault();
  875. if (_Info != null) { num = _Info.count; }
  876. return num;
  877. }
  878. /// <summary>
  879. /// 获取时间段内节假日
  880. /// </summary>
  881. /// <param name="startDt"></param>
  882. /// <param name="endDt"></param>
  883. /// <returns></returns>
  884. public static async Task<Result> GetHoilDays(DateTime startDt,DateTime endDt)
  885. {
  886. Result result = new Result();
  887. HttpClient _httpClient = new HttpClient();
  888. var res = await _httpClient.GetAsync("https://timor.tech/api/holiday/year/"+ startDt.ToString("yyyy"));
  889. if (res.IsSuccessStatusCode)
  890. {
  891. var stringResponse = await res.Content.ReadAsStringAsync();
  892. HoiDaysRes obj = JsonConvert.DeserializeObject<HoiDaysRes>(stringResponse);
  893. if (obj.code == 0)
  894. {
  895. int hoilDays = 0;
  896. while (true)
  897. {
  898. string dt = startDt.ToString("MM-dd");
  899. if (startDt == endDt)
  900. {
  901. continue;
  902. }
  903. startDt.AddDays(1);
  904. }
  905. result.Code = 0;
  906. result.Data = hoilDays;
  907. }
  908. int code = obj.code;
  909. }
  910. return result;
  911. }
  912. public class HoiDaysRes
  913. {
  914. public int code { get; set; }
  915. public object holiday { get; set; }
  916. }
  917. }
  918. }