From 7d0c8a812777393ac2eefe40cbe3fa8b857e9b1f Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期一, 19 一月 2026 16:18:27 +0800
Subject: [PATCH] 新增前后端
---
service/src/main/java/com/ruoyi/cwgl/controller/InvoiceManageController.java | 70 +++++-----------------------------
1 files changed, 11 insertions(+), 59 deletions(-)
diff --git a/service/src/main/java/com/ruoyi/cwgl/controller/InvoiceManageController.java b/service/src/main/java/com/ruoyi/cwgl/controller/InvoiceManageController.java
index 09019d8..664059c 100644
--- a/service/src/main/java/com/ruoyi/cwgl/controller/InvoiceManageController.java
+++ b/service/src/main/java/com/ruoyi/cwgl/controller/InvoiceManageController.java
@@ -1,6 +1,9 @@
package com.ruoyi.cwgl.controller;
import java.util.List;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.cwgl.domain.InvoiceBillDetail;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -97,24 +100,16 @@
* 鐢宠寮�绁�
*/
@PreAuthorize("@ss.hasPermi('cwgl:invoiceManage:apply')")
- @Log(title = "鍙戠エ绠$悊", businessType = BusinessType.UPDATE)
- @PostMapping("/apply")
- public AjaxResult applyInvoice(@RequestBody InvoiceManage invoiceManage)
+ @Log(title = "鐢宠寮�绁�", businessType = BusinessType.UPDATE)
+ @PostMapping("/apply/{id}")
+ public AjaxResult applyInvoice(@PathVariable("id") Integer id)
{
- try {
- // 璋冪敤鏈嶅姟灞傛柟娉曞鐞嗙敵璇峰紑绁ㄩ�昏緫
- int result = invoiceManageService.updateInvoiceManage(invoiceManage);
+
+
+ return invoiceManageService.applyInvoice(id);
- if (result > 0) {
- // 璁板綍鐢宠寮�绁ㄦ棩蹇�
- recordApplyInvoiceLog(invoiceManage);
- return AjaxResult.success("鐢宠寮�绁ㄦ垚鍔�");
- } else {
- return AjaxResult.error("鐢宠寮�绁ㄥけ璐�");
- }
- } catch (Exception e) {
- return AjaxResult.error("鐢宠寮�绁ㄥ紓甯革細" + e.getMessage());
- }
+
+
}
/**
@@ -139,47 +134,4 @@
return toAjax(invoiceManageService.deleteInvoiceManageByIds(ids));
}
- /**
- * 璁板綍鐢宠寮�绁ㄦ棩蹇�
- *
- * @param invoiceManage 鍙戠エ绠$悊瀵硅薄
- */
- private void recordApplyInvoiceLog(InvoiceManage invoiceManage)
- {
- try {
- InvoiceManageLog log = new InvoiceManageLog();
- log.setInvoiceManageId(invoiceManage.getId());
- log.setOperator(getUsername());
- log.setOperationTime(new java.util.Date());
-
- // 鏋勫缓鎿嶄綔鎻忚堪锛屽寘鍚紑绁ㄩ噾棰濄�佸叧鑱旇处鍗曠紪鍙峰拰瀵瑰簲寮�绁ㄩ噾棰�
- StringBuilder descBuilder = new StringBuilder();
- descBuilder.append("鐢宠寮�绁�: ");
-
- if (invoiceManage.getInvoiceAmount() != null) {
- descBuilder.append("寮�绁ㄩ噾棰�=").append(invoiceManage.getInvoiceAmount()).append("; ");
- }
-
- // 鑾峰彇鍏宠仈璐﹀崟淇℃伅
- if (invoiceManage.getInvoiceDetailList() != null && !invoiceManage.getInvoiceDetailList().isEmpty()) {
- descBuilder.append("鍏宠仈璐﹀崟淇℃伅: ");
- for (com.ruoyi.cwgl.domain.InvoiceDetail detail : invoiceManage.getInvoiceDetailList()) {
- if (detail.getReceivableBillNo() != null) {
- descBuilder.append("璐﹀崟缂栧彿=").append(detail.getReceivableBillNo());
- }
- if (detail.getCurrentBilledAmount() != null) {
- descBuilder.append(", 鏈寮�绁ㄩ噾棰�=").append(detail.getCurrentBilledAmount());
- }
- descBuilder.append("; ");
- }
- }
-
- log.setOperationDesc(descBuilder.toString());
- log.setCreateTime(new java.util.Date());
-
- invoiceManageLogService.insertInvoiceManageLog(log);
- } catch (Exception e) {
- logger.error("璁板綍鐢宠寮�绁ㄦ棩蹇楀け璐�: {}", e.getMessage());
- }
- }
}
--
Gitblit v1.8.0