From ac4bf3bccb266666a60fd0addb73bce125d43758 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期四, 06 三月 2025 19:15:26 +0800
Subject: [PATCH] bug修改

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java |   54 +++++++++++++++++++++++++++---------------------------
 1 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
index e38938d..344fc69 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
@@ -291,46 +291,46 @@
 
             THouse tHouse = houseService.getById(contract.getHouseId());
             Map<String, Object> templateParam = new HashMap<>(5);
-            templateParam.put("partyOneName", contract.getPartyOneName());
-            templateParam.put("partyTwoName", contract.getPartyTwoName());
-            templateParam.put("houseAddress", tHouse.getHouseAddress());
-            templateParam.put("houseArea", tHouse.getHouseArea()+"m²");
+            templateParam.put("${partyOneName}", contract.getPartyOneName());
+            templateParam.put("${partyTwoName}", contract.getPartyTwoName());
+            templateParam.put("${houseAddress}", tHouse.getHouseAddress());
+            templateParam.put("${houseArea}", tHouse.getHouseArea()+"m²");
             long between = ChronoUnit.DAYS.between(contract.getStartTime(), contract.getStartPayTime())+1;
-            templateParam.put("day", between);
-            templateParam.put("endTimeFree", DateUtils.localDateTimeToStringYear(contract.getStartPayTime().plusDays(1)));
-            templateParam.put("startPayTime", DateUtils.localDateTimeToStringYear(contract.getStartPayTime()));
-            templateParam.put("startTime", DateUtils.localDateTimeToStringYear(contract.getStartTime()));
-            templateParam.put("endTime", DateUtils.localDateTimeToStringYear(contract.getEndTime()));
-            templateParam.put("monthRent", "¥¥"+contract.getMonthRent()+"元");
-            templateParam.put("monthRentString", "人民币"+NumberToChineseUtils.numberToChinese(contract.getMonthRent().setScale(2, BigDecimal.ROUND_DOWN).doubleValue()));
+            templateParam.put("${day}", between);
+            templateParam.put("${endTimeFree}", DateUtils.localDateTimeToStringYear(contract.getStartPayTime().plusDays(1)));
+            templateParam.put("${startPayTime}", DateUtils.localDateTimeToStringYear(contract.getStartPayTime()));
+            templateParam.put("${startTime}", DateUtils.localDateTimeToStringYear(contract.getStartTime()));
+            templateParam.put("${endTime}", DateUtils.localDateTimeToStringYear(contract.getEndTime()));
+            templateParam.put("${monthRent}", "¥"+contract.getMonthRent()+"元");
+            templateParam.put("${monthRentString}", "人民币"+NumberToChineseUtils.numberToChinese(contract.getMonthRent().setScale(2, BigDecimal.ROUND_DOWN).doubleValue()));
             String totalYear = Objects.nonNull(contract.getTotalYear())?contract.getTotalYear().toString():"";
-            templateParam.put("totalYear", "¥¥"+totalYear+"元");
+            templateParam.put("${totalYear}", "¥"+totalYear+"元");
             String totalYearString = StringUtils.isNotEmpty(totalYear)?NumberToChineseUtils.numberToChinese(contract.getTotalYear().setScale(2, BigDecimal.ROUND_DOWN).doubleValue()):"";
-            templateParam.put("totalYearString", "人民币"+totalYearString);
-            templateParam.put("payType", contract.getPayType().equals("1")?"月":contract.getPayType().equals("2")?"季":"年");
+            templateParam.put("${totalYearString}", "人民币"+totalYearString);
+            templateParam.put("${payType}", contract.getPayType().equals("1")?"月":contract.getPayType().equals("2")?"季":"年");
             if(firstBill!=null){
-                templateParam.put("firstRent", "¥"+(firstBill.getPayableFeesMoney())+"元");
+                templateParam.put("${firstRent}", "¥"+(firstBill.getPayableFeesMoney())+"元");
             }else{
-                templateParam.put("firstRent", "");
+                templateParam.put("${firstRent}", "");
 
             }
-            templateParam.put("firstRentString", "人民币"+NumberToChineseUtils.numberToChinese((contract.getPayType().equals("1")?contract.getMonthRent():contract.getPayType().equals("2")?contract.getMonthRent().multiply(new BigDecimal("3")):contract.getMonthRent().multiply(new BigDecimal("12")).setScale(2,BigDecimal.ROUND_DOWN)).doubleValue()));
-            templateParam.put("nextPayTime", contract.getPayType().equals("1")?"月":contract.getPayType().equals("2")?"季":"年");
-            templateParam.put("deposit", "¥"+contract.getDeposit()+"元");
-            templateParam.put("depositString", NumberToChineseUtils.numberToChinese(contract.getDeposit().setScale(2, BigDecimal.ROUND_DOWN).doubleValue()));
-            templateParam.put("partyOnePerson", contract.getPartyOnePerson());
-            templateParam.put("partyOnePhone", contract.getPartyOnePhone());
-            templateParam.put("partyTwoPerson", contract.getPartyTwoPerson());
-            templateParam.put("partyTwoPhone", contract.getPartyTwoPhone());
+            templateParam.put("${firstRentString}", "人民币"+NumberToChineseUtils.numberToChinese((contract.getPayType().equals("1")?contract.getMonthRent():contract.getPayType().equals("2")?contract.getMonthRent().multiply(new BigDecimal("3")):contract.getMonthRent().multiply(new BigDecimal("12")).setScale(2,BigDecimal.ROUND_DOWN)).doubleValue()));
+            templateParam.put("${nextPayTime}", contract.getPayType().equals("1")?"月":contract.getPayType().equals("2")?"季":"年");
+            templateParam.put("${deposit}", "¥"+contract.getDeposit()+"元");
+            templateParam.put("${depositString}", NumberToChineseUtils.numberToChinese(contract.getDeposit().setScale(2, BigDecimal.ROUND_DOWN).doubleValue()));
+            templateParam.put("${partyOnePerson}", contract.getPartyOnePerson());
+            templateParam.put("${partyOnePhone}", contract.getPartyOnePhone());
+            templateParam.put("${partyTwoPerson}", contract.getPartyTwoPerson());
+            templateParam.put("${partyTwoPhone}", contract.getPartyTwoPhone());
             // 验收时间
             TCheckAcceptRecord tCheckAcceptRecord = checkAcceptRecordService.lambdaQuery().eq(TCheckAcceptRecord::getContractId, contract.getId()).last("limit 1").one();
             if (tCheckAcceptRecord!=null &&tCheckAcceptRecord.getCheckTime()!=null ){
-                templateParam.put("checkTime", DateUtils.localDateTimeToStringYear(tCheckAcceptRecord.getCheckTime()));
+                templateParam.put("${checkTime}", DateUtils.localDateTimeToStringYear(tCheckAcceptRecord.getCheckTime()));
             }else{
-                templateParam.put("checkTime", "");
+                templateParam.put("${checkTime}", "");
 
             }
-            String url = wordUtil.generatePdf("/template", "1_yzj_租赁合同.xml", templateParam, "租赁合同", "E:\\");
+            String url = wordUtil.generatePdf("/usr/local/project/file/", "1_yzj_租赁合同.docx", templateParam, "租赁合同", "/usr/local/project/file/");
             res.add(url);
         }
 

--
Gitblit v1.7.1