From fdaee3c82a8009abbac5920c79b006a7a092d3fc Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期四, 29 一月 2026 10:28:30 +0800
Subject: [PATCH] 新增申请开票代码
---
service/src/main/java/com/ruoyi/cwgl/controller/ReceivableBillManagementController.java | 62 +++++++++++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
diff --git a/service/src/main/java/com/ruoyi/cwgl/controller/ReceivableBillManagementController.java b/service/src/main/java/com/ruoyi/cwgl/controller/ReceivableBillManagementController.java
index 61dc87c..4cf492f 100644
--- a/service/src/main/java/com/ruoyi/cwgl/controller/ReceivableBillManagementController.java
+++ b/service/src/main/java/com/ruoyi/cwgl/controller/ReceivableBillManagementController.java
@@ -16,8 +16,15 @@
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Objects;
+import com.ruoyi.cwgl.domain.InvoiceManage;
import com.ruoyi.cwgl.domain.ReceivableBillManagement;
+import com.ruoyi.cwgl.domain.ReceivableInvoiceBusiness;
+import com.ruoyi.cwgl.service.IInvoiceManageService;
import com.ruoyi.cwgl.service.IReceivableBillManagementService;
+import com.ruoyi.cwgl.service.IReceivableInvoiceBusinessService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -33,6 +40,12 @@
{
@Autowired
private IReceivableBillManagementService receivableBillManagementService;
+
+ @Autowired
+ private IInvoiceManageService invoiceManageService;
+
+ @Autowired
+ private IReceivableInvoiceBusinessService receivableInvoiceBusinessService;
@@ -105,4 +118,53 @@
{
return toAjax(receivableBillManagementService.deleteReceivableBillManagementByIds(ids));
}
+
+ /**
+ * 浣滃簾搴旀敹璐﹀崟绠$悊璁板綍
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:receivableBillManagement:void')")
+ @Log(title = "搴旀敹璐﹀崟绠$悊", businessType = BusinessType.UPDATE)
+ @PutMapping("/void/{id}")
+ public AjaxResult voidReceivableBill(@PathVariable("id") Integer id)
+ {
+ return toAjax(receivableBillManagementService.voidReceivableBillManagement(id));
+ }
+
+ /**
+ * 搴旀敹璐﹀崟鐢宠寮�绁�
+ * @param invoiceManage 鍙戠エ绠$悊瀵硅薄
+ * @param id 搴旀敹璐﹀崟ID
+ * @return 缁撴灉
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:receivableBillManagement:invoice')")
+ @Log(title = "搴旀敹璐﹀崟绠$悊", businessType = BusinessType.OTHER)
+ @PostMapping("/invoice/{id}")
+ public AjaxResult applyReceivableInvoice(@RequestBody InvoiceManage invoiceManage, @PathVariable("id") Integer id)
+ {
+ return invoiceManageService.applyReceivableInvoice(invoiceManage, id);
+ }
+
+ /**
+ * 鏌ヨ搴旀敹璐﹀崟宸插紑绁ㄩ噾棰�
+ * @param id 搴旀敹璐﹀崟ID
+ * @return 宸插紑绁ㄩ噾棰�
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:receivableBillManagement:query')")
+ @GetMapping("/invoice/amount/{id}")
+ public AjaxResult getReceivableInvoicedAmount(@PathVariable("id") Integer id)
+ {
+ // 鏌ヨreceivable_invoice_business琛ㄤ腑status涓�1鐨勮褰�
+ ReceivableInvoiceBusiness query = new ReceivableInvoiceBusiness();
+ query.setHeadId(id);
+ query.setStatus(1);
+ List<ReceivableInvoiceBusiness> invoices = receivableInvoiceBusinessService.selectReceivableInvoiceBusinessList(query);
+
+ // 璁$畻宸插紑绁ㄩ噾棰�
+ BigDecimal invoicedAmount = invoices.stream()
+ .map(ReceivableInvoiceBusiness::getInvoicingAmount)
+ .filter(Objects::nonNull)
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
+
+ return AjaxResult.success(invoicedAmount);
+ }
}
--
Gitblit v1.8.0