新增处方队列执行,系统配置选择添加队列
This commit is contained in:
@@ -158,17 +158,6 @@ class OrderPrescriptionService extends BaseService
|
||||
throw new BusinessException("医生开方日期错误");
|
||||
}
|
||||
|
||||
// // 获取处方文件数据
|
||||
// $params = array();
|
||||
// $params['order_prescription_id'] = $order_prescription_id;
|
||||
// $order_prescription_file = OrderPrescriptionFile::getOne($params);
|
||||
// if (empty($order_prescription_file)){
|
||||
// // 检测处方图片
|
||||
// if ($user['user_type'] == 3) {
|
||||
// throw new BusinessException("处方文件错误");
|
||||
// }
|
||||
// }
|
||||
|
||||
$CaService = new CaService($order_prescription,$user);
|
||||
|
||||
// 获取云证书签名+验证云证书签名
|
||||
@@ -197,9 +186,6 @@ class OrderPrescriptionService extends BaseService
|
||||
// 进行处方pdf签章
|
||||
$file_id = $CaService->addSignPdf($order_prescription,$user['user_type']);
|
||||
|
||||
// 增加队列处理、自动下载处方签章文件并上传oss
|
||||
|
||||
|
||||
if ($user['user_type'] == 3) {
|
||||
// 药师端时,需要进行系统签章
|
||||
// 把药师签章的pdf存储至本地文件
|
||||
@@ -208,9 +194,6 @@ class OrderPrescriptionService extends BaseService
|
||||
|
||||
// 进行处方pdf签章
|
||||
$file_id = $CaService->addSignPdf($order_prescription,$user['user_type']);
|
||||
|
||||
// 加入下载签章队列
|
||||
|
||||
}
|
||||
|
||||
$result = array();
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Services;
|
||||
use App\Amqp\Producer\AssignPharmacistProducer;
|
||||
use App\Amqp\Producer\AutoCompleteInquiryDelayDirectProducer;
|
||||
use App\Amqp\Producer\AutoFinishInquiryDelayDirectProducer;
|
||||
use App\Amqp\Producer\AutoPharmacistCaVerifyProducer;
|
||||
use App\Constants\DoctorTitleCode;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
@@ -32,6 +33,7 @@ use App\Model\PatientHistoryInquiry;
|
||||
use App\Model\Popup;
|
||||
use App\Model\Product;
|
||||
use App\Model\ProductPlatformAmount;
|
||||
use App\Model\SystemConfig;
|
||||
use App\Model\SystemInquiryConfig;
|
||||
use App\Model\SystemInquiryTime;
|
||||
use App\Model\User;
|
||||
@@ -1381,8 +1383,18 @@ class UserDoctorService extends BaseService
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "处方开具失败");
|
||||
}
|
||||
|
||||
// 获取系统配置
|
||||
$params = array();
|
||||
$params['system_config_id'] = 1;
|
||||
$system_config = SystemConfig::getOne($params);
|
||||
if (empty($system_config)){
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "处方开具失败");
|
||||
}
|
||||
|
||||
// 修改处方表
|
||||
$data = array();
|
||||
$data['is_auto_phar_verify'] = $system_config['is_auto_phar_verify_prescription'];// 是否药师自动审核(0:否 1:是)
|
||||
$data['doctor_created_time'] = date('Y-m-d H:i:s',time());
|
||||
|
||||
$params = array();
|
||||
@@ -1400,6 +1412,22 @@ class UserDoctorService extends BaseService
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "处方开具失败");
|
||||
}
|
||||
|
||||
if ($system_config['is_auto_phar_verify_prescription'] == 1){
|
||||
// 添加药师自动签章审核队列
|
||||
$data = array();
|
||||
$data['prescription_file_id'] = $prescription_open_result['file_id'];
|
||||
$data['order_prescription_id'] = $order_prescription->order_prescription_id;
|
||||
|
||||
$message = new AutoPharmacistCaVerifyProducer($data);
|
||||
$producer = ApplicationContext::getContainer()->get(Producer::class);
|
||||
$result = $producer->produce($message);
|
||||
if (!$result) {
|
||||
// 处方开具成功,添加自动签章审核队列失败
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "处方开具失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 发送消息-药师审核中
|
||||
$ImService = new ImService();
|
||||
$ImService->pharmacistVerify($order_inquiry,(string)$order_prescription->order_prescription_id,$product_name,$user_doctor['user_id'],$order_inquiry['user_id']);
|
||||
|
||||
Reference in New Issue
Block a user