新增处方上报处方平台,未开发完毕,修改药品订单支付金额为0.01
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Amqp\Producer\CancelUnpayOrdersDelayDirectProducer;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Model\DoctorInquiryTime;
|
||||
use App\Model\OrderPrescriptionProduct;
|
||||
use App\Model\UserCaCert;
|
||||
use App\Model\OrderInquiry;
|
||||
use App\Model\OrderPrescription;
|
||||
@@ -575,134 +576,30 @@ class TestController extends AbstractController
|
||||
}
|
||||
|
||||
public function test_11(){
|
||||
$oss = new Oss();
|
||||
$prescription_pdf = $oss->getObjectToLocal("applet/prescription/500341310934036481.pdf","./runtime/test.pdf");
|
||||
dump($prescription_pdf);
|
||||
$order_prescription_id = "";
|
||||
|
||||
// 获取处方数据
|
||||
$params = array();
|
||||
$params['order_prescription_id'] = $order_prescription_id;
|
||||
$order_prescription = OrderPrescription::getOne($params);
|
||||
if (empty($order_prescription)) {
|
||||
throw new BusinessException("处方数据错误");
|
||||
}
|
||||
|
||||
// 获取处方关联商品数据
|
||||
$params = array();
|
||||
$params['order_prescription_id'] = $order_prescription_id;
|
||||
$order_prescription_product = OrderPrescriptionProduct::getList($params);
|
||||
if (empty($order_prescription_product)) {
|
||||
throw new BusinessException("处方药品数据错误");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$OrderPrescriptionService = new OrderPrescriptionService();
|
||||
$result = $OrderPrescriptionService->reportPrescription();
|
||||
}
|
||||
|
||||
// pdf进行签章
|
||||
public function test_12(){
|
||||
$ca = new Ca();
|
||||
|
||||
$pdf_file = fopen("./runtime/prescription.pdf",'r');
|
||||
|
||||
$oss = new Oss();
|
||||
|
||||
$filename = "basic/file/hospital_signature.png";
|
||||
|
||||
$style = "image/resize,w_300,h_300";
|
||||
|
||||
$sign_image = $oss->getCusTomObjectToRAM($filename,$style);
|
||||
$sign_image = base64_encode($sign_image);
|
||||
if (!$sign_image){
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
|
||||
$sign_param = [
|
||||
[ // 医院签章
|
||||
"llx"=>"1550", // 左边底部X坐标
|
||||
"lly"=>"1350", // 左边底部Y坐标
|
||||
"urx"=>"2250", // 右边上部x坐标
|
||||
"ury"=>"650", // 右边上部y坐标
|
||||
"pageList"=>[1],
|
||||
"sealImg"=>$sign_image
|
||||
],
|
||||
// [ // 药师端
|
||||
// "llx"=>"350", // 左边底部X坐标
|
||||
// "lly"=>"190", // 左边底部Y坐标
|
||||
// "urx"=>"440", // 右边上部x坐标
|
||||
// "ury"=>"140", // 右边上部y坐标
|
||||
// "pageList"=>[1],
|
||||
// "sealImg"=>$sign_image
|
||||
// ]
|
||||
];
|
||||
$data = array();
|
||||
$data['sign_param'] = json_encode($sign_param);
|
||||
$data['pdf_file'] = $pdf_file;
|
||||
|
||||
|
||||
$result = $ca->addSignPdf("5345345461",$data);
|
||||
|
||||
$file_id = $result[0]['fileId'];
|
||||
|
||||
$result = $ca->getSignedFile("5345345461",$file_id);
|
||||
if (empty($result)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
$file = fopen("./runtime/test.pdf", "w") or die("Unable to open file!");
|
||||
fwrite($file, $result);
|
||||
fclose($file);
|
||||
|
||||
// 上传阿里云oss
|
||||
|
||||
// $oss = new Oss();
|
||||
//
|
||||
// $filename = "applet/doctor/prescription/test.pdf";
|
||||
//
|
||||
// $result = $oss->putObject($filename, $result);
|
||||
// dump($result);
|
||||
}
|
||||
|
||||
public function test_13(){
|
||||
$oss = new Oss();
|
||||
$hospital_sign_image_path = "basic/file/hospital_signature.png";
|
||||
|
||||
// 下载医院签名图片
|
||||
$style = "image/resize,w_300,h_300";
|
||||
$sign_image = $oss->getCusTomObjectToRAM($hospital_sign_image_path,$style);
|
||||
$sign_image = base64_encode($sign_image);
|
||||
if (!$sign_image){
|
||||
throw new BusinessException("医院签名图片下载失败");
|
||||
}
|
||||
|
||||
$sign_param = [
|
||||
[ // 医院签章
|
||||
"llx"=>"370", // 左边底部X坐标 控制左右(越小越左)
|
||||
"lly"=>"210", // 左边底部Y坐标 控制上下(越小越下)
|
||||
"urx"=>"520", // 右边上部x坐标
|
||||
"ury"=>"360", // 右边上部y坐标
|
||||
"pageList"=>[1],
|
||||
"sealImg"=>$sign_image
|
||||
],
|
||||
];
|
||||
|
||||
// 打开处方pdf文件
|
||||
unset($pdf_file);
|
||||
$pdf_file = fopen("./runtime/" . "501402833412673536" . ".pdf",'r');
|
||||
|
||||
$ca = new Ca();
|
||||
|
||||
// 处方pdf进行签章
|
||||
$data = array();
|
||||
$data['sign_param'] = json_encode($sign_param);
|
||||
$data['pdf_file'] = $pdf_file;
|
||||
$hospital_sign_pdf_result = $ca->addSignPdf("5345345461",$data);
|
||||
if (empty($hospital_sign_pdf_result[0]['fileId'])){
|
||||
throw new BusinessException("处方签章失败");
|
||||
}
|
||||
|
||||
dump($hospital_sign_pdf_result);
|
||||
|
||||
dump("处方pdf进行医院签章成功");
|
||||
|
||||
|
||||
|
||||
// 下载处方签章文件
|
||||
unset($prescription_pdf_result);
|
||||
$file_id = $hospital_sign_pdf_result[0]['fileId'];
|
||||
$prescription_pdf_result = $ca->getSignedFile("5345345461",$file_id);
|
||||
|
||||
if (empty($prescription_pdf_result)){
|
||||
throw new BusinessException("下载处方签章文件失败");
|
||||
}
|
||||
|
||||
dump("下载医院处方签章文件成功");
|
||||
|
||||
$file = fopen("./runtime/test.pdf", "w") or die("Unable to open file!");
|
||||
fwrite($file, $prescription_pdf_result);
|
||||
fclose($file);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user