You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

75 line
2.3 KiB

  1. using Learun.Application.Base.SystemModule;
  2. using Learun.Application.TwoDevelopment.LogisticsManagement;
  3. using Learun.Application.TwoDevelopment.PersonnelManagement;
  4. using Learun.Util;
  5. using Nancy;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.IO;
  9. namespace Learun.Application.WebApi.Modules
  10. {
  11. /// <summary>
  12. /// 考勤打卡功能
  13. /// </summary>
  14. public class AttendanceApi : BaseApi
  15. {
  16. public AttendanceApi()
  17. : base("/learun/adms/attendance")
  18. {
  19. //判断当前时间是否可以打卡
  20. Get["/IsAttendance"] = IsAttendance;
  21. //打卡
  22. Post["/clockin"] = ClockIn;
  23. //获取考勤打卡记录
  24. Get["/getrecordpagelist"] = GetRecordPageList;
  25. }
  26. private ADR_RestrictionIBLL adr_RestrictionBLL = new ADR_RestrictionBLL();
  27. private ADR_RecordIBLL adr_RecordBLL = new ADR_RecordBLL();
  28. /// <summary>
  29. /// 判断当前时间是否可以打卡
  30. /// </summary>
  31. /// <param name="_"></param>
  32. /// <returns></returns>
  33. public Response IsAttendance(dynamic _)
  34. {
  35. var res = adr_RestrictionBLL.IsAttendance();
  36. var jsondata =
  37. new
  38. {
  39. data = res
  40. };
  41. return Success(jsondata);
  42. }
  43. /// <summary>
  44. /// 打卡
  45. /// </summary>
  46. /// <param name="_"></param>
  47. /// <returns></returns>
  48. public Response ClockIn(dynamic _)
  49. {
  50. adr_RestrictionBLL.ClockIn();
  51. return Success("打卡成功");
  52. }
  53. /// <summary>
  54. /// 打卡
  55. /// </summary>
  56. /// <param name="_"></param>
  57. /// <returns></returns>
  58. public Response GetRecordPageList(dynamic _)
  59. {
  60. ReqPageParam parameter = this.GetReqData<ReqPageParam>();
  61. var data = adr_RecordBLL.GetPageList(parameter.pagination, parameter.queryJson);
  62. var jsonData = new
  63. {
  64. rows = data,
  65. total = parameter.pagination.total,
  66. page = parameter.pagination.page,
  67. records = parameter.pagination.records
  68. };
  69. return Success(jsonData);
  70. }
  71. }
  72. }