新增药师签章
This commit is contained in:
parent
d6ccd430e0
commit
9ef8ebff50
@ -373,6 +373,7 @@ class OrderPrescriptionService extends BaseService
|
||||
// 上传处方图片至oss
|
||||
$prescription_img_oss_filename = "applet/prescription/" . $order_prescription['order_prescription_id'] . '.' . 'jpg';
|
||||
$prescription_img_url = $oss->putObject($prescription_img_oss_filename, $img_result);
|
||||
$prescription_img_url = '/' . $prescription_img_url;
|
||||
dump("处方图片上传oss成功");
|
||||
|
||||
// 图片生成pdf
|
||||
@ -399,6 +400,7 @@ class OrderPrescriptionService extends BaseService
|
||||
|
||||
$prescription_pdf_local = $oss->getObjectToLocal($prescription_pdf_path,$local);
|
||||
dump("下载医生开具的处方pdf成功");
|
||||
|
||||
}
|
||||
|
||||
// 下载签名图片
|
||||
@ -442,7 +444,11 @@ class OrderPrescriptionService extends BaseService
|
||||
$data = array();
|
||||
$data['sign_param'] = json_encode($sign_param);
|
||||
$data['pdf_file'] = $pdf_file;
|
||||
if ($user['user_type'] == 2){
|
||||
$sign_pdf_result = $ca->addSignPdf("491925054435950592",$data);
|
||||
}else{
|
||||
$sign_pdf_result = $ca->addSignPdf($user['user_id'],$data);
|
||||
}
|
||||
|
||||
if (empty($sign_pdf_result[0]['fileId'])){
|
||||
throw new BusinessException("处方签章失败");
|
||||
@ -452,23 +458,25 @@ class OrderPrescriptionService extends BaseService
|
||||
|
||||
// 下载处方签章文件
|
||||
$file_id = $sign_pdf_result[0]['fileId'];
|
||||
if ($user['user_type'] == 2){
|
||||
$prescription_pdf_result = $ca->getSignedFile("491925054435950592",$file_id);
|
||||
}else{
|
||||
$prescription_pdf_result = $ca->getSignedFile($user['user_id'],$file_id);
|
||||
}
|
||||
|
||||
if (empty($prescription_pdf_result)){
|
||||
throw new BusinessException("下载处方签章文件失败");
|
||||
}
|
||||
|
||||
dump("下载处方签章文件成功");
|
||||
|
||||
// 处方签章pdf转图片
|
||||
|
||||
|
||||
// 上传oss
|
||||
$filename = "applet/prescription/" . $order_prescription['order_prescription_id'] . '.' . 'pdf';
|
||||
$prescription_pdf_url = $oss->putObject($filename, $prescription_pdf_result);
|
||||
|
||||
$result = array();
|
||||
$result['prescription_img_url'] = $prescription_img_url ?: "";
|
||||
$result['prescription_pdf_url'] = $prescription_pdf_url ?: "";
|
||||
$result['prescription_img_url'] = $prescription_img_url ?? $order_prescription['prescription_img'];
|
||||
$result['prescription_pdf_url'] = '/' . $prescription_pdf_url ?: "";
|
||||
return $result;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user