|
|
|
@ -46,29 +46,45 @@ class TempInvoiceService |
|
|
|
$feeUsers['jsyj'] = $FeeComputeDetail['WaterAmount']; |
|
|
|
$feeUsers['zsfsmc'] = $FeeComputeDetail['chargetype']; |
|
|
|
$feeUsers['jfrq'] = $FeeComputeDetail['WaterPayDate']; |
|
|
|
$feeUsers['project_name'] = $invoiceIssuance['project_name']; |
|
|
|
$feeUsers['serial_number'] = $invoiceIssuance['serial_number']; |
|
|
|
|
|
|
|
// 保存 |
|
|
|
$is_continue = false;// 是否跳过加工 |
|
|
|
$jsyj = 0; // 总金额 |
|
|
|
$ChinaTaxes = new ChinaTaxes($feeUsers, $invoiceDate); |
|
|
|
$savingDetailedData = $ChinaTaxes->savingDetailedData(); |
|
|
|
|
|
|
|
// 批次号 |
|
|
|
$sbpch = $savingDetailedData['sbpch']; |
|
|
|
if (!isset($savingDetailedData['sbpch'])) { |
|
|
|
$VoucherData = $ChinaTaxes->queryIssuedPaymentVoucher($bdznsrsbh); |
|
|
|
if (empty($VoucherData['bdzkjmxList'])) { |
|
|
|
throw new \Exception('未查询到待开具电子缴款凭证数据'); |
|
|
|
} |
|
|
|
$sbpch = $VoucherData['bdzkjmxList']['bdzkjmxVO']['sbpch']; |
|
|
|
$jsyj = $VoucherData['bdzkjmxList']['bdzkjmxVO']['ydzse']; |
|
|
|
$is_continue = true; |
|
|
|
} else { |
|
|
|
// 批次号 |
|
|
|
$sbpch = $savingDetailedData['sbpch']; |
|
|
|
} |
|
|
|
$returnData['sbpch'] = $sbpch; |
|
|
|
|
|
|
|
// 委托 - 加工数据 |
|
|
|
$realTimeProcessing = $ChinaTaxes->realTimeProcessing($sbpch); |
|
|
|
$realTimeProcessing = ['code' => 0]; |
|
|
|
if (!$is_continue) { |
|
|
|
$realTimeProcessing = $ChinaTaxes->realTimeProcessing($sbpch); |
|
|
|
} |
|
|
|
|
|
|
|
if ($realTimeProcessing['code'] == 200) { |
|
|
|
if ($realTimeProcessing['code'] == 200 || $is_continue) { |
|
|
|
// 处理加工成功返回数据 |
|
|
|
if (!isset($realTimeProcessing['data']['mxGrid'])) { |
|
|
|
throw new FuncException('加工数据有误'); |
|
|
|
} |
|
|
|
$mxGrid = $realTimeProcessing['data']['mxGrid']; |
|
|
|
|
|
|
|
$jsyj = 0; // 总金额 |
|
|
|
if (isset($mxGrid['sbMxsjVOList'])) { |
|
|
|
foreach ($mxGrid['sbMxsjVOList'] as $sbMxsjVOValue) { |
|
|
|
if (isset($sbMxsjVOValue['jsyj'])) $jsyj += $sbMxsjVOValue['jsyj']; |
|
|
|
if (!$is_continue) { |
|
|
|
if (!isset($realTimeProcessing['data']['mxGrid'])) { |
|
|
|
throw new FuncException('加工数据有误'); |
|
|
|
} |
|
|
|
$mxGrid = $realTimeProcessing['data']['mxGrid']; |
|
|
|
if (isset($mxGrid['sbMxsjVOList'])) { |
|
|
|
foreach ($mxGrid['sbMxsjVOList'] as $sbMxsjVOValue) { |
|
|
|
if (isset($sbMxsjVOValue['jsyj'])) $jsyj += $sbMxsjVOValue['jsyj']; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|