feat: 添加医院相关信息接口,添加对应Model

fix: 修正建档数据问题
master
Rmiku 2 weeks ago
parent 4f5667bba2
commit 18b3a032f4
  1. 189
      app/Http/Controllers/Hospital/IntroduceController.php
  2. 2
      app/Http/Logics/Outpatient/RecordLogic.php
  3. 16
      app/Http/Logics/Patient/PatientLogic.php
  4. 28
      app/Http/Logics/Registration/RecordLogic.php
  5. 4
      app/Http/Requests/Patient/CreatePatientRequest.php
  6. 6
      app/Http/Resources/Dictionary/ItemListsResource.php
  7. 39
      app/Http/Resources/Registration/Record/RecordListsResource.php
  8. 12
      app/Http/Resources/Registration/Schedule/DeptListsResource.php
  9. 3
      app/Http/Resources/Registration/Schedule/DoctorListsResource.php
  10. 48
      app/Models/Admin/BuildingDistribution.php
  11. 2
      app/Models/Admin/Department.php
  12. 2
      app/Models/Admin/DepartmentCategory.php
  13. 2
      app/Models/Admin/DepartmentTip.php
  14. 2
      app/Models/Admin/Doctor.php
  15. 49
      app/Models/Admin/HealthLecture.php
  16. 49
      app/Models/Admin/Info.php
  17. 3
      app/Models/Admin/Navigation.php
  18. 49
      app/Models/Admin/News.php
  19. 17
      app/Utils/Helpers.php
  20. 4
      app/Utils/Transfer/HisHttpClient/ClientMockHttpTransfer.php
  21. 35
      routes/api.php

@ -6,10 +6,14 @@ namespace App\Http\Controllers\Hospital;
use App\Exceptions\GeneralException; use App\Exceptions\GeneralException;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Department; use App\Models\Admin\BuildingDistribution;
use App\Models\DepartmentCategory; use App\Models\Admin\Department;
use App\Models\Doctor; use App\Models\Admin\DepartmentCategory;
use App\Models\Navigation; use App\Models\Admin\Doctor;
use App\Models\Admin\HealthLecture;
use App\Models\Admin\Info;
use App\Models\Admin\Navigation;
use App\Models\Admin\News;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@ -80,30 +84,19 @@ class IntroduceController extends Controller
*/ */
public function doctorLists(): JsonResponse public function doctorLists(): JsonResponse
{ {
$doctor_lists = Doctor::select( $doctor_lists = Doctor::select('dept_id', 'doctor_id', 'doctor_name', 'doctor_title', 'doctor_specialty', 'avatar as doctor_avatar', 'is_expert', 'sort',)
'doctors.dept_id', ->where('is_enable', 1)
'departments.dept_name', ->orderBy('is_expert', 'DESC')
'doctors.doctor_id', ->orderBy('sort', 'DESC')
'doctors.doctor_name', ->orderBy('id', 'ASC')
'doctors.doctor_title', ->get();
'doctors.doctor_specialty',
'doctors.avatar as doctor_avatar',
'doctors.is_expert',
'doctors.sort',
)
->join('departments', 'doctors.dept_id', '=', 'departments.dept_id')
->where('doctors.is_enable', 1)
->orderBy('doctors.sort', 'DESC')
->orderBy('doctors.is_expert', 'DESC')
->orderBy('doctors.id', 'ASC')
->get()
->toArray();
foreach ($doctor_lists as $k => $v) { foreach ($doctor_lists as $k => $v) {
$doctor_lists[$k]['doctor_avatar'] = $v['doctor_avatar'] ?: ''; $doctor_lists[$k]['dept_name'] = $v->department->dept_name ?? '';
$doctor_lists[$k]['doctor_avatar'] = getAdminUploadImageUrl($v['doctor_avatar']);
} }
return jsonResponse(Response::HTTP_OK, 'success.', $doctor_lists); return jsonResponse(Response::HTTP_OK, 'success.', $doctor_lists->toArray());
} }
/** /**
@ -130,7 +123,7 @@ class IntroduceController extends Controller
'doctor_name' => $doctor_details->doctor_name, 'doctor_name' => $doctor_details->doctor_name,
'doctor_title' => $doctor_details->doctor_title, 'doctor_title' => $doctor_details->doctor_title,
'doctor_specialty' => $doctor_details->doctor_specialty, 'doctor_specialty' => $doctor_details->doctor_specialty,
'avatar' => $doctor_details->avatar ?: '', 'avatar' => getAdminUploadImageUrl($doctor_details->avatar),
'introduction' => $doctor_details->introduction ?: '', 'introduction' => $doctor_details->introduction ?: '',
'is_expert' => $doctor_details->is_expert, 'is_expert' => $doctor_details->is_expert,
]; ];
@ -138,6 +131,33 @@ class IntroduceController extends Controller
return jsonResponse(Response::HTTP_OK, 'success.', $details); return jsonResponse(Response::HTTP_OK, 'success.', $details);
} }
/**
* 医院简介
* @return JsonResponse
* @throws GeneralException
*/
public function info(): JsonResponse
{
$info = Info::find(1);
if (empty($info)) {
throw new GeneralException('找不到医院信息');
}
$info = [
'name' => $info->name,
'level' => $info->level ?: '',
'address' => $info->address ?: '',
'telephone' => $info->telephone ?: '',
'email' => $info->email ?: '',
'logo' => getAdminUploadImageUrl($info->logo),
'website' => $info->website ?: '',
'description' => !empty($info['description']) ? html_entity_decode($info['description']) : ''
];
return jsonResponse(Response::HTTP_OK, 'success.', $info);
}
/** /**
* 获取医院导航信息 * 获取医院导航信息
* @throws GeneralException * @throws GeneralException
@ -145,7 +165,7 @@ class IntroduceController extends Controller
public function navigationDetails(Request $request): JsonResponse public function navigationDetails(Request $request): JsonResponse
{ {
$navigation_details = Navigation::select('area_id', 'area_name', 'longitude', 'latitude', 'address', 'telephone', 'traffic', 'guide') $navigation_details = Navigation::select('area_id', 'area_name', 'longitude', 'latitude', 'address', 'telephone', 'traffic', 'guide')
->where('area_id', 1) ->where('area_id', '01')
->where('is_enable', 1) ->where('is_enable', 1)
->first(); ->first();
@ -157,7 +177,124 @@ class IntroduceController extends Controller
$details['traffic'] = !empty($details['traffic']) ? html_entity_decode($details['traffic']) : ''; $details['traffic'] = !empty($details['traffic']) ? html_entity_decode($details['traffic']) : '';
$details['guide'] = !empty($details['guide']) ? html_entity_decode($details['guide']) : ''; $details['guide'] = !empty($details['guide']) ? html_entity_decode($details['guide']) : '';
return jsonResponse(Response::HTTP_OK, 'success.', $details);
}
/**
* 获取新闻动态列表
* @throws GeneralException
*/
public function newLists(Request $request): JsonResponse
{
$new_lists = News::select('title', 'image', 'sort', 'published_at')
->where('is_display', 1)
->where('published_at', '<=', date('Y-m-d H:i:s'))
->orderBy('sort', 'DESC')
->orderBy('id', 'DESC')
->get()
->toArray();
if (empty($new_lists)) {
throw new GeneralException('找不到新闻动态');
}
foreach ($new_lists as $v) {
$v['image'] = getAdminUploadImageUrl($v['image']);
}
return jsonResponse(Response::HTTP_OK, 'success.', $new_lists);
}
/**
* 获取新闻动态详情
* @param Request $request
* @param int $new_id
* @return JsonResponse
* @throws GeneralException
*/
public function newDetails(Request $request, int $new_id): JsonResponse
{
$details = News::select('title', 'image', 'sort', 'published_at', 'content')
->where('id', $new_id)
->where('is_display', 1)
->where('published_at', '<=', date('Y-m-d H:i:s'))
->first()
->toArray();
if (empty($details)) {
throw new GeneralException('找不到该新闻动态信息');
}
$details['image'] = getAdminUploadImageUrl($details['image']);
$details['content'] = !empty($details['content']) ? html_entity_decode($details['content']) : '';
return jsonResponse(Response::HTTP_OK, 'success.', $details);
}
/**
* 获取宣讲列表
* @throws GeneralException
*/
public function healthLectureLists(Request $request): JsonResponse
{
$lecture_lists = HealthLecture::select('title', 'speaker', 'lecture_date', 'sort')
->where('is_display', 1)
->orderBy('sort', 'DESC')
->orderBy('lecture_date', 'DESC')
->orderBy('id', 'DESC')
->get()
->toArray();
if (empty($lecture_lists)) {
throw new GeneralException('找不到健康宣讲内容');
}
return jsonResponse(Response::HTTP_OK, 'success.', $lecture_lists);
}
/**
* 获取宣讲详情
* @param Request $request
* @param int $lecture_id
* @return JsonResponse
* @throws GeneralException
*/
public function healthLectureDetails(Request $request, int $lecture_id): JsonResponse
{
$details = HealthLecture::select('title', 'speaker', 'lecture_date', 'sort', 'content')
->where('id', $lecture_id)
->where('is_display', 1)
->first()
->toArray();
if (empty($details)) {
throw new GeneralException('找不到该新闻动态信息');
}
$details['content'] = !empty($details['content']) ? html_entity_decode($details['content']) : '';
return jsonResponse(Response::HTTP_OK, 'success.', $details); return jsonResponse(Response::HTTP_OK, 'success.', $details);
} }
/**
* 获取医院楼群信息
* @throws GeneralException
*/
public function buildingDetails(Request $request): JsonResponse
{
$building_lists = BuildingDistribution::select('name', 'description', 'image', 'sort')
->where('is_display', 1)
->get()
->toArray();
if (empty($building_lists)) {
throw new GeneralException('找不到医院楼群信息');
}
foreach ($building_lists as $k => $v) {
$building_lists[$k]['image'] = getAdminUploadImageUrl($v['image']);
}
return jsonResponse(Response::HTTP_OK, 'success.', $building_lists);
}
} }

@ -43,7 +43,7 @@ class RecordLogic
$response = $this->his_client->getPaidLists($patient_id, $start_date, $end_date); $response = $this->his_client->getPaidLists($patient_id, $start_date, $end_date);
if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') { if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') {
throw new GeneralException($response['ERRORMSG'] ?? '暂无相关挂号记录!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException($response['ERRORMSG'] ?? '暂无相关缴费记录!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
// 缓存2小时 // 缓存2小时

@ -5,12 +5,8 @@ namespace App\Http\Logics\Patient;
use App\Dictionary\Patient\CardType; use App\Dictionary\Patient\CardType;
use App\Dictionary\Patient\Sex; use App\Dictionary\Patient\Sex;
use App\Dictionary\SendMessage\Type;
use App\Dictionary\WeChat\MiniProgram\SubscribeId;
use App\Exceptions\GeneralException; use App\Exceptions\GeneralException;
use App\Jobs\SendWeChatMessageJob;
use App\Models\Patient; use App\Models\Patient;
use App\Models\SendMessageJob;
use App\Services\HisHttp\Client; use App\Services\HisHttp\Client;
use App\Utils\Traits\Logger; use App\Utils\Traits\Logger;
use App\Utils\Traits\MiniProgramAuth; use App\Utils\Traits\MiniProgramAuth;
@ -141,7 +137,7 @@ class PatientLogic
$sex, $sex,
$birthday, $birthday,
$data['card_no'], $data['card_no'],
$data['mobile_phone'], $data['phone'],
$data['address'] $data['address']
); );
$this->info('建档患者:'. $data['name']. '建档结果', $response); $this->info('建档患者:'. $data['name']. '建档结果', $response);
@ -167,7 +163,7 @@ class PatientLogic
throw new GeneralException('数据保存失败,请重试!', Response::HTTP_INTERNAL_SERVER_ERROR); throw new GeneralException('数据保存失败,请重试!', Response::HTTP_INTERNAL_SERVER_ERROR);
} }
$this->sendBindPatientSubscribeMessage($result->id, $result->id, $data['name']); $this->sendBindPatientSubscribeMessage($this->open_id, $result->id, $data['name']);
return $patient_id; return $patient_id;
} }
@ -198,11 +194,11 @@ class PatientLogic
} }
$patient_info = &$response['response']; $patient_info = &$response['response'];
$patient_id = &$patient_info['response']['patientId']; $patient_id = &$patient_info['patientId'];
$patient_number = &$patient_info['response']['patientNumber']; $patient_number = &$patient_info['patientNumber'];
$sex = Sex::from((int) $patient_info['SEX']); $sex = Sex::from((int) $patient_info['sex']);
if ($patient_info['patientNumber'] != $data['patient_number']) { if ($patient_info['patientNumber'] != $data['patient_id']) {
throw new GeneralException('该证件号已建档,但就诊卡号不匹配!'); throw new GeneralException('该证件号已建档,但就诊卡号不匹配!');
} }

@ -62,8 +62,15 @@ class RecordLogic
$response = $this->his_client->getRegisterRecordLists($patient_id, $start_date, $end_date); $response = $this->his_client->getRegisterRecordLists($patient_id, $start_date, $end_date);
if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') { if (!isset($response['success']) || !$response['success']) {
throw new GeneralException($response['ERRORMSG'] ?? '暂无相关挂号记录!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException($response['msg'] ?? '暂无相关挂号记录!', Response::HTTP_SERVICE_UNAVAILABLE);
}
// 重写一下patientId
if (!empty($response['response'])) {
foreach ($response['response'] as $k => $v) {
$response['response'][$k]['patientId'] = $patient_number;
}
} }
// 缓存2小时 // 缓存2小时
@ -87,14 +94,14 @@ class RecordLogic
$record_info = Cache::get($cache_key); $record_info = Cache::get($cache_key);
if (empty($record_info)) { if (empty($record_info)) {
throw new GeneralException($response['ERRORMSG'] ?? '查询不到需要退号的挂号记录,请重新再试!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException($response['msg'] ?? '查询不到需要退号的挂号记录,请重新再试!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
$record_info = json_decode($record_info, true); $record_info = json_decode($record_info, true);
// 获取具体的预约详情 // 获取具体的预约详情
$record_info = xmlArrayToListByKey($record_info, 'ITEM'); $record_info = xmlArrayToListByKey($record_info, 'ITEM');
foreach ($record_info['ITEM'] as $v) { foreach ($record_info['response'] as $v) {
if ($v['VISITNO'] === $reg_serial_no) { if ($v['visitNo'] === $reg_serial_no) {
$info = $v; $info = $v;
break; break;
} }
@ -122,22 +129,23 @@ class RecordLogic
$response = $this->his_client->checkRefundRegisterStatus($reg_serial_no); $response = $this->his_client->checkRefundRegisterStatus($reg_serial_no);
$this->info('检查是否可进行退号', $response); $this->info('检查是否可进行退号', $response);
if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') { if (!isset($response['success']) || !$response['success']) {
throw new GeneralException($response['ERRORMSG'] ?? '当前挂号记录不可退号!', Response::HTTP_BAD_REQUEST); throw new GeneralException($response['msg'] ?? '当前挂号记录不可退号!', Response::HTTP_BAD_REQUEST);
} }
// 开始退号 // 开始退号
$response = $this->his_client->refundRegister($reg_serial_no, $order_id, date('Y-m-d'), date('H:i:s'), (string) ($fee / 100)); $response = $this->his_client->refundRegister($reg_serial_no, $order_id, date('Y-m-d'), date('H:i:s'), (string) ($fee / 100));
$this->info('退号结果', $response); $this->info('退号结果', $response);
if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') { if (!isset($response['success']) || !$response['success']) {
throw new GeneralException($response['ERRORMSG'] ?? '退号失败,请重新再试!', Response::HTTP_BAD_REQUEST); throw new GeneralException($response['msg'] ?? '退号失败,请重新再试!', Response::HTTP_BAD_REQUEST);
} }
// 创建退款单 // 创建退款单
$refund_order_id = $this->order_model->getRefundOrderId($order_id); $refund_order_id = $this->order_model->getRefundOrderId($order_id);
$refund_order_info = $this->order_model->createRefundOReverseOrder( $refund_order_info = $this->order_model->createRefundOReverseOrder(
$order_info->id, $order_info->id,
$patient_info->id,
$refund_order_id, $refund_order_id,
PayType::from($order_info->pay_type), PayType::from($order_info->pay_type),
$fee, $fee,
@ -150,7 +158,7 @@ class RecordLogic
$this->info('创建退款订单', ['id' => $refund_order_info->id]); $this->info('创建退款订单', ['id' => $refund_order_info->id]);
if (empty($refund_order_info)) { if (empty($refund_order_info)) {
throw new GeneralException($response['ERRORMSG'] ?? '退号成功,退费失败,请重新再试!', Response::HTTP_BAD_REQUEST); throw new GeneralException($response['msg'] ?? '退号成功,退费失败,请重新再试!', Response::HTTP_BAD_REQUEST);
} }
// 退款 // 退款

@ -60,8 +60,8 @@ class CreatePatientRequest extends FormRequest
$fail('联系号码格式错误'); $fail('联系号码格式错误');
} }
}], }],
'birthday' => 'required|date_format:Y-m-d', 'birthday' => 'date_format:Y-m-d',
'sex' => 'required|in:1,2', 'sex' => 'in:1,2',
// 'nation' => 'max:50', // 'nation' => 'max:50',
'address' => 'required|max:100' 'address' => 'required|max:100'
]; ];

@ -15,10 +15,10 @@ class ItemListsResource extends JsonResource
public function toArray(Request $request = null): array public function toArray(Request $request = null): array
{ {
$lists = []; $lists = [];
foreach ($this->resource['ITEM'] as $v) { foreach ($this->resource['response'] as $v) {
$lists[] = [ $lists[] = [
'type_id' => (int) $v['TYPEID'], 'type_id' => (int) $v['typeId'],
'type_name' => $v['TYPENAME'], 'type_name' => $v['typeName'],
]; ];
} }

@ -14,28 +14,27 @@ class RecordListsResource extends JsonResource
*/ */
public function toArray(Request $request = null): array public function toArray(Request $request = null): array
{ {
$this->resource = xmlArrayToListByKey($this->resource, 'ITEM');
$lists = []; $lists = [];
foreach ($this->resource['ITEM'] as $v) { foreach ($this->resource['response'] as $v) {
$lists[] = [ $lists[] = [
'reg_serial_no' => $v['VISITNO'], 'reg_serial_no' => $v['visitNo'],
'reg_type' => $v['FTYPE'], 'reg_type' => $v['registrationType'],
'reg_date' => $v['GHDATE'], 'reg_date' => $v['registrationDate'],
'patient_id' => $v['PATIENTID'], 'patient_id' => $v['patientId'],
'patient_name' => $v['PATIENTNAME'], 'patient_name' => $v['patientName'],
'dept_id' => $v['DEPID'], 'dept_id' => $v['depId'],
'dept_name' => $v['DEPNAME'], 'dept_name' => $v['depName'],
'rank_id' => $v['RANKID'], 'rank_id' => $v['rankId'],
'rank_name' => $v['RANKNAME'] ?? '', 'rank_name' => $v['rankName'] ?? '',
'start_time' => $v['STARTTIME'] ?? '', 'start_time' => $v['startTime'] ?? '',
'end_time' => $v['ENDTIME'] ?? '', 'end_time' => $v['endTime'] ?? '',
'dept_location' => $v['DEPLOCATION'], 'dept_location' => $v['depLocation'],
'reg_fee' => $v['PAYFEE'], 'reg_fee' => $v['payFee'],
'trea_id' => $v['TREAID'], 'trea_id' => $v['treaId'],
'tran_snum' => $v['TRANSNUM'], 'tran_snum' => $v['transNum'] ?: '',
'wait_no' => $v['WAITNUM'], 'wait_no' => $v['waitNum'] ?: '',
'reg_status' => $v['STATUS'], 'oppat_no' => $v['oppatNo'] ?: '',
'reg_status' => $v['status'],
]; ];
} }

@ -2,13 +2,11 @@
namespace App\Http\Resources\Registration\Schedule; namespace App\Http\Resources\Registration\Schedule;
use App\Models\Department; use App\Models\Admin\Department;
use App\Models\DepartmentCategory; use App\Models\Admin\DepartmentCategory;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis; use Illuminate\Support\Facades\Redis;
use mysql_xdevapi\Collection;
class DeptListsResource extends JsonResource class DeptListsResource extends JsonResource
{ {
@ -21,10 +19,10 @@ class DeptListsResource extends JsonResource
{ {
// 科室分类 // 科室分类
$categories = $this->getDepartmentCategoryLists(); $categories = $this->getDepartmentCategoryLists();
// 科室及排序 // 科室及排序
$departments = $this->getDepartmentLists(); $departments = $this->getDepartmentLists();
$sorts = collect($departments)->pluck('sort', 'dept_id')->toArray(); $sorts = collect($departments)->pluck('sort', 'dept_id')->toArray();
// 根据科室的 sort 字段对 科室列表 进行排序 // 根据科室的 sort 字段对 科室列表 进行排序
usort($this->resource['response'], function ($a, $b) use ($sorts) { usort($this->resource['response'], function ($a, $b) use ($sorts) {
$sort_a = $sorts[$a['typeId']] ?? 0; $sort_a = $sorts[$a['typeId']] ?? 0;
@ -62,7 +60,7 @@ class DeptListsResource extends JsonResource
->orderBy('id', 'ASC') ->orderBy('id', 'ASC')
->get(); ->get();
$category_lists = $category_lists->keyBy('category_id')->map(function ($value) { return (array)$value; })->toArray(); $category_lists = $category_lists->keyBy('category_id')->map(function ($value) { return $value->toArray(); })->toArray();
Redis::setex('department.category', 4 * 3600, json_encode($category_lists, JSON_UNESCAPED_UNICODE)); Redis::setex('department.category', 4 * 3600, json_encode($category_lists, JSON_UNESCAPED_UNICODE));
} }
@ -84,7 +82,7 @@ class DeptListsResource extends JsonResource
->orderBy('id', 'ASC') ->orderBy('id', 'ASC')
->get(); ->get();
$department_lists = $department_lists->keyBy('dept_id')->map(function ($value) { return (array)$value; })->toArray(); $department_lists = $department_lists->keyBy('dept_id')->map(function ($value) { return $value->toArray(); })->toArray();
Redis::setex('department.lists', 4 * 3600, json_encode($department_lists, JSON_UNESCAPED_UNICODE)); Redis::setex('department.lists', 4 * 3600, json_encode($department_lists, JSON_UNESCAPED_UNICODE));
} }

@ -2,10 +2,9 @@
namespace App\Http\Resources\Registration\Schedule; namespace App\Http\Resources\Registration\Schedule;
use App\Models\Doctor; use App\Models\Admin\Doctor;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis; use Illuminate\Support\Facades\Redis;
class DoctorListsResource extends JsonResource class DoctorListsResource extends JsonResource

@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class BuildingDistribution extends Model
{
use HasFactory;
/**
* @var string
*/
protected $connection = 'mysql_admin';
/**
* @var string
*/
protected $table = 'building_distributions';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'area_id',
'name',
'description',
'image',
'sort',
'is_display',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'area_id' => 'integer',
'sort' => 'integer',
'is_display' => 'integer',
];
}

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Models; namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Models; namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Models; namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Models; namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;

@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class HealthLecture extends Model
{
use HasFactory;
/**
* @var string
*/
protected $connection = 'mysql_admin';
/**
* @var string
*/
protected $table = 'health_lectures';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'title',
'speaker',
'lecture_date',
'content',
'sort',
'is_display',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'id' => 'integer',
'sort' => 'integer',
'is_display' => 'integer',
];
}

@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Info extends Model
{
use HasFactory;
/**
* @var string
*/
protected $connection = 'mysql_admin';
/**
* @var string
*/
protected $table = 'hospital_infos';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'level',
'address',
'telephone',
'email',
'logo',
'website',
'description'
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'id' => 'integer',
];
}

@ -2,11 +2,10 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Models; namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Navigation extends Model class Navigation extends Model
{ {

@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
namespace App\Models\Admin;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class News extends Model
{
use HasFactory;
/**
* @var string
*/
protected $connection = 'mysql_admin';
/**
* @var string
*/
protected $table = 'hospital_news';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'title',
'image',
'sort',
'is_display',
'content',
'published_at',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'id' => 'integer',
'sort' => 'integer',
'is_display' => 'integer',
];
}

@ -260,7 +260,6 @@ if (!function_exists('getBirthdayByIdCard'))
} }
} }
if (!function_exists('getBirthdayBy2017ForeignersIDCard')) if (!function_exists('getBirthdayBy2017ForeignersIDCard'))
{ {
/** /**
@ -792,3 +791,19 @@ if (!function_exists('replaceSpecialChar')) {
return preg_replace($regex, '', $string); return preg_replace($regex, '', $string);
} }
} }
if (!function_exists('getAdminUploadImageUrl')) {
/**
* 获取admin后台image地址
* @param string $image
* @return string
*/
function getAdminUploadImageUrl(string $image): string
{
if (empty($image)) {
return '';
}
return (string) url('/images/uploads/'. $image);
}
}

@ -110,7 +110,7 @@ class ClientMockHttpTransfer extends HttpTransferAbstract
*/ */
private function mockGetPatientInfo(array $params): self private function mockGetPatientInfo(array $params): self
{ {
$this->transfer_response = '{"status":200,"success":true,"msg":"成功","msgDev":null,"response":{"patientId":"2235574","cardNo":"230403199903245493","name":"谭玉山","sex":"0","birthday":"1999-03-24","cardStatus":"0","naturePatients":"123","patientNumber":"288712335574"}}'; $this->transfer_response = '{"status":200,"success":true,"msg":"成功","msgDev":null,"response":{"patientId":"2235574","cardNo":"230403199903245493","name":"谭玉山","sex":"1","birthday":"1999-03-24","cardStatus":"0","naturePatients":"123","patientNumber":"288712335574"}}';
return $this; return $this;
} }
@ -155,7 +155,7 @@ class ClientMockHttpTransfer extends HttpTransferAbstract
*/ */
private function mockGetRegisterRecordLists(array $params): self private function mockGetRegisterRecordLists(array $params): self
{ {
$this->transfer_response = '<RESPONSE><RESULTCODE>0</RESULTCODE><ERRORMSG>成功</ERRORMSG><ITEM><VISITNO>3405227</VISITNO><FTYPE>当天挂号</FTYPE><STATUS>0</STATUS><WAITNUM>143</WAITNUM><TREAID>600240002968</TREAID><GHDATE>2021-07-17</GHDATE><PATIENTID>1103903</PATIENTID><PATIENTNAME>杨尧</PATIENTNAME><RANKID>2</RANKID><RANKNAME>下午</RANKNAME><OPPATNO>600005001000</OPPATNO><DEPLOCATION>门诊一楼</DEPLOCATION><TRANSNUM>0</TRANSNUM><ORDERTYPE>线上预约</ORDERTYPE><PAYFEE>17</PAYFEE><DEPID>16</DEPID><DEPNAME>急诊科</DEPNAME></ITEM><ITEM><VISITNO>3405228</VISITNO><FTYPE>预约挂号</FTYPE><STATUS>1</STATUS><WAITNUM>58</WAITNUM><TREAID>600240002969</TREAID><GHDATE>2021-07-18</GHDATE><PATIENTID>1103904</PATIENTID><PATIENTNAME>李梅</PATIENTNAME><RANKID>1</RANKID><RANKNAME>上午</RANKNAME><OPPATNO>600005001001</OPPATNO><DEPLOCATION>门诊二楼</DEPLOCATION><TRANSNUM>1</TRANSNUM><ORDERTYPE>现场挂号</ORDERTYPE><PAYFEE>25</PAYFEE><DEPID>20</DEPID><DEPNAME>内科</DEPNAME></ITEM><ITEM><VISITNO>3405229</VISITNO><FTYPE>当天挂号</FTYPE><STATUS>0</STATUS><WAITNUM>23</WAITNUM><TREAID>600240002970</TREAID><GHDATE>2021-07-19</GHDATE><PATIENTID>1103905</PATIENTID><PATIENTNAME>张强</PATIENTNAME><RANKID>3</RANKID><RANKNAME>夜间</RANKNAME><OPPATNO>600005001002</OPPATNO><DEPLOCATION>急诊大厅</DEPLOCATION><TRANSNUM>2</TRANSNUM><ORDERTYPE>电话预约</ORDERTYPE><PAYFEE>30</PAYFEE><DEPID>18</DEPID><DEPNAME>儿科</DEPNAME></ITEM><ITEM><VISITNO>3405230</VISITNO><FTYPE>预约挂号</FTYPE><STATUS>1</STATUS><WAITNUM>78</WAITNUM><TREAID>600240002971</TREAID><GHDATE>2021-07-20</GHDATE><PATIENTID>1103906</PATIENTID><PATIENTNAME>王丽</PATIENTNAME><RANKID>1</RANKID><RANKNAME>上午</RANKNAME><OPPATNO>600005001003</OPPATNO><DEPLOCATION>门诊三楼</DEPLOCATION><TRANSNUM>0</TRANSNUM><ORDERTYPE>线上预约</ORDERTYPE><PAYFEE>45</PAYFEE><DEPID>22</DEPID><DEPNAME>眼科</DEPNAME></ITEM></RESPONSE>'; $this->transfer_response = '{"status":200,"success":true,"msg":"成功","msgDev":null,"response":[{"visitNo":"5348615","registrationType":"当天挂号","status":"0","waitNum":null,"treaId":"1-3","registrationDate":"2025-01-17","patientId":"2235574","patientName":"谭玉山","rankId":"2","rankName":"下午","startTime":"16:30","endTime":"17:00","oppatNo":"288712335574","depLocation":"请到一楼儿童保健门诊","transNum":null,"orderType":"","payFee":"0","payId":null,"depId":"12","depName":"儿保门诊","doctorId":"10977","doctorName":"杜丽丽","regSource":"自助机","timeSpam":"下午:16:30-17:00","serialNumber":null}]}';
return $this; return $this;
} }

@ -58,19 +58,32 @@ Route::middleware(['apiLog'])->group(function() {
Route::get('/', [ItemController::class, 'lists']); Route::get('/', [ItemController::class, 'lists']);
Route::get('/{type_id}', [ItemController::class, 'details'])->where('type_id', '[0-9]+'); Route::get('/{type_id}', [ItemController::class, 'details'])->where('type_id', '[0-9]+');
}); });
});
// 医院详情相关项目 // 医院详情相关项目
Route::prefix('Hospital')->group(function () { Route::middleware([])->prefix('Hospital')->group(function () {
// 科室介绍 // 科室介绍
Route::get('/dept', [IntroduceController::class, 'deptLists']); Route::get('/dept', [IntroduceController::class, 'deptLists']);
Route::get('/dept/{dept_id}', [IntroduceController::class, 'deptDetails'])->where('dept_id', '[0-9]+'); Route::get('/dept/{dept_id}', [IntroduceController::class, 'deptDetails'])->where('dept_id', '[0-9]+');
// 医生介绍 // 医生介绍
Route::get('/doctor', [IntroduceController::class, 'doctorLists']); Route::get('/doctor', [IntroduceController::class, 'doctorLists']);
Route::get('/doctor/{doctor_id}', [IntroduceController::class, 'doctorDetails'])->where('doctor_id', '[0-9]+'); Route::get('/doctor/{doctor_id}', [IntroduceController::class, 'doctorDetails'])->where('doctor_id', '[0-9]+');
// 医院导航 // 医院导航
Route::get('/navigation', [IntroduceController::class, 'navigationDetails']); Route::get('/navigation', [IntroduceController::class, 'navigationDetails']);
}); Route::get('/info', [IntroduceController::class, 'info']);
// 新闻动态
Route::get('/news', [IntroduceController::class, 'newLists']);
Route::get('/news/{new_id}', [IntroduceController::class, 'newDetails'])->where('new_id', '[0-9]+');
// 健康宣讲
Route::get('/lectures', [IntroduceController::class, 'healthLectureLists']);
Route::get('/lectures/{lecture_id}', [IntroduceController::class, 'healthLectureDetails'])->where('lecture_id', '[0-9]+');
// 楼群分布
Route::get('/building', [IntroduceController::class, 'buildingDetails']);
}); });
}); });

Loading…
Cancel
Save