From 821fc2f632f8b974a2c0fc37630e13c5fbe6086c Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 26 九月 2025 17:26:16 +0800
Subject: [PATCH] 修改bug

---
 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java |   74 ++++++++++++++++++++----------------
 1 files changed, 41 insertions(+), 33 deletions(-)

diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java
index 44f8bc3..8df18cb 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java
@@ -7,31 +7,27 @@
 import com.stylefeng.guns.core.util.SinataUtil;
 import com.stylefeng.guns.core.util.ToolUtil;
 import com.stylefeng.guns.modular.system.model.TEmail;
+import com.stylefeng.guns.modular.system.model.TFeedback;
 import com.stylefeng.guns.modular.system.model.TSystemNotice;
 import com.stylefeng.guns.modular.system.model.TUser;
+import com.stylefeng.guns.modular.system.service.ITFeedbackService;
 import com.stylefeng.guns.modular.system.service.ITSystemNoticeService;
 import com.stylefeng.guns.modular.system.service.ITUserService;
 import com.stylefeng.guns.modular.system.service.TEmailService;
 import com.stylefeng.guns.modular.system.util.EmailUtil;
-import com.stylefeng.guns.modular.system.util.itextpdf.HtmlToPdfUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.stylefeng.guns.core.log.LogObjectHolder;
+import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
-import com.stylefeng.guns.modular.system.model.TFeedback;
-import com.stylefeng.guns.modular.system.service.ITFeedbackService;
+import org.springframework.web.bind.annotation.ResponseBody;
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.util.Date;
 import java.util.Map;
@@ -182,22 +178,45 @@
                 if(ToolUtil.isNotEmpty(userInfo.getEmail())){
                     String path = templatePath +  "user/feedbackResult.html";
                     Document document = Jsoup.parse(new File(path), "UTF-8");
-                    document.getElementById("chinese").remove();
-                    document.getElementById("french").remove();
-                    document.getElementsByTag("title").get(0).text("Feedback Processing Results");
-                    Element english_user = document.getElementById("english_user");
-                    english_user.text("Hello " + userInfo.getNickName() + ",");
-                    Element english_content = document.getElementById("english_content");
-                    english_content.text(remark);
-                    EmailUtil.send(userInfo.getEmail(), "Feedback Processing Results",  document.html());
-
+                    Integer language = userInfo.getLanguage();
+                    if(1 == language){
+                        document.getElementById("english").remove();
+                        document.getElementById("french").remove();
+                        document.getElementsByTag("title").get(0).text("意见反馈处理结果");
+                        Element chinese_user = document.getElementById("chinese_user");
+                        chinese_user.text("您好 " + userInfo.getNickName() + ",");
+                        Element chinese_content = document.getElementById("chinese_content");
+                        chinese_content.text(remark);
+                        EmailUtil.send(userInfo.getEmail(), "意见反馈处理结果",  document.html());
+                    }
+                    if(2 == language){
+                        document.getElementById("chinese").remove();
+                        document.getElementById("french").remove();
+                        document.getElementsByTag("title").get(0).text("Solutions for feedback");
+                        Element english_user = document.getElementById("english_user");
+                        english_user.text("Hello " + userInfo.getNickName() + ",");
+                        Element english_content = document.getElementById("english_content");
+                        english_content.text(remark);
+                        EmailUtil.send(userInfo.getEmail(), "Solutions for feedback",  document.html());
+                    }
+                    if(3 == language){
+                        document.getElementById("chinese").remove();
+                        document.getElementById("english").remove();
+                        document.getElementsByTag("title").get(0).text("Solutions pour avis");
+                        Element french_user = document.getElementById("french_user");
+                        french_user.text("Bonjour " + userInfo.getNickName() + ",");
+                        Element french_content = document.getElementById("french_content");
+                        french_content.text(remark);
+                        EmailUtil.send(userInfo.getEmail(), "Solutions pour avis",  document.html());
+                    }
+                    
                     //开始生成pdf收据和html收据
-                    File file = new File("/usr/local/nginx/html/files/html/");
+                    File file = new File("/data/nginx/html/files/html/");
                     if(!file.exists()){
                         file.mkdirs();
                     }
                     String randomString = ToolUtil.getRandomString(10);
-                    file = new File("/usr/local/nginx/html/files/html/feedbackResult_" + randomString + ".html");
+                    file = new File("/data/nginx/html/files/html/feedbackResult_" + randomString + ".html");
                     if(!file.exists()){
                         file.createNewFile();
                     }
@@ -205,24 +224,13 @@
                     fileWriter.write(document.html());
                     fileWriter.flush();
                     fileWriter.close();
-                    FileInputStream fileInputStream = new FileInputStream(file);
-                    File file1 = new File("/usr/local/nginx/html/files/pdf/");
-                    if(!file1.exists()){
-                        file1.mkdirs();
-                    }
-                    file1 = new File("/usr/local/nginx/html/files/pdf/feedbackResult_" + randomString + ".pdf");
-                    if(!file1.exists()){
-                        file1.createNewFile();
-                    }
-                    FileOutputStream fileOutputStream = new FileOutputStream(file1);
-                    HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream);
 
-                    String link ="http://182.160.16.251:81/files/html/feedbackResult_" + randomString + ".html";
+                    String link ="https://igo.i-go.group/files/html/feedbackResult_" + randomString + ".html";
                     TEmail tEmail = new TEmail();
                     tEmail.setLink(link);
                     tEmail.setUserId(userInfo.getId());
                     tEmail.setType(1);
-                    tEmail.setName("Feedback Processing Results");
+                    tEmail.setName(1 == language ? "意见反馈处理结果" : 2 == language ? "Solutions for feedback" : "Solutions pour avis");
                     tEmail.setCreateTime(new Date());
                     int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1;
                     tEmail.setWeek(EmailUtil.getWeek(2,i));

--
Gitblit v1.7.1