新增药师端首页、修正问诊列表医生数据
This commit is contained in:
parent
a1101d4d12
commit
f64c46b30c
@ -346,14 +346,9 @@ class UserDoctorController extends AbstractController
|
||||
/**
|
||||
* 新增医生接诊
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function addDoctorInquiry(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(UserDoctorRequest::class);
|
||||
$request->scene('addDoctorInquiry')->validateResolved();
|
||||
|
||||
$UserDoctorService = new UserDoctorService();
|
||||
$data = $UserDoctorService->addDoctorInquiry();
|
||||
return $this->response->json($data);
|
||||
|
||||
31
app/Controller/UserPharmacistController.php
Normal file
31
app/Controller/UserPharmacistController.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Request\UserPharmacistRequest;
|
||||
use App\Services\UserPharmacistService;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* 药师
|
||||
*/
|
||||
class UserPharmacistController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* 获取药师审核处方列表
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getPrescriptionList(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(UserPharmacistRequest::class);
|
||||
$request->scene('getPrescriptionList')->validateResolved();
|
||||
|
||||
$UserPharmacistService = new UserPharmacistService();
|
||||
$data = $UserPharmacistService->getPrescriptionList();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
@ -239,7 +239,7 @@ class OrderInquiry extends Model
|
||||
->when($inquiry_status_params, function ($query, $inquiry_status_params) {
|
||||
$query->whereIn('inquiry_status',$inquiry_status_params);
|
||||
})
|
||||
// ->orderBy('created_at','asc')
|
||||
->orderBy('created_at','desc')
|
||||
->paginate($per_page, $fields, "page", $page);
|
||||
|
||||
$data = array();
|
||||
|
||||
@ -19,13 +19,15 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $patient_id 患者id
|
||||
* @property int $family_id 家庭成员id(就诊用户)
|
||||
* @property int $pharmacist_id 药师id
|
||||
* @property int $prescription_status 处方状态(1:待审核 2:待使用 3:已失效 4:已使用)
|
||||
* @property int $prescription_status 处方状态(1:待审核 3:待使用 4:已失效 5:已使用)
|
||||
* @property int $pharmacist_audit_status 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
* @property string $pharmacist_fail_reason 药师审核驳回原因
|
||||
* @property int $platform_audit_status 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
* @property string $platform_fail_time 平台审核失败时间
|
||||
* @property string $platform_fail_reason 处方平台驳回原因
|
||||
* @property int $is_delete 是否删除(0:否 1:是)
|
||||
* @property string $prescription_code 处方编号
|
||||
* @property string $pharmacist_verify_time 药师审核时间
|
||||
* @property string $doctor_name 医生名称
|
||||
* @property string $patient_name 患者姓名-就诊人
|
||||
* @property int $patient_sex 患者性别-就诊人(1:男 2:女)
|
||||
@ -50,7 +52,7 @@ class OrderPrescription extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['order_prescription_id', 'order_inquiry_id', 'doctor_id', 'patient_id', 'family_id', 'pharmacist_id', 'prescription_status', 'pharmacist_audit_status', 'pharmacist_fail_reason', 'platform_audit_status', 'platform_fail_reason', 'is_delete', 'prescription_code', 'doctor_name', 'patient_name', 'patient_sex', 'patient_age', 'prescription_img', 'doctor_advice', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['order_prescription_id', 'order_inquiry_id', 'doctor_id', 'patient_id', 'family_id', 'pharmacist_id', 'prescription_status', 'pharmacist_audit_status', 'pharmacist_fail_reason', 'platform_audit_status', 'platform_fail_time', 'platform_fail_reason', 'is_delete', 'prescription_code', 'pharmacist_verify_time', 'doctor_name', 'patient_name', 'patient_sex', 'patient_age', 'prescription_img', 'doctor_advice', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "order_prescription_id";
|
||||
|
||||
|
||||
@ -72,9 +72,6 @@ class UserDoctorRequest extends FormRequest
|
||||
'getDoctorMessageList' => [ // 获取医生问诊消息列表
|
||||
'message_inquiry_type',// 消息订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:结束)
|
||||
],
|
||||
'addDoctorInquiry' => [ // 新增医生接诊
|
||||
'order_inquiry_id',// 订单-问诊id
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
54
app/Request/UserPharmacistRequest.php
Normal file
54
app/Request/UserPharmacistRequest.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Request;
|
||||
|
||||
use App\Constants\HttpEnumCode;
|
||||
use Hyperf\Validation\Request\FormRequest;
|
||||
|
||||
class UserPharmacistRequest extends FormRequest
|
||||
{
|
||||
protected array $scenes = [
|
||||
'getPrescriptionList' => [ // 获取药师审核处方列表
|
||||
'pharmacist_audit_status',
|
||||
'platform_audit_status',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'pharmacist_audit_status' => 'required|integer|min:0|max:2',
|
||||
'platform_audit_status' => 'required|integer|min:0|max:2',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已定义验证规则的错误消息.
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'pharmacist_audit_status.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'pharmacist_audit_status.integer' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'pharmacist_audit_status.min' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'pharmacist_audit_status.max' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'platform_audit_status.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'platform_audit_status.integer' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'platform_audit_status.min' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'platform_audit_status.max' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,6 @@ class IndexService extends BaseService
|
||||
"pharmacist_id",
|
||||
"user_id",
|
||||
"user_name",
|
||||
"open_id",
|
||||
"status",
|
||||
"avatar",
|
||||
"is_online",
|
||||
@ -215,15 +214,10 @@ class IndexService extends BaseService
|
||||
$audit_number = 0;
|
||||
}
|
||||
|
||||
// 获取药师待审核处方
|
||||
$OrderPrescriptionService = new OrderPrescriptionService();
|
||||
$prescription = $OrderPrescriptionService->getPharmacistWaitAuditPage($user_pharmacist['pharmacist_id']);
|
||||
|
||||
// 组合返回数据
|
||||
$data = array();
|
||||
$data['pharmacist'] = $user_pharmacist;
|
||||
$data['audit_number'] = $audit_number;
|
||||
$data['prescription'] = $prescription;
|
||||
|
||||
return success($data);
|
||||
}
|
||||
|
||||
@ -27,36 +27,21 @@ class OrderPrescriptionService extends BaseService
|
||||
/**
|
||||
* 获取药师待审核处方-分页-存在问题,需修改
|
||||
* @param string $pharmacist_id 药师id
|
||||
* @param int $pharmacist_audit_status 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
* @param int $platform_audit_status
|
||||
* @param string|int $page
|
||||
* @param string|int $per_page
|
||||
* @return array
|
||||
*/
|
||||
public function getPharmacistWaitAuditPage(string $pharmacist_id): array
|
||||
public function getPharmacistWaitAuditPage(string $pharmacist_id,int $pharmacist_audit_status,int $platform_audit_status,string|int $page = 1,string|int $per_page = 10): array
|
||||
{
|
||||
$params = array();
|
||||
$params['pharmacist_id'] = $pharmacist_id;
|
||||
$params['pharmacist_audit_status'] = 0; //处方审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
$params['prescription_status'] = 1; // 处方状态(1:待审核 2:待使用 3:已失效 4:已使用)
|
||||
$params['pharmacist_audit_status'] = $pharmacist_audit_status; // 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
$params['platform_audit_status'] = $platform_audit_status; // 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
|
||||
// $fields = [
|
||||
// "order_prescription_id",
|
||||
// "order_inquiry_id",
|
||||
// "doctor_id",
|
||||
// "pharmacist_id",
|
||||
// "prescription_status",
|
||||
// "pharmacist_audit_status",
|
||||
// "is_delete",
|
||||
// "is_pass",
|
||||
// "prescription_code",
|
||||
// "not_pass_reason",
|
||||
// "audit_fail_reason",
|
||||
// "doctor_name",
|
||||
// "patient_name",
|
||||
// "patient_sex",
|
||||
// "patient_age",
|
||||
// "created_at",
|
||||
// ];
|
||||
$fields = [];
|
||||
$page = $this->request->input('page', 1);
|
||||
$per_page = $this->request->input('per_page', 10);
|
||||
return OrderPrescription::getPage($params, $fields,$page,$per_page);
|
||||
return OrderPrescription::getPage($params, ['*'], $page, $per_page);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,19 +50,19 @@ class OrderPrescriptionService extends BaseService
|
||||
* @param string|int $order_prescription_id
|
||||
* @return array
|
||||
*/
|
||||
public function getproductList(string|int $order_inquiry_id ,string|int $order_prescription_id): array
|
||||
public function getproductList(string|int $order_inquiry_id, string|int $order_prescription_id): array
|
||||
{
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_inquiry_id;
|
||||
$params['order_prescription_id'] = $order_prescription_id;
|
||||
$order_prescription_products = OrderPrescriptionProduct::getLimit($params);
|
||||
if(empty($order_prescription_products)){
|
||||
if (empty($order_prescription_products)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$result = [];
|
||||
|
||||
foreach ($order_prescription_products as $order_prescription_product){
|
||||
foreach ($order_prescription_products as $order_prescription_product) {
|
||||
$data = array();
|
||||
$data['prescription_product_id'] = $order_prescription_product['prescription_product_id'];
|
||||
$data['product_id'] = $order_prescription_product['product_id'];
|
||||
@ -103,7 +88,7 @@ class OrderPrescriptionService extends BaseService
|
||||
* @param int $prescription_status 处方状态(1:待审核 2:待使用 3:已失效 4:已使用)
|
||||
* @return int
|
||||
*/
|
||||
public function getPatientPrescriptionWithStatus(string $patient_id,int $prescription_status): int
|
||||
public function getPatientPrescriptionWithStatus(string $patient_id, int $prescription_status): int
|
||||
{
|
||||
$params = array();
|
||||
$params['patient_id'] = $patient_id;
|
||||
|
||||
@ -114,6 +114,7 @@ class PatientOrderService extends BaseService
|
||||
'user_name',
|
||||
'doctor_title',
|
||||
'hospital_id',
|
||||
"avatar"
|
||||
];
|
||||
|
||||
$params = array();
|
||||
@ -130,6 +131,9 @@ class PatientOrderService extends BaseService
|
||||
$user_doctor['hospital_name'] = "";
|
||||
$user_doctor['hospital_level_name'] = "";
|
||||
|
||||
// 医生头像
|
||||
$user_doctor['avatar'] = addAliyunOssWebsite($user_doctor['avatar']);
|
||||
|
||||
$fields = [
|
||||
'hospital_id',
|
||||
'hospital_name',
|
||||
|
||||
@ -1448,7 +1448,7 @@ class UserDoctorService extends BaseService
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$order_inquiry_id = $this->request->input('order_inquiry_id');
|
||||
$order_inquiry_id = $this->request->route('order_inquiry_id');
|
||||
|
||||
// 获取问诊订单数据
|
||||
$params = array();
|
||||
@ -1456,7 +1456,7 @@ class UserDoctorService extends BaseService
|
||||
$params['order_inquiry_id'] = $order_inquiry_id;
|
||||
$order_inquiry = OrderInquiry::getOne($params);
|
||||
if (empty($order_inquiry)) {
|
||||
return fail();
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "接诊失败");
|
||||
}
|
||||
|
||||
if ($order_inquiry['inquiry_status'] != 3) {
|
||||
|
||||
28
app/Services/UserPharmacistService.php
Normal file
28
app/Services/UserPharmacistService.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
/**
|
||||
* 药师
|
||||
*/
|
||||
class UserPharmacistService extends BaseService
|
||||
{
|
||||
/**
|
||||
* 获取药师审核处方列表
|
||||
* @return array
|
||||
*/
|
||||
public function getPrescriptionList(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$pharmacist_audit_status = $this->request->input('pharmacist_audit_status');
|
||||
$platform_audit_status = $this->request->input('platform_audit_status');
|
||||
$page = $this->request->input('page', 1);
|
||||
$per_page = $this->request->input('per_page', 10);
|
||||
|
||||
$OrderPrescriptionService = new OrderPrescriptionService();
|
||||
$prescription = $OrderPrescriptionService->getPharmacistWaitAuditPage($user_info['client_user_id'],$pharmacist_audit_status,$page,$per_page);
|
||||
|
||||
return success($prescription);
|
||||
}
|
||||
}
|
||||
@ -29,6 +29,7 @@ use App\Controller\SystemController;
|
||||
use App\Controller\UserController;
|
||||
use App\Controller\UserDoctorController;
|
||||
use App\Controller\UserPatientController;
|
||||
use App\Controller\UserPharmacistController;
|
||||
use App\Services\SafeService;
|
||||
use Hyperf\HttpServer\Router\Router;
|
||||
|
||||
@ -83,7 +84,7 @@ Router::addGroup('/doctor', function () {
|
||||
Router::post('/message/attr', [UserDoctorController::class, 'getDoctorMessageAttrList']);
|
||||
|
||||
// 新增医生接诊
|
||||
Router::post('', [UserDoctorController::class, 'addDoctorInquiry']);
|
||||
Router::post('/{order_inquiry_id:\d+}', [UserDoctorController::class, 'addDoctorInquiry']);
|
||||
});
|
||||
|
||||
//银行卡
|
||||
@ -355,6 +356,12 @@ Router::addGroup('/patient', function () {
|
||||
Router::addGroup('/pharmacist', function () {
|
||||
// 首页
|
||||
Router::get('/index', [IndexController::class, 'pharmacistIndex']);
|
||||
|
||||
// 处方
|
||||
Router::addGroup('/prescription', function () {
|
||||
// 获取药师审核处方列表
|
||||
Router::get('', [UserPharmacistController::class, 'getPrescriptionList']);
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
@ -390,6 +397,7 @@ Router::addGroup('/area', function () {
|
||||
Router::get('/county', [AreaController::class, 'getCounty']);
|
||||
});
|
||||
|
||||
// 签名
|
||||
Router::addGroup('/sign', function () {
|
||||
// 获取oss签名数据
|
||||
Router::get('/oss', [SafeController::class, 'getOssSign']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user