Commit d8228081 authored by hangjun83's avatar hangjun83

财务开票模块更新

parent 698a3904
...@@ -223,6 +223,7 @@ class InvoiceService ...@@ -223,6 +223,7 @@ class InvoiceService
if($result){ if($result){
//记录请求参数 //记录请求参数
$this->apiService->storePlatformDataEntries('invoice_apply_'.$result['invoice_number'],$applyInvoiceParams); $this->apiService->storePlatformDataEntries('invoice_apply_'.$result['invoice_number'],$applyInvoiceParams);
try{
$response = $this->apiService->applyElecInvoice($applyInvoiceParams); $response = $this->apiService->applyElecInvoice($applyInvoiceParams);
if($response){ if($response){
$this->invoiceRecordRepository->saveInvoice([ $this->invoiceRecordRepository->saveInvoice([
...@@ -231,6 +232,20 @@ class InvoiceService ...@@ -231,6 +232,20 @@ class InvoiceService
]); ]);
return true; return true;
} }
}catch(\Throwable $exception){
switch($invoiceParams['invoice_platform']){
case 'rhawn' :
$updateResult = $this->rhawnInvoiceRepository->updateInvoiceById($invoiceParams['platform_invoice_id'], [
'soi_api_status' => 2,
'soi_no' => mb_substr($exception->getMessage(),0,250,'utf-8')
]);break;
case 'bhua' :
$updateResult = $this->bhuaInvoiceRepository->updateInvoiceById($invoiceParams['platform_invoice_id'], [
'soi_api_status' => 2,
'soi_no' => mb_substr($exception->getMessage(),0,250,'utf-8')
]);break;
}
}
} }
throw new \Exception('申请发票失败',502); throw new \Exception('申请发票失败',502);
......
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