CheckInView.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace OASystem.Domain.ViewModels.QiYeWeChat
  7. {
  8. #region 企业微信 API 获取企业打卡规则
  9. /// <summary>
  10. /// 企业微信 API 获取企业打卡规则
  11. /// </summary>
  12. public class CorpCheckInRuleView : ResponseBase
  13. {
  14. /// <summary>
  15. /// 企业规则信息列表
  16. /// </summary>
  17. public List<GroupItem>? group { get; set; }
  18. }
  19. public class GroupItem
  20. {
  21. /// <summary>
  22. /// 打卡规则类型,1:固定时间上下班;2:按班次上下班;3:自由上下班
  23. /// </summary>
  24. public int grouptype { get; set; }
  25. /// <summary>
  26. /// 打卡规则id
  27. /// </summary>
  28. public int groupid { get; set; }
  29. /// <summary>
  30. /// 打卡规则名称
  31. /// </summary>
  32. public string groupname { get; set; }
  33. /// <summary>
  34. /// 特殊日期-不用打卡日期时间戳
  35. /// </summary>
  36. public List<spe_offdaysItem> spe_offdays { get; set; }
  37. }
  38. /// <summary>
  39. /// 特殊日期-不用打卡日期时间戳
  40. /// </summary>
  41. public class spe_offdaysItem
  42. {
  43. /// <summary>
  44. /// 特殊日期备注
  45. /// </summary>
  46. public string notes { get; set; }
  47. public long timestamp { get; set; }
  48. public List<long> checkintime { get; set; }
  49. public int type { get; set; }
  50. /// <summary>
  51. /// 开始时间戳
  52. /// </summary>
  53. public long begtime { get; set; }
  54. /// <summary>
  55. /// 开始时间
  56. /// </summary>
  57. public DateTime begtime_dt
  58. {
  59. get
  60. {
  61. return new DateTime(begtime * 10000000 + 621355968000000000L).ToLocalTime();
  62. }
  63. }
  64. public long endtime { get; set; }
  65. /// <summary>
  66. /// 开始时间
  67. /// </summary>
  68. public DateTime endtime_dt
  69. {
  70. get
  71. {
  72. return new DateTime(endtime * 10000000 + 621355968000000000L).ToLocalTime();
  73. }
  74. }
  75. }
  76. #endregion
  77. /// <summary>
  78. /// 企业微信 API
  79. /// 打卡月数据
  80. /// </summary>
  81. public class CheckInView:ResponseBase
  82. {
  83. /// <summary>
  84. /// 基础信息
  85. /// </summary>
  86. public List<Data>? datas { get; set; }
  87. }
  88. /// <summary>
  89. /// 基础信息 Data
  90. /// </summary>
  91. public class Data
  92. {
  93. /// <summary>
  94. /// 基础信息
  95. /// </summary>
  96. public Base_Info? base_info { get; set; }
  97. /// <summary>
  98. /// 汇总信息
  99. /// </summary>
  100. public Summary_Info? summary_info { get; set; }
  101. /// <summary>
  102. /// 异常状态统计信息
  103. /// </summary>
  104. public List<Exception_Info>? exception_infos { get; set; }
  105. /// <summary>
  106. /// 假勤统计信息
  107. /// </summary>
  108. public List<Sp_Item>? sp_items { get; set; }
  109. /// <summary>
  110. /// 加班情况
  111. /// </summary>
  112. public Overwork_Info? overwork_info { get; set; }
  113. }
  114. /// <summary>
  115. /// 成员基础信息
  116. /// </summary>
  117. public class Base_Info
  118. {
  119. /// <summary>
  120. /// 记录类型:1-固定上下班;2-外出(此报表中不会出现外出打卡数据);3-按班次上下班;4-自由签到;5-加班;7-无规则
  121. /// </summary>
  122. public int record_type { get; set; }
  123. /// <summary>
  124. /// 打卡人员姓名
  125. /// </summary>
  126. public string? name { get; set; }
  127. /// <summary>
  128. /// 打卡人员别名
  129. /// </summary>
  130. public string? name_ex { get; set; }
  131. /// <summary>
  132. /// 打卡人员所在部门,会显示所有所在部门
  133. /// </summary>
  134. public string? departs_name { get; set; }
  135. /// <summary>
  136. /// 打卡人员账号,即userid
  137. /// </summary>
  138. public string? acctid { get; set; }
  139. /// <summary>
  140. /// 打卡人员所属规则信息
  141. /// </summary>
  142. public Rule_Info? rule_info { get; set; }
  143. }
  144. /// <summary>
  145. /// 打卡人员所属规则信息
  146. /// </summary>
  147. public class Rule_Info
  148. {
  149. /// <summary>
  150. /// 所属规则的id
  151. /// </summary>
  152. public int groupid { get; set; }
  153. /// <summary>
  154. /// 打卡规则名
  155. /// </summary>
  156. public string? groupname { get; set; }
  157. }
  158. /// <summary>
  159. /// 汇总信息
  160. /// </summary>
  161. public class Summary_Info
  162. {
  163. /// <summary>
  164. /// 应打卡天数
  165. /// </summary>
  166. public int work_days { get; set; }
  167. /// <summary>
  168. /// 正常天数
  169. /// </summary>
  170. public int regular_days { get; set; }
  171. /// <summary>
  172. /// 异常天数
  173. /// </summary>
  174. public int except_days { get; set; }
  175. /// <summary>
  176. /// 实际工作时长,为统计周期每日实际工作时长之和
  177. /// </summary>
  178. public int regular_work_sec { get; set; }
  179. /// <summary>
  180. /// 标准工作时长,为统计周期每日标准工作时长之和
  181. /// </summary>
  182. public int standard_work_sec { get; set; }
  183. }
  184. /// <summary>
  185. /// 异常状态统计信息
  186. /// </summary>
  187. public class Exception_Info
  188. {
  189. /// <summary>
  190. /// 异常类型:1-迟到;2-早退;3-缺卡;4-旷工;5-地点异常;6-设备异常
  191. /// </summary>
  192. public int exception { get; set; }
  193. /// <summary>
  194. /// 异常次数,为统计周期内每日此异常次数之和
  195. /// </summary>
  196. public int count { get; set; }
  197. /// <summary>
  198. /// 异常时长(迟到/早退/旷工才有值),为统计周期内每日此异常时长之和
  199. /// </summary>
  200. public int duration { get; set; }
  201. }
  202. /// <summary>
  203. /// 假勤统计信息
  204. /// </summary>
  205. public class Sp_Item
  206. {
  207. /// <summary>
  208. /// 假勤类型:1-请假;2-补卡;3-出差;4-外出;100-外勤
  209. /// </summary>
  210. public int type { get; set; }
  211. /// <summary>
  212. /// 具体请假类型,当type为1请假时,具体的请假类型id,可通过审批相关接口获取假期详情
  213. /// </summary>
  214. public int vacation_id { get; set; }
  215. /// <summary>
  216. /// 假勤次数,为统计周期内每日此假勤发生次数之和
  217. /// </summary>
  218. public int count { get; set; }
  219. /// <summary>
  220. /// 假勤时长,为统计周期内每日此假勤发生时长之和,时长单位为天直接除以86400即为天数,单位为小时直接除以3600即为小时数
  221. /// </summary>
  222. public int duration { get; set; }
  223. /// <summary>
  224. /// 时长单位:0-按天 1-按小时
  225. /// </summary>
  226. public int time_type { get; set; }
  227. /// <summary>
  228. /// 统计项名称
  229. /// </summary>
  230. public string? name { get; set; }
  231. }
  232. /// <summary>
  233. /// 加班情况
  234. /// </summary>
  235. public class Overwork_Info
  236. {
  237. /// <summary>
  238. /// 工作日加班时长
  239. /// </summary>
  240. public int? workday_over_sec { get; set; }
  241. /// <summary>
  242. /// 节假日加班时长
  243. /// </summary>
  244. public int? holidays_over_sec { get; set; }
  245. /// <summary>
  246. /// 休息日加班时长
  247. /// </summary>
  248. public int? restdays_over_sec { get; set; }
  249. }
  250. public class AssessmentByUserListView : ResponseBase
  251. {
  252. public List<AssessmentByUserView> Data { get; set; }
  253. }
  254. public class AssessmentByUserView
  255. {
  256. public string Name { get; set; }
  257. public string Accid { get; set; }
  258. public int Regular_days { get; set; }
  259. public int Except_days { get; set; }
  260. public List<Exception_info> Exception_info_List { get; set; }
  261. public int Work_days { get; set; }
  262. }
  263. public class Exception_info
  264. {
  265. public ErrorType Type { get; set; }
  266. public DateTime Date { get; set; }
  267. public string Info { get; set; }
  268. }
  269. public enum ErrorType
  270. {
  271. 迟到 = 1, // 迟到
  272. 早退 = 2, // 早退
  273. 缺卡 = 3, // 缺卡
  274. 旷工 = 4, // 旷工
  275. 地点异常 = 5, // 地点异常
  276. 设备异常 = 6 // 设备异常
  277. }
  278. }