增加站内、短信订阅消息推送,修改所有消息推送入参
This commit is contained in:
@@ -986,15 +986,25 @@ class OrderServicePackageService extends BaseService
|
||||
// 等待医生接诊
|
||||
$imService->waitDoctorInquiry($order_inquiry, $user_doctor['user_id'], $order_inquiry['user_id']);
|
||||
|
||||
// 发送站内、订阅失败发送短信消息-医生有新服务包订单
|
||||
$MessagePush = new MessagePush($user_doctor['user_id'], $order_service_package['order_service_no']);
|
||||
$MessagePush->doctorHaveNewServicePackage();
|
||||
// 检测问诊是否服务包首次问诊
|
||||
$OrderServicePackageService = new OrderServicePackageService();
|
||||
$is_first = $OrderServicePackageService->isFirstInquiryServicePackage($order_no);
|
||||
if ($is_first){
|
||||
// 首次
|
||||
// 发送站内、订阅失败发送短信消息-医生有新服务包订单
|
||||
$MessagePush = new MessagePush($user_doctor['user_id'], $order_inquiry['inquiry_no']);
|
||||
$MessagePush->doctorHaveNewServicePackage();
|
||||
}else{
|
||||
// 发送站内、订阅失败-医生有新的服务包问诊订单
|
||||
$MessagePush = new MessagePush($user_doctor['user_id'], $order_inquiry['inquiry_no']);
|
||||
$MessagePush->doctorHaveNewServicePackageInquiry();
|
||||
}
|
||||
|
||||
// 加入xx时间未接诊通知队列
|
||||
$data = array();
|
||||
$data['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
|
||||
|
||||
$time = 1000 * 60 * 60 * 2;
|
||||
$time = 1000 * 60 * 60 * 24;
|
||||
$message = new DoctorNotYetInquiryDelayDirectProducer($data);
|
||||
$message->setDelayMs($time);
|
||||
$producer = $this->container->get(Producer::class);
|
||||
@@ -1260,7 +1270,7 @@ class OrderServicePackageService extends BaseService
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务包剩余药品数量
|
||||
* 获取服务包内某一药品的剩余数量
|
||||
* @param string|int $order_service_id
|
||||
* @param string|int $product_id
|
||||
* @return int
|
||||
@@ -1303,4 +1313,50 @@ class OrderServicePackageService extends BaseService
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务包订单编号-通过问诊订单id
|
||||
* @param string|int $inquiry_no
|
||||
* @return string|int
|
||||
*/
|
||||
public function getOrderServiceNoByOrderInquiryId(string|int $inquiry_no): string|int
|
||||
{
|
||||
$params = array();
|
||||
$params['inquiry_no'] = $inquiry_no;
|
||||
$order_service_package_inquiry = OrderServicePackageInquiry::getOne($params);
|
||||
if (empty($order_service_package_inquiry)){
|
||||
throw new BusinessException("订单错误");
|
||||
}
|
||||
|
||||
return $order_service_package_inquiry['order_service_no'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测患者服务包内是否还存在剩余药品
|
||||
* @param string|int $order_no
|
||||
* @return bool
|
||||
*/
|
||||
public function checkOrderServiceRemainingProduct(string|int $order_no): bool
|
||||
{
|
||||
// 获取服务包关联商品
|
||||
$params = array();
|
||||
$params['order_service_no'] = $order_no;
|
||||
$order_service_package = OrderServicePackage::getOne($params);
|
||||
if (empty($order_service_package)){
|
||||
return false;
|
||||
}
|
||||
|
||||
$params = array();
|
||||
$params['order_service_id'] = $order_service_package['order_service_id'];
|
||||
$order_service_package_products = OrderServicePackageProduct::getList($params);
|
||||
foreach ($order_service_package_products as $order_service_package_product){
|
||||
$remaining_quantity = $order_service_package_product['quantity'] - $order_service_package_product['used_quantity'];
|
||||
if ($remaining_quantity > 0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user