Browse Source

最新优化点2

master
wanghongjun 11 months ago
parent
commit
464b62e2fd
  1. 2
      app/controller/admin/InvoiceFinalReport.php
  2. 44
      app/service/invoice/TempInvoiceService.php

2
app/controller/admin/InvoiceFinalReport.php

@ -67,7 +67,7 @@ class InvoiceFinalReport extends Base
validate()->rule(['frd_id' => 'require|number'])->check($param); validate()->rule(['frd_id' => 'require|number'])->check($param);
$frd_id = $param['frd_id']; $frd_id = $param['frd_id'];
$InvoiceIssuanceService = new InvoiceIssuanceService(); $InvoiceIssuanceService = new InvoiceIssuanceService();
$result = $InvoiceIssuanceService->finalReport($frd_id); $result = $InvoiceIssuanceService->tempFinalReport($frd_id);
if ($result !== true) throw new \Exception($result); if ($result !== true) throw new \Exception($result);
return $this->buildSuccess(); return $this->buildSuccess();
} catch (\Exception $e) { } catch (\Exception $e) {

44
app/service/invoice/TempInvoiceService.php

@ -46,29 +46,45 @@ class TempInvoiceService
$feeUsers['jsyj'] = $FeeComputeDetail['WaterAmount']; $feeUsers['jsyj'] = $FeeComputeDetail['WaterAmount'];
$feeUsers['zsfsmc'] = $FeeComputeDetail['chargetype']; $feeUsers['zsfsmc'] = $FeeComputeDetail['chargetype'];
$feeUsers['jfrq'] = $FeeComputeDetail['WaterPayDate']; $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); $ChinaTaxes = new ChinaTaxes($feeUsers, $invoiceDate);
$savingDetailedData = $ChinaTaxes->savingDetailedData(); $savingDetailedData = $ChinaTaxes->savingDetailedData();
if (!isset($savingDetailedData['sbpch'])) {
// 批次号 $VoucherData = $ChinaTaxes->queryIssuedPaymentVoucher($bdznsrsbh);
$sbpch = $savingDetailedData['sbpch']; 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; $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'])) { if (!$is_continue) {
throw new FuncException('加工数据有误'); if (!isset($realTimeProcessing['data']['mxGrid'])) {
} throw new FuncException('加工数据有误');
$mxGrid = $realTimeProcessing['data']['mxGrid']; }
$mxGrid = $realTimeProcessing['data']['mxGrid'];
$jsyj = 0; // 总金额 if (isset($mxGrid['sbMxsjVOList'])) {
if (isset($mxGrid['sbMxsjVOList'])) { foreach ($mxGrid['sbMxsjVOList'] as $sbMxsjVOValue) {
foreach ($mxGrid['sbMxsjVOList'] as $sbMxsjVOValue) { if (isset($sbMxsjVOValue['jsyj'])) $jsyj += $sbMxsjVOValue['jsyj'];
if (isset($sbMxsjVOValue['jsyj'])) $jsyj += $sbMxsjVOValue['jsyj']; }
} }
} }

Loading…
Cancel
Save