OapiAttendanceApproveDurationCalculateRequest.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. /**
  3. * dingtalk API: dingtalk.oapi.attendance.approve.duration.calculate request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2019.09.25
  7. */
  8. class OapiAttendanceApproveDurationCalculateRequest
  9. {
  10. /**
  11. * 审批单类型1:加班,2:出差,3:请假
  12. **/
  13. private $bizType;
  14. /**
  15. * 计算方法,0:按自然日计算,1:按工作日计算
  16. **/
  17. private $calculateModel;
  18. /**
  19. * 时长单位,支持的day,halfDay,hour,biz_type为1时仅支持hour。时间格式必须与时长单位对应,2019-08-15对应day,2019-08-15 AM对应halfDay,2019-08-15 12:43对应hour
  20. **/
  21. private $durationUnit;
  22. /**
  23. * 开始时间,支持的时间格式 2019-08-15/2019-08-15 AM/2019-08-15 12:43。开始时间不能早于当前时间前31天
  24. **/
  25. private $fromTime;
  26. /**
  27. * 结束时间,支持的时间格式 2019-08-15/2019-08-15 AM/2019-08-15 12:43。结束时间减去开始时间的天数不能超过31天。biz_type为1时结束时间减去开始时间不能超过1天
  28. **/
  29. private $toTime;
  30. /**
  31. * 员工的user_id
  32. **/
  33. private $userid;
  34. private $apiParas = array();
  35. public function setBizType($bizType)
  36. {
  37. $this->bizType = $bizType;
  38. $this->apiParas["biz_type"] = $bizType;
  39. }
  40. public function getBizType()
  41. {
  42. return $this->bizType;
  43. }
  44. public function setCalculateModel($calculateModel)
  45. {
  46. $this->calculateModel = $calculateModel;
  47. $this->apiParas["calculate_model"] = $calculateModel;
  48. }
  49. public function getCalculateModel()
  50. {
  51. return $this->calculateModel;
  52. }
  53. public function setDurationUnit($durationUnit)
  54. {
  55. $this->durationUnit = $durationUnit;
  56. $this->apiParas["duration_unit"] = $durationUnit;
  57. }
  58. public function getDurationUnit()
  59. {
  60. return $this->durationUnit;
  61. }
  62. public function setFromTime($fromTime)
  63. {
  64. $this->fromTime = $fromTime;
  65. $this->apiParas["from_time"] = $fromTime;
  66. }
  67. public function getFromTime()
  68. {
  69. return $this->fromTime;
  70. }
  71. public function setToTime($toTime)
  72. {
  73. $this->toTime = $toTime;
  74. $this->apiParas["to_time"] = $toTime;
  75. }
  76. public function getToTime()
  77. {
  78. return $this->toTime;
  79. }
  80. public function setUserid($userid)
  81. {
  82. $this->userid = $userid;
  83. $this->apiParas["userid"] = $userid;
  84. }
  85. public function getUserid()
  86. {
  87. return $this->userid;
  88. }
  89. public function getApiMethodName()
  90. {
  91. return "dingtalk.oapi.attendance.approve.duration.calculate";
  92. }
  93. public function getApiParas()
  94. {
  95. return $this->apiParas;
  96. }
  97. public function check()
  98. {
  99. RequestCheckUtil::checkNotNull($this->bizType,"bizType");
  100. RequestCheckUtil::checkNotNull($this->calculateModel,"calculateModel");
  101. RequestCheckUtil::checkNotNull($this->durationUnit,"durationUnit");
  102. RequestCheckUtil::checkNotNull($this->fromTime,"fromTime");
  103. RequestCheckUtil::checkNotNull($this->toTime,"toTime");
  104. RequestCheckUtil::checkNotNull($this->userid,"userid");
  105. }
  106. public function putOtherTextParam($key, $value) {
  107. $this->apiParas[$key] = $value;
  108. $this->$key = $value;
  109. }
  110. }