修改检测所结果回调方法
This commit is contained in:
parent
9b675c1681
commit
bdd7492670
@ -4,10 +4,19 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Amqp\Consumer;
|
||||
|
||||
use App\Amqp\Producer\AutoCompleteInquiryDelayDirectProducer;
|
||||
use App\Amqp\Producer\DetectionCompleteDelayDirectProducer;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Model\DetectionProject;
|
||||
use App\Model\OrderDetection;
|
||||
use App\Model\OrderDetectionCase;
|
||||
use App\Model\OrderInquiry;
|
||||
use App\Model\OrderInquiryCase;
|
||||
use App\Model\PatientFamily;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Services\ImService;
|
||||
use App\Services\InquiryService;
|
||||
use App\Services\MessagePush;
|
||||
use App\Utils\Log;
|
||||
use Hyperf\Amqp\Message\ConsumerDelayedMessageTrait;
|
||||
use Hyperf\Amqp\Message\ProducerDelayedMessageTrait;
|
||||
@ -17,6 +26,7 @@ use Hyperf\Amqp\Result;
|
||||
use Hyperf\Amqp\Annotation\Consumer;
|
||||
use Hyperf\Amqp\Message\ConsumerMessage;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Snowflake\IdGeneratorInterface;
|
||||
use PhpAmqpLib\Message\AMQPMessage;
|
||||
|
||||
#[Consumer(nums: 1)]
|
||||
@ -42,7 +52,7 @@ class DetectionCompleteDelayDirectConsumer extends ConsumerMessage
|
||||
$params['detection_no'] = $data['detection_no'];
|
||||
$order_detection = OrderDetection::getOne($params);
|
||||
if (empty($order_detection)){
|
||||
Log::getInstance("queue-DoctorNotYetInquiry")->error("非法订单");
|
||||
Log::getInstance("queue-DetectionComplete")->error("非法订单");
|
||||
return Result::ACK;
|
||||
}
|
||||
|
||||
@ -54,29 +64,210 @@ class DetectionCompleteDelayDirectConsumer extends ConsumerMessage
|
||||
// 存在未完成订单
|
||||
// 获取现在时间距离订单结束时间的时间差
|
||||
$time_diff = $InquiryService->getInquiryFinishTimeDiff($order_inquiry);
|
||||
if ($time_diff == 0){
|
||||
$time_diff = 10;
|
||||
}
|
||||
|
||||
// 计算时间并重新加入队列
|
||||
$queue_data = array();
|
||||
$queue_data['order_inquiry_id'] = $data['order_inquiry_id'];
|
||||
$queue_data['detection_no'] = $data['detection_no'];
|
||||
|
||||
$message = new DetectionCompleteDelayDirectProducer($queue_data);
|
||||
$message->setDelayMs(1000 * $time_diff);
|
||||
$producer = $this->container->get(Producer::class);
|
||||
$res = $producer->produce($message);
|
||||
if (!$res) {
|
||||
Db::rollBack();
|
||||
Log::getInstance()->error("处理用户优惠卷过期队列 执行失败:未到过期时间,重新添加队列失败");
|
||||
Log::getInstance("queue-DetectionComplete")->error("重新添加队列失败");
|
||||
return Result::REQUEUE;
|
||||
}
|
||||
}
|
||||
|
||||
// 检测订单状态
|
||||
if ($order_detection['detection_status'] != 3){
|
||||
Log::getInstance("queue-DetectionComplete")->error("订单状态错误,无法处理");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
}catch (\Throwable $e){
|
||||
Log::getInstance("queue-DoctorNotYetInquiry")->error($e->getMessage());
|
||||
return Result::DROP; // 重回队列
|
||||
if (!empty($order_detection['detection_result_pdf'])){
|
||||
Log::getInstance("queue-DetectionComplete")->error("无检测报告数据");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
// 获取医生数据
|
||||
$params = array();
|
||||
$params['doctor_id'] = $order_detection['doctor_id'];
|
||||
$user_doctor = UserDoctor::getOne($params);
|
||||
if (empty($user_doctor)){
|
||||
Log::getInstance("queue-DetectionComplete")->error("医生数据错误");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
// 获取检测病例数据
|
||||
$params = array();
|
||||
$params['order_detection_id'] = $order_detection['order_detection_id'];
|
||||
$order_detection_case = OrderDetectionCase::getOne($params);
|
||||
if (empty($order_detection_case)){
|
||||
Log::getInstance("queue-DetectionComplete")->error("订单数据错误");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
// 获取检测项目数据
|
||||
$params = array();
|
||||
$params['detection_project_id'] = $order_detection['detection_project_id'];
|
||||
$detection_project = DetectionProject::getOne($params);
|
||||
if (empty($detection_project)){
|
||||
Log::getInstance("queue-DetectionComplete")->error("订单数据错误");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
// 检测家庭成员是否存在
|
||||
$params = array();
|
||||
$params['family_id'] = $order_detection['family_id'];
|
||||
$params['patient_id'] = $order_detection['patient_id'];
|
||||
$patient_family = PatientFamily::getOne($params);
|
||||
if (empty($patient_family)) {
|
||||
Log::getInstance("queue-DetectionComplete")->error("患者信息错误");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
|
||||
}catch (\Throwable $e){
|
||||
Log::getInstance("queue-DetectionComplete")->error($e->getMessage());
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
Db::beginTransaction();
|
||||
|
||||
try {
|
||||
$generator = $this->container->get(IdGeneratorInterface::class);
|
||||
|
||||
// 创建问诊订单
|
||||
$data = array();
|
||||
$data['user_id'] = $order_detection['user_id'];
|
||||
$data['patient_id'] = $order_detection['patient_id'];
|
||||
$data['doctor_id'] = $order_detection['doctor_id'];
|
||||
$data['family_id'] = $order_detection['family_id'];
|
||||
$data['inquiry_type'] = 5; // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
$data['inquiry_mode'] = 1; // 订单问诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
$data['inquiry_status'] = 4; // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
|
||||
$data['inquiry_pay_channel'] = 3; // 支付渠道(1:小程序支付 2:微信扫码支付 3:模拟支付)
|
||||
$data['inquiry_pay_status'] = 2; // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
|
||||
$data['inquiry_no'] = $generator->generate();// 订单编号
|
||||
$data['escrow_trade_no'] = "GD" . $generator->generate(); // 第三方支付流水号
|
||||
$data['amount_total'] = 0;// 订单金额
|
||||
$data['coupon_amount_total'] = 0;// 优惠卷总金额
|
||||
$data['payment_amount_total'] = 0;// 实际付款金额
|
||||
$data['pay_time'] = date('Y-m-d H:i:s', time());// 支付时间
|
||||
$data['reception_time'] = date('Y-m-d H:i:s', time());// 接诊时间
|
||||
$data['patient_name'] = $patient_family['card_name'];// 患者姓名-就诊人
|
||||
$data['patient_name_mask'] = $patient_family['card_name_mask'];// 患者姓名-就诊人(掩码)
|
||||
$data['patient_sex'] = $patient_family['sex'];// 患者性别-就诊人(0:未知 1:男 2:女)
|
||||
$data['patient_age'] = $patient_family['age'];// 患者年龄-就诊人
|
||||
$order_inquiry = OrderInquiry::addOrderInquiry($data);
|
||||
if (empty($order_inquiry)) {
|
||||
Db::rollBack();
|
||||
Log::getInstance("queue-DetectionComplete")->error("问诊订单创建失败");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
// 回填问诊订单id
|
||||
$order_detection['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
|
||||
// 增加患者问诊病例
|
||||
$data = array();
|
||||
$data['user_id'] = $order_detection['user_id'];
|
||||
$data['patient_id'] = $order_detection['patient_id'];
|
||||
$data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];// 订单-问诊id
|
||||
$data['family_id'] = $patient_family['family_id']; // 家庭成员id
|
||||
$data['relation'] = $patient_family['relation']; // 与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他 )
|
||||
$data['name'] = $patient_family['card_name']; // 患者名称
|
||||
$data['sex'] = $patient_family['sex'] ?? 0; // 患者性别(0:未知 1:男 2:女)
|
||||
$data['age'] = $patient_family['age'] ?? null; // 患者年龄
|
||||
$data['height'] = $patient_family['height'] ?: null; // 身高(cm)
|
||||
$data['weight'] = $patient_family['weight'] ?: null;; // 体重(kg)
|
||||
$order_inquiry_case = OrderInquiryCase::addOrderInquiryCase($data);
|
||||
if (empty($order_inquiry_case)) {
|
||||
Db::rollBack();
|
||||
Log::getInstance("queue-DetectionComplete")->error("问诊订单病例创建失败");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
// 修改检测订单
|
||||
$data = array();
|
||||
$data['detection_status'] = 4;
|
||||
$data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];// 订单-问诊id
|
||||
|
||||
$params = array();
|
||||
$params['order_detection_id'] = $order_detection['order_detection_id'];
|
||||
OrderDetection::editOrderDetection($params,$data);
|
||||
|
||||
// 回填检测结果字段
|
||||
$order_detection['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
|
||||
// 添加自动完成队列
|
||||
$time = 1000 * 60 * 60 * 24 * 3;
|
||||
|
||||
$data = array();
|
||||
$data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
|
||||
$message = new AutoCompleteInquiryDelayDirectProducer($data);
|
||||
$message->setDelayMs($time);
|
||||
$producer = $this->container->get(Producer::class);
|
||||
$res = $producer->produce($message);
|
||||
if (!$res) {
|
||||
Db::rollBack();
|
||||
Log::getInstance("queue-DetectionComplete")->error("添加自动完成队列失败");
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
// 发送im消息
|
||||
$imService = new ImService();
|
||||
|
||||
// 患者病例
|
||||
$imService->patientCase(
|
||||
$order_inquiry,
|
||||
$user_doctor['user_id'],
|
||||
$order_inquiry_case['disease_desc']
|
||||
);
|
||||
|
||||
// 发送IM消息-检测报告结果
|
||||
$imService->detectionTestReport(
|
||||
$order_detection,
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id'],
|
||||
$order_detection_case['detection_disease_class_names'],
|
||||
$detection_project['detection_project_name']
|
||||
);
|
||||
|
||||
Db::commit();
|
||||
}catch (\Throwable $e){
|
||||
Db::rollBack();
|
||||
Log::getInstance("queue-DetectionComplete")->error($e->getMessage());
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
// 发送消息
|
||||
try {
|
||||
// 发送IM消息-检测报告结果-文字
|
||||
$imService->detectionTestReportStr(
|
||||
$order_detection,
|
||||
$user_doctor['user_name'],
|
||||
$detection_project['detection_project_name'],
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id']
|
||||
);
|
||||
|
||||
// 患者-新报告生成通知
|
||||
$MessagePush = new MessagePush($order_detection['user_id']);
|
||||
$MessagePush->patientDetectionResultNotice($order_detection['order_detection_id']);
|
||||
|
||||
// 医生-通知医生患者检测报告已生成
|
||||
$MessagePush = new MessagePush($user_doctor['user_id']);
|
||||
$MessagePush->doctorDetectionResultNotice($order_detection['order_detection_id']);
|
||||
}catch (\Throwable $e){
|
||||
Log::getInstance("queue-DetectionComplete")->error($e->getMessage());
|
||||
return Result::DROP;
|
||||
}
|
||||
|
||||
return Result::ACK;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ namespace App\Controller;
|
||||
|
||||
use App\Amqp\Producer\AssignDoctorDelayDirectProducer;
|
||||
use App\Amqp\Producer\AutoCompleteInquiryDelayDirectProducer;
|
||||
use App\Amqp\Producer\DetectionCompleteDelayDirectProducer;
|
||||
use App\Amqp\Producer\DoctorNotYetInquiryDelayDirectProducer;
|
||||
use App\Constants\DoctorTitleCode;
|
||||
use App\Constants\HttpEnumCode;
|
||||
@ -1411,7 +1412,7 @@ class CallBackController extends AbstractController
|
||||
$params['doctor_id'] = $order_detection['doctor_id'];
|
||||
$user_doctor = UserDoctor::getOne($params);
|
||||
if (empty($user_doctor)){
|
||||
return $this->detectionResultFailReturn("订单数据错误");
|
||||
return $this->detectionResultFailReturn("医生数据错误");
|
||||
}
|
||||
|
||||
// 获取检测病例数据
|
||||
@ -1660,9 +1661,52 @@ class CallBackController extends AbstractController
|
||||
$detection_result_pdf = $oss->putObject($detection_result_pdf_name, $pdfData);
|
||||
$detection_result_pdf = '/' . $detection_result_pdf;
|
||||
|
||||
Db::beginTransaction();
|
||||
// 获取医生数据
|
||||
$params = array();
|
||||
$params['doctor_id'] = $order_detection['doctor_id'];
|
||||
$user_doctor = UserDoctor::getOne($params);
|
||||
if (empty($user_doctor)){
|
||||
return $this->detectionResultFailReturn("医生数据错误");
|
||||
}
|
||||
|
||||
// 获取检测病例数据
|
||||
$params = array();
|
||||
$params['order_detection_id'] = $order_detection['order_detection_id'];
|
||||
$order_detection_case = OrderDetectionCase::getOne($params);
|
||||
if (empty($order_detection_case)){
|
||||
return $this->detectionResultFailReturn("订单数据错误");
|
||||
}
|
||||
|
||||
// 获取检测项目数据
|
||||
$params = array();
|
||||
$params['detection_project_id'] = $order_detection['detection_project_id'];
|
||||
$detection_project = DetectionProject::getOne($params);
|
||||
if (empty($detection_project)){
|
||||
return $this->detectionResultFailReturn("订单数据错误");
|
||||
}
|
||||
|
||||
// 检测当前医生是否和患者存在未完成问诊订单
|
||||
$InquiryService = new InquiryService();
|
||||
$order_inquiry = $InquiryService->checkPatientDoctorProgressInquiry($order_detection['user_id'],$order_detection['doctor_id']);
|
||||
if(!empty($order_inquiry)){
|
||||
// 存在问诊订单
|
||||
$time_diff = $InquiryService->getInquiryFinishTimeDiff($order_inquiry);
|
||||
if ($time_diff == 0){
|
||||
$time_diff = 60;
|
||||
}
|
||||
|
||||
// 计算时间并重新加入队列
|
||||
$queue_data = array();
|
||||
$queue_data['detection_no'] = $order_detection['detection_no'];
|
||||
|
||||
$message = new DetectionCompleteDelayDirectProducer($queue_data);
|
||||
$message->setDelayMs(1000 * $time_diff);
|
||||
$producer = $this->container->get(Producer::class);
|
||||
$res = $producer->produce($message);
|
||||
if (!$res) {
|
||||
return $this->detectionResultFailReturn("加入队列失败");
|
||||
}
|
||||
|
||||
try {
|
||||
// 修改检测订单
|
||||
$data = array();
|
||||
$data['detection_result_pdf'] = $detection_result_pdf;
|
||||
@ -1672,12 +1716,169 @@ class CallBackController extends AbstractController
|
||||
$params['order_detection_id'] = $order_detection['order_detection_id'];
|
||||
OrderDetection::editOrderDetection($params,$data);
|
||||
|
||||
// 发送im消息
|
||||
$imService = new ImService();
|
||||
|
||||
// 发送IM消息-检测报告结果
|
||||
$imService->detectionTestReport(
|
||||
$order_detection,
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id'],
|
||||
$order_detection_case['detection_disease_class_names'],
|
||||
$detection_project['detection_project_name']
|
||||
);
|
||||
|
||||
// 发送IM消息-检测报告结果-文字
|
||||
$imService->detectionTestReportStr(
|
||||
$order_detection,
|
||||
$user_doctor['user_name'],
|
||||
$detection_project['detection_project_name'],
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id']
|
||||
);
|
||||
|
||||
return $this->detectionResultSuccessReturn();
|
||||
}
|
||||
|
||||
// 检测家庭成员是否存在
|
||||
$params = array();
|
||||
$params['family_id'] = $order_detection['family_id'];
|
||||
$params['patient_id'] = $order_detection['patient_id'];
|
||||
$patient_family = PatientFamily::getOne($params);
|
||||
if (empty($patient_family)) {
|
||||
return $this->detectionResultFailReturn("患者信息错误");
|
||||
}
|
||||
|
||||
Db::beginTransaction();
|
||||
|
||||
try {
|
||||
$generator = $this->container->get(IdGeneratorInterface::class);
|
||||
|
||||
// 创建问诊订单
|
||||
$data = array();
|
||||
$data['user_id'] = $order_detection['user_id'];
|
||||
$data['patient_id'] = $order_detection['patient_id'];
|
||||
$data['doctor_id'] = $order_detection['doctor_id'];
|
||||
$data['family_id'] = $order_detection['family_id'];
|
||||
$data['inquiry_type'] = 5; // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
$data['inquiry_mode'] = 1; // 订单问诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
$data['inquiry_status'] = 4; // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
|
||||
$data['inquiry_pay_channel'] = 3; // 支付渠道(1:小程序支付 2:微信扫码支付 3:模拟支付)
|
||||
$data['inquiry_pay_status'] = 2; // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
|
||||
$data['inquiry_no'] = $generator->generate();// 订单编号
|
||||
$data['escrow_trade_no'] = "GD" . $generator->generate(); // 第三方支付流水号
|
||||
$data['amount_total'] = 0;// 订单金额
|
||||
$data['coupon_amount_total'] = 0;// 优惠卷总金额
|
||||
$data['payment_amount_total'] = 0;// 实际付款金额
|
||||
$data['pay_time'] = date('Y-m-d H:i:s', time());// 支付时间
|
||||
$data['reception_time'] = date('Y-m-d H:i:s', time());// 接诊时间
|
||||
$data['patient_name'] = $patient_family['card_name'];// 患者姓名-就诊人
|
||||
$data['patient_name_mask'] = $patient_family['card_name_mask'];// 患者姓名-就诊人(掩码)
|
||||
$data['patient_sex'] = $patient_family['sex'];// 患者性别-就诊人(0:未知 1:男 2:女)
|
||||
$data['patient_age'] = $patient_family['age'];// 患者年龄-就诊人
|
||||
$order_inquiry = OrderInquiry::addOrderInquiry($data);
|
||||
if (empty($order_inquiry)) {
|
||||
Db::rollBack();
|
||||
return $this->detectionResultFailReturn("问诊订单创建失败");
|
||||
}
|
||||
|
||||
// 回填问诊订单id
|
||||
$order_detection['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
|
||||
// 增加患者问诊病例
|
||||
$data = array();
|
||||
$data['user_id'] = $order_detection['user_id'];
|
||||
$data['patient_id'] = $order_detection['patient_id'];
|
||||
$data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];// 订单-问诊id
|
||||
$data['family_id'] = $patient_family['family_id']; // 家庭成员id
|
||||
$data['relation'] = $patient_family['relation']; // 与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他 )
|
||||
$data['name'] = $patient_family['card_name']; // 患者名称
|
||||
$data['sex'] = $patient_family['sex'] ?? 0; // 患者性别(0:未知 1:男 2:女)
|
||||
$data['age'] = $patient_family['age'] ?? null; // 患者年龄
|
||||
$data['height'] = $patient_family['height'] ?: null; // 身高(cm)
|
||||
$data['weight'] = $patient_family['weight'] ?: null;; // 体重(kg)
|
||||
$order_inquiry_case = OrderInquiryCase::addOrderInquiryCase($data);
|
||||
if (empty($order_inquiry_case)) {
|
||||
Db::rollBack();
|
||||
return $this->detectionResultFailReturn("问诊订单病例创建失败");
|
||||
}
|
||||
|
||||
// 修改检测订单
|
||||
$data = array();
|
||||
$data['detection_status'] = 4;
|
||||
$data['detection_result_pdf'] = $detection_result_pdf;
|
||||
$data['detection_result_date'] = date('Y-m-d H:i:s',time());
|
||||
$data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];// 订单-问诊id
|
||||
|
||||
$params = array();
|
||||
$params['order_detection_id'] = $order_detection['order_detection_id'];
|
||||
OrderDetection::editOrderDetection($params,$data);
|
||||
|
||||
// 回填检测结果字段
|
||||
$order_detection['detection_result_pdf'] = $detection_result_pdf;
|
||||
$order_detection['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
|
||||
// 添加自动完成队列
|
||||
$time = 1000 * 60 * 60 * 24 * 3;
|
||||
|
||||
$data = array();
|
||||
$data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
|
||||
$message = new AutoCompleteInquiryDelayDirectProducer($data);
|
||||
$message->setDelayMs($time);
|
||||
$producer = $this->container->get(Producer::class);
|
||||
$res = $producer->produce($message);
|
||||
if (!$res) {
|
||||
Db::rollBack();
|
||||
return $this->detectionResultFailReturn("添加自动完成队列失败");
|
||||
}
|
||||
|
||||
// 发送im消息
|
||||
$imService = new ImService();
|
||||
|
||||
// 患者病例
|
||||
$imService->patientCase(
|
||||
$order_inquiry,
|
||||
$user_doctor['user_id'],
|
||||
$order_inquiry_case['disease_desc']
|
||||
);
|
||||
|
||||
// 发送IM消息-检测报告结果
|
||||
$imService->detectionTestReport(
|
||||
$order_detection,
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id'],
|
||||
$order_detection_case['detection_disease_class_names'],
|
||||
$detection_project['detection_project_name']
|
||||
);
|
||||
|
||||
Db::commit();
|
||||
} catch (\Throwable $e) {
|
||||
Db::rollBack();
|
||||
return $this->detectionResultFailReturn($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
// 发送IM消息-检测报告结果-文字
|
||||
$imService->detectionTestReportStr(
|
||||
$order_detection,
|
||||
$user_doctor['user_name'],
|
||||
$detection_project['detection_project_name'],
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id']
|
||||
);
|
||||
|
||||
// 患者-新报告生成通知
|
||||
$MessagePush = new MessagePush($order_detection['user_id']);
|
||||
$MessagePush->patientDetectionResultNotice($order_detection['order_detection_id']);
|
||||
|
||||
// 医生-通知医生患者检测报告已生成
|
||||
$MessagePush = new MessagePush($user_doctor['user_id']);
|
||||
$MessagePush->doctorDetectionResultNotice($order_detection['order_detection_id']);
|
||||
}catch (\Throwable $e){
|
||||
Log::getInstance("detectionResult")->error($e->getMessage());
|
||||
}
|
||||
|
||||
return $this->detectionResultSuccessReturn();
|
||||
} catch (\Throwable $e) {
|
||||
return $this->detectionResultFailReturn("异常:" . $e->getMessage());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user