修改订单类型错误问题
This commit is contained in:
parent
1366e121fd
commit
3606b62397
@ -235,7 +235,8 @@ class DetectionCompleteDelayDirectConsumer extends ConsumerMessage
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id'],
|
||||
$order_detection_case['detection_disease_class_names'],
|
||||
$detection_project['detection_project_name']
|
||||
$detection_project['detection_project_name'],
|
||||
$order_inquiry['inquiry_type']
|
||||
);
|
||||
|
||||
Db::commit();
|
||||
@ -253,7 +254,8 @@ class DetectionCompleteDelayDirectConsumer extends ConsumerMessage
|
||||
$user_doctor['user_name'],
|
||||
$detection_project['detection_project_name'],
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id']
|
||||
$order_detection['user_id'],
|
||||
$order_inquiry['inquiry_type']
|
||||
);
|
||||
|
||||
// 患者-新报告生成通知
|
||||
|
||||
@ -1334,253 +1334,253 @@ class CallBackController extends AbstractController
|
||||
return $server->serve();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测所结果回调
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function DetectionResultCallBack1(): ResponseInterface
|
||||
{
|
||||
$request_params = $this->request->all();
|
||||
$auth = $this->request->header("Authorization");
|
||||
if (empty($auth)){
|
||||
return $this->detectionResultFailReturn("非法请求");
|
||||
}
|
||||
|
||||
Log::getInstance("CallBackController-DetectionResultCallBack")->info("处理检测所结果");
|
||||
|
||||
try {
|
||||
// 检测参数
|
||||
if (!isset($request_params['appId'])){
|
||||
return $this->detectionResultFailReturn("缺少appId参数");
|
||||
}
|
||||
|
||||
if (!isset($request_params['orderCode'])){
|
||||
return $this->detectionResultFailReturn("缺少orderCode参数");
|
||||
}
|
||||
|
||||
if (!isset($request_params['detectBarcode'])){
|
||||
return $this->detectionResultFailReturn("缺少detectBarcode参数");
|
||||
}
|
||||
|
||||
if (!isset($request_params['pdfReport'])){
|
||||
return $this->detectionResultFailReturn("缺少pdfReport参数");
|
||||
}
|
||||
|
||||
// 检测签名
|
||||
$params = array();
|
||||
$params['app_id'] = $request_params['appId'];
|
||||
$basic_detection_organ = BasicDetectionOrgan::getOne($params);
|
||||
if (empty($basic_detection_organ)){
|
||||
return $this->detectionResultFailReturn("非法appId");
|
||||
}
|
||||
|
||||
$time = date('Ymd');
|
||||
$sign = md5($basic_detection_organ['app_id'] . $basic_detection_organ['app_secret'] . $time);
|
||||
if ($auth != $sign){
|
||||
return $this->detectionResultFailReturn("签名错误");
|
||||
}
|
||||
|
||||
// 检测pdf文件
|
||||
$pdfData = base64_decode($request_params['pdfReport']);
|
||||
if (!$pdfData){
|
||||
return $this->detectionResultFailReturn("文件错误");
|
||||
}
|
||||
|
||||
// 获取检测订单数据
|
||||
$params = array();
|
||||
$params['detection_no'] = $request_params['orderCode'];
|
||||
$order_detection = OrderDetection::getOne($params);
|
||||
if (empty($order_detection)){
|
||||
return $this->detectionResultFailReturn("非法订单");
|
||||
}
|
||||
|
||||
// 检测订单状态
|
||||
if ($order_detection['detection_status'] != 3){
|
||||
return $this->detectionResultFailReturn("订单状态错误,无法处理");
|
||||
}
|
||||
|
||||
if (!empty($order_detection['detection_result_pdf'])){
|
||||
return $this->detectionResultSuccessReturn();
|
||||
}
|
||||
|
||||
if ($order_detection['detection_bar_code'] != $request_params['detectBarcode']){
|
||||
return $this->detectionResultFailReturn("检测条码无法对应");
|
||||
}
|
||||
|
||||
// 获取医生数据
|
||||
$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("订单数据错误");
|
||||
}
|
||||
|
||||
// 检测家庭成员是否存在
|
||||
$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("患者信息错误");
|
||||
}
|
||||
|
||||
// 上传处方图片至oss
|
||||
$oss = new Oss();
|
||||
$detection_result_pdf_name = "applet/patient/detection/pdf/" . $order_detection['order_detection_id'] . '.' . 'pdf';
|
||||
$detection_result_pdf = $oss->putObject($detection_result_pdf_name, $pdfData);
|
||||
$detection_result_pdf = '/' . $detection_result_pdf;
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
// /**
|
||||
// * 检测所结果回调
|
||||
// * @return ResponseInterface
|
||||
// */
|
||||
// public function DetectionResultCallBack1(): ResponseInterface
|
||||
// {
|
||||
// $request_params = $this->request->all();
|
||||
// $auth = $this->request->header("Authorization");
|
||||
// if (empty($auth)){
|
||||
// return $this->detectionResultFailReturn("非法请求");
|
||||
// }
|
||||
//
|
||||
// Log::getInstance("CallBackController-DetectionResultCallBack")->info("处理检测所结果");
|
||||
//
|
||||
// try {
|
||||
// // 检测参数
|
||||
// if (!isset($request_params['appId'])){
|
||||
// return $this->detectionResultFailReturn("缺少appId参数");
|
||||
// }
|
||||
//
|
||||
// if (!isset($request_params['orderCode'])){
|
||||
// return $this->detectionResultFailReturn("缺少orderCode参数");
|
||||
// }
|
||||
//
|
||||
// if (!isset($request_params['detectBarcode'])){
|
||||
// return $this->detectionResultFailReturn("缺少detectBarcode参数");
|
||||
// }
|
||||
//
|
||||
// if (!isset($request_params['pdfReport'])){
|
||||
// return $this->detectionResultFailReturn("缺少pdfReport参数");
|
||||
// }
|
||||
//
|
||||
// // 检测签名
|
||||
// $params = array();
|
||||
// $params['app_id'] = $request_params['appId'];
|
||||
// $basic_detection_organ = BasicDetectionOrgan::getOne($params);
|
||||
// if (empty($basic_detection_organ)){
|
||||
// return $this->detectionResultFailReturn("非法appId");
|
||||
// }
|
||||
//
|
||||
// $time = date('Ymd');
|
||||
// $sign = md5($basic_detection_organ['app_id'] . $basic_detection_organ['app_secret'] . $time);
|
||||
// if ($auth != $sign){
|
||||
// return $this->detectionResultFailReturn("签名错误");
|
||||
// }
|
||||
//
|
||||
// // 检测pdf文件
|
||||
// $pdfData = base64_decode($request_params['pdfReport']);
|
||||
// if (!$pdfData){
|
||||
// return $this->detectionResultFailReturn("文件错误");
|
||||
// }
|
||||
//
|
||||
// // 获取检测订单数据
|
||||
// $params = array();
|
||||
// $params['detection_no'] = $request_params['orderCode'];
|
||||
// $order_detection = OrderDetection::getOne($params);
|
||||
// if (empty($order_detection)){
|
||||
// return $this->detectionResultFailReturn("非法订单");
|
||||
// }
|
||||
//
|
||||
// // 检测订单状态
|
||||
// if ($order_detection['detection_status'] != 3){
|
||||
// return $this->detectionResultFailReturn("订单状态错误,无法处理");
|
||||
// }
|
||||
//
|
||||
// if (!empty($order_detection['detection_result_pdf'])){
|
||||
// return $this->detectionResultSuccessReturn();
|
||||
// }
|
||||
//
|
||||
// if ($order_detection['detection_bar_code'] != $request_params['detectBarcode']){
|
||||
// return $this->detectionResultFailReturn("检测条码无法对应");
|
||||
// }
|
||||
//
|
||||
// // 获取医生数据
|
||||
// $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("订单数据错误");
|
||||
// }
|
||||
//
|
||||
// // 检测家庭成员是否存在
|
||||
// $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("患者信息错误");
|
||||
// }
|
||||
//
|
||||
// // 上传处方图片至oss
|
||||
// $oss = new Oss();
|
||||
// $detection_result_pdf_name = "applet/patient/detection/pdf/" . $order_detection['order_detection_id'] . '.' . 'pdf';
|
||||
// $detection_result_pdf = $oss->putObject($detection_result_pdf_name, $pdfData);
|
||||
// $detection_result_pdf = '/' . $detection_result_pdf;
|
||||
//
|
||||
// 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());
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 检测所结果回调
|
||||
@ -1732,7 +1732,8 @@ class CallBackController extends AbstractController
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id'],
|
||||
$order_detection_case['detection_disease_class_names'],
|
||||
$detection_project['detection_project_name']
|
||||
$detection_project['detection_project_name'],
|
||||
$order_inquiry['inquiry_type']
|
||||
);
|
||||
|
||||
return $this->detectionResultSuccessReturn();
|
||||
@ -1838,7 +1839,8 @@ class CallBackController extends AbstractController
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id'],
|
||||
$order_detection_case['detection_disease_class_names'],
|
||||
$detection_project['detection_project_name']
|
||||
$detection_project['detection_project_name'],
|
||||
$order_inquiry['inquiry_type']
|
||||
);
|
||||
|
||||
Db::commit();
|
||||
@ -1855,7 +1857,8 @@ class CallBackController extends AbstractController
|
||||
$user_doctor['user_name'],
|
||||
$detection_project['detection_project_name'],
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id']
|
||||
$order_detection['user_id'],
|
||||
$order_inquiry['inquiry_type']
|
||||
);
|
||||
|
||||
// 患者-新报告生成通知
|
||||
|
||||
@ -300,8 +300,6 @@ class UserDoctor extends Model
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取是否存在
|
||||
* @param array $params
|
||||
|
||||
@ -737,7 +737,8 @@ class DetectionService extends BaseService
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id'],
|
||||
$order_detection_case['detection_disease_class_names'],
|
||||
$detection_project['detection_project_name']
|
||||
$detection_project['detection_project_name'],
|
||||
$order_inquiry['inquiry_type']
|
||||
);
|
||||
|
||||
// 发送IM消息-检测报告结果-文字
|
||||
@ -746,7 +747,8 @@ class DetectionService extends BaseService
|
||||
$user_doctor['user_name'],
|
||||
$detection_project['detection_project_name'],
|
||||
$user_doctor['user_id'],
|
||||
$order_detection['user_id']
|
||||
$order_detection['user_id'],
|
||||
$order_inquiry['inquiry_type']
|
||||
);
|
||||
|
||||
Db::commit();
|
||||
|
||||
@ -670,16 +670,17 @@ class ImService extends BaseService
|
||||
* @param string $patient_user_id 患者user_id
|
||||
* @param string $disease_class_names 疾病数据
|
||||
* @param string $detection_project_name
|
||||
* @param string|int $inquiry_type
|
||||
* @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
|
||||
public function detectionTestReport(array|object $order_detection,string $doctor_user_id, string $patient_user_id,string $disease_class_names,string $detection_project_name,string|int $inquiry_type): void
|
||||
{
|
||||
try {
|
||||
// 发送消息
|
||||
$cloud_custom_data = array();
|
||||
$cloud_custom_data['order_inquiry_id'] = (string)$order_detection['order_inquiry_id'];
|
||||
$cloud_custom_data['is_system'] = 1;
|
||||
$cloud_custom_data['inquiry_type'] = 5; // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
$cloud_custom_data['inquiry_type'] = $inquiry_type; // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
$cloud_custom_data['message_rounds'] = 0;
|
||||
$cloud_custom_data['order_no'] = $order_detection['detection_no'];
|
||||
$cloud_custom_data['patient_family_data']['patient_name'] = $order_detection['patient_name'];
|
||||
@ -713,16 +714,17 @@ class ImService extends BaseService
|
||||
* @param string $detection_project_name 检测项目名称
|
||||
* @param string $doctor_user_id 医生user_id
|
||||
* @param string $patient_user_id 患者user_id
|
||||
* @param string|int $inquiry_type
|
||||
* @return void
|
||||
*/
|
||||
public function detectionTestReportStr(array|object $order_detection,string $doctor_name,string $detection_project_name,string $doctor_user_id, string $patient_user_id): void
|
||||
public function detectionTestReportStr(array|object $order_detection,string $doctor_name,string $detection_project_name,string $doctor_user_id, string $patient_user_id,string|int $inquiry_type): void
|
||||
{
|
||||
try {
|
||||
// 消息内容
|
||||
$cloud_custom_data = array();
|
||||
$cloud_custom_data['order_inquiry_id'] = (string)$order_detection['order_inquiry_id'];
|
||||
$cloud_custom_data['is_system'] = 1;
|
||||
$cloud_custom_data['inquiry_type'] = 5; // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
$cloud_custom_data['inquiry_type'] = $inquiry_type; // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
$cloud_custom_data['message_rounds'] = 0;
|
||||
$cloud_custom_data['order_no'] = $order_detection['detection_no'];
|
||||
$cloud_custom_data['patient_family_data']['patient_name'] = $order_detection['patient_name'];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user