修改ca开具处方
This commit is contained in:
@@ -23,6 +23,7 @@ use App\Model\UserPharmacistInfo;
|
||||
use App\Utils\Log;
|
||||
use Extend\Alibaba\Oss;
|
||||
use Extend\Ca\Ca;
|
||||
use Extend\Ca\CaOffline;
|
||||
use Extend\Prescription\Prescription;
|
||||
use Hyperf\Contract\LengthAwarePaginatorInterface;
|
||||
use Hyperf\Utils\WaitGroup;
|
||||
@@ -242,7 +243,7 @@ class OrderPrescriptionService extends BaseService
|
||||
$icd_name = "";
|
||||
}
|
||||
|
||||
$ca = new Ca();
|
||||
$CaOffline = new CaOffline();
|
||||
|
||||
// 获取云证书签名
|
||||
$data = array();
|
||||
@@ -268,23 +269,23 @@ class OrderPrescriptionService extends BaseService
|
||||
}
|
||||
|
||||
dump("获取用户云证书签名");
|
||||
$cert_sign_result = $ca->getCertSign($user_entity_id, $user_entity_id, $data);
|
||||
$cert_sign_result = $CaOffline->getCertSign($user_entity_id, $user_entity_id, $data);
|
||||
dump("获取用户云证书签名成功");
|
||||
|
||||
// 验证云证书签名-验证无需处理,只要不返回错误即可
|
||||
dump("验证用户云证书签名");
|
||||
$ca->verifyPkcs7($cert_sign_result['signP7'], $data);
|
||||
$CaOffline->verifyPkcs7($cert_sign_result['signP7'], $data);
|
||||
dump("验证用户云证书签名成功");
|
||||
|
||||
if ($user['user_type'] == 3) {
|
||||
dump("获取医院云证书签名");
|
||||
unset($cert_sign_result);
|
||||
$cert_sign_result = $ca->getCertSign($hospital_entity_id, $hospital_entity_id, $data);
|
||||
$cert_sign_result = $CaOffline->getCertSign($hospital_entity_id, $hospital_entity_id, $data);
|
||||
dump("获取医院云证书签名成功");
|
||||
|
||||
// 验证云证书签名-验证无需处理,只要不返回错误即可
|
||||
dump("验证医院云证书签名");
|
||||
$ca->verifyPkcs7($cert_sign_result['signP7'], $data);
|
||||
$CaOffline->verifyPkcs7($cert_sign_result['signP7'], $data);
|
||||
dump("验证医院云证书签名成功");
|
||||
}
|
||||
|
||||
@@ -481,7 +482,7 @@ class OrderPrescriptionService extends BaseService
|
||||
$data = array();
|
||||
$data['sign_param'] = json_encode($sign_param);
|
||||
$data['pdf_file'] = $pdf_file;
|
||||
$sign_pdf_result = $ca->addSignPdf($user_entity_id, $data);
|
||||
$sign_pdf_result = $CaOffline->addSignPdf($user_entity_id, $data);
|
||||
if (empty($sign_pdf_result[0]['fileId'])) {
|
||||
throw new BusinessException("处方签章失败");
|
||||
}
|
||||
@@ -490,7 +491,7 @@ class OrderPrescriptionService extends BaseService
|
||||
|
||||
// 下载处方签章文件
|
||||
$file_id = $sign_pdf_result[0]['fileId'];
|
||||
$prescription_pdf_result = $ca->getSignedFile($user_entity_id, $file_id);
|
||||
$prescription_pdf_result = $CaOffline->getSignedFile($user_entity_id, $file_id);
|
||||
|
||||
if (empty($prescription_pdf_result)) {
|
||||
throw new BusinessException("下载处方签章文件失败");
|
||||
@@ -537,7 +538,7 @@ class OrderPrescriptionService extends BaseService
|
||||
$data = array();
|
||||
$data['sign_param'] = json_encode($sign_param);
|
||||
$data['pdf_file'] = $pdf_file;
|
||||
$hospital_sign_pdf_result = $ca->addSignPdf($hospital_entity_id, $data);
|
||||
$hospital_sign_pdf_result = $CaOffline->addSignPdf($hospital_entity_id, $data);
|
||||
if (empty($hospital_sign_pdf_result[0]['fileId'])) {
|
||||
throw new BusinessException("处方签章失败");
|
||||
}
|
||||
@@ -547,7 +548,7 @@ class OrderPrescriptionService extends BaseService
|
||||
// 下载处方签章文件
|
||||
unset($prescription_pdf_result);
|
||||
$file_id = $hospital_sign_pdf_result[0]['fileId'];
|
||||
$prescription_pdf_result = $ca->getSignedFile($hospital_entity_id, $file_id);
|
||||
$prescription_pdf_result = $CaOffline->getSignedFile($hospital_entity_id, $file_id);
|
||||
|
||||
if (empty($prescription_pdf_result)) {
|
||||
throw new BusinessException("下载处方签章文件失败");
|
||||
|
||||
Reference in New Issue
Block a user