Hr.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. declare (strict_types=1);
  3. namespace app\zskk\controller;
  4. use app\admin\model\dict\Commondata;
  5. use app\common\controller\ZskkApiController;
  6. use think\db\exception\DataNotFoundException;
  7. use think\db\exception\DbException;
  8. use think\db\exception\ModelNotFoundException;
  9. use Throwable;
  10. use app\zskk\servies\HrServies;
  11. class Hr extends ZskkApiController
  12. {
  13. // protected function initialize(): void
  14. // {
  15. // BlurUtils::setNotNeedBlur();
  16. // }
  17. /**
  18. * 后台初始化请求
  19. * @return void
  20. * @throws Throwable
  21. */
  22. public function getRecogViewDetail(HrServies $servies): void
  23. {
  24. $params = $this->request->post();
  25. $token = $params['TOKEN'] ?? '';
  26. // todo 容错处理
  27. $data = $servies->getRecogViewDetailByToken($token);
  28. // if(empty($data))
  29. // {
  30. // $this->error('token失效或已过期');
  31. // }
  32. $this->success('success', $data);
  33. }
  34. /**
  35. * 后台初始化请求
  36. * @return void
  37. * @throws Throwable
  38. */
  39. public function getRecogViewHrDetail(HrServies $servies): void
  40. {
  41. $params = $this->request->post();
  42. $token = $params['TOKEN'] ?? '';
  43. // todo 容错处理
  44. $data = $servies->getRecogViewDetailByToken($token,1);
  45. // if(empty($data))
  46. // {
  47. // $this->error('token失效或已过期');
  48. // }
  49. $this->success('success', $data);
  50. }
  51. /**
  52. * @throws ModelNotFoundException
  53. * @throws DataNotFoundException
  54. * @throws DbException
  55. */
  56. public function saveRecogViewDetail(HrServies $servies): void
  57. {
  58. $params = $this->request->post();
  59. $HR_RECORDS = $params['HR_RECORDS'] ?? array();
  60. $TOKEN = $params['TOKEN'] ?? '';
  61. $servies->saveRecogViewDetail($HR_RECORDS, $TOKEN);
  62. $this->success('success');
  63. }
  64. public function getNoHrReasonList(): void
  65. {
  66. $model = new Commondata();
  67. $res = $model
  68. ->field(['code','name'])
  69. ->where('type', '7')
  70. ->where('status', 1)
  71. ->order('weigh asc, id asc')
  72. ->select()
  73. ->toArray();
  74. $this->success('', ['list' => $res]);
  75. }
  76. }