Commit 37419622 authored by hangjun83's avatar hangjun83

财务开票模块更新

parent ef80f120
......@@ -618,12 +618,15 @@ class InvoiceService
return [ 'path' => $downloadUrl['downloadUrl'], 'filename' => $downloadUrl['filename']];
}
private function saveInvoicePdf($path,$pdfUrl)
private function saveInvoicePdf($path,$pdfUrl = '')
{
$cmd = 'chmod -R 777 storage/';
trim(shell_exec("$cmd 2>&1"));
if(!Storage::exists($path)){
if(empty($pdfUrl)){
throw new \Exception('pdf下载地址为空');
}
$pdf = $this->apiService->clientRequest('get',$pdfUrl,[]);
if($pdf){
Storage::put($path, $pdf);
......@@ -662,9 +665,9 @@ class InvoiceService
$invoiceInfo = $this->invoiceRecordRepository->getInvoiceRecordByRealNumber($params['invoice_real_number']);
if(!$invoiceInfo){
$filename = $params.'.pdf';
$filename = $params['invoice_real_number'].'.pdf';
$path = config('filesystems.default.root').'public/finance/invoice/manual/';
$this->saveInvoicePdf($path.$filename, $invoiceInfo['invoice_pdf_url']);
$this->saveInvoicePdf($path.$filename);
$downloadUrl = 'http://download.rhawn.cn/';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment