Commit d8228081 authored by hangjun83's avatar hangjun83

财务开票模块更新

parent 698a3904
......@@ -223,13 +223,28 @@ class InvoiceService
if($result){
//记录请求参数
$this->apiService->storePlatformDataEntries('invoice_apply_'.$result['invoice_number'],$applyInvoiceParams);
$response = $this->apiService->applyElecInvoice($applyInvoiceParams);
if($response){
$this->invoiceRecordRepository->saveInvoice([
'invoice_number' => $result['invoice_number'],
'invoice_status' => 0
]);
return true;
try{
$response = $this->apiService->applyElecInvoice($applyInvoiceParams);
if($response){
$this->invoiceRecordRepository->saveInvoice([
'invoice_number' => $result['invoice_number'],
'invoice_status' => 0
]);
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;
}
}
}
......
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