新增检测回调、修改自动完成订单、新增im推送、

This commit is contained in:
2023-08-09 11:27:56 +08:00
parent 00937e9154
commit 3bb279ab57
9 changed files with 402 additions and 28 deletions
+67
View File
@@ -662,4 +662,71 @@ class ImService extends BaseService
throw new BusinessException($e->getMessage());
}
}
/**
* 糖组检测报告
* @param array|object $order_detection 检测订单数据
* @param string $doctor_user_id 医生user_id
* @param string $patient_user_id 患者user_id
* @param string $disease_class_names 疾病数据
* @return void
*/
public function detectionTestReport(array|object $order_detection,string $doctor_user_id, string $patient_user_id,string $disease_class_names,string $detection_project_name): void
{
try {
// 发送消息
$cloud_custom_data = array();
$cloud_custom_data['is_system'] = 1;
$cloud_custom_data['inquiry_type'] = 5; // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
$cloud_custom_data['message_rounds'] = 0;
$cloud_custom_data['order_no'] = $order_detection['order_no'];
$cloud_custom_data['patient_family_data']['patient_name'] = $order_detection['patient_name'];
$cloud_custom_data['patient_family_data']['patient_sex'] = $order_detection['patient_sex'];
$cloud_custom_data['patient_family_data']['patient_age'] = $order_detection['patient_age'];
// 消息内容
$message_content_data = array();
$message_content_data['message_type'] = 10;
$message_content_data['title'] = $detection_project_name;
$message_content_data['desc'] = "";
$message_content_data['data']['order_no'] = (string)$order_detection['order_no'];
$message_content_data['data']['disease_class_names'] = $disease_class_names;
$message_content_data['data']['message_path'] = "/pages/checkOrderDetail/checkOrderDetail?order_detection_id=" . $order_detection['detection_no']; // 跳转地址(小程序内页)
$message_content = [
'Data' => json_encode($message_content_data, JSON_UNESCAPED_UNICODE),
];
$this->sendMessage($patient_user_id,$doctor_user_id, $message_content, "TIMCustomElem", $cloud_custom_data);
} catch (\Exception $e) {
throw new BusinessException($e->getMessage());
}
}
/**
* 糖组检测报告-文字
* @param array|object $doctor_name 医生名称
* @param string $detection_project_name 检测项目名称
* @param string $doctor_user_id 医生user_id
* @param string $patient_user_id 患者user_id
* @param string $disease_class_names 疾病数据
* @return void
*/
public function detectionTestReportStr(string $doctor_name,string $detection_project_name,string $doctor_user_id, string $patient_user_id,string $disease_class_names): void
{
try {
// 消息内容
$message_content_data = array();
$message_content_data['Text'] = $doctor_name . "医生您好,我在您那里开具的【" . $detection_project_name . "】服务,报告单已出,请您查看报告并详细的做一下解读,谢谢医生。";
$message_content = [
'Data' => json_encode($message_content_data, JSON_UNESCAPED_UNICODE),
];
$this->sendMessage($patient_user_id,$doctor_user_id, $message_content, "TIMTextElem", []);
} catch (\Exception $e) {
throw new BusinessException($e->getMessage());
}
}
}