From ab01a0f611c0adb97662bc8f548ca4a911ec8045 Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期五, 06 六月 2025 17:37:39 +0800
Subject: [PATCH] 分页修改

---
 src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java |   80 ++++++++++++++++++++++++++++++---------
 1 files changed, 61 insertions(+), 19 deletions(-)

diff --git a/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java b/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
index b8f233d..2dcbc80 100644
--- a/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
+++ b/src/main/java/com/ruoyi/purchase/controller/PaymentRegistrationController.java
@@ -1,10 +1,13 @@
 package com.ruoyi.purchase.controller;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 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;
@@ -13,17 +16,17 @@
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 浠樻鐧昏Controller
- * 
+ *
  * @author ruoyi
  * @date 2025-05-15
  */
 @RestController
 @RequestMapping("/purchase/paymentRegistration")
-public class PaymentRegistrationController extends BaseController
-{
+public class PaymentRegistrationController extends BaseController {
     @Autowired
     private IPaymentRegistrationService paymentRegistrationService;
 
@@ -32,8 +35,7 @@
      */
 //    @PreAuthorize("@ss.hasPermi('system:registration:list')")
     @GetMapping("/list")
-    public TableDataInfo list(PaymentRegistrationDto paymentRegistrationDto)
-    {
+    public TableDataInfo list(PaymentRegistrationDto paymentRegistrationDto) {
         startPage();
         List<PaymentRegistrationDto> list = paymentRegistrationService.selectPaymentRegistrationList(paymentRegistrationDto);
         return getDataTable(list);
@@ -55,8 +57,7 @@
      * 鑾峰彇浠樻鐧昏璇︾粏淇℃伅
      */
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(paymentRegistrationService.selectPaymentRegistrationById(id));
     }
 
@@ -65,8 +66,7 @@
      */
     @Log(title = "浠樻鐧昏", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody PaymentRegistration paymentRegistration)
-    {
+    public AjaxResult add(@RequestBody PaymentRegistration paymentRegistration) {
         return toAjax(paymentRegistrationService.insertPaymentRegistration(paymentRegistration));
     }
 
@@ -75,8 +75,7 @@
      */
     @Log(title = "浠樻鐧昏", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody PaymentRegistration paymentRegistration)
-    {
+    public AjaxResult edit(@RequestBody PaymentRegistration paymentRegistration) {
         return toAjax(paymentRegistrationService.updatePaymentRegistration(paymentRegistration));
     }
 
@@ -84,9 +83,8 @@
      * 鍒犻櫎浠樻鐧昏
      */
     @Log(title = "浠樻鐧昏", businessType = BusinessType.DELETE)
-	@DeleteMapping("/del")
-    public AjaxResult remove(@RequestBody Long[] ids)
-    {
+    @DeleteMapping("/del")
+    public AjaxResult remove(@RequestBody Long[] ids) {
         return toAjax(paymentRegistrationService.deletePaymentRegistrationByIds(ids));
     }
 
@@ -94,8 +92,7 @@
      * 鑾峰彇浠樻鐧昏璇︾粏淇℃伅
      */
     @GetMapping(value = "/byPurchaseId/{id}")
-    public AjaxResult getPurchaseInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getPurchaseInfo(@PathVariable("id") Long id) {
         return success(paymentRegistrationService.selectPaymentRegistrationByPurchaseId(id));
     }
 
@@ -103,8 +100,53 @@
      * 鑾峰彇浠樻鐧昏璇︾粏淇℃伅
      */
     @GetMapping(value = "/paymentLedgerList")
-    public AjaxResult paymentLedgerList(PaymentLedgerDto paymentLedgerDto)
-    {
-        return success(paymentRegistrationService.selectPaymentLedgerList(paymentLedgerDto));
+    public AjaxResult paymentLedgerList(PaymentLedgerDto paymentLedgerDto, Page page,
+                                        Integer detailPageNum,
+                                        Integer detailPageSize) {
+        IPage<Map<String, Object>> mapIPage = paymentRegistrationService.selectPaymentLedgerList(paymentLedgerDto, page, detailPageNum, detailPageSize);
+        return success(mapIPage);
+    }
+
+    /**
+     * 鑾峰彇鏈湀搴斾粯淇℃伅
+     */
+    @GetMapping(value = "/paymentMonthList")
+    public AjaxResult paymentMonthList() {
+        return success(paymentRegistrationService.paymentMonthList());
+    }
+
+    /**
+     * 鏌ヨ浠樻鐧昏鍒楄〃
+     *
+     * @param paymentRegistrationDto 浠樻鐧昏
+     * @return 浠樻鐧昏闆嗗悎
+     */
+    @GetMapping("/paymentHistoryList")
+    public TableDataInfo paymentHistoryList(PaymentRegistrationDto paymentRegistrationDto) {
+        startPage();
+        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