Browse Source

最新优化点2

master
wanghongjun 9 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);
$frd_id = $param['frd_id'];
$InvoiceIssuanceService = new InvoiceIssuanceService();
$result = $InvoiceIssuanceService->finalReport($frd_id);
$result = $InvoiceIssuanceService->tempFinalReport($frd_id);
if ($result !== true) throw new \Exception($result);
return $this->buildSuccess();
} catch (\Exception $e) {

44
app/service/invoice/TempInvoiceService.php

@ -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'];
}
}
}

Loading…
Cancel
Save