ApprovalDataView.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  1. using Google.Protobuf.WellKnownTypes;
  2. using Newtonsoft.Json;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Reflection.Metadata.Ecma335;
  7. using System.Text;
  8. using System.Text.Json.Serialization;
  9. using System.Threading.Tasks;
  10. namespace OASystem.Domain.ViewModels.QiYeWeChat
  11. {
  12. /// <summary>
  13. /// 企业微信 审批 View
  14. /// </summary>
  15. public class ApprovalDataView : ResponseBase
  16. {
  17. /// <summary>
  18. /// 拉取的审批单个数,最大值为100,当total参数大于100时,可运用next_spnum参数进行多次拉取
  19. /// </summary>
  20. public int Count { get; set; }
  21. /// <summary>
  22. /// 时间段内的总审批单个数
  23. /// </summary>
  24. public int total { get; set; }
  25. /// <summary>
  26. /// 拉取列表的最后一个审批单号
  27. /// </summary>
  28. public long next_spnum { get; set; }
  29. /// <summary>
  30. /// 审批Data
  31. /// </summary>
  32. public List<Sp_Info>? data { get; set; }
  33. }
  34. /// <summary>
  35. /// 批量获取审批单号 View
  36. /// </summary>
  37. public class ApprovalInfoView : ResponseBase
  38. {
  39. /// <summary>
  40. /// 审批单号列表,包含满足条件的审批申请
  41. /// </summary>
  42. public List<string>? sp_no_list { get; set; }
  43. /// <summary>
  44. /// 后续请求查询的游标,当返回结果没有该字段时表示审批单已经拉取完
  45. /// </summary>
  46. public string? new_next_cursor { get; set; }
  47. }
  48. /// <summary>
  49. /// 审批申请详情 View
  50. /// </summary>
  51. public class ApprovalDetailView : ResponseBase
  52. {
  53. /// <summary>
  54. /// 审批申请详情
  55. /// </summary>
  56. public Sp_Detail? info { get; set; }
  57. }
  58. /// <summary>
  59. /// 申请人信息
  60. /// </summary>
  61. public class Applyer
  62. {
  63. /// <summary>
  64. /// 申请人userid
  65. /// </summary>
  66. public string userid { get; set; }
  67. /// <summary>
  68. /// 申请人所在部门id
  69. /// </summary>
  70. public string partyid { get; set; }
  71. }
  72. /// <summary>
  73. /// 分支审批人
  74. /// </summary>
  75. public class Approver
  76. {
  77. /// <summary>
  78. /// 分支审批人userid
  79. /// </summary>
  80. public string userid { get; set; }
  81. }
  82. /// <summary>
  83. /// 审批节点详情,一个审批节点有多个审批人
  84. /// </summary>
  85. public class DetailsItem
  86. {
  87. /// <summary>
  88. /// 分支审批人
  89. /// </summary>
  90. public Approver approver { get; set; }
  91. /// <summary>
  92. /// 审批意见
  93. /// </summary>
  94. public string speech { get; set; }
  95. /// <summary>
  96. /// 分支审批人审批状态:1-审批中;2-已同意;3-已驳回;4-已转审;11-已退回;12-已加签;13-已同意并加签
  97. /// </summary>
  98. public int sp_status { get; set; }
  99. /// <summary>
  100. /// 节点分支审批人审批操作时间戳,0表示未操作
  101. /// </summary>
  102. public int sptime { get; set; }
  103. /// <summary>
  104. /// 节点分支审批人审批意见附件,media_id具体使用请参考:文档-获取临时素材
  105. /// </summary>
  106. public List<string> media_id { get; set; }
  107. }
  108. /// <summary>
  109. /// 审批流程信息,可能有多个审批节点。
  110. /// </summary>
  111. public class Sp_recordItem
  112. {
  113. /// <summary>
  114. /// 审批节点状态:1-审批中;2-已同意;3-已驳回;4-已转审;11-已退回;12-已加签;13-已同意并加签
  115. /// </summary>
  116. public int sp_status { get; set; }
  117. /// <summary>
  118. /// 节点审批方式:1-或签;2-会签
  119. /// </summary>
  120. public int approverattr { get; set; }
  121. /// <summary>
  122. /// 审批节点详情,一个审批节点有多个审批人
  123. /// </summary>
  124. public List<DetailsItem> details { get; set; }
  125. }
  126. /// <summary>
  127. /// 抄送信息,可能有多个抄送节点
  128. /// </summary>
  129. public class NotifyerItem
  130. {
  131. /// <summary>
  132. /// 节点抄送人userid
  133. /// </summary>
  134. public string userid { get; set; }
  135. }
  136. /// <summary>
  137. /// 控件标题
  138. /// </summary>
  139. public class TitleItem
  140. {
  141. /// <summary>
  142. /// 文本值 中文
  143. /// </summary>
  144. public string text { get; set; }
  145. /// <summary>
  146. /// 文本值 英文值
  147. /// </summary>
  148. public string lang { get; set; }
  149. }
  150. /// <summary>
  151. /// 用户所选选项
  152. /// </summary>
  153. public class OptionsItem
  154. {
  155. /// <summary>
  156. /// 选项key,选项的唯一id,可通过“获取审批模板详情”接口获得
  157. /// </summary>
  158. public string key { get; set; }
  159. /// <summary>
  160. /// 选项值,若配置了多语言则会包含中英文的选项值
  161. /// </summary>
  162. public List<TitleItem> value { get; set; }
  163. }
  164. /// <summary>
  165. /// 请假类型,所选选项与假期管理关联,为假期管理中的假期类型
  166. /// </summary>
  167. public class Selector
  168. {
  169. /// <summary>
  170. /// 选择类型:single-单选;multi-多选,在假勤控件中固定为单选
  171. /// </summary>
  172. public string type { get; set; }
  173. /// <summary>
  174. /// 用户所选选项
  175. /// </summary>
  176. public List<OptionsItem> options { get; set; }
  177. }
  178. /// <summary>
  179. /// 假勤组件时间选择范围
  180. /// </summary>
  181. public class Date_range
  182. {
  183. /// <summary>
  184. /// 时间展示类型:halfday-日期;hour-日期+时间
  185. /// </summary>
  186. public string type { get; set; }
  187. /// <summary>
  188. /// 开始时间
  189. /// </summary>
  190. public long new_begin { get; set; }
  191. /// <summary>
  192. /// 开始时间
  193. /// </summary>
  194. public DateTime new_begin_dt
  195. {
  196. get
  197. {
  198. return new DateTime(new_begin * 10000000 + 621355968000000000L).ToLocalTime();
  199. }
  200. }
  201. /// <summary>
  202. /// 结束时间
  203. /// </summary>
  204. public long new_end { get; set; }
  205. /// <summary>
  206. /// 开始时间
  207. /// </summary>
  208. public DateTime new_end_dt
  209. {
  210. get
  211. {
  212. return new DateTime(new_end * 10000000 + 621355968000000000L).ToLocalTime();
  213. }
  214. }
  215. /// <summary>
  216. /// 请假时长
  217. /// </summary>
  218. public int new_duration { get; set; }
  219. }
  220. /// <summary>
  221. /// 每一天的分片时长信息
  222. /// </summary>
  223. public class Day_itemsItem
  224. {
  225. /// <summary>
  226. /// 日期的00:00:00时间戳,Unix时间
  227. /// </summary>
  228. public long daytime { get; set; }
  229. public DateTime daytimeDt
  230. {
  231. get
  232. {
  233. return new DateTime(daytime * 10000000 + 621355968000000000L).ToLocalTime();
  234. }
  235. }
  236. ///// <summary>
  237. /////
  238. ///// </summary>
  239. //public List<string> time_sections { get; set; }
  240. /// <summary>
  241. /// 分隔当前日期的时长秒数
  242. /// </summary>
  243. public long duration { get; set; }
  244. }
  245. /// <summary>
  246. /// 时长支持按天分片信息, 2020/10/01之前的历史表单不支持时长分片
  247. /// </summary>
  248. public class Slice_info
  249. {
  250. /// <summary>
  251. /// 每一天的分片时长信息
  252. /// </summary>
  253. public List<Day_itemsItem> day_items { get; set; }
  254. /// <summary>
  255. /// 时长计算来源类型: 1--系统自动计算;2--用户修改
  256. /// </summary>
  257. public int state { get; set; }
  258. /// <summary>
  259. /// 总时长,单位是秒
  260. /// </summary>
  261. public long duration { get; set; }
  262. }
  263. /// <summary>
  264. /// 假勤组件
  265. /// </summary>
  266. public class Attendance
  267. {
  268. /// <summary>
  269. /// 假勤组件时间选择范围
  270. /// </summary>
  271. public Date_range date_range { get; set; }
  272. /// <summary>
  273. /// 假勤组件类型:1-请假;2-补卡;3-出差;4-外出;5-加班
  274. /// </summary>
  275. public int type { get; set; }
  276. /// <summary>
  277. /// 时长支持按天分片信息, 2020/10/01之前的历史表单不支持时长分片
  278. /// </summary>
  279. public Slice_info slice_info { get; set; }
  280. }
  281. /// <summary>
  282. /// 假内容,即申请人在此组件内选择的请假信息
  283. /// </summary>
  284. public class Vacation
  285. {
  286. /// <summary>
  287. /// 请假类型,所选选项与假期管理关联,为假期管理中的假期类型
  288. /// </summary>
  289. public Selector selector { get; set; }
  290. /// <summary>
  291. /// 假勤组件
  292. /// </summary>
  293. public Attendance attendance { get; set; }
  294. }
  295. /// <summary>
  296. /// 控件值 ,包含了申请人在各种类型控件中输入的值,不同控件有不同的值,具体说明详见附录
  297. /// </summary>
  298. public class Value
  299. {
  300. public string? text { get; set; }
  301. /// <summary>
  302. /// 此控件不显示在审批详情中,故value为空
  303. /// </summary>
  304. public object? tips { get; set; }
  305. /// <summary>
  306. /// 成员内容,即申请人在此控件选择的成员,多选模式下可能有多个
  307. /// </summary>
  308. public List<Member> members { get; set; }
  309. /// <summary>
  310. /// 部门内容,即申请人在此控件选择的部门,多选模式下可能有多个
  311. /// </summary>
  312. public List<Department> departments { get; set; }
  313. /// <summary>
  314. /// 文件内容,即申请人在此控件上传的文件内容,可能有多个
  315. /// </summary>
  316. public List<File_Info> files { get; set; }
  317. /// <summary>
  318. /// 明细内容,一个明细控件可能包含多个子明细
  319. /// </summary>
  320. public List<Children> children { get; set; }
  321. /// <summary>
  322. ///
  323. /// </summary>
  324. public List<string> stat_field { get; set; }
  325. /// <summary>
  326. /// 请假内容,即申请人在此组件内选择的请假信息
  327. /// </summary>
  328. public Vacation vacation { get; set; }
  329. ///// <summary>
  330. /////
  331. ///// </summary>
  332. //public List<string> sum_field { get; set; }
  333. /// <summary>
  334. /// 补卡类型模板值
  335. /// </summary>
  336. public Punch_Correction punch_correction { get; set; }
  337. /// <summary>
  338. /// 关联审批单的模板
  339. /// </summary>
  340. public List<Related_Approval> related_approval { get; set; }
  341. public Attendance attendance { get; set; }
  342. ///// <summary>
  343. /////
  344. ///// </summary>
  345. //public List<string> students { get; set; }
  346. ///// <summary>
  347. /////
  348. ///// </summary>
  349. //public List<string> classes { get; set; }
  350. ///// <summary>
  351. /////
  352. ///// </summary>
  353. //public List<string> docs { get; set; }
  354. ///// <summary>
  355. /////
  356. ///// </summary>
  357. //public List<string> wedrive_files { get; set; }
  358. }
  359. /// <summary>
  360. /// 补卡模板 值
  361. /// </summary>
  362. public class Punch_Correction
  363. {
  364. /// <summary>
  365. /// 异常状态说明 状态 未打卡
  366. /// </summary>
  367. public string state { get; set; }
  368. /// <summary>
  369. /// 补卡时间
  370. /// </summary>
  371. public long time { get; set; }
  372. /// <summary>
  373. /// 开始时间
  374. /// </summary>
  375. public DateTime time_dt
  376. {
  377. get
  378. {
  379. return new DateTime(time * 10000000 + 621355968000000000L).ToLocalTime();
  380. }
  381. }
  382. /// <summary>
  383. /// ?
  384. /// </summary>
  385. public long date { get; set; }
  386. }
  387. /// <summary>
  388. /// 部门内容,即申请人在此控件选择的部门,多选模式下可能有多个
  389. /// </summary>
  390. public class Department
  391. {
  392. /// <summary>
  393. /// 部门id
  394. /// </summary>
  395. public string openapi_id { get; set; }
  396. /// <summary>
  397. /// 部门名
  398. /// </summary>
  399. public string name { get; set; }
  400. }
  401. /// <summary>
  402. /// 成员内容,即申请人在此控件选择的成员,多选模式下可能有多个
  403. /// </summary>
  404. public class Member
  405. {
  406. /// <summary>
  407. /// 成员的userid
  408. /// </summary>
  409. public string userid { get; set; }
  410. /// <summary>
  411. /// 成员名
  412. /// </summary>
  413. public string name { get; set; }
  414. }
  415. /// <summary>
  416. /// 文件内容,即申请人在此控件上传的文件内容,可能有多个
  417. /// </summary>
  418. public class File_Info
  419. {
  420. /// <summary>
  421. /// 文件的media_id
  422. /// </summary>
  423. public string file_id { get; set; }
  424. }
  425. /// <summary>
  426. /// 明细内容,一个明细控件可能包含多个子明细
  427. /// </summary>
  428. public class Children
  429. {
  430. public List<ListInfo> list { get; set; }
  431. }
  432. public class ListInfo
  433. {
  434. public string control { get; set; }
  435. public string id { get; set; }
  436. public List<TitleItem> title { get; set; }
  437. public ValueText value { get; set; }
  438. }
  439. public class ValueText
  440. {
  441. public string text { get; set; }
  442. }
  443. /// <summary>
  444. /// 关联审批单的模板
  445. /// </summary>
  446. public class Related_Approval
  447. {
  448. /// <summary>
  449. /// 关联审批单的模板名
  450. /// </summary>
  451. public List<TitleItem> template_names { get; set; }
  452. /// <summary>
  453. /// 关联审批单的审批单号
  454. /// </summary>
  455. public string sp_no { get; set; }
  456. /// <summary>
  457. /// 关联审批单的状态
  458. /// </summary>
  459. public int sp_status { get; set; }
  460. /// <summary>
  461. /// 关联审批单的提单时间
  462. /// </summary>
  463. public long create_time { get; set; }
  464. /// <summary>
  465. /// 关联审批单的提单者
  466. /// </summary>
  467. public string name { get; set; }
  468. }
  469. /// <summary>
  470. /// 审批申请详情,由多个表单控件及其内容组成
  471. /// </summary>
  472. public class ContentsItem
  473. {
  474. /// <summary>
  475. /// 控件类型:
  476. /// Text-文本;Textarea-多行文本;Number-数字;Money-金额;Date-日期/日期+时间;
  477. /// Selector-单选/多选;;Contact-成员/部门;Tips-说明文字;File-附件;Table-明细;
  478. /// Attendance-假勤;Vacation-请假;PunchCorrection-补卡;DateRange-时长
  479. /// </summary>
  480. public string control { get; set; }
  481. /// <summary>
  482. /// 控件id
  483. /// </summary>
  484. public string id { get; set; }
  485. /// <summary>
  486. /// 控件名称 ,若配置了多语言则会包含中英文的控件名称
  487. /// </summary>
  488. public List<TitleItem> title { get; set; }
  489. /// <summary>
  490. /// 控件值 ,包含了申请人在各种类型控件中输入的值,不同控件有不同的值,具体说明详见附录
  491. /// </summary>
  492. public Value value { get; set; }
  493. /// <summary>
  494. ///
  495. /// </summary>
  496. public int display { get; set; }
  497. /// <summary>
  498. ///
  499. /// </summary>
  500. public int require { get; set; }
  501. }
  502. /// <summary>
  503. /// 审批申请数据
  504. /// </summary>
  505. public class Apply_data
  506. {
  507. /// <summary>
  508. /// 审批申请详情,由多个表单控件及其内容组成
  509. /// </summary>
  510. public List<ContentsItem> contents { get; set; }
  511. }
  512. /// <summary>
  513. /// 审批详情
  514. /// </summary>
  515. public class Sp_Detail
  516. {
  517. /// <summary>
  518. /// 审批编号
  519. /// </summary>
  520. public string sp_no { get; set; }
  521. /// <summary>
  522. /// 审批申请类型名称(审批模板名称)
  523. /// </summary>
  524. public string sp_name { get; set; }
  525. /// <summary>
  526. /// 申请单状态:1-审批中;2-已通过;3-已驳回;4-已撤销;6-通过后撤销;7-已删除;10-已支付
  527. /// </summary>
  528. public int sp_status { get; set; }
  529. /// <summary>
  530. /// 审批模板id。可在“获取审批申请详情”、“审批状态变化回调通知”中获得,也可在审批模板的模板编辑页面链接中获得。
  531. /// </summary>
  532. public string template_id { get; set; }
  533. /// <summary>
  534. /// 审批申请提交时间,Unix时间戳
  535. /// </summary>
  536. public long apply_time { get; set; }
  537. /// <summary>
  538. /// 开始时间
  539. /// </summary>
  540. public DateTime apply_time_dt
  541. {
  542. get
  543. {
  544. return new DateTime(apply_time * 10000000 + 621355968000000000L).ToLocalTime();
  545. }
  546. }
  547. /// <summary>
  548. /// 申请人信息
  549. /// </summary>
  550. public Applyer applyer { get; set; }
  551. /// <summary>
  552. /// 审批流程信息,可能有多个审批节点。
  553. /// </summary>
  554. public List<Sp_recordItem> sp_record { get; set; }
  555. /// <summary>
  556. /// 抄送信息,可能有多个抄送节点
  557. /// </summary>
  558. public List<NotifyerItem> notifyer { get; set; }
  559. /// <summary>
  560. /// 审批申请数据
  561. /// </summary>
  562. public Apply_data apply_data { get; set; }
  563. /// <summary>
  564. /// 审批申请备注信息,可能有多个备注节点
  565. /// </summary>
  566. public List<Comment> comments { get; set; }
  567. }
  568. /// <summary>
  569. /// 审批申请备注信息
  570. /// </summary>
  571. public class Comment
  572. {
  573. /// <summary>
  574. /// userid
  575. /// </summary>
  576. public Approver commentUserInfo { get; set; }
  577. /// <summary>
  578. /// unix时间戳
  579. /// </summary>
  580. public long commenttime { get; set; }
  581. /// <summary>
  582. /// 备注信息
  583. /// </summary>
  584. public string commentcontent { get; set; }
  585. /// <summary>
  586. /// 备注id
  587. /// </summary>
  588. public string commentid { get; set; }
  589. /// <summary>
  590. /// 备注附件id,可能有多个,media_id具体使用请参考:文档-获取临时素材
  591. /// </summary>
  592. public List<string> media_id { get; set; }
  593. }
  594. #region 审批详情 (旧版)
  595. /// <summary>
  596. /// 审批基本信息
  597. /// </summary>
  598. public class Sp_Info
  599. {
  600. /// <summary>
  601. /// 审批名称(请假,报销,自定义审批名称)
  602. /// </summary>
  603. public string? spname { get; set; }
  604. /// <summary>
  605. /// 申请人姓名
  606. /// </summary>
  607. public string? apply_name { get; set; }
  608. /// <summary>
  609. /// 申请人部门
  610. /// </summary>
  611. public string? apply_org { get; set; }
  612. /// <summary>
  613. /// 审批人姓名
  614. /// </summary>
  615. public List<string>? approval_name { get; set; }
  616. /// <summary>
  617. /// 抄送人姓名
  618. /// </summary>
  619. public List<string>? notify_name { get; set; }
  620. /// <summary>
  621. /// 审批状态:1审批中;2 已通过;3已驳回;4已取消;6通过后撤销;10已支付
  622. /// </summary>
  623. public int sp_status { get; set; }
  624. /// <summary>
  625. /// 审批单号
  626. /// </summary>
  627. public long sp_num { get; set; }
  628. /// <summary>
  629. /// 请假类型(只有请假模板审批记录有此数据项)
  630. /// </summary>
  631. public Leave? leave { get; set; }
  632. /// <summary>
  633. /// 审批模板信息
  634. /// </summary>
  635. public Comm? comm { get; set; }
  636. ///// <summary>
  637. ///// 补卡时间
  638. ///// 打卡补卡 筛选使用
  639. ///// </summary>
  640. //public DateTime? comm_applydata_dt
  641. //{
  642. // get
  643. // {
  644. // DateTime? dt = null;
  645. // if (comm == null) return dt;
  646. // if (comm.FillingDt != null)
  647. // {
  648. // dt = comm.FillingDt;
  649. // }
  650. // return dt;
  651. // }
  652. //}
  653. /// <summary>
  654. /// 审批的附件media_id,可使用media/get获取附件
  655. /// </summary>
  656. public List<string>? mediaids { get; set; }
  657. /// <summary>
  658. /// 审批单提交时间
  659. /// Unix时间戳
  660. /// </summary>
  661. public uint apply_time { get; set; }
  662. /// <summary>
  663. /// 审批单提交时间
  664. /// datetime
  665. /// </summary>
  666. public DateTime apply_time_dt
  667. {
  668. get
  669. {
  670. return new DateTime(long.Parse(apply_time.ToString()) * 10000000 + 621355968000000000L).ToLocalTime();
  671. }
  672. }
  673. /// <summary>
  674. /// 审批单提交者的userid
  675. /// </summary>
  676. public string? apply_user_id { get; set; }
  677. }
  678. /// <summary>
  679. /// 审批类型
  680. /// </summary>
  681. public class Leave
  682. {
  683. /// <summary>
  684. /// 请假时间单位:0半天;1小时
  685. /// </summary>
  686. public int timeunit { get; set; }
  687. /// <summary>
  688. /// 请假类型
  689. /// 1年假;2事假;3病假;4调休假;5婚假;6产假;7陪产假;8其他
  690. /// </summary>
  691. public int leave_type { get; set; }
  692. /// <summary>
  693. /// 请假开始时间,unix时间
  694. /// </summary>
  695. public uint start_time { get; set; }
  696. /// <summary>
  697. /// 请假开始时间,datetime时间
  698. /// </summary>
  699. public DateTime start_time_dt
  700. {
  701. get
  702. {
  703. return new DateTime(long.Parse(start_time.ToString()) * 10000000 + 621355968000000000L).ToLocalTime();
  704. }
  705. }
  706. /// <summary>
  707. /// 请假结束时间,unix时间
  708. /// </summary>
  709. public uint end_time { get; set; }
  710. /// <summary>
  711. /// 请假开始时间,datetime时间
  712. /// </summary>
  713. public DateTime end_time_dt
  714. {
  715. get
  716. {
  717. return new DateTime(long.Parse(end_time.ToString()) * 10000000 + 621355968000000000L).ToLocalTime();
  718. }
  719. }
  720. /// <summary>
  721. /// 请假时长,单位小时
  722. /// </summary>
  723. public int duration { get; set; }
  724. /// <summary>
  725. /// 请假事由
  726. /// </summary>
  727. public string? reason { get; set; }
  728. }
  729. /// <summary>
  730. /// 审批模板信息
  731. /// </summary>
  732. public class Comm
  733. {
  734. /// <summary>
  735. /// 模板数据
  736. /// </summary>
  737. public string? apply_data { get; set; }
  738. public List<ApplyInfo>? applydata
  739. {
  740. get
  741. {
  742. List<ApplyInfo> applyInfos = new List<ApplyInfo>();
  743. if (!string.IsNullOrEmpty(apply_data))
  744. {
  745. applyInfos = JsonConvert.DeserializeObject<List<ApplyInfo>>(apply_data);
  746. }
  747. return applyInfos;
  748. }
  749. }
  750. /// <summary>
  751. /// 补卡时间
  752. /// 筛选使用
  753. /// </summary>
  754. public DateTime? FillingDt {
  755. get
  756. {
  757. DateTime? dt = null;
  758. if (applydata != null && applydata.Count > 0)
  759. {
  760. ApplyInfo applyInfo = applydata.Where(it => it.id == "checkin-time").FirstOrDefault();
  761. if (applyInfo != null)
  762. {
  763. dt = applyInfo.valueDt;
  764. }
  765. }
  766. return dt;
  767. }
  768. }
  769. }
  770. /// <summary>
  771. ///
  772. /// </summary>
  773. public class ApplyInfo
  774. {
  775. public string? id { get; set; }
  776. public string? title { get; set; }
  777. public string? type { get; set; }
  778. public object? value { get; set; }
  779. public DateTime? valueDt
  780. {
  781. get
  782. {
  783. if (id == "checkin-time" && value != null)
  784. {
  785. long timeSpan = long.Parse(value.ToString()) / 1000;
  786. return new DateTime(timeSpan * 10000000 + 621355968000000000L).ToLocalTime();
  787. }
  788. return null;
  789. }
  790. }
  791. }
  792. #endregion
  793. }