|
|
|
@ -136,4 +136,46 @@ class TempInvoiceService |
|
|
|
} |
|
|
|
return $returnData; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 临时获取结报接口数据 |
|
|
|
* @param $report_date |
|
|
|
* @return array|string |
|
|
|
*/ |
|
|
|
public function tempSaveSummaryReport($report_date) |
|
|
|
{ |
|
|
|
try { |
|
|
|
|
|
|
|
$InvoiceIssuanceService = new InvoiceIssuanceService(); |
|
|
|
$invoiceDate = $InvoiceIssuanceService->getInvoiceDate(strtotime($report_date)); |
|
|
|
$bdznsrsbh = $InvoiceIssuanceService->getTaxNumber(0); // 被征纳税人 |
|
|
|
|
|
|
|
$ChinaTaxes = new ChinaTaxes([], $invoiceDate); |
|
|
|
$daiZhengSummaryQuery = $ChinaTaxes->daiZhengSummaryQuery($bdznsrsbh); |
|
|
|
|
|
|
|
$save = []; |
|
|
|
if (isset($daiZhengSummaryQuery['cxwjbList'])) { |
|
|
|
foreach ($daiZhengSummaryQuery['cxwjbList'] as $value) { |
|
|
|
foreach ($value['cxwjbVO'] as $val) { |
|
|
|
$sbpch = $val['sbpch']; // 申报批次号 |
|
|
|
$queryWhere = [ |
|
|
|
'sbpch' => $sbpch |
|
|
|
]; |
|
|
|
$queryWhere['ydzse'] = $val['ydzse']; |
|
|
|
$queryWhere['create_time'] = time(); |
|
|
|
$save[] = $queryWhere; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!$save) { |
|
|
|
throw new FuncException($daiZhengSummaryQuery['message'] ?? '数据储存失败'); |
|
|
|
} |
|
|
|
|
|
|
|
return $save; |
|
|
|
} catch (\Exception $e) { |
|
|
|
return $e->getMessage(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|