新增对接检测所,新增医生短信推送

This commit is contained in:
2023-08-15 15:23:24 +08:00
parent a13b55d90b
commit 19ae7e6bff
9 changed files with 416 additions and 27 deletions
+49 -1
View File
@@ -2338,7 +2338,7 @@ class MessagePush extends BaseService
// 短信
$sms_data = array();
$sms_data['template_code'] = "SMS_462035956";
$sms_data['scene_desc'] = "您的{$detection_project['detection_project_name']}报告单已出,请联系医生做报告解读。平台已赠送您和医生5个沟通回合,请珍惜沟通机会,请前往肝胆相照互联网医院微信小程序“个人中心”-“检测订单”-“订单详情”查看报告。";
$sms_data['scene_desc'] = "新报告生成通知";
$sms_data['phone'] = $this->user['mobile'];
$sms_data['user_id'] = $this->user['user_id'];
@@ -2360,4 +2360,52 @@ class MessagePush extends BaseService
Log::getInstance("MessagePush-patientDetectionResultNotice")->error($e->getMessage());
}
}
/**
* 医生-通知医生患者检测报告已生成
* 短信
* @param string $order_detection_id
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function doctorDetectionResultNotice(string $order_detection_id): void
{
// 获取检测订单
$params = array();
$params['order_detection_id'] = $order_detection_id;
$order_detection = OrderDetection::getOne($params);
if (empty($order_detection)) {
Log::getInstance("MessagePush-patientDetectionResultNotice")->error("无检测订单数据");
return;
}
// 获取检测项目
$params = array();
$params['detection_project_id'] = $order_detection['detection_project_id'];
$detection_project = DetectionProject::getOne($params);
if (empty($detection_project)) {
Log::getInstance("MessagePush-patientDetectionResultNotice")->error("检测项目错误");
return;
}
// 获取系统接诊配置
$data = array();
$data['template_code'] = "SMS_461980700";
$data['scene_desc'] = "通知医生患者检测报告已生成";
$data['phone'] = $this->user['mobile'];
$data['user_id'] = $this->user['user_id'];
$template_param = array();
$template_param['name'] = $order_detection['patient_name'];
$template_param['report'] = $detection_project['detection_project_name'];
$data['template_param'] = $template_param;
$message = new SendSmsMessageProducer($data);
$producer = ApplicationContext::getContainer()->get(Producer::class);
$result = $producer->produce($message);
if (!$result) {
throw new BusinessException("加入推送队列失败" . json_encode($data, JSON_UNESCAPED_UNICODE));
}
}
}