修改消息分野
This commit is contained in:
@@ -258,8 +258,8 @@ class OrderPrescriptionService extends BaseService
|
||||
// 医生
|
||||
if ($user['user_type'] == 2){
|
||||
// 下载基础处方pdf图片
|
||||
$filename = "basic/file/prescription.jpg";
|
||||
$prescription_image = $oss->getObjectToRAM($filename);
|
||||
$prescription_basic_filename = "basic/file/prescription.jpg";
|
||||
$prescription_image = $oss->getObjectToRAM($prescription_basic_filename);
|
||||
|
||||
dump("下载基础处方pdf图片成功");
|
||||
|
||||
@@ -267,7 +267,6 @@ class OrderPrescriptionService extends BaseService
|
||||
|
||||
$image = $manager->make($prescription_image);
|
||||
|
||||
// $fontPath = './extend/Ca/ZiYuYongSongTi-2.ttf';
|
||||
$fontPath = './extend/Ca/msyh.ttf';
|
||||
|
||||
// 处方号
|
||||
@@ -372,39 +371,36 @@ class OrderPrescriptionService extends BaseService
|
||||
dump("处方图片生成成功");
|
||||
|
||||
// 上传处方图片至oss
|
||||
$filename = "applet/prescription/" . $order_prescription['order_prescription_id'] . '.' . 'jpg';
|
||||
$prescription_img_url = $oss->putObject($filename, $img_result);
|
||||
$prescription_img_oss_filename = "applet/prescription/" . $order_prescription['order_prescription_id'] . '.' . 'jpg';
|
||||
$prescription_img_url = $oss->putObject($prescription_img_oss_filename, $img_result);
|
||||
dump("处方图片上传oss成功");
|
||||
|
||||
// 图片生成pdf
|
||||
$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Image('@' . $img_result, 10, 10, 0, 0, '', '', '', false, 300, '', false, false, 0, false, false, false);
|
||||
|
||||
$prescription_pdf_local_filename = $order_prescription['order_prescription_id'] . '.' . 'pdf';
|
||||
|
||||
// 图片生成的处方pdf存储为本地文件
|
||||
$pdf->Output(dirname(__DIR__, 2) . "/" . $prescription_pdf_local_filename ,"F");
|
||||
|
||||
dump("处方图片生成pdf成功");
|
||||
}
|
||||
|
||||
// 药师
|
||||
if ($user['user_type'] == 3){
|
||||
// 下载开具的处方图片
|
||||
$filename = "basic/file/prescription.jpg";
|
||||
$prescription_image = $oss->getObjectToRAM($filename);
|
||||
|
||||
dump("下载基础处方pdf图片成功");
|
||||
// 下载医生开具的处方pdf
|
||||
// 去除第一个/ oss不识别
|
||||
$prescription_pdf_path = substr($order_prescription['prescription_pdf'], 1, strlen($order_prescription['prescription_pdf']) - 1);
|
||||
|
||||
$local = "./runtime/" . $order_prescription['order_prescription_id'] . '.' . 'pdf';
|
||||
|
||||
$prescription_pdf_local = $oss->getObjectToLocal($prescription_pdf_path,$local);
|
||||
dump("下载医生开具的处方pdf成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 图片生成pdf
|
||||
$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Image('@' . $img_result, 10, 10, 0, 0, '', '', '', false, 300, '', false, false, 0, false, false, false);
|
||||
|
||||
$filename = $order_prescription['order_prescription_id'] . '.' . 'pdf';
|
||||
|
||||
// 图片生成的处方pdf存储为本地文件
|
||||
$pdf->Output(dirname(__DIR__, 2) . "/" . $filename ,"F");
|
||||
|
||||
dump("图片生成pdf成功");
|
||||
// 下载签名图片
|
||||
$style = "image/resize,m_lfit,w_100,h_350";
|
||||
$sign_image = $oss->getCusTomObjectToRAM($sign_image_path,$style);
|
||||
@@ -440,7 +436,7 @@ class OrderPrescriptionService extends BaseService
|
||||
}
|
||||
|
||||
// 打开处方pdf文件
|
||||
$pdf_file = fopen("./runtime/" . $filename,'r');
|
||||
$pdf_file = fopen("./runtime/" . $order_prescription['order_prescription_id'] . ".pdf",'r');
|
||||
|
||||
// 处方pdf进行签章
|
||||
$data = array();
|
||||
|
||||
Reference in New Issue
Block a user