From d2038a623e02c2d7bb6b95a908832c0432adf2f0 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 21 五月 2026 13:46:21 +0800
Subject: [PATCH] 增加日志

---
 src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java |  185 +++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 165 insertions(+), 20 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java b/src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java
index 6fd4449..a798d18 100644
--- a/src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java
+++ b/src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java
@@ -1,31 +1,51 @@
 package com.ruoyi.sales.controller;
 
 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.domain.AjaxResult;
 import com.ruoyi.sales.dto.InvoiceLedgerDto;
+import com.ruoyi.sales.dto.InvoiceRegistrationProductDto;
+import com.ruoyi.sales.mapper.InvoiceLedgerFileMapper;
+import com.ruoyi.sales.mapper.InvoiceRegistrationProductMapper;
+import com.ruoyi.sales.pojo.InvoiceRegistrationProduct;
 import com.ruoyi.sales.service.InvoiceLedgerService;
+import io.jsonwebtoken.lang.Collections;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
 import java.util.List;
 
 @RestController
 @RequestMapping("/invoiceLedger")
+@Api(tags = "寮�绁ㄥ彴璐︾鐞�")
 public class InvoiceLedgerController {
 
     @Autowired
     private InvoiceLedgerService invoiceLedgerService;
 
+    @Autowired
+    private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper;
+
+    @Autowired
+    private InvoiceLedgerFileMapper invoiceLedgerFileMapper;
+
     /**
      * 寮�绁ㄥ彴璐︽柊澧�
-     * @param invoiceLedgerDto
+     * @param productDto
      * @return
      */
-    @PostMapping("/add")
-    public AjaxResult invoiceLedgerAdd(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
-        invoiceLedgerService.invoiceLedgerAdd(invoiceLedgerDto);
+    @PostMapping("/saveOrUpdate")
+    @ApiOperation("寮�绁ㄥ彴璐︽柊澧�")
+    @Log(title = "寮�绁ㄥ彴璐︽柊澧�", businessType = BusinessType.UPDATE)
+    public AjaxResult invoiceLedgerSaveOrUpdate(@RequestBody InvoiceRegistrationProductDto productDto) {
+        invoiceLedgerService.invoiceLedgerSaveOrUpdate(productDto);
         return AjaxResult.success();
     }
 
@@ -35,19 +55,10 @@
      * @return
      */
     @DeleteMapping("/del")
-    public AjaxResult invoiceLedgerDel(@RequestParam List<Integer> ids) {
+    @ApiOperation("寮�绁ㄥ彴璐﹀垹闄�")
+    @Log(title = "寮�绁ㄥ彴璐﹀垹闄�", businessType = BusinessType.DELETE)
+    public AjaxResult invoiceLedgerDel(@RequestBody List<Integer> ids) {
         invoiceLedgerService.invoiceLedgerDel(ids);
-        return AjaxResult.success();
-    }
-
-    /**
-     * 寮�绁ㄥ彴璐︿慨鏀�
-     * @param invoiceLedgerDto
-     * @return
-     */
-    @PostMapping("/update")
-    public AjaxResult invoiceLedgerUpdate(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
-        invoiceLedgerService.invoiceLedgerUpdate(invoiceLedgerDto);
         return AjaxResult.success();
     }
 
@@ -58,6 +69,8 @@
      * @return
      */
     @GetMapping("/page")
+    @ApiOperation("寮�绁ㄥ彴璐﹀垎椤垫煡璇�")
+    @Log(title = "寮�绁ㄥ彴璐﹀垎椤垫煡璇�", businessType = BusinessType.OTHER)
     public AjaxResult invoiceLedgerPage(Page page, InvoiceLedgerDto invoiceLedgerDto) {
         return AjaxResult.success(invoiceLedgerService.invoiceLedgerPage(page, invoiceLedgerDto));
     }
@@ -68,9 +81,25 @@
      * @return
      */
     @GetMapping("/fileList")
+    @ApiOperation("寮�绁ㄥ彴璐︽枃浠舵煡璇�")
+    @Log(title = "寮�绁ㄥ彴璐︽枃浠舵煡璇�", businessType = BusinessType.OTHER)
     public AjaxResult invoiceLedgerFileList(Integer invoiceLedgerId) {
         return AjaxResult.success(invoiceLedgerService.invoiceLedgerFileList(invoiceLedgerId));
     }
+
+    /**
+     * 寮�绁ㄥ彴璐︽枃浠跺垹闄�
+     */
+    @DeleteMapping("/delFile")
+    @ApiOperation("寮�绁ㄥ彴璐︽枃浠跺垹闄�")
+    @Log(title = "寮�绁ㄥ彴璐�", businessType = BusinessType.DELETE)
+    public AjaxResult invoiceLedgerDelFile(@RequestBody List<Integer> ids) {
+        if(Collections.isEmpty(ids)) return AjaxResult.error("璇烽�夋嫨瑕佸垹闄ょ殑鏂囦欢");
+        invoiceLedgerFileMapper.deleteBatchIds(ids);
+        return AjaxResult.success();
+    }
+
+
 
     /**
      * 寮�绁ㄥ彴璐︽枃浠朵笂浼�
@@ -78,6 +107,8 @@
      * @return
      */
     @PostMapping("/uploadFile")
+    @ApiOperation("寮�绁ㄥ彴璐︽枃浠朵笂浼�")
+    @Log(title = "寮�绁ㄥ彴璐︽枃浠朵笂浼�", businessType = BusinessType.OTHER)
     public AjaxResult invoiceLedgerUploadFile(MultipartFile file) {
         try {
             return AjaxResult.success(invoiceLedgerService.invoiceLedgerUploadFile(file));
@@ -87,14 +118,128 @@
     }
 
     /**
-     * 闄勪欢涓嬭浇
+     * 寮�绁ㄥ彴璐﹀鍑�
      * @param response
+     * @param invoiceRegistrationProductDto
+     * @return
+     */
+    @PostMapping("/export")
+    @ApiOperation("寮�绁ㄥ彴璐﹀鍑�")
+    @Log(title = "寮�绁ㄥ彴璐﹀鍑�", businessType = BusinessType.EXPORT)
+    public void invoiceLedgerExport(HttpServletResponse response, InvoiceRegistrationProductDto invoiceRegistrationProductDto) {
+        invoiceLedgerService.invoiceLedgerExport(response, invoiceRegistrationProductDto);
+    }
+
+    /**
+     * 寮�绁ㄥ彴璐﹁鎯�
+     * @param id
+     * @return
+     */
+    @GetMapping("/info")
+    @ApiOperation("寮�绁ㄥ彴璐﹁鎯�")
+    @Log(title = "寮�绁ㄥ彴璐﹁鎯�", businessType = BusinessType.OTHER)
+    public AjaxResult invoiceLedgerInfo(Integer id) {
+        return AjaxResult.success(invoiceLedgerService.invoiceLedgerDetail(id));
+    }
+
+    /**
+     * 鏂囦欢鎻愪氦
      * @param invoiceLedgerDto
      * @return
      */
-    @GetMapping("/downloadFile")
-    public void invoiceLedgerDownloadFile(HttpServletResponse response, InvoiceLedgerDto invoiceLedgerDto) {
-        invoiceLedgerService.invoiceLedgerDownload(response, invoiceLedgerDto);
+    @PostMapping("/commitFile")
+    @ApiOperation("鏂囦欢鎻愪氦")
+    @Log(title = "鏂囦欢鎻愪氦", businessType = BusinessType.OTHER)
+    public AjaxResult invoiceLedgerCommitFile(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
+        try {
+            invoiceLedgerService.invoiceLedgerCommitFile(invoiceLedgerDto);
+            return AjaxResult.success();
+        }catch (Exception e) {
+            return AjaxResult.error(e.getMessage());
+        }
+    }
+
+    /**
+     * 寮�绁ㄥ彴璐︽煡璇�
+     * @param invoiceLedgerDto
+     * @return
+     */
+    @GetMapping("/list")
+    @ApiOperation("寮�绁ㄥ彴璐︽煡璇�")
+    @Log(title = "寮�绁ㄥ彴璐︽煡璇�", businessType = BusinessType.OTHER)
+    public AjaxResult invoiceLedgerList(InvoiceLedgerDto invoiceLedgerDto) {
+        return AjaxResult.success(invoiceLedgerService.invoiceLedgerList(invoiceLedgerDto));
+    }
+
+    /**
+     * 瀹㈡埛閿�鍞褰�
+     * @param page
+     * @param invoiceLedgerDto
+     * @return
+     */
+    @GetMapping("/salesAccount")
+    @ApiOperation("瀹㈡埛閿�鍞褰�")
+    @Log(title = "瀹㈡埛閿�鍞褰�", businessType = BusinessType.OTHER)
+    public AjaxResult invoiceLedgerSalesAccount(Page page, InvoiceLedgerDto invoiceLedgerDto) {
+        return AjaxResult.success(invoiceLedgerService.invoiceLedgerSalesAccount(page,invoiceLedgerDto));
+    }
+
+    /**
+     * 鏈湀寮�绁ㄩ噾棰�
+     */
+    @GetMapping("/getInvoiceAmount")
+    @ApiOperation("鏈湀寮�绁ㄩ噾棰�")
+    @Log(title = "鏈湀寮�绁ㄩ噾棰�", businessType = BusinessType.OTHER)
+    public AjaxResult getInvoiceAmount() {
+        try {
+            BigDecimal amount = invoiceLedgerService.getInvoiceAmount();
+            return AjaxResult.success(amount != null ? amount : BigDecimal.ZERO);
+        } catch (Exception e) {
+            return AjaxResult.error("鑾峰彇寮�绁ㄩ噾棰濆け璐ワ細" + e.getMessage());
+        }
+    }
+
+    /**
+     * 浜у搧寮�绁ㄨ褰曟煡璇�
+     * @param page
+     * @param registrationProductDto
+     * @return
+     */
+    @GetMapping("/registrationProductPage")
+    @ApiOperation("浜у搧寮�绁ㄨ褰曟煡璇�")
+    @Log(title = "浜у搧寮�绁ㄨ褰曟煡璇�", businessType = BusinessType.OTHER)
+    public AjaxResult registrationProductPage(Page page, InvoiceRegistrationProductDto registrationProductDto) {
+
+        return AjaxResult.success(invoiceLedgerService.registrationProductPage(page,registrationProductDto));
+    }
+
+    /**
+     * 浜у搧寮�绁ㄨ鎯�
+     * @param id
+     * @return
+     */
+    @GetMapping("/invoiceLedgerProductInfo")
+    @ApiOperation("浜у搧寮�绁ㄨ鎯�")
+    @Log(title = "浜у搧寮�绁ㄨ鎯�", businessType = BusinessType.OTHER)
+    public AjaxResult invoiceLedgerProductDetail(Integer id) {
+        return AjaxResult.success(invoiceLedgerService.invoiceLedgerProductDetail(id));
+    }
+
+    /**
+     * 寮�绁ㄥ彴璐﹀垹闄�
+     * @param invoiceRegistrationProductId
+     * @return
+     */
+    @DeleteMapping("delInvoiceLedger/{invoiceRegistrationProductId}")
+    @ApiOperation("寮�绁ㄥ彴璐﹀垹闄�")
+    @Log(title = "寮�绁ㄥ彴璐﹀垹闄�", businessType = BusinessType.DELETE)
+    public AjaxResult delInvoiceLedger(@PathVariable Integer invoiceRegistrationProductId) {
+        try {
+            invoiceLedgerService.delInvoiceLedger(invoiceRegistrationProductId);
+            return AjaxResult.success();
+        }catch (Exception e) {
+            return AjaxResult.error(e.getMessage());
+        }
     }
 
 }

--
Gitblit v1.9.3