新增订阅消息推送-医生-医生有新问诊,医生超时未接诊
This commit is contained in:
parent
873fee6ac0
commit
e00fab60bb
@ -266,6 +266,9 @@ class AssignDoctorDelayDirectConsumer extends ConsumerMessage
|
|||||||
$imService = new ImService();
|
$imService = new ImService();
|
||||||
$imService->waitDoctorInquiry($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id']);
|
$imService->waitDoctorInquiry($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id']);
|
||||||
|
|
||||||
|
// 发送IM消息-横幅通知-医生有新问诊
|
||||||
|
$imService->bannerNoticeNewInquiry($order_inquiry,$user_doctor['user_id']);
|
||||||
|
|
||||||
// 医生-医生有新问诊 站内、订阅失败发送短信
|
// 医生-医生有新问诊 站内、订阅失败发送短信
|
||||||
$MessagePush = new MessagePush($user_doctor['user_id'],$order_inquiry['order_inquiry_id']);
|
$MessagePush = new MessagePush($user_doctor['user_id'],$order_inquiry['order_inquiry_id']);
|
||||||
$MessagePush->doctorHaveNewInquiry();
|
$MessagePush->doctorHaveNewInquiry();
|
||||||
|
|||||||
@ -160,10 +160,14 @@ class CancelUnInquiryOrdersDelayDirectConsumer extends ConsumerMessage
|
|||||||
// 发送IM消息-问诊退款
|
// 发送IM消息-问诊退款
|
||||||
$imService->inquiryRefund($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id']);
|
$imService->inquiryRefund($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id']);
|
||||||
|
|
||||||
// 发送站内、订阅消息-医生未接诊
|
// 发送站内、订阅消息-患者-医生未接诊
|
||||||
$MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']);
|
$MessagePush = new MessagePush($order_inquiry['user_id'],$order_inquiry['order_inquiry_id']);
|
||||||
$MessagePush->patientNoInquiry();
|
$MessagePush->patientNoInquiry();
|
||||||
|
|
||||||
|
// 发送站内、订阅消息-医生-超时未接诊
|
||||||
|
$MessagePush = new MessagePush($user_doctor['user_id'],$order_inquiry['order_inquiry_id']);
|
||||||
|
$MessagePush->doctorNoInquiry();
|
||||||
|
|
||||||
if (!empty($order_inquiry['coupon_amount_total']) && $order_inquiry['coupon_amount_total'] > 0) {
|
if (!empty($order_inquiry['coupon_amount_total']) && $order_inquiry['coupon_amount_total'] > 0) {
|
||||||
// 获取用户优惠卷信息
|
// 获取用户优惠卷信息
|
||||||
$params = array();
|
$params = array();
|
||||||
|
|||||||
@ -170,6 +170,9 @@ class CallBackController extends AbstractController
|
|||||||
$imService = new ImService();
|
$imService = new ImService();
|
||||||
$imService->waitDoctorInquiry($order_inquiry, $user_doctor['user_id'], $order_inquiry['user_id']);
|
$imService->waitDoctorInquiry($order_inquiry, $user_doctor['user_id'], $order_inquiry['user_id']);
|
||||||
|
|
||||||
|
// 发送IM消息-横幅通知-医生有新问诊
|
||||||
|
$imService->bannerNoticeNewInquiry($order_inquiry,$user_doctor['user_id']);
|
||||||
|
|
||||||
// 发送站内、订阅失败发送短信消息-医生有新问诊
|
// 发送站内、订阅失败发送短信消息-医生有新问诊
|
||||||
$MessagePush = new MessagePush($user_doctor['user_id'], $order_inquiry['order_inquiry_id']);
|
$MessagePush = new MessagePush($user_doctor['user_id'], $order_inquiry['order_inquiry_id']);
|
||||||
$MessagePush->doctorHaveNewInquiry();
|
$MessagePush->doctorHaveNewInquiry();
|
||||||
|
|||||||
@ -619,4 +619,46 @@ class ImService extends BaseService
|
|||||||
throw new BusinessException($e->getMessage());
|
throw new BusinessException($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 横幅通知-医生有新问诊
|
||||||
|
* @param array|object $order_inquiry
|
||||||
|
* @param string $doctor_user_id 用户id
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function bannerNoticeNewInquiry(array|object $order_inquiry, string $doctor_user_id): void
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
// 发送消息
|
||||||
|
$cloud_custom_data = array();
|
||||||
|
$cloud_custom_data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||||
|
$cloud_custom_data['is_system'] = 1;
|
||||||
|
$cloud_custom_data['inquiry_type'] = $order_inquiry['inquiry_type'];
|
||||||
|
$cloud_custom_data['message_rounds'] = 0;
|
||||||
|
$cloud_custom_data['patient_family_data']['patient_name'] = $order_inquiry['patient_name'];
|
||||||
|
$cloud_custom_data['patient_family_data']['patient_sex'] = $order_inquiry['patient_sex'];
|
||||||
|
$cloud_custom_data['patient_family_data']['patient_age'] = $order_inquiry['patient_age'];
|
||||||
|
|
||||||
|
if ($order_inquiry['inquiry_type'] == 1 || $order_inquiry['inquiry_type'] == 3) {
|
||||||
|
// 专家、公益
|
||||||
|
$desc = "24小时内未接诊,平台将自动取消问诊";
|
||||||
|
}else{
|
||||||
|
// 快速、购药
|
||||||
|
$desc = "5分钟内未接诊,平台将自动取消问诊";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 消息内容 医生-患者
|
||||||
|
$message_content_data = array();
|
||||||
|
$message_content_data['message_type'] = 1;
|
||||||
|
$message_content_data['title'] = "您有一个新的问诊服务等待接诊";
|
||||||
|
$message_content_data['desc'] = $desc;
|
||||||
|
$message_content = [
|
||||||
|
'Data' => json_encode($message_content_data, JSON_UNESCAPED_UNICODE),
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->sendMessage("", $doctor_user_id, $message_content, "TIMCustomElem", $cloud_custom_data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw new BusinessException($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1098,7 +1098,6 @@ class MessagePush extends BaseService
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 订阅
|
// 订阅
|
||||||
$inquiry_type = inquiryTypeToString($this->order_inquiry['inquiry_type']);
|
|
||||||
|
|
||||||
// 问诊内容-病情主诉
|
// 问诊内容-病情主诉
|
||||||
$disease_desc = $order_inquiry_case['disease_desc'];
|
$disease_desc = $order_inquiry_case['disease_desc'];
|
||||||
@ -1111,6 +1110,15 @@ class MessagePush extends BaseService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->order_inquiry['inquiry_type'] == 1 || $this->order_inquiry['inquiry_type'] == 3) {
|
||||||
|
// 专家、公益
|
||||||
|
$thing6 = "【" . inquiryTypeToString($this->order_inquiry['inquiry_type']) . "】" . ":24小时内未接诊,平台将自动取消问诊";
|
||||||
|
} else {
|
||||||
|
// 快速、购药
|
||||||
|
$thing6 = "【" . inquiryTypeToString($this->order_inquiry['inquiry_type']) . "】" . ":5分钟内未接诊,平台将自动取消问诊";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$sub_data = array();
|
$sub_data = array();
|
||||||
$sub_data['push_user_id'] = $this->user['user_id'];
|
$sub_data['push_user_id'] = $this->user['user_id'];
|
||||||
$sub_data['wx_template_id'] = "G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc";//咨询提醒
|
$sub_data['wx_template_id'] = "G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc";//咨询提醒
|
||||||
@ -1122,7 +1130,7 @@ class MessagePush extends BaseService
|
|||||||
|
|
||||||
"thing4" => (string)$disease_desc,// 病情描述
|
"thing4" => (string)$disease_desc,// 病情描述
|
||||||
|
|
||||||
"thing6" => "24小时内未接诊,平台将自动取消问诊",// 提示说明
|
"thing6" => $thing6,// 提示说明
|
||||||
|
|
||||||
"thing5" => "",// 咨询内容
|
"thing5" => "",// 咨询内容
|
||||||
|
|
||||||
@ -2151,4 +2159,77 @@ class MessagePush extends BaseService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医生-超时未接诊
|
||||||
|
* 站内、订阅
|
||||||
|
* @return void
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
|
public function doctorNoInquiry(): void
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
// 获取问诊订单关联病例
|
||||||
|
$params = array();
|
||||||
|
$params['order_inquiry_id'] = $this->order_inquiry['order_inquiry_id'];
|
||||||
|
$order_inquiry_case = OrderInquiryCase::getOne($params);
|
||||||
|
if (empty($order_inquiry_case)) {
|
||||||
|
Log::getInstance("MessagePush")->error("错误:病例数据为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 站内
|
||||||
|
$data = array();
|
||||||
|
$data['user_id'] = $this->user['user_id'];
|
||||||
|
$data['notice_type'] = 1;
|
||||||
|
$data['inquiry_type'] = $this->order_inquiry['inquiry_type']; // 问诊类型(医生端服务通知存在 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||||
|
$data['from_name'] = "肝胆小秘书";
|
||||||
|
$data['notice_brief_title'] = "因您超时未接诊,因您超时未接诊订单已失效,已退款给患者。";
|
||||||
|
$data['notice_title'] = "因您超时未接诊,因您超时未接诊订单已失效,已退款给患者。";
|
||||||
|
$data['notice_content'] = "因您超时未接诊,因您超时未接诊订单已失效,已退款给患者。";
|
||||||
|
|
||||||
|
$message = new SendStationMessageProducer($data);
|
||||||
|
$producer = ApplicationContext::getContainer()->get(Producer::class);
|
||||||
|
$result = $producer->produce($message);
|
||||||
|
if (!$result) {
|
||||||
|
Log::getInstance("MessagePush")->error("错误:加入推送队列失败" . json_encode($data, JSON_UNESCAPED_UNICODE));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 问诊内容-病情主诉
|
||||||
|
$disease_desc = $order_inquiry_case['disease_desc'];
|
||||||
|
if (!empty($disease_desc)) {
|
||||||
|
if (strlen($disease_desc) > 15) {
|
||||||
|
$disease_desc = mb_substr($disease_desc, 0, 15);
|
||||||
|
if ($disease_desc) {
|
||||||
|
$disease_desc = $disease_desc . "...";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sub_data = array();
|
||||||
|
$sub_data['push_user_id'] = $this->user['user_id'];
|
||||||
|
$sub_data['wx_template_id'] = "G1RIs0RYqsTQ2CuPQWalIMyb6_deuEEbJfajfhGvNzc";//咨询提醒
|
||||||
|
$sub_data['params']['page'] = "";
|
||||||
|
$sub_data['params']['data'] = [
|
||||||
|
"thing1" => "超时未接诊",// 提醒内容
|
||||||
|
"name2" => (string)$this->order_inquiry['patient_name'],// 患者姓名
|
||||||
|
"thing4" => (string)$disease_desc,// 病情描述
|
||||||
|
"thing6" => "因您超时未接诊订单已失效,已退款给患者",// 提示说明
|
||||||
|
"thing5" => "",// 咨询内容
|
||||||
|
];
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
$data['sub_data'] = $sub_data;
|
||||||
|
$data['sms_data'] = [];
|
||||||
|
|
||||||
|
$message = new SendSubMessageProducer($data);
|
||||||
|
$producer = ApplicationContext::getContainer()->get(Producer::class);
|
||||||
|
$result = $producer->produce($message);
|
||||||
|
if (!$result) {
|
||||||
|
Log::getInstance("MessagePush")->error("错误:加入推送队列失败" . json_encode($data, JSON_UNESCAPED_UNICODE));
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
Log::getInstance("MessagePush")->error("错误:加入推送队列失败" . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -906,6 +906,9 @@ class PatientOrderService extends BaseService
|
|||||||
$imService = new ImService();
|
$imService = new ImService();
|
||||||
$imService->waitDoctorInquiry($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id']);
|
$imService->waitDoctorInquiry($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id']);
|
||||||
|
|
||||||
|
// 发送IM消息-横幅通知-医生有新问诊
|
||||||
|
$imService->bannerNoticeNewInquiry($order_inquiry,$user_doctor['user_id']);
|
||||||
|
|
||||||
// 发送站内、订阅失败发送短信消息-医生有新问诊
|
// 发送站内、订阅失败发送短信消息-医生有新问诊
|
||||||
$MessagePush = new MessagePush($user_doctor['user_id'],$order_inquiry['order_inquiry_id']);
|
$MessagePush = new MessagePush($user_doctor['user_id'],$order_inquiry['order_inquiry_id']);
|
||||||
$MessagePush->doctorHaveNewInquiry();
|
$MessagePush->doctorHaveNewInquiry();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user