From 0010b446cb0f747f4995355b468f9a32244e57dc Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期五, 26 十二月 2025 15:47:37 +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