| | |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.FileWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | |
| | | return ResultUtil.error(language == 1 ? "反馈内容过长" : language == 2 ? "Feedback-content is overlong." : "Le contenu de l’avis est trop long."); |
| | | } |
| | | List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null); |
| | | List<String> list = Arrays.asList(content.split(" ")); |
| | | for(SensitiveWords s : sensitiveWords){ |
| | | content = content.replaceAll(s.getContent(), "***"); |
| | | List<String> str = new ArrayList<>(); |
| | | String lowerCase = s.getContent().toLowerCase(); |
| | | for (String s1 : list) { |
| | | if(lowerCase.equals(s1.toLowerCase())){ |
| | | str.add("***"); |
| | | }else{ |
| | | str.add(s1); |
| | | } |
| | | } |
| | | list = str; |
| | | } |
| | | content = list.stream().collect(Collectors.joining(" ")); |
| | | } |
| | | |
| | | Feedback feedback = new Feedback(); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "反馈意见" : language == 2 ? "Feedback" : "Avis", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/feedback_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/feedback_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/feedback_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/feedback_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |