修改自动审核处方为延迟队列
This commit is contained in:
@@ -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\AutoPharmacistCaVerifyDelayDirectProducer;
|
||||
use App\Amqp\Producer\AutoPharmacistCaVerifyProducer;
|
||||
use App\Constants\DoctorTitleCode;
|
||||
use App\Constants\HttpEnumCode;
|
||||
@@ -1413,14 +1414,6 @@ class UserDoctorService extends BaseService
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "处方开具失败");
|
||||
}
|
||||
|
||||
|
||||
Db::commit();
|
||||
} catch (\Exception $e) {
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
// 检测药师自动审核配置开启状态
|
||||
if ($system_config['is_auto_phar_verify_prescription'] == 1){
|
||||
// 添加药师自动签章审核队列
|
||||
@@ -1428,8 +1421,10 @@ class UserDoctorService extends BaseService
|
||||
$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);
|
||||
$message = new AutoPharmacistCaVerifyDelayDirectProducer($data);
|
||||
|
||||
$message->setDelayMs(1000 * 60 * 1);
|
||||
$producer = $this->container->get(Producer::class);
|
||||
$result = $producer->produce($message);
|
||||
if (!$result) {
|
||||
// 处方开具成功,添加自动签章审核队列失败
|
||||
@@ -1438,12 +1433,18 @@ class UserDoctorService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
} catch (\Exception $e) {
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
// 发送消息-药师审核中
|
||||
$ImService = new ImService();
|
||||
$ImService->pharmacistVerify($order_inquiry,(string)$order_prescription->order_prescription_id,$product_name,$user_doctor['user_id'],$order_inquiry['user_id']);
|
||||
|
||||
}catch (\Exception $e){
|
||||
|
||||
return success([],HttpEnumCode::HTTP_SUCCESS,"消息发送失败");
|
||||
}
|
||||
|
||||
return success();
|
||||
|
||||
Reference in New Issue
Block a user