[关闭]
@zongwu 2016-12-12T13:04:07.000000Z 字数 2736 阅读 447

考勤模块接口设计文档

开发设计


  1. 接口名:pd.attendance.preference
  2. 接口描述:检测合作商是否开启考勤任务,本期默认所有合作商都是开启考勤任务,后端写死即可。
  3. 参数:
  4. 0. sessionId // 必填
  5. 返回:
  6. {
  7. "success": true,
  8. "msgCode": null,
  9. "msgInfo": null,
  10. "count": 0,
  11. "model": true
  12. }
  1. 接口名:pd.attendance.month
  2. 接口描述:查询某月考勤记录,此处返回的数据足够客户端生成日历。点击日历上的某一天的具体考勤记录,需再次请求“某日的考勤记录”接口。
  3. 参数:
  4. 0. sessionId // 必填
  5. 1. year // 年
  6. 2. month // 月
  7. 返回:
  8. {
  9. "success": true,
  10. "msgCode": null,
  11. "msgInfo": null,
  12. "count": 0,
  13. "model": {
  14. "year": 2016,
  15. "month": 11,
  16. "records": [
  17. {
  18. "day": 1, //日期,此处指的是11月1日
  19. "isExceptionStatus": 1, //是否异常状态
  20. "signInCount": 0 //签到次数
  21. },
  22. {
  23. "day": 2,
  24. "isExceptionStatus": 1,
  25. "signInCount": 2
  26. },
  27. {
  28. "day": 3,
  29. "isExceptionStatus": 0,
  30. "signInCount": 2
  31. },
  32. {
  33. "day": 4,
  34. "isExceptionStatus": 0,
  35. "signInCount": 0
  36. }
  37. ]
  38. }
  39. }
  1. 接口名:pd.attendance.day
  2. 接口描述:查询某天的考勤记录,返回该天的详细记录。若给定的【日期】是未来的时间,则给出相应的错误提示。
  3. 输入:
  4. 0. year // 年
  5. 1. month // 月
  6. 2. day // 日
  7. 输出:
  8. {
  9. "success": true,
  10. "msgCode": null,
  11. "msgInfo": null,
  12. "count": 0,
  13. "model": {
  14. "date": "2016年11月29日",// 2016-12-12 新增
  15. "description": "出勤 10:00-18:00",// 2016-12-12 新增
  16. "year": 2016,
  17. "month": 11,
  18. "records": [
  19. {
  20. "type":0,// 2016-12-12 新增
  21. "title": "上班签到",
  22. "status": 2,
  23. "tag": "旷工",
  24. "time": "14: 12",
  25. "address": "杭州市余杭区文一西路998号",
  26. "remark": "事由:忘了今天要上班了,忘了今天要上班了,忘了今天要上班了,忘了今天要上班了,忘了今天要上班了,忘了。"// 异常状态,必有remark
  27. },{
  28. "type":1,// 2016-12-12 新增
  29. "title": "下班签退",
  30. "status": 2,
  31. "tag": "正常",
  32. "time": "18: 12",
  33. "address": "杭州市余杭区文一西路998号",
  34. "remark":null // 正常签到,必没有remark
  35. }
  36. ]
  37. }
  38. }

  1. 接口名:pd.attendance.context
  2. 接口描述:仅限于获取当日的考勤上下文,注意与接口`pd.attendance.day`加以区分。
  3. 参数:
  4. 0. sessionId //登录后的sessionId凭据【必填】
  5. 返回:
  6. * 若未设置考勤,异常提示“您未有考勤任务”。
  7. {
  8. "success": false,
  9. "msgCode": 1024,
  10. "msgInfo": "您未有考勤任务",
  11. "count": 0,
  12. "model": null
  13. }
  14. * 若已设置考勤,但是检查还未到生效日期,则显示“已开启考勤,于2016/11/14日开始生效。”
  15. {
  16. "success": false,
  17. "msgCode": 1025,
  18. "msgInfo": "已开启考勤,于2016/11/14日开始生效",
  19. "count": 0,
  20. "model": null
  21. }
  22. * 若已设置考勤,且已经在生效日期范围内,则显示正确的考勤任务数据。
  23. {
  24. "success": true,
  25. "msgCode": null,
  26. "msgInfo": null,
  27. "count": 0,
  28. "model": {
  29. "date": "2016年11月29日",
  30. "description": "出勤 10:00-18:00",
  31. "records": [
  32. {
  33. "type":0,// 2016-12-12 新增
  34. "title": "上班签到",
  35. "status": 2,
  36. "tag": "旷工",
  37. "time": "14: 12",
  38. "address": "杭州市余杭区文一西路998号",
  39. "remark": "事由:忘了今天要上班了,忘了今天要上班了,忘了今天要上班了,忘了今天要上班了,忘了今天要上班了,忘了。"
  40. }
  41. ]
  42. }
  43. }

  1. 接口名:pd.attendance.apply
  2. 接口描述:申请打卡
  3. 参数:
  4. 0. sessionId // 【必填】
  5. 1. type // 0签到 1签退
  6. 2. longitude // 经度,若APP实在无法定位则会传-1 兼容无法定位的情况【必填】
  7. 3. latitude // 纬度,若APP实在无法定位则会传-1 兼容无法定位的情况【必填】
  8. 4. device_mac // 打卡设备mac地址【选填】
  9. 5. content // 补充说明。{当出现异常打卡(经纬度未获得,距离范围之外,早退、迟到、旷工)时,必填}
  10. 返回:
  11. {
  12. "success": true,
  13. "msgCode": null,
  14. "msgInfo": null,
  15. "count": 0,
  16. "model": true
  17. }

  1. 接口名:pd.attendance.status
  2. 接口描述:获取打卡状态
  3. 参数:
  4. 0. sessionId // 登录后的sessionId凭据【必填】
  5. 2. type // 0签到 1签退
  6. 3. longitude // 经度,若APP实在无法定位则会传-1 兼容无法定位的情况【必填】
  7. 4. latitude // 纬度,若APP实在无法定位则会传-1 兼容无法定位的情况【必填】
  8. 返回:
  9. {
  10. "success": true,
  11. "msgCode": null,
  12. "msgInfo": null,
  13. "count": 0,
  14. "model": {
  15. "type":0, // 2016-12-12 新增
  16. "distance": 300, // 实际距离
  17. "date": "2016年11月14日 14:20" // 实际打卡时间(服务器上的北京时间)
  18. "status":0 // 0 正常状态
  19. // 1 异常状态,迟到
  20. // 2 异常状态,旷工
  21. // 3 异常状态,早退
  22. }
  23. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注