diff --git a/Laravel/app/Http/Controllers/API/Third/CSharpController.php b/Laravel/app/Http/Controllers/API/Third/CSharpController.php index 86c0d3d..5fd010f 100644 --- a/Laravel/app/Http/Controllers/API/Third/CSharpController.php +++ b/Laravel/app/Http/Controllers/API/Third/CSharpController.php @@ -205,6 +205,21 @@ public function SaveApply($orderNo) if ($entrust->user_sex == 1) $sex = 'M'; if ($entrust->user_sex == 2) $sex = 'F'; $hisiteminfo = collect($hisInfo['itemList']??[])->firstWhere('termCode', $entrust->entrust_code); + + // 获取顶级科室名称 + $deptName = ''; + if (!empty($entrust->department_id)) { + $execDept = DB::table('s_department')->where('id', $entrust->department_id)->where('is_del', 0)->first(); + if ($execDept) { + if ($execDept->pid == 0) { + $deptName = $execDept->department_name; + } else { + $topDept = DB::table('s_department')->where('id', $execDept->pid)->where('is_del', 0)->first(); + $deptName = $topDept->department_name ?? ''; + } + } + } + $send_data = [ 'Request' => [ 'Head' => [ @@ -257,7 +272,7 @@ public function SaveApply($orderNo) 'appoint_date' => $entrust->reservation_date . ' ' . substr($reservation_time, 0, 5), 'register_date' => $entrust->reservation_date . ' ' . substr($reservation_end_time, 0, 5), 'bodypartexamined' => $hisiteminfo['examPosiSmallName']??'', - 'dept_name' => '', + 'dept_name' => $deptName, 'studyclass1' => $hisInfo['requestTypeAlias']??'', 'studyclass1his' => $hisiteminfo['execDeptName']??'', 'studyclass1name' => $hisiteminfo['execDeptName']??'',