From 4498a6cf17b55e14b39ae03bec4c569e4b95480b Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 13 八月 2026 14:55:52 +0800
Subject: [PATCH] fix(purchase): 修复采购台账导入功能异常处理

---
 src/main/java/com/ruoyi/purchase/controller/AccountingReportController.java |   53 ++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 40 insertions(+), 13 deletions(-)

diff --git a/src/main/java/com/ruoyi/purchase/controller/AccountingReportController.java b/src/main/java/com/ruoyi/purchase/controller/AccountingReportController.java
index 798112b..2cc9557 100644
--- a/src/main/java/com/ruoyi/purchase/controller/AccountingReportController.java
+++ b/src/main/java/com/ruoyi/purchase/controller/AccountingReportController.java
@@ -1,12 +1,17 @@
 package com.ruoyi.purchase.controller;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.account.service.purchase.AccountPurchasePaymentService;
 import com.ruoyi.basic.service.ISupplierService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.domain.R;
+import com.ruoyi.purchase.dto.SavePaymentDto;
 import com.ruoyi.purchase.dto.VatDto;
+import com.ruoyi.purchase.dto.VatSummaryDto;
 import com.ruoyi.purchase.service.PurchaseReportService;
 import com.ruoyi.purchase.vo.PurchaseReportVo;
 import io.swagger.v3.oas.annotations.Operation;
@@ -15,6 +20,7 @@
 import lombok.AllArgsConstructor;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -28,50 +34,71 @@
 
     private final ISupplierService supplierService;
     private final PurchaseReportService purchaseReportService;
-
+    private final AccountPurchasePaymentService accountPurchasePaymentService;
 
     @GetMapping("/list")
     @Log(title = "閲囪喘鎶ヨ〃-椤圭洰鍒╂鼎", businessType = BusinessType.OTHER)
     public R list(Page page, String customerName) {
-        return R.ok(purchaseReportService.list(page,customerName));
+        return R.ok(purchaseReportService.list(page, customerName));
     }
 
     @Log(title = "閲囪喘鎶ヨ〃-椤圭洰鍒╂鼎瀵煎嚭", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     @Operation(summary = "閲囪喘鎶ヨ〃-椤圭洰鍒╂鼎瀵煎嚭")
     public void export(HttpServletResponse response, String customerName) {
-        List<PurchaseReportVo> list = purchaseReportService.list(new Page(1,-1),customerName).getRecords();
+        List<PurchaseReportVo> list = purchaseReportService.list(new Page(1, -1), customerName).getRecords();
         ExcelUtil<PurchaseReportVo> util = new ExcelUtil<>(PurchaseReportVo.class);
-        util.exportExcel(response, list , "椤圭洰鍒╂鼎");
-
+        util.exportExcel(response, list, "椤圭洰鍒╂鼎");
     }
 
     @Log(title = "閲囪喘鎶ヨ〃-澧炲�肩◣姣斿", businessType = BusinessType.OTHER)
     @GetMapping("/listVat")
-    public R listVat(Page page,String month) {
-        return R.ok(purchaseReportService.listVat(page,month));
+    public R listVat(Page page, String month, String type) {
+        return R.ok(purchaseReportService.listVat(page, month, type));
     }
 
     @Log(title = "閲囪喘鎶ヨ〃-澧炲�肩◣姣斿", businessType = BusinessType.EXPORT)
     @PostMapping("/exportTwo")
-    @Operation(summary = "閲囪喘鎶ヨ〃-澧炲�肩◣姣斿")
-    public void exportTwo(HttpServletResponse response,String month) {
-        List<VatDto> list = purchaseReportService.listVat(new Page(1,-1),month).getRecords();
+    @Operation(summary = "閲囪喘鎶ヨ〃-澧炲�肩◣姣斿瀵煎嚭")
+    public void exportTwo(HttpServletResponse response, String month) {
+        List<VatDto> list = purchaseReportService.listVat(new Page(1, -1), month, null).getRecords();
         ExcelUtil<VatDto> util = new ExcelUtil<>(VatDto.class);
-        util.exportExcel(response, list , "澧炲�肩◣姣斿");
+        util.exportExcel(response, list, "澧炲�肩◣姣斿");
+    }
+
+    @Log(title = "閲囪喘鎶ヨ〃-澧炲�肩◣鍥捐〃鏁版嵁", businessType = BusinessType.OTHER)
+    @GetMapping("/vatChart")
+    @Operation(summary = "澧炲�肩◣杩涢攢椤瑰姣斿浘琛ㄦ暟鎹�")
+    public R vatChart(String year) {
+        List<VatSummaryDto> list = purchaseReportService.vatSummary(year);
+        return R.ok(list);
+    }
+
+    @GetMapping("/listVatDetail")
+    @Operation(summary = "澧炲�肩◣鏄庣粏-鎸夊彂绁�/璁㈠崟灞曠ず")
+    public AjaxResult listVatDetail(Page page, String month) {
+        IPage<VatDto> result = purchaseReportService.listVatDetail(page, month);
+        return AjaxResult.success(result);
     }
 
     @GetMapping("/supplierTransactions")
     @Log(title = "渚涘簲鍟嗗線鏉�", businessType = BusinessType.OTHER)
     @Operation(summary = "渚涘簲鍟嗗線鏉�")
     public R supplierTransactions(Page page, String supplierName) {
-        return R.ok(supplierService.supplierTransactions(page,supplierName));
+        return R.ok(supplierService.supplierTransactions(page, supplierName));
     }
 
     @GetMapping("/supplierTransactionsDetails")
     @Log(title = "渚涘簲鍟嗗線鏉ユ槑缁�", businessType = BusinessType.OTHER)
     @Operation(summary = "渚涘簲鍟嗗線鏉ユ槑缁�")
     public R supplierTransactionsDetails(Page page, Long supplierId) {
-        return R.ok(supplierService.supplierTransactionsDetails(page,supplierId));
+        return R.ok(supplierService.supplierTransactionsDetails(page, supplierId));
+    }
+
+    @PostMapping("/savePayment")
+    @Log(title = "鏂板浠樻", businessType = BusinessType.INSERT)
+    @Operation(summary = "鏂板浠樻")
+    public R savePayment(@RequestBody SavePaymentDto dto) {
+        return R.ok(accountPurchasePaymentService.savePayment(dto));
     }
 }

--
Gitblit v1.9.3