From 7865c2a70e8cf9d0f44e66131bdc98bcea089c7c Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期一, 02 二月 2026 15:23:00 +0800
Subject: [PATCH] 新增日志

---
 service/src/main/java/com/ruoyi/cwgl/controller/ReceivableFeeManagementController.java |   64 +++++++++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 1 deletions(-)

diff --git a/service/src/main/java/com/ruoyi/cwgl/controller/ReceivableFeeManagementController.java b/service/src/main/java/com/ruoyi/cwgl/controller/ReceivableFeeManagementController.java
index 4af3ce9..3ed912c 100644
--- a/service/src/main/java/com/ruoyi/cwgl/controller/ReceivableFeeManagementController.java
+++ b/service/src/main/java/com/ruoyi/cwgl/controller/ReceivableFeeManagementController.java
@@ -1,6 +1,9 @@
 package com.ruoyi.cwgl.controller;
 
+import java.util.ArrayList;
 import java.util.List;
+
+import com.ruoyi.cwgl.domain.ReceivableFeeDetail;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -11,6 +14,7 @@
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 import com.ruoyi.common.utils.file.DownloadExportUtil;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
@@ -129,4 +133,62 @@
 
         return toAjax(receivableFeeManagementService.createReceivableBill(billCreateVo));
     }
-}
+    
+    /**
+     * 浣滃簾搴旀敹璐圭敤绠$悊璁板綍
+     */
+    @PreAuthorize("@ss.hasPermi('cwgl:receivableFeeManagement:void')")
+    @Log(title = "搴旀敹璐圭敤绠$悊", businessType = BusinessType.UPDATE)
+    @PutMapping("/void/{id}")
+    public AjaxResult voidReceivableFee(@PathVariable Integer id)
+    {
+        return toAjax(receivableFeeManagementService.voidReceivableFeeManagement(id));
+    }
+
+    /**
+     * 瀵煎叆搴旀敹璐圭敤绠$悊鏁版嵁锛堟敮鎸佸Sheet锛歋heet1涓昏〃锛孲heet2鏄庣粏琛級
+     */
+    @Log(title = "搴旀敹璐圭敤绠$悊", businessType = BusinessType.IMPORT)
+    @PreAuthorize("@ss.hasPermi('cwgl:receivableFeeManagement:import')")
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        // 瀵煎叆涓昏〃鏁版嵁锛圫heet1锛�
+        ExcelUtil<ReceivableFeeManagement> mainUtil = new ExcelUtil<ReceivableFeeManagement>(ReceivableFeeManagement.class);
+        List<ReceivableFeeManagement> receivableFeeList = mainUtil.importExcel("搴旀敹璐圭敤涓昏〃", file.getInputStream(),10000);
+        
+        // 瀵煎叆鏄庣粏琛ㄦ暟鎹紙Sheet2锛夊苟鍏宠仈鍒颁富琛�
+        ExcelUtil<ReceivableFeeDetail> detailUtil = new ExcelUtil<ReceivableFeeDetail>(ReceivableFeeDetail.class);
+        List<ReceivableFeeDetail> detailList = detailUtil.importExcel("搴旀敹璐圭敤鏄庣粏", file.getInputStream(),10000);
+        
+        // 灏嗘槑缁嗘暟鎹叧鑱斿埌瀵瑰簲鐨勪富琛ㄨ褰�
+        if (detailList != null && !detailList.isEmpty()) {
+            for (ReceivableFeeDetail detail : detailList) {
+                // 鏍规嵁搴忓彿瀛楁鎵惧埌瀵瑰簲鐨勪富琛ㄨ褰�
+                for (ReceivableFeeManagement mainRecord : receivableFeeList) {
+                    if (mainRecord.getSerialNumber() != null && 
+                        mainRecord.getSerialNumber().equals(detail.getSerialNumber())) {
+                        if (mainRecord.getReceivableFeeDetailList() == null) {
+                            mainRecord.setReceivableFeeDetailList(new ArrayList<>());
+                        }
+                        mainRecord.getReceivableFeeDetailList().add(detail);
+                        break;
+                    }
+                }
+            }
+        }
+        
+        String message = receivableFeeManagementService.importReceivableFee(receivableFeeList, getUsername());
+        return success(message);
+    }
+
+    /**
+     * 涓嬭浇瀵煎叆妯℃澘
+     */
+    @GetMapping("/importTemplate")
+    public AjaxResult importTemplate(String exportKey)
+    {
+        receivableFeeManagementService.importTemplate(exportKey);
+        return AjaxResult.success("瀵煎嚭璇锋眰鎴愬姛锛岃绋嶅悗鐐瑰嚮涓嬭浇...!");
+    }
+}
\ No newline at end of file

--
Gitblit v1.8.0