Commit 89f8ef8d authored by hangjun83's avatar hangjun83

财务开票模块更新

parent c6b7c9dd
...@@ -539,6 +539,29 @@ class InvoiceService ...@@ -539,6 +539,29 @@ class InvoiceService
$this->mailService->sendMailToHtml($title, 'hangjun@rhawn.cn',$message); $this->mailService->sendMailToHtml($title, 'hangjun@rhawn.cn',$message);
} }
public function downLoadInvoice($params)
{
if(empty($params)){
return false;
}
$invoiceInfo = $this->invoiceRecordRepository->getInvoiceRecordByRealNumber($params['hm']);
if(!$invoiceInfo){
throw new \Exception('没有对应的电子发票提供下载',502);
}
//验证token
$urlParams = [
'platform_invoice_id' => $invoiceInfo['platform_invoice_id'],
'invoice_real_number' => $params['invoice_real_number'],
'invoice_real_date' => $invoiceInfo['invoice_real_date']
];
$token = hash_hmac("sha256", json_encode($urlParams), $params['invoice_real_number'], false);
if($token != $params['token']){
throw new \Exception('电子发票无效无法提供下载',502);
}
return $invoiceInfo['invoice_pdf_url'];
}
public function getInvoicePdfDownloadUrl() public function getInvoicePdfDownloadUrl()
{ {
} }
......
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