From 3ffbb4756bbddcf101d367fdde3dfc7f7ced6bb6 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期五, 20 三月 2026 11:26:18 +0800
Subject: [PATCH] 新增字段
---
service/src/main/java/com/ruoyi/cwgl/controller/PayableBillManagementController.java | 62 +++++++++++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
diff --git a/service/src/main/java/com/ruoyi/cwgl/controller/PayableBillManagementController.java b/service/src/main/java/com/ruoyi/cwgl/controller/PayableBillManagementController.java
index 2916ee3..0db2612 100644
--- a/service/src/main/java/com/ruoyi/cwgl/controller/PayableBillManagementController.java
+++ b/service/src/main/java/com/ruoyi/cwgl/controller/PayableBillManagementController.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.PayableBillManagement;
+import com.ruoyi.cwgl.domain.PayableInvoiceBusiness;
+import com.ruoyi.cwgl.service.IInvoiceManageService;
import com.ruoyi.cwgl.service.IPayableBillManagementService;
+import com.ruoyi.cwgl.service.IPayableInvoiceBusinessService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -33,6 +40,12 @@
{
@Autowired
private IPayableBillManagementService payableBillManagementService;
+
+ @Autowired
+ private IInvoiceManageService invoiceManageService;
+
+ @Autowired
+ private IPayableInvoiceBusinessService payableInvoiceBusinessService;
@@ -105,4 +118,53 @@
{
return toAjax(payableBillManagementService.deletePayableBillManagementByIds(ids));
}
+
+ /**
+ * 浣滃簾搴斾粯璐﹀崟绠$悊璁板綍
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:payableBillManagement:void')")
+ @Log(title = "搴斾粯璐﹀崟绠$悊", businessType = BusinessType.UPDATE)
+ @PutMapping("/void/{id}")
+ public AjaxResult voidPayableBill(@PathVariable("id") Integer id)
+ {
+ return toAjax(payableBillManagementService.voidPayableBillManagement(id));
+ }
+
+ /**
+ * 搴斾粯璐﹀崟鐢宠寮�绁�
+ * @param invoiceManage 鍙戠エ绠$悊瀵硅薄
+ * @param id 搴斾粯璐﹀崟ID
+ * @return 缁撴灉
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:payableBillManagement:invoice')")
+ @Log(title = "搴斾粯璐﹀崟绠$悊", businessType = BusinessType.OTHER)
+ @PostMapping("/invoice/{id}")
+ public AjaxResult applyPayableInvoice(@RequestBody InvoiceManage invoiceManage, @PathVariable("id") Integer id)
+ {
+ return invoiceManageService.applyPayableInvoice(invoiceManage, id);
+ }
+
+ /**
+ * 鏌ヨ搴斾粯璐﹀崟宸插紑绁ㄩ噾棰�
+ * @param id 搴斾粯璐﹀崟ID
+ * @return 宸插紑绁ㄩ噾棰�
+ */
+ @PreAuthorize("@ss.hasPermi('cwgl:payableBillManagement:query')")
+ @GetMapping("/invoice/amount/{id}")
+ public AjaxResult getPayableInvoicedAmount(@PathVariable("id") Integer id)
+ {
+ // 鏌ヨpayable_invoice_business琛ㄤ腑status涓�1鐨勮褰�
+ PayableInvoiceBusiness query = new PayableInvoiceBusiness();
+ query.setHeadId(id);
+ query.setStatus(1);
+ List<PayableInvoiceBusiness> invoices = payableInvoiceBusinessService.selectPayableInvoiceBusinessList(query);
+
+ // 璁$畻宸插紑绁ㄩ噾棰�
+ BigDecimal invoicedAmount = invoices.stream()
+ .map(PayableInvoiceBusiness::getInvoicingAmount)
+ .filter(Objects::nonNull)
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
+
+ return AjaxResult.success(invoicedAmount);
+ }
}
--
Gitblit v1.8.0