From 7e3fff6cdcb668e5c2e3b5d3ae6cd717748f891f Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Fri, 5 May 2023 18:41:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8D=AF=E5=B8=88=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oPharmacistCaVerifyDelayDirectConsumer.php | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/app/Amqp/Consumer/AutoPharmacistCaVerifyDelayDirectConsumer.php b/app/Amqp/Consumer/AutoPharmacistCaVerifyDelayDirectConsumer.php index fb6bb7a..5f74a6e 100644 --- a/app/Amqp/Consumer/AutoPharmacistCaVerifyDelayDirectConsumer.php +++ b/app/Amqp/Consumer/AutoPharmacistCaVerifyDelayDirectConsumer.php @@ -128,14 +128,23 @@ class AutoPharmacistCaVerifyDelayDirectConsumer extends ConsumerMessage } } + try { - Log::getInstance("queue-AutoPharmacistCaVerify")->info("检测执行次数"); + Log::getInstance("queue-AutoPharmacistCaVerify")->info("信息:检测执行次数"); // 检测执行次数 $res = $this->checkHandleNumber($data['prescription_file_id']); - if (!$res) { - Log::getInstance("queue-AutoPharmacistCaVerify")->error("错误:超出最大执行次数或检测错误"); + }catch (\Exception $e){ + // 检测次数失败 + Log::getInstance("queue-AutoPharmacistCaVerify")->info("错误:" . $e->getMessage()); + return Result::ACK; + } + if (!$res) { + Log::getInstance("queue-AutoPharmacistCaVerify")->error("错误:超出最大执行次数或检测错误"); + + Db::beginTransaction(); + try { // 修改处方表为未通过 $this->modifyOrderPrescription($data['order_prescription_id'], 2, "请联系平台客服,请勿重开处方"); @@ -146,27 +155,20 @@ class AutoPharmacistCaVerifyDelayDirectConsumer extends ConsumerMessage // 患者-处方审核未通过 $MessagePush = new MessagePush($user_patient['user_id'], $order_prescription['order_inquiry_id']); $MessagePush->patientPrescriptionVerifyFail(); + Db::commit(); return Result::ACK; - } - - if (time() < 1682424000){ + }catch (\Exception $e){ Db::rollBack(); - return Result::REQUEUE; + Log::getInstance("queue-AutoPharmacistCaVerify")->info("错误:" . $e->getMessage()); + return Result::ACK; } - - - }catch (\Exception $e){ - // 检测次数失败 - Log::getInstance("queue-AutoPharmacistCaVerify")->info("错误:" . $e->getMessage()); - return Result::ACK; } + // 下载医生签章文件 Db::beginTransaction(); try { - - // 检测执行次数 $res = $this->checkHandleNumber($data['prescription_file_id']); if (!$res) {