| | |
| | | import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper; |
| | | import com.stylefeng.guns.modular.system.model.Feedback; |
| | | import com.stylefeng.guns.modular.system.model.SensitiveWords; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.IFeedbackService; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.EmailUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | 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.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Value("${spring.mail.template-path}") |
| | | private String templatePath; |
| | | |
| | | |
| | | |
| | |
| | | feedback.setUserId(uid); |
| | | this.insert(feedback); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | if(ToolUtil.isNotEmpty(userInfo.getEmail())){ |
| | | String path = templatePath + "user/feedback.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | if(1 == language){ |
| | | document.getElementById("english").attr("style", "display: none;"); |
| | | document.getElementById("french").attr("style", "display: none;"); |
| | | Element user_chinese = document.getElementById("user_chinese"); |
| | | user_chinese.text("您好 " + userInfo.getNickName() + ","); |
| | | } |
| | | if(2 == language){ |
| | | document.getElementById("chinese").attr("style", "display: none;"); |
| | | document.getElementById("french").attr("style", "display: none;"); |
| | | Element user_english = document.getElementById("user_english"); |
| | | user_english.text("Hello " + userInfo.getNickName() + ","); |
| | | } |
| | | if(3 == language){ |
| | | document.getElementById("chinese").attr("style", "display: none;"); |
| | | document.getElementById("english").attr("style", "display: none;"); |
| | | Element user_french = document.getElementById("user_french"); |
| | | user_french.text("Bonjour " + userInfo.getNickName() + ","); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "反馈意见" : language == 2 ? "Feedback" : "Retour", document.html()); |
| | | } |
| | | |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您的反馈已提交成功,我们会尽快处理!" : language == 2 ? "Your feedback has been submitted successfully, we will deal with it as soon as possible" |
| | | : "Vos commentaires ont été soumis avec succès, nous les traiterons dès que possible", uid, 1); |
| | | return ResultUtil.success(); |