| | |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.FileWriter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public void saveData(Integer driverId, String reason, String description, Integer uid, Integer language) throws Exception { |
| | | public void saveData(Integer orderId, Integer orderType, Integer driverId, String reason, String description, Integer uid, Integer language) throws Exception { |
| | | if(ToolUtil.isNotEmpty(description)){ |
| | | description = description.toLowerCase(); |
| | | List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null); |
| | | for(SensitiveWords s : sensitiveWords){ |
| | | description = description.replaceAll(s.getContent(), "***"); |
| | | for(SensitiveWords s : sensitiveWords) { |
| | | description = description.replaceAll(s.getContent().toLowerCase(), "***"); |
| | | } |
| | | } |
| | | Complaint complaint = new Complaint(); |
| | | complaint.setInsertTime(new Date()); |
| | | complaint.setDriverId(driverId); |
| | | complaint.setReason(reason); |
| | | complaint.setOrderId(orderId); |
| | | complaint.setOrderType(orderType); |
| | | complaint.setDescription(description); |
| | | complaint.setUserId(uid); |
| | | complaint.setIsHandle(0); |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "投诉司机" : language == 2 ? "Complain against driver" : "Porter plainte contre le chauffeur", 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/complain_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/complain_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/complain_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/complain_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |