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 | 122 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 116 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java b/src/main/java/com/ruoyi/sales/controller/InvoiceLedgerController.java
index 99a3ea2..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("/saveOrUpdate")
- public AjaxResult invoiceLedgerSaveOrUpdate(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
- invoiceLedgerService.invoiceLedgerSaveOrUpdate(invoiceLedgerDto);
+ @ApiOperation("寮�绁ㄥ彴璐︽柊澧�")
+ @Log(title = "寮�绁ㄥ彴璐︽柊澧�", businessType = BusinessType.UPDATE)
+ public AjaxResult invoiceLedgerSaveOrUpdate(@RequestBody InvoiceRegistrationProductDto productDto) {
+ invoiceLedgerService.invoiceLedgerSaveOrUpdate(productDto);
return AjaxResult.success();
}
@@ -35,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();
@@ -47,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));
}
@@ -57,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();
+ }
+
+
/**
* 寮�绁ㄥ彴璐︽枃浠朵笂浼�
@@ -67,6 +107,8 @@
* @return
*/
@PostMapping("/uploadFile")
+ @ApiOperation("寮�绁ㄥ彴璐︽枃浠朵笂浼�")
+ @Log(title = "寮�绁ㄥ彴璐︽枃浠朵笂浼�", businessType = BusinessType.OTHER)
public AjaxResult invoiceLedgerUploadFile(MultipartFile file) {
try {
return AjaxResult.success(invoiceLedgerService.invoiceLedgerUploadFile(file));
@@ -78,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);
}
/**
@@ -92,6 +136,8 @@
* @return
*/
@GetMapping("/info")
+ @ApiOperation("寮�绁ㄥ彴璐﹁鎯�")
+ @Log(title = "寮�绁ㄥ彴璐﹁鎯�", businessType = BusinessType.OTHER)
public AjaxResult invoiceLedgerInfo(Integer id) {
return AjaxResult.success(invoiceLedgerService.invoiceLedgerDetail(id));
}
@@ -102,6 +148,8 @@
* @return
*/
@PostMapping("/commitFile")
+ @ApiOperation("鏂囦欢鎻愪氦")
+ @Log(title = "鏂囦欢鎻愪氦", businessType = BusinessType.OTHER)
public AjaxResult invoiceLedgerCommitFile(@RequestBody InvoiceLedgerDto invoiceLedgerDto) {
try {
invoiceLedgerService.invoiceLedgerCommitFile(invoiceLedgerDto);
@@ -117,6 +165,8 @@
* @return
*/
@GetMapping("/list")
+ @ApiOperation("寮�绁ㄥ彴璐︽煡璇�")
+ @Log(title = "寮�绁ㄥ彴璐︽煡璇�", businessType = BusinessType.OTHER)
public AjaxResult invoiceLedgerList(InvoiceLedgerDto invoiceLedgerDto) {
return AjaxResult.success(invoiceLedgerService.invoiceLedgerList(invoiceLedgerDto));
}
@@ -128,8 +178,68 @@
* @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