From fd1efdba56dbf07943b82c971694579af034fc5a Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 03 十一月 2026 20:10:12 +0800
Subject: [PATCH] feat: 新增废料管理并完善合同导出

---
 yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractDocumentRenderer.java |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractDocumentRenderer.java b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractDocumentRenderer.java
index 8b9ef51..cd05bb6 100644
--- a/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractDocumentRenderer.java
+++ b/yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/service/contract/CrmContractDocumentRenderer.java
@@ -78,9 +78,12 @@
             BigDecimal discount = productTotal.subtract(total);
             replace(document, Map.of("customerName", text(contract.getCustomerName()),
                     "contractNo", text(contract.getNo()),
+                    "contractName", text(contract.getName()),
                     "contractDate", contract.getOrderDate() == null ? "____________" : contract.getOrderDate().format(DateTimeFormatter.ofPattern("yyyy骞碝M鏈坉d鏃�")),
+                    "startDate", date(contract.getStartTime()),
+                    "endDate", date(contract.getEndTime()),
                     "totalPrice", money(total), "totalUpper", Convert.digitToChinese(total),
-                    "discountNote", discount.signum() == 0 ? "" : "锛堟槑缁嗗悎璁� " + money(productTotal) + " 鍏冿紝鏁村崟浼樻儬 " + money(discount) + " 鍏冿級"));
+                    "discountNote", discount.signum() == 0 ? "" : "锛堟槑缁嗗悎璁� " + money(productTotal) + " 鍏冿紝涓庡悎鍚岄噾棰濈殑宸 " + money(discount) + " 鍏冿級"));
             if (document.getDocumentElement().getTextContent().contains("${")) throw new IOException("鍚堝悓妯℃澘瀛樺湪鏈~鍐欐Ы浣�");
             var transformerFactory = TransformerFactory.newInstance();
             transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
@@ -103,5 +106,6 @@
     }
 
     private static String money(BigDecimal value) { return value.setScale(2, RoundingMode.HALF_UP).toPlainString(); }
+    private static String date(java.time.LocalDateTime value) { return value == null ? "____________" : value.format(DateTimeFormatter.ofPattern("yyyy骞碝M鏈坉d鏃�")); }
     private static String text(String value) { return value == null ? "" : value; }
 }

--
Gitblit v1.9.3