ExamDao.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <?php
  2. namespace app\api\dao\exam;
  3. use app\api\actions\ZskkCache;
  4. use app\api\dao\ZskkDefaultDao;
  5. use app\api\model\doctor\DoctorruleModel;
  6. use app\api\model\doctorvisit\DoctorvisitModel;
  7. use app\api\model\exam\ExamModel;
  8. use think\facade\Log;
  9. /**
  10. * 后台控制器基类
  11. * 接口方法权限 必传参数 接口返回 错误抛出 通用参数处理
  12. */
  13. class ExamDao extends ZskkDefaultDao {
  14. protected $flag = true;
  15. protected $logName = "ExamDao";
  16. protected $exam = null;
  17. protected $visit = null;
  18. protected $doctorRuleModel = null;
  19. public function __construct(ExamModel $examModel,DoctorvisitModel $doctorVisitModel,DoctorruleModel $doctorRuleModel)
  20. {
  21. parent::__construct();
  22. $this->exam = $examModel;
  23. $this->visit = $doctorVisitModel;
  24. $this->doctorRuleModel = $doctorRuleModel;
  25. }
  26. public function saveDoctorVisit($arr)
  27. {
  28. $this->visit->insert($arr);
  29. }
  30. public function getExamClass($class)
  31. {
  32. $where = [];
  33. if($class == '*')
  34. {
  35. return $where;
  36. }else{
  37. $where[] = ['exam_class','in',explode(',',$class)];
  38. return $where;
  39. }
  40. }
  41. public function getDoctorDepart($id)
  42. {
  43. $depart = $this->exam->getDoctorDepart($id);
  44. return $depart;
  45. }
  46. public function getInsInfo($id)
  47. {
  48. $info = $this->exam->geInsInfo($id);
  49. return $info;
  50. }
  51. public function getOtherRule($where,$value)
  52. {
  53. return $this->doctorRuleModel->where($where)->value($value);
  54. }
  55. public function getRemoteExamClass($class)
  56. {
  57. $where = [];
  58. if($class == '*')
  59. {
  60. return $where;
  61. }else{
  62. $where[] = ['a.exam_class','in',explode(',',$class)];
  63. return $where;
  64. }
  65. }
  66. public function getInstitution($token)
  67. {
  68. $institution = $this->getCache($token)['institution_id'] ?? false;
  69. if(!$institution){
  70. $this->throwError('登陆信息失效,请重新进行登陆','0099');
  71. }
  72. return $institution;
  73. }
  74. public function checkIsSet($studyId)
  75. {
  76. $id = $this->exam->check($studyId);
  77. return $id;
  78. }
  79. public function getExamList($institutionId, $fuzzyWhere, $moreWhere,$class_where, $params,$report_where,$gradeWhere)
  80. {
  81. $info = $this->exam->getExamList($institutionId, $fuzzyWhere, $moreWhere,$class_where, $params,$report_where,$gradeWhere);
  82. return $info;
  83. }
  84. public function getHistoryList($institutionId,$institutionIds, $fuzzyWhere, $params,$id)
  85. {
  86. $info = $this->exam->getHistoryList($institutionId,$institutionIds, $fuzzyWhere, $params,$id);
  87. return $info;
  88. }
  89. public function getExamData($id)
  90. {
  91. $info = $this->exam->getExamData($id);
  92. return $info;
  93. }
  94. public function getRemoteExamList($institutionId, $fuzzyWhere, $moreWhere,$class_where, $params,$report_where)
  95. {
  96. $info = $this->exam->getRemoteExamList($institutionId, $fuzzyWhere, $moreWhere,$class_where, $params,$report_where);
  97. return $info;
  98. }
  99. public function getRemoteList($id,$institutionId)
  100. {
  101. $info = $this->exam->getRemoteList($id,$institutionId);
  102. return $info;
  103. }
  104. public function updateExam($id,$update)
  105. {
  106. $info = $this->exam->updateExam($update,$id);
  107. return $info;
  108. }
  109. public function insertExam($data)
  110. {
  111. $info = $this->exam->insertExam($data);
  112. return $info;
  113. }
  114. public function getReport($where,$institution)
  115. {
  116. $info = $this->exam->getReport($where,$institution);
  117. return $info;
  118. }
  119. public function getDoctorClass($doctor)
  120. {
  121. $class = $this->exam->getDoctorClass($doctor);
  122. return $class;
  123. }
  124. public function changeDoctor($doctor,$id)
  125. {
  126. $info = $this->exam->changeDoctor($doctor,$id);
  127. return $info;
  128. }
  129. public function getFilmAnnex($id,$exam_datetime,$code)
  130. {
  131. $info = $this->exam->getFilmAnnex($id,$exam_datetime,$code);
  132. return $info;
  133. }
  134. public function del_exam($id)
  135. {
  136. $info = $this->exam->del_exam($id);
  137. return $info;
  138. }
  139. public function insertDcmDel($data)
  140. {
  141. $info = $this->exam->insertDcmDel($data);
  142. return $info;
  143. }
  144. public function getSyncAi($where)
  145. {
  146. return $this->exam->getSyncAi($where);
  147. }
  148. public function getAiNode($where)
  149. {
  150. return $this->exam->getAiNode($where);
  151. }
  152. }