|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- 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
- {
- /// <summary>
- /// 考勤打卡功能
- /// </summary>
- public class AttendanceApi : BaseApi
- {
- public AttendanceApi()
- : base("/learun/adms/attendance")
- {
- //判断当前时间是否可以打卡
- Get["/IsAttendance"] = IsAttendance;
- //打卡
- Post["/clockin"] = ClockIn;
- //获取考勤打卡记录
- Get["/getrecordpagelist"] = GetRecordPageList;
- //判断学生当前打卡状态
- Get["IsAttendanceStudent"] = IsAttendanceStudent;
- //学生打卡
- Post["/clockinStudent"] = ClockInStudent;
- //打卡记录
- Get["/GetTeacherRecord"] = GetTeacherRecord;
- }
- private ADR_RestrictionIBLL adr_RestrictionBLL = new ADR_RestrictionBLL();
- private ADR_RecordIBLL adr_RecordBLL = new ADR_RecordBLL();
-
-
- public Response GetTeacherRecord(dynamic _)
- {
- ReqPageParam parameter = this.GetReqData<ReqPageParam>();
- var res=adr_RecordBLL.GetList(parameter.queryJson);
- var jsondata =
- new
- {
- data = res
- };
- return Success(jsondata);
- }
-
- /// <summary>
- /// 判断当前时间是否可以打卡
- /// </summary>
- /// <param name="_"></param>
- /// <returns></returns>
- public Response IsAttendance(dynamic _)
- {
- var res = adr_RestrictionBLL.IsAttendance();
- var jsondata =
- new
- {
- data = res
- };
- return Success(jsondata);
- }
- /// <summary>
- /// 学生打卡判断
- /// </summary>
- /// <param name="_"></param>
- /// <returns></returns>
- public Response IsAttendanceStudent(dynamic _)
- {
- var res = adr_RestrictionBLL.IsAttendanceStudent();
- var jsondata =
- new
- {
- data = res
- };
- return Success(jsondata);
- }
-
- public class Attendance
- {
- public decimal ALon { get; set; }
- public decimal ALat { get; set; }
- public bool AIsOut { get; set; }
- public string ARemark { get; set; }
- public string ADPhoto { get; set; }
- public string ClockPlace { get; set; }
- public string LessonSortNo { get; set; }
- public string ALTId { get; set; }
- public string ALTOEId { get; set; }
- }
-
- /// <summary>
- /// 打卡
- /// </summary>
- /// <param name="_"></param>
- /// <returns></returns>
- public Response ClockIn(dynamic _)
- {
- Attendance parameter = this.GetReqData<Attendance>();
-
- adr_RestrictionBLL.ClockIn(parameter.ALon, parameter.ALat, parameter.AIsOut, parameter.ARemark,parameter.ADPhoto,parameter.ClockPlace);
-
- return Success("打卡成功");
- }
- public Response ClockInStudent(dynamic _)
- {
- Attendance parameter = this.GetReqData<Attendance>();
-
- adr_RestrictionBLL.ClockInStudent(parameter.ALon, parameter.ALat, parameter.AIsOut, parameter.ARemark, parameter.ADPhoto, parameter.ClockPlace,parameter.LessonSortNo,parameter.ALTId,parameter.ALTOEId);
-
- return Success("打卡成功");
- }
- /// <summary>
- /// 打卡
- /// </summary>
- /// <param name="_"></param>
- /// <returns></returns>
- public Response GetRecordPageList(dynamic _)
- {
- ReqPageParam parameter = this.GetReqData<ReqPageParam>();
- 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);
- }
- }
- }
|