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 |   75 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java b/src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java
index 650dbaa..a798d18 100644
--- a/src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java
+++ b/src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java
@@ -1,22 +1,30 @@
 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
@@ -25,12 +33,17 @@
     @Autowired
     private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper;
 
+    @Autowired
+    private InvoiceLedgerFileMapper invoiceLedgerFileMapper;
+
     /**
      * 寮�绁ㄥ彴璐︽柊澧�
      * @param productDto
      * @return
      */
     @PostMapping("/saveOrUpdate")
+    @ApiOperation("寮�绁ㄥ彴璐︽柊澧�")
+    @Log(title = "寮�绁ㄥ彴璐︽柊澧�", businessType = BusinessType.UPDATE)
     public AjaxResult invoiceLedgerSaveOrUpdate(@RequestBody InvoiceRegistrationProductDto productDto) {
         invoiceLedgerService.invoiceLedgerSaveOrUpdate(productDto);
         return AjaxResult.success();
@@ -42,6 +55,8 @@
      * @return
      */
     @DeleteMapping("/del")
+    @ApiOperation("寮�绁ㄥ彴璐﹀垹闄�")
+    @Log(title = "寮�绁ㄥ彴璐﹀垹闄�", businessType = BusinessType.DELETE)
     public AjaxResult invoiceLedgerDel(@RequestBody List<Integer> ids) {
         invoiceLedgerService.invoiceLedgerDel(ids);
         return AjaxResult.success();
@@ -54,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));
     }
@@ -64,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();
+    }
+
+
 
     /**
      * 寮�绁ㄥ彴璐︽枃浠朵笂浼�
@@ -74,6 +107,8 @@
      * @return
      */
     @PostMapping("/uploadFile")
+    @ApiOperation("寮�绁ㄥ彴璐︽枃浠朵笂浼�")
+    @Log(title = "寮�绁ㄥ彴璐︽枃浠朵笂浼�", businessType = BusinessType.OTHER)
     public AjaxResult invoiceLedgerUploadFile(MultipartFile file) {
         try {
             return AjaxResult.success(invoiceLedgerService.invoiceLedgerUploadFile(file));
@@ -85,12 +120,14 @@
     /**
      * 寮�绁ㄥ彴璐﹀鍑�
      * @param response
-     * @param invoiceLedgerDto
+     * @param invoiceRegistrationProductDto
      * @return
      */
     @PostMapping("/export")
-    public void invoiceLedgerExport(HttpServletResponse response, InvoiceLedgerDto invoiceLedgerDto) {
-        invoiceLedgerService.invoiceLedgerExport(response, invoiceLedgerDto);
+    @ApiOperation("寮�绁ㄥ彴璐﹀鍑�")
+    @Log(title = "寮�绁ㄥ彴璐﹀鍑�", businessType = BusinessType.EXPORT)
+    public void invoiceLedgerExport(HttpServletResponse response, InvoiceRegistrationProductDto invoiceRegistrationProductDto) {
+        invoiceLedgerService.invoiceLedgerExport(response, invoiceRegistrationProductDto);
     }
 
     /**
@@ -99,6 +136,8 @@
      * @return
      */
     @GetMapping("/info")
+    @ApiOperation("寮�绁ㄥ彴璐﹁鎯�")
+    @Log(title = "寮�绁ㄥ彴璐﹁鎯�", businessType = BusinessType.OTHER)
     public AjaxResult invoiceLedgerInfo(Integer id) {
         return AjaxResult.success(invoiceLedgerService.invoiceLedgerDetail(id));
     }
@@ -109,6 +148,8 @@
      * @return
      */
     @PostMapping("/commitFile")
+    @ApiOperation("鏂囦欢鎻愪氦")
+    @Log(title = "鏂囦欢鎻愪氦", businessType = BusinessType.OTHER)
     public AjaxResult invoiceLedgerCommitFile(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
         try {
             invoiceLedgerService.invoiceLedgerCommitFile(invoiceLedgerDto);
@@ -124,6 +165,8 @@
      * @return
      */
     @GetMapping("/list")
+    @ApiOperation("寮�绁ㄥ彴璐︽煡璇�")
+    @Log(title = "寮�绁ㄥ彴璐︽煡璇�", businessType = BusinessType.OTHER)
     public AjaxResult invoiceLedgerList(InvoiceLedgerDto invoiceLedgerDto) {
         return AjaxResult.success(invoiceLedgerService.invoiceLedgerList(invoiceLedgerDto));
     }
@@ -135,6 +178,8 @@
      * @return
      */
     @GetMapping("/salesAccount")
+    @ApiOperation("瀹㈡埛閿�鍞褰�")
+    @Log(title = "瀹㈡埛閿�鍞褰�", businessType = BusinessType.OTHER)
     public AjaxResult invoiceLedgerSalesAccount(Page page, InvoiceLedgerDto invoiceLedgerDto) {
         return AjaxResult.success(invoiceLedgerService.invoiceLedgerSalesAccount(page,invoiceLedgerDto));
     }
@@ -143,6 +188,8 @@
      * 鏈湀寮�绁ㄩ噾棰�
      */
     @GetMapping("/getInvoiceAmount")
+    @ApiOperation("鏈湀寮�绁ㄩ噾棰�")
+    @Log(title = "鏈湀寮�绁ㄩ噾棰�", businessType = BusinessType.OTHER)
     public AjaxResult getInvoiceAmount() {
         try {
             BigDecimal amount = invoiceLedgerService.getInvoiceAmount();
@@ -159,7 +206,10 @@
      * @return
      */
     @GetMapping("/registrationProductPage")
+    @ApiOperation("浜у搧寮�绁ㄨ褰曟煡璇�")
+    @Log(title = "浜у搧寮�绁ㄨ褰曟煡璇�", businessType = BusinessType.OTHER)
     public AjaxResult registrationProductPage(Page page, InvoiceRegistrationProductDto registrationProductDto) {
+
         return AjaxResult.success(invoiceLedgerService.registrationProductPage(page,registrationProductDto));
     }
 
@@ -169,8 +219,27 @@
      * @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