diff --git a/app/Amqp/Consumer/AssignDoctorConsumer.php b/app/Amqp/Consumer/AssignDoctorConsumer.php index 3639160..9256dba 100644 --- a/app/Amqp/Consumer/AssignDoctorConsumer.php +++ b/app/Amqp/Consumer/AssignDoctorConsumer.php @@ -32,9 +32,6 @@ class AssignDoctorConsumer extends ConsumerMessage { /** * @param $data - * [ - * "order_inquiry_id":"问诊订单id" - * ] * @param AMQPMessage $message * @return string * @throws ContainerExceptionInterface diff --git a/app/Amqp/Consumer/AssignPharmacistConsumer.php b/app/Amqp/Consumer/AssignPharmacistConsumer.php new file mode 100644 index 0000000..504421b --- /dev/null +++ b/app/Amqp/Consumer/AssignPharmacistConsumer.php @@ -0,0 +1,52 @@ +error("开始执行 分配药师 队列:" . json_encode($data, JSON_UNESCAPED_UNICODE)); + + Db::beginTransaction(); + + try { + // 获取订单-处方表数据 + $params = array(); + $params['order_prescription_id'] = $data['order_prescription_id']; + $order_prescription = OrderPrescription::getOne($params); + if (empty($order_prescription)){ + Db::rollBack(); + Log::getInstance()->error("分配药师队列执行失败:未查询到对应处方订单数据"); + return Result::DROP;// 销毁 + } + + // 检测处方状态 + if ($order_prescription['prescription_status'] != 1){ + + } + + + } catch (\Exception $e) { + Db::rollBack(); + Log::getInstance()->error("分配药师队列执行失败原因:" . $e->getMessage()); + return Result::REQUEUE; // 重回队列 + } + + return Result::ACK; + } +} diff --git a/app/Amqp/Producer/AssignDoctorProducer.php b/app/Amqp/Producer/AssignDoctorProducer.php index 3489b35..3f6d5f3 100644 --- a/app/Amqp/Producer/AssignDoctorProducer.php +++ b/app/Amqp/Producer/AssignDoctorProducer.php @@ -14,6 +14,12 @@ use Hyperf\Amqp\Message\ProducerMessage; #[Producer(exchange: 'amqp.direct', routingKey: 'AssignDoctor')] class AssignDoctorProducer extends ProducerMessage { + /** + * @param $data + * [ + * "order_inquiry_id":"问诊订单id" + * ] + */ public function __construct($data) { $this->payload = $data; diff --git a/app/Amqp/Producer/AssignPharmacistProducer.php b/app/Amqp/Producer/AssignPharmacistProducer.php new file mode 100644 index 0000000..c479422 --- /dev/null +++ b/app/Amqp/Producer/AssignPharmacistProducer.php @@ -0,0 +1,26 @@ +payload = $data; + } +} diff --git a/app/Services/OrderPrescriptionService.php b/app/Services/OrderPrescriptionService.php index cba8af9..32b794c 100644 --- a/app/Services/OrderPrescriptionService.php +++ b/app/Services/OrderPrescriptionService.php @@ -70,6 +70,7 @@ class OrderPrescriptionService extends BaseService $data['single_use'] = $order_prescription_product['single_use'] ?? ""; $data['packaging_unit'] = $order_prescription_product['packaging_unit'] ?? ""; $data['frequency_use'] = $order_prescription_product['frequency_use'] ?? ""; + $data['available_days'] = $order_prescription_product['available_days'] ?? 0; $result[] = $data; } diff --git a/app/Services/UserDoctorService.php b/app/Services/UserDoctorService.php index 2f48f3d..1a571a0 100644 --- a/app/Services/UserDoctorService.php +++ b/app/Services/UserDoctorService.php @@ -1149,8 +1149,6 @@ class UserDoctorService extends BaseService // 获取医生信息 $params = array(); $params['doctor_id'] = $user_info['client_user_id']; - - $user_doctor = UserDoctor::getOne($params); if (empty($user_doctor)) { return fail(HttpEnumCode::HTTP_ERROR, "非法医生");