2
This commit is contained in:
parent
ceafb98380
commit
8dcf90368f
@ -55,4 +55,20 @@ class UserPharmacistController extends AbstractController
|
||||
$data = $UserPharmacistService->getPrescriptionInfo();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核处方
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function putPrescriptionVerify(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(UserPharmacistRequest::class);
|
||||
$request->scene('putPrescriptionVerify')->validateResolved();
|
||||
|
||||
$UserPharmacistService = new UserPharmacistService();
|
||||
$data = $UserPharmacistService->putPrescriptionVerify();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
@ -17,6 +17,9 @@ class UserPharmacistRequest extends FormRequest
|
||||
'putOnOff' => [ // 设置上下线
|
||||
'is_online',
|
||||
],
|
||||
'putPrescriptionVerify' => [ // 审核处方
|
||||
'pharmacist_audit_status',// 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@ -245,6 +245,7 @@ class UserDoctorService extends BaseService
|
||||
$fields = [
|
||||
'doctor_id',
|
||||
'is_bind_bank',
|
||||
'iden_auth_status',
|
||||
];
|
||||
$user_doctor = UserDoctor::getOne($params, $fields);
|
||||
if (empty($user_doctor)) {
|
||||
|
||||
@ -100,6 +100,62 @@ class UserPharmacistService extends BaseService
|
||||
|
||||
$order_prescription['prescription_img'] = addAliyunOssWebsite($order_prescription['prescription_img']);
|
||||
|
||||
return success($order_prescription->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核处方
|
||||
* @return array
|
||||
*/
|
||||
public function putPrescriptionVerify(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$order_prescription_id = $this->request->route('order_prescription_id');
|
||||
$pharmacist_audit_status = $this->request->route('pharmacist_audit_status');
|
||||
|
||||
// 验证器未验证未0的情况
|
||||
if ($pharmacist_audit_status == 0){
|
||||
return fail(HttpEnumCode::CLIENT_HTTP_ERROR);
|
||||
}
|
||||
|
||||
// 获取药师数据
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$user_pharmacist = UserPharmacist::getOne($params);
|
||||
if (empty($user_pharmacist)) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 获取处方数据
|
||||
$params = array();
|
||||
$params['order_prescription_id'] = $order_prescription_id;
|
||||
$params['pharmacist_id'] = $user_info['client_user_id'];
|
||||
$order_prescription = OrderPrescription::getOne($params);
|
||||
if (empty($order_prescription)) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 验证处方状态
|
||||
if ($order_prescription['prescription_status'] != 1){
|
||||
// 处方状态(1:待审核 3:待使用 4:已失效 5:已使用)
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"处方审核失败");
|
||||
}
|
||||
|
||||
// 验证处方审核状态
|
||||
if ($order_prescription['pharmacist_audit_status'] != 0){
|
||||
// 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"处方已审核,请勿重复审核");
|
||||
}
|
||||
|
||||
// 处方平台审核状态
|
||||
if ($order_prescription['platform_audit_status'] != 0){
|
||||
// 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"处方已审核,请勿重复审核");
|
||||
}
|
||||
|
||||
|
||||
|
||||
return success($order_prescription->toArray());
|
||||
}
|
||||
}
|
||||
@ -372,6 +372,9 @@ Router::addGroup('/pharmacist', function () {
|
||||
|
||||
// 获取处方详情
|
||||
Router::get('/info/{order_prescription_id:\d+}', [UserPharmacistController::class, 'getPrescriptionInfo']);
|
||||
|
||||
// 审核处方
|
||||
Router::put('/verify/{order_prescription_id:\d+}', [UserPharmacistController::class, 'putPrescriptionVerify']);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user