From 37b697351e8e0a9200eee1276c4081c07588dc10 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期二, 17 六月 2025 20:39:48 +0800
Subject: [PATCH] 未回款金额(元)为NaN修复

---
 src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerController.java |   72 +++++++++++++++++++++++++++---------
 1 files changed, 54 insertions(+), 18 deletions(-)

diff --git a/src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerController.java b/src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerController.java
index 1e210f0..8f991e3 100644
--- a/src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerController.java
+++ b/src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerController.java
@@ -1,28 +1,24 @@
 package com.ruoyi.purchase.controller;
 
-import javax.servlet.http.HttpServletResponse;
-
+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.purchase.dto.PurchaseLedgerDto;
-import com.ruoyi.purchase.pojo.PurchaseLedger;
-import com.ruoyi.purchase.service.IPurchaseLedgerService;
-import com.ruoyi.sales.service.ISalesLedgerService;
-import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 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.PurchaseLedgerDto;
+import com.ruoyi.purchase.pojo.PurchaseLedger;
+import com.ruoyi.purchase.service.IPurchaseLedgerService;
+import com.ruoyi.sales.service.ISalesLedgerService;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 閲囪喘鍙拌处Controller
@@ -69,7 +65,7 @@
     }
 
     /**
-     * 鏌ヨ閿�鍞彴璐﹀拰浜у搧鐖跺瓙鍒楄〃
+     * 鏌ヨ閲囪喘鍙拌处鍜屼骇鍝佺埗瀛愬垪琛�
      */
     @GetMapping("/getPurchaseById")
     public PurchaseLedgerDto getPurchaseById(PurchaseLedgerDto purchaseLedgerDto) {
@@ -93,11 +89,36 @@
         return salesLedgerService.getSalesNo();
     }
 
+
+    /**
+     * 鏍规嵁閿�鍞悎鍚屾煡璇骇鍝佷俊鎭�
+     */
+    @GetMapping("/getProductBySalesNo")
+    public AjaxResult getProductBySalesNo(Long id) {
+        return AjaxResult.success(purchaseLedgerService.getProductBySalesNo(id));
+    }
+
+    /**
+     * 鏌ヨ閲囪喘鍚堝悓鍙�
+     */
+    @GetMapping("/getPurchaseNo")
+    public List getPurchasesNo() {
+        return purchaseLedgerService.getPurchasesNo();
+    }
+
+    /**
+     * 鏍规嵁id鏌ヨ閲囪喘鍚堝悓鍙�
+     */
+    @GetMapping("/getPurchaseNoById")
+    public AjaxResult getPurchaseNoById(Long id) {
+        return AjaxResult.success(purchaseLedgerService.getPurchaseNoById(id));
+    }
+
     /**
      * 鏍规嵁閲囪喘鍚堝悓鍙锋煡璇骇鍝�
      */
     @GetMapping("/getProduct")
-    public List getProduct(PurchaseLedgerDto purchaseLedgerDto){
+    public List getProduct(PurchaseLedgerDto purchaseLedgerDto) {
         return purchaseLedgerService.getProduct(purchaseLedgerDto);
     }
 
@@ -105,7 +126,22 @@
      * 鏍规嵁閲囪喘鍚堝悓鍙锋煡璇骇鍝�
      */
     @GetMapping("/getInfo")
-    public PurchaseLedgerDto getInfo(PurchaseLedgerDto purchaseLedgerDto){
-        return purchaseLedgerService.getInfo(purchaseLedgerDto);
+    public AjaxResult getInfo(PurchaseLedgerDto purchaseLedgerDto) {
+        return AjaxResult.success(purchaseLedgerService.getInfo(purchaseLedgerDto));
+    }
+
+    /**
+     * 鏌ヨ閲囪喘鍙拌处鍒楄〃
+     */
+    @GetMapping("/listPage")
+    public IPage<PurchaseLedger> listPage(Page page, PurchaseLedger purchaseLedger) {
+         return purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger);
+    }
+
+    @ApiOperation("鐢熸垚閲囪喘搴忓垪鍙�")
+    @GetMapping("/createPurchaseNo")
+    @Log(title = "鐢熸垚閲囪喘搴忓垪鍙�", businessType = BusinessType.OTHER)
+    public String createPurchaseNo() {
+        return purchaseLedgerService.getPurchaseNo();
     }
 }

--
Gitblit v1.9.3