| | |
| | | package com.stylefeng.guns.modular.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | 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.TReportLoss; |
| | | import com.stylefeng.guns.modular.system.model.TUser; |
| | | import com.stylefeng.guns.modular.system.service.ITReportLossService; |
| | | 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.TReportLoss; |
| | | import com.stylefeng.guns.modular.system.service.ITReportLossService; |
| | | 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; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | tReportLoss.setDisposeInfo(info); |
| | | tReportLoss.setStatus(2); |
| | | tReportLoss.setHandleTime(new Date()); |
| | | tReportLoss.setHandleUserId(ShiroKit.getUser().getObjectId()); |
| | | tReportLoss.setHandleUserId(ShiroKit.getUser().getId()); |
| | | boolean b = tReportLossService.updateById(tReportLoss); |
| | | if(b){ |
| | | try { |
| | |
| | | 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."); |
| | | document.getElementsByTag("title").get(0).text("Solutions pour signaler les objets perdus"); |
| | | 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()); |
| | | EmailUtil.send(userInfo.getEmail(), "Solutions pour signaler les objets perdus", document.html()); |
| | | } |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/home/igotechgh/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("/home/igotechgh/nginx/html/files/html/reportLossResult_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/reportLossResult_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "物品报失处理结果" : language == 2 ? "Solutions for reporting lost items" : "Soumis avec succès, veuillez attendre notre réponse"); |
| | | tEmail.setName(language == 1 ? "物品报失处理结果" : language == 2 ? "Solutions for reporting lost items" : "Solutions pour signaler les objets perdus"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(2,i)); |