using Learun.Application.Base.SystemModule; using Learun.Application.TwoDevelopment.LogisticsManagement; using Learun.Application.TwoDevelopment.PersonnelManagement; using Learun.Util; using Nancy; using System; using System.Collections.Generic; using System.IO; namespace Learun.Application.WebApi.Modules { /// /// 考勤打卡功能 /// public class AttendanceApi : BaseApi { public AttendanceApi() : base("/learun/adms/attendance") { //判断当前时间是否可以打卡 Get["/IsAttendance"] = IsAttendance; //打卡 Post["/clockin"] = ClockIn; //获取考勤打卡记录 Get["/getrecordpagelist"] = GetRecordPageList; } private ADR_RestrictionIBLL adr_RestrictionBLL = new ADR_RestrictionBLL(); private ADR_RecordIBLL adr_RecordBLL = new ADR_RecordBLL(); /// /// 判断当前时间是否可以打卡 /// /// /// public Response IsAttendance(dynamic _) { var res = adr_RestrictionBLL.IsAttendance(); var jsondata = new { data = res }; return Success(jsondata); } /// /// 打卡 /// /// /// public Response ClockIn(dynamic _) { adr_RestrictionBLL.ClockIn(); return Success("打卡成功"); } /// /// 打卡 /// /// /// public Response GetRecordPageList(dynamic _) { ReqPageParam parameter = this.GetReqData(); var data = adr_RecordBLL.GetPageList(parameter.pagination, parameter.queryJson); var jsonData = new { rows = data, total = parameter.pagination.total, page = parameter.pagination.page, records = parameter.pagination.records }; return Success(jsonData); } } }