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/ReceiptPaymentController.java |   91 ++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 85 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java b/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
index 50bf83b..1e851ed 100644
--- a/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
+++ b/src/main/java/com/ruoyi/sales/controller/ReceiptPaymentController.java
@@ -1,18 +1,33 @@
 package com.ruoyi.sales.controller;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.utils.bean.BeanUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+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.InvoicePurchaseDto;
+import com.ruoyi.sales.dto.InvoiceLedgerDto;
 import com.ruoyi.sales.dto.ReceiptPaymentDto;
+import com.ruoyi.sales.dto.ReceiptPaymentRecordDto;
+import com.ruoyi.sales.dto.SalesLedgerDto;
 import com.ruoyi.sales.pojo.ReceiptPayment;
+import com.ruoyi.sales.pojo.SalesLedger;
 import com.ruoyi.sales.service.ReceiptPaymentService;
+import io.swagger.annotations.ApiModelProperty;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
+import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/receiptPayment")
@@ -27,7 +42,8 @@
      * @return
      */
     @PostMapping("/saveOrUpdate")
-    public AjaxResult receiptPaymentSaveOrUpdate (@RequestBody ReceiptPayment receiptPayment) {
+    @Log(title = "鏂板鍥炴鐧昏", businessType = BusinessType.INSERT)
+    public AjaxResult receiptPaymentSaveOrUpdate (@RequestBody List<ReceiptPayment> receiptPayment) {
         receiptPaymentService.receiptPaymentSaveOrUpdate(receiptPayment);
         return AjaxResult.success();
     }
@@ -38,6 +54,8 @@
      * @return
      */
     @PostMapping("/update")
+    @Log(title = "淇敼鍥炴鐧昏", businessType = BusinessType.UPDATE)
+    @Transactional(rollbackFor = Exception.class)
     public AjaxResult receiptPaymentUpdate (@RequestBody ReceiptPayment receiptPayment) {
         return AjaxResult.success(receiptPaymentService.receiptPaymentUpdate(receiptPayment));
     }
@@ -48,19 +66,21 @@
      * @return
      */
     @DeleteMapping("/del")
+    @Log(title = "鍒犻櫎鍥炴鐧昏", businessType = BusinessType.DELETE)
+    @Transactional(rollbackFor = Exception.class)
     public AjaxResult receiptPaymentDel (@RequestBody List<Integer> ids) {
         return AjaxResult.success(receiptPaymentService.receiptPaymentDel(ids));
     }
 
     /**
-     * 鍥炴鐧昏鍒嗛〉鏌ヨ
-     * @param page
+     * 瀹㈡埛寰�鏉ヨ褰曟煡璇�
      * @param receiptPaymentDto
      * @return
      */
-    @GetMapping("/listPage")
-    public AjaxResult receiptPaymentListPage (Page page, ReceiptPaymentDto receiptPaymentDto) {
-        return AjaxResult.success(receiptPaymentService.receiptPaymentListPage(page,receiptPaymentDto));
+    @GetMapping("/customerInteractions")
+    @Log(title = "鏌ヨ瀹㈡埛寰�鏉ヨ褰�", businessType = BusinessType.OTHER)
+    public AjaxResult customerInteractions (InvoiceLedgerDto receiptPaymentDto) {
+        return AjaxResult.success(receiptPaymentService.customerInteractions(receiptPaymentDto));
     }
 
     /**
@@ -69,6 +89,7 @@
      * @return
      */
     @GetMapping("/info")
+    @Log(title = "鏌ヨ鍥炴鐧昏璇︽儏", businessType = BusinessType.OTHER)
     public AjaxResult receiptPaymentInfo (Integer id) {
         return AjaxResult.success(receiptPaymentService.receiptPaymentInfo(id));
     }
@@ -77,6 +98,7 @@
      * 鏈湀鍥炴閲戦
      */
     @GetMapping("/getReceiptAmount")
+    @Log(title = "鏌ヨ鏈湀鍥炴閲戦", businessType = BusinessType.OTHER)
     public AjaxResult getReceiptAmount() {
         try {
             BigDecimal receiptAmount = receiptPaymentService.getReceiptAmount();
@@ -93,9 +115,26 @@
      * @return
      */
     @GetMapping("/bindInvoiceNoRegPage")
+    @Log(title = "鏌ヨ宸茬粡缁戝畾鍙戠エ鐨勫紑绁ㄥ彴璐�", businessType = BusinessType.OTHER)
     public AjaxResult bindInvoiceNoRegPage(Page page, ReceiptPaymentDto receiptPaymentDto) {
         return AjaxResult.success(receiptPaymentService.bindInvoiceNoRegPage(page,receiptPaymentDto));
     }
+
+    @ApiModelProperty("瀵煎嚭鍥炴鐧昏")
+    @PostMapping("/export")
+    @Log(title = "瀵煎嚭鍥炴鐧昏", businessType = BusinessType.EXPORT)
+    public void export(HttpServletResponse response, String ids) {
+        if (ids == null || ids.isEmpty()) {
+            receiptPaymentService.exportPaymentList(response, null);
+        } else {
+            ArrayList<Long> idList = (ArrayList<Long>) Arrays.stream(ids.split(","))
+                    .map(s -> s.replaceAll("[\\[\\]]", "").trim())
+                    .map(Long::valueOf)
+                    .collect(Collectors.toList());
+            receiptPaymentService.exportPaymentList(response, idList);
+        }
+    }
+
 
     /**
      * 寮�绁ㄥ彴璐﹁鎯�
@@ -103,6 +142,7 @@
      * @return
      */
     @GetMapping("/invoiceInfo")
+    @Log(title = "鏌ヨ寮�绁ㄥ彴璐﹁鎯�", businessType = BusinessType.OTHER)
     public AjaxResult invoiceInfo (Integer id) {
         return AjaxResult.success(receiptPaymentService.invoiceInfo(id));
     }
@@ -111,6 +151,7 @@
      * 鏈湀搴旀敹,鍥炴閲戦
      */
     @GetMapping("/getAmountMouth")
+    @Log(title = "鏌ヨ鏈湀搴旀敹,鍥炴閲戦", businessType = BusinessType.OTHER)
     public AjaxResult getAmountMouth() {
         return  AjaxResult.success(receiptPaymentService.getAmountMouth());
     }
@@ -118,10 +159,48 @@
     /**
      * 鏌ヨ鍥炴璁板綍
      */
+    @Log(title = "鏌ヨ鍥炴璁板綍", businessType = BusinessType.OTHER)
     @GetMapping("/receiptPaymentHistoryList")
     public TableDataInfo receiptPaymentHistoryList(ReceiptPaymentDto receiptPaymentDto) {
         startPage();
         List<ReceiptPaymentDto> list = receiptPaymentService.receiptPaymentHistoryList(receiptPaymentDto);
         return getDataTable(list);
     }
+
+    /**
+     * 鏌ヨ鍥炴璁板綍
+     */
+    @GetMapping("/receiptPaymentHistoryListPage")
+    @Log(title = "鏌ヨ鍥炴璁板綍", businessType = BusinessType.OTHER)
+    public IPage<ReceiptPaymentDto> receiptPaymentHistoryListPage(Page page, ReceiptPaymentDto receiptPaymentDto) {
+        return receiptPaymentService.receiptPaymentHistoryListPage(page,receiptPaymentDto);
+    }
+
+    /**
+     * 瀵煎嚭鍥炴娴佹按鍒楄〃
+     */
+    @Log(title = "瀵煎嚭鍥炴娴佹按鍒楄〃", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportOne")
+    public void exportOne(HttpServletResponse response, ReceiptPaymentDto salesLedgerDto) {
+        Page page = new Page();
+        page.setCurrent(-1);
+        page.setSize(-1);
+        IPage<ReceiptPaymentDto> salesLedgerIPage = receiptPaymentHistoryListPage(page, salesLedgerDto);
+        ExcelUtil<ReceiptPaymentRecordDto> util = new ExcelUtil<ReceiptPaymentRecordDto>(ReceiptPaymentRecordDto.class);
+        List<ReceiptPaymentRecordDto> receiptPaymentRecordDtos = new ArrayList<>();
+        salesLedgerIPage.getRecords().forEach(receiptPaymentRecordDto -> {
+            ReceiptPaymentRecordDto receiptPaymentRecordDto1 = new ReceiptPaymentRecordDto();
+            BeanUtils.copyProperties(receiptPaymentRecordDto, receiptPaymentRecordDto1);
+            receiptPaymentRecordDtos.add(receiptPaymentRecordDto1);
+        });
+        util.exportExcel(response, receiptPaymentRecordDtos, "瀵煎嚭寮�绁ㄧ櫥璁板垪琛�");
+    }
+
+    /**
+     * 鏌ヨ鍥炴璁板綍涓嶅垎椤�
+     */
+    @GetMapping("/receiptPaymentHistoryListNoPage")
+    public List<ReceiptPaymentDto> receiptPaymentHistoryListNoPage(ReceiptPaymentDto receiptPaymentDto) {
+        return receiptPaymentService.receiptPaymentHistoryListNoPage(receiptPaymentDto);
+    }
 }

--
Gitblit v1.9.3