From 2ed03e83ce1e513632a188de78190e79a85636b9 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期五, 31 十月 2025 17:51:31 +0800
Subject: [PATCH] yys 1.导出接口开发

---
 src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java |   53 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 44 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java b/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
index d2c5522..71f1b5d 100644
--- a/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
+++ b/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
@@ -2,11 +2,13 @@
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.purchase.dto.PaymentHistoryRecordVo;
 import com.ruoyi.purchase.dto.PaymentLedgerDto;
 import com.ruoyi.purchase.dto.PaymentRegistrationDto;
 import com.ruoyi.purchase.pojo.PaymentRegistration;
@@ -14,6 +16,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 import java.util.Map;
 
@@ -41,16 +44,17 @@
     }
 
     /**
-     * 瀵煎嚭浠樻鐧昏鍒楄〃
+     * 瀵煎嚭浠樻娴佹按鍒楄〃
      */
-//    @Log(title = "浠樻鐧昏", businessType = BusinessType.EXPORT)
-//    @PostMapping("/export")
-//    public void export(HttpServletResponse response, PaymentRegistrationDto paymentRegistrationDto)
-//    {
-//        List<PaymentRegistrationDto> list = paymentRegistrationService.selectPaymentRegistrationList(paymentRegistrationDto);
-//        ExcelUtil<PaymentRegistration> util = new ExcelUtil<PaymentRegistration>(PaymentRegistration.class);
-//        util.exportExcel(response, list, "浠樻鐧昏鏁版嵁");
-//    }
+    @Log(title = "瀵煎嚭浠樻娴佹按鍒楄〃", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PaymentRegistrationDto paymentRegistrationDto)
+    {
+        Page page = new Page<>(-1,-1);
+        IPage<PaymentRegistrationDto> paymentRegistrationDtoIPage = paymentHistoryListPage(page, paymentRegistrationDto);
+        ExcelUtil<PaymentRegistrationDto> util = new ExcelUtil<PaymentRegistrationDto>(PaymentRegistrationDto.class);
+        util.exportExcel(response, paymentRegistrationDtoIPage.getRecords(), "瀵煎嚭浠樻娴佹按鍒楄〃");
+    }
 
     /**
      * 鑾峰彇浠樻鐧昏璇︾粏淇℃伅
@@ -85,6 +89,15 @@
     @DeleteMapping("/del")
     public AjaxResult remove(@RequestBody Long[] ids) {
         return toAjax(paymentRegistrationService.deletePaymentRegistrationByIds(ids));
+    }
+
+    /**
+     * 鍒犻櫎浠樻鐧昏
+     */
+    @Log(title = "浠樻鐧昏", businessType = BusinessType.DELETE)
+    @DeleteMapping("/delete")
+    public AjaxResult delete(@RequestBody Long[] ids) {
+        return toAjax(paymentRegistrationService.delete(ids));
     }
 
     /**
@@ -126,4 +139,26 @@
         List<PaymentRegistrationDto> list = paymentRegistrationService.paymentHistoryList(paymentRegistrationDto);
         return getDataTable(list);
     }
+
+    /**
+     * 鏌ヨ渚涘簲鍟嗗線鏉ヨ褰�
+     * @param supplierId
+     * @return
+     */
+    @GetMapping("/getPaymentRecordList/{supplierId}")
+    public AjaxResult getPaymentRecordList(@PathVariable Long supplierId) {
+        List<PaymentHistoryRecordVo> paymentRecordList = paymentRegistrationService.getPaymentRecordList(supplierId);
+        return success(paymentRecordList);
+    }
+
+    /**
+     * 鏌ヨ浠樻鐧昏鍒楄〃
+     *
+     * @param paymentRegistrationDto 浠樻鐧昏
+     * @return 浠樻鐧昏闆嗗悎
+     */
+    @GetMapping("/paymentHistoryListPage")
+    public IPage<PaymentRegistrationDto> paymentHistoryListPage(Page page, PaymentRegistrationDto paymentRegistrationDto) {
+        return paymentRegistrationService.paymentHistoryListPage(page,paymentRegistrationDto);
+    }
 }

--
Gitblit v1.9.3