From 1223edea2f56e5c3c0e36ea844c12ef55908e3c2 Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期五, 09 五月 2025 17:33:34 +0800
Subject: [PATCH] 回款登记功能开发

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

diff --git a/src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerController.java b/src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerController.java
new file mode 100644
index 0000000..7f0fb01
--- /dev/null
+++ b/src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerController.java
@@ -0,0 +1,73 @@
+package com.ruoyi.purchase.controller;
+
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.purchase.pojo.PurchaseLedger;
+import com.ruoyi.purchase.service.IPurchaseLedgerService;
+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 java.util.List;
+
+/**
+ * 閲囪喘鍙拌处Controller
+ * 
+ * @author ruoyi
+ * @date 2025-05-09
+ */
+@RestController
+@RequestMapping("/system/ledger")
+@AllArgsConstructor
+public class PurchaseLedgerController extends BaseController {
+    private IPurchaseLedgerService purchaseLedgerService;
+
+    /**
+     * 鏌ヨ閲囪喘鍙拌处鍒楄〃
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(PurchaseLedger purchaseLedger) {
+        startPage();
+        List<PurchaseLedger> list = purchaseLedgerService.selectPurchaseLedgerList(purchaseLedger);
+        return getDataTable(list);
+    }
+
+    /**
+     * 瀵煎嚭閲囪喘鍙拌处鍒楄〃
+     */
+    @Log(title = "閲囪喘鍙拌处", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PurchaseLedger purchaseLedger) {
+        List<PurchaseLedger> list = purchaseLedgerService.selectPurchaseLedgerList(purchaseLedger);
+        ExcelUtil<PurchaseLedger> util = new ExcelUtil<PurchaseLedger>(PurchaseLedger.class);
+        util.exportExcel(response, list, "銆愯濉啓鍔熻兘鍚嶇О銆戞暟鎹�");
+    }
+
+    /**
+     * 鏂板淇敼閲囪喘鍙拌处
+     */
+    @Log(title = "閲囪喘鍙拌处", businessType = BusinessType.INSERT)
+    @PostMapping ("/addOrEditPurchase")
+    public AjaxResult addOrEditPurchase(@RequestBody PurchaseLedger purchaseLedger) {
+        return toAjax(purchaseLedgerService.addOrEditPurchase(purchaseLedger));
+    }
+
+    /**
+     * 鍒犻櫎閲囪喘鍙拌处
+     */
+    @Log(title = "閲囪喘鍙拌处", businessType = BusinessType.DELETE)
+	@DeleteMapping("/delPurchase")
+    public AjaxResult remove(@RequestBody Long[] ids) {
+        return toAjax(purchaseLedgerService.deletePurchaseLedgerByIds(ids));
+    }
+}

--
Gitblit v1.9.3