From 80c2d96df6745cd0286b4d037f9e6049944486e5 Mon Sep 17 00:00:00 2001
From: zhibing.pu <393733352@qq.com>
Date: 星期二, 27 八月 2024 14:34:08 +0800
Subject: [PATCH] 修改bug

---
 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java    |   12 ++--
 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java     |    2 
 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java            |   43 +++++++++++---
 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TReportLossController.java                  |   41 ++++++++++---
 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java |   15 -----
 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java           |   42 +++++++++++---
 6 files changed, 105 insertions(+), 50 deletions(-)

diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TReportLossController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TReportLossController.java
index fcc31e6..c444f44 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TReportLossController.java
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TReportLossController.java
@@ -161,16 +161,39 @@
             try {
                 TUser userInfo = userService.selectById(tReportLoss.getUserId());
                 if(ToolUtil.isNotEmpty(userInfo.getEmail())){
+                    Integer language = userInfo.getLanguage();
                     String path = templatePath +  "user/reportLossResult.html";
                     Document document = Jsoup.parse(new File(path), "UTF-8");
-                    document.getElementById("chinese").remove();
-                    document.getElementById("french").remove();
-                    document.getElementsByTag("title").get(0).text("Notification of the result of the loss report");
-                    Element english_user = document.getElementById("english_user");
-                    english_user.text("Hello " + userInfo.getNickName() + ",");
-                    Element english_content = document.getElementById("english_content");
-                    english_content.text(info);
-                    EmailUtil.send(userInfo.getEmail(), "Notification of the result of the loss report",  document.html());
+                    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(info);
+                        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 reporting lost items");
+                        Element english_user = document.getElementById("english_user");
+                        english_user.text("Hello " + userInfo.getNickName() + ",");
+                        Element english_content = document.getElementById("english_content");
+                        english_content.text(info);
+                        EmailUtil.send(userInfo.getEmail(), "Solutions for reporting lost items",  document.html());
+                    }
+                    if(3 == language){
+                        document.getElementById("chinese").remove();
+                        document.getElementById("english").remove();
+                        document.getElementsByTag("title").get(0).text("Soumis avec succès, veuillez attendre notre réponse.");
+                        Element french_user = document.getElementById("french_user");
+                        french_user.text("Bonjour " + userInfo.getNickName() + ",");
+                        Element french_content = document.getElementById("french_content");
+                        french_content.text(info);
+                        EmailUtil.send(userInfo.getEmail(), "Soumis avec succès, veuillez attendre notre réponse.",  document.html());
+                    }
 
                     //开始生成pdf收据和html收据
                     File file = new File("/usr/local/nginx/html/files/html/");
@@ -192,7 +215,7 @@
                     tEmail.setLink(link);
                     tEmail.setUserId(userInfo.getId());
                     tEmail.setType(1);
-                    tEmail.setName("Notification of the result of the loss report");
+                    tEmail.setName(language == 1 ? "物品报失处理结果" : language == 2 ? "Solutions for reporting lost items" : "Soumis avec succès, veuillez attendre notre réponse");
                     tEmail.setCreateTime(new Date());
                     int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1;
                     tEmail.setWeek(EmailUtil.getWeek(2,i));
diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java
index 07470ca..3008ffb 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java
@@ -152,14 +152,38 @@
                 if(ToolUtil.isNotEmpty(tUser.getEmail())){
                     String path = templatePath +  "user/complaintResult.html";
                     Document document = Jsoup.parse(new File(path), "UTF-8");
-                    document.getElementById("chinese").remove();
-                    document.getElementById("french").remove();
-                    document.getElementsByTag("title").get(0).text("Solutions for complaints");
-                    Element english_user = document.getElementById("english_user");
-                    english_user.text("Hello " + tUser.getNickName() + ",");
-                    Element english_content = document.getElementById("english_content");
-                    english_content.text(handleResult);
-                    EmailUtil.send(tUser.getEmail(), "Solutions for complaints",  document.html());
+                    Integer language = tUser.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("您好 " + tUser.getNickName() + ",");
+                        Element chinese_content = document.getElementById("chinese_content");
+                        chinese_content.text(handleResult);
+                        EmailUtil.send(tUser.getEmail(), "投诉反馈处理结果",  document.html());
+                    }
+                    if(2 == language){
+                        document.getElementById("chinese").remove();
+                        document.getElementById("french").remove();
+                        document.getElementsByTag("title").get(0).text("Solutions for complaints");
+                        Element english_user = document.getElementById("english_user");
+                        english_user.text("Hello " + tUser.getNickName() + ",");
+                        Element english_content = document.getElementById("english_content");
+                        english_content.text(handleResult);
+                        EmailUtil.send(tUser.getEmail(), "Solutions for complaints",  document.html());
+                    }
+                    if(3 == language){
+                        document.getElementById("chinese").remove();
+                        document.getElementById("english").remove();
+                        document.getElementsByTag("title").get(0).text("Solutions pour plaintes");
+                        Element french_user = document.getElementById("french_user");
+                        french_user.text("Bonjour " + tUser.getNickName() + ",");
+                        Element french_content = document.getElementById("french_content");
+                        french_content.text(handleResult);
+                        EmailUtil.send(tUser.getEmail(), "Solutions pour plaintes",  document.html());
+                    }
+                    
                     //开始生成pdf收据和html收据
                     File file = new File("/usr/local/nginx/html/files/html/");
                     if(!file.exists()){
@@ -180,7 +204,7 @@
                     tEmail.setLink(link);
                     tEmail.setUserId(tUser.getId());
                     tEmail.setType(1);
-                    tEmail.setName("Solutions for complaints");
+                    tEmail.setName(1 == language ? "投诉反馈处理结果" : 2 == language ? "Solutions for complaints" : "Solutions pour plaintes");
                     tEmail.setCreateTime(new Date());
                     int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1;
                     tEmail.setWeek(EmailUtil.getWeek(2,i));
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 6859a15..97936dd 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
@@ -182,15 +182,38 @@
                 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("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(), "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/");
                     if(!file.exists()){
@@ -211,7 +234,7 @@
                     tEmail.setLink(link);
                     tEmail.setUserId(userInfo.getId());
                     tEmail.setType(1);
-                    tEmail.setName("Solutions for feedback");
+                    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));
diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java
index 4b72592..7a051e4 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java
@@ -171,11 +171,6 @@
     @RequestMapping(value = "/add")
     @ResponseBody
     public Object add(TServerCarmodel tServerCarmodel,@RequestParam Integer isPrivateCar) {
-        int count = tServerCarmodelService.selectCount(new EntityWrapper<TServerCarmodel>().eq("type", 1)
-                .eq("name", tServerCarmodel.getName()).last(" and not FIND_IN_SET(state,'3')"));
-        if (count > 0){
-            return new ErrorTip(500, "【"+tServerCarmodel.getName()+"】已存在,请重新输入");
-        }
         tServerCarmodel.setInsertTime(new Date());
         tServerCarmodel.setState(1);
         tServerCarmodel.setType(isPrivateCar);
@@ -205,11 +200,6 @@
     @RequestMapping(value = "/addAcrossCity")
     @ResponseBody
     public Object addAcrossCity(TServerCarmodel tServerCarmodel) {
-        int count = tServerCarmodelService.selectCount(new EntityWrapper<TServerCarmodel>().eq("type", 2)
-                .eq("name", tServerCarmodel.getName()).last(" and not FIND_IN_SET(state,'3')"));
-        if (count > 0){
-            return new ErrorTip(500, "【"+tServerCarmodel.getName()+"】已存在,请重新输入");
-        }
         tServerCarmodel.setInsertTime(new Date());
         tServerCarmodel.setState(1);
         tServerCarmodel.setType(2);
@@ -239,11 +229,6 @@
     @RequestMapping(value = "/addCharter")
     @ResponseBody
     public Object addCharter(TServerCarmodel tServerCarmodel) {
-        int count = tServerCarmodelService.selectCount(new EntityWrapper<TServerCarmodel>().eq("type", 3)
-                .eq("name", tServerCarmodel.getName()).last(" and not FIND_IN_SET(state,'3')"));
-        if (count > 0){
-            return new ErrorTip(500, "【"+tServerCarmodel.getName()+"】已存在,请重新输入");
-        }
         tServerCarmodel.setInsertTime(new Date());
         tServerCarmodel.setState(1);
         tServerCarmodel.setType(3);
diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java
index 17abe1c..a85f1dd 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java
@@ -227,7 +227,7 @@
                 .last(" and not FIND_IN_SET(state,'3')"));
         if (count > 0){
             TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId());
-            return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择");
+            return new ErrorTip(500, "【"+one.getChineseName()+"】已存在,请重新选择");
         }
         tSystemPrice.setCompanyId(ShiroKit.getUser().getObjectId());
         tSystemPrice.setType(1);
@@ -247,7 +247,7 @@
                 .last(" and not FIND_IN_SET(state,'3')"));
         if (count > 0){
             TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId());
-            return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择");
+            return new ErrorTip(500, "【"+one.getChineseName()+"】已存在,请重新选择");
         }
         tSystemPrice.setCompanyId(ShiroKit.getUser().getObjectId());
         tSystemPrice.setType(4);
@@ -263,7 +263,7 @@
     @ResponseBody
     public Object update(TSystemPrice tSystemPrice) {
         TSystemPrice obj = tSystemPriceService.selectById(tSystemPrice.getId());
-        if (obj.getServerCarModelId() != tSystemPrice.getServerCarModelId()){
+        if (obj.getServerCarModelId().compareTo(tSystemPrice.getServerCarModelId()) != 0){
             //判断当前公司是否添加过该专车车型价格配置
             int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>()
                     .eq("type", 1)
@@ -272,7 +272,7 @@
                     .last(" and not FIND_IN_SET(state,'3')"));
             if (count > 0){
                 TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId());
-                return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择");
+                return new ErrorTip(500, "【"+one.getChineseName()+"】已存在,请重新选择");
             }
         }
         tSystemPriceService.updateById(tSystemPrice);
@@ -283,7 +283,7 @@
     @ResponseBody
     public Object smallupdate(TSystemPrice tSystemPrice) {
         TSystemPrice obj = tSystemPriceService.selectById(tSystemPrice.getId());
-        if (obj.getServerCarModelId() != tSystemPrice.getServerCarModelId()){
+        if (obj.getServerCarModelId().compareTo(tSystemPrice.getServerCarModelId()) != 0){
             //判断当前公司是否添加过该专车车型价格配置
             int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>()
                     .eq("isPackage", 1)
@@ -292,7 +292,7 @@
                     .last(" and not FIND_IN_SET(state,'3')"));
             if (count > 0){
                 TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId());
-                return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择");
+                return new ErrorTip(500, "【"+one.getChineseName()+"】已存在,请重新选择");
             }
         }
         tSystemPriceService.updateById(tSystemPrice);
diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java
index 9a744f8..922f959 100644
--- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java
+++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java
@@ -327,6 +327,7 @@
 
             for (TUser user : tUsers) {
                 if(ToolUtil.isNotEmpty(user.getEmail())){
+                    Integer language = user.getLanguage();
                     for (String key : strings) {
                         Double aDouble = map.get(key);
                         String path1 = templatePath +  "user/discount.html";
@@ -340,7 +341,6 @@
                         english_ride.text("Discount for I-GO " + key);
                         Element english_discount = document1.getElementById("english_discount");
                         english_discount.text(" Enjoy " + new BigDecimal((100 - aDouble)).setScale(2, RoundingMode.HALF_EVEN).doubleValue() + "% off your trip fare.");
-                        
                         EmailUtil.send(user.getEmail(), "Discount activities",  document1.html());
                         //开始生成pdf收据和html收据
                         File file = new File("/usr/local/nginx/html/files/html/");

--
Gitblit v1.7.1