| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.Tingg.TinggPayUtil; |
| | | import com.stylefeng.guns.modular.system.util.Tingg.model.CheckoutRequest; |
| | | import com.stylefeng.guns.modular.system.util.itextpdf.HtmlToPdfUtils; |
| | | import com.stylefeng.guns.modular.system.warpper.LoginWarpper; |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | | import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.FileWriter; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | |
| | | private String salt = "&a.s"; |
| | | |
| | | @Autowired |
| | | private SMSUtil smsUtil; |
| | | |
| | | @Autowired |
| | | private TEmailService emailService; |
| | | |
| | | |
| | | /** |
| | | * 获取短信验证码 |
| | |
| | | sb.append((int) (random.nextDouble() * 10)); |
| | | } |
| | | String authCode = sb.toString(); |
| | | String sms = "短信验证码【" + authCode + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"; |
| | | String sms = ""; |
| | | |
| | | //发送验证码短信 |
| | | redisUtil.setStrValue(phone, authCode, 5 * 60);//设置五分钟过期 |
| | | String templateId = ""; |
| | | switch (language){ |
| | | case 1: |
| | | templateId = "b793ae3d41a049059197bfe92cf8bc83"; |
| | | sms = "您的验证码为:" + authCode + ",该验证码5分钟内有效,请勿泄漏于他人!"; |
| | | break; |
| | | case 2: |
| | | templateId = "058c7d11ce594d668841cceb49fb5c9a"; |
| | | sms = "Your verification code is: " + authCode + ", the verification code is valid within 5 minutes, do not leak to others!"; |
| | | break; |
| | | case 3: |
| | | templateId = "4edbe604da6546808ffda582085b3c83"; |
| | | sms = "Votre code de vérification est: " + authCode + ". Ce code est valide pendant 5 minutes. Ne le divulguez pas aux autres!"; |
| | | break; |
| | | } |
| | | SMSUtil.send_huawei_sms(templateId, "+" + phone, "[\"" + authCode + "\"]"); |
| | | System.out.println(sms); |
| | | smsUtil.sendCellulantMessage(phone, sms); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | user_french.text("Bonjour " + userInfo.getNickName() + ","); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Successful registration" : "Inscription réussie", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/registration_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/registration_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "注册成功" : language == 2 ? "Successful registration" : "Inscription réussie"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(language,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"AM":"Dans la matinée"); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"PM":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | |
| | | } |
| | | |
| | | this.addCoupon(userInfo, language);//添加优惠券 |
| | |
| | | user2_content.text("Vous avez invité avec succès un utilisateur à s’inscrire à i-go pour recevoir une récompense GHS " + bigDecimal.doubleValue() + ". Veuillez vérifier"); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "邀请奖励" : language == 2 ? "invitation bonus" : "prime d'invitation", document1.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document1.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/invitation_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/invitation_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "邀请奖励" : language == 2 ? "invitation bonus" : "prime d'invitation"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(language,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"AM":"Dans la matinée"); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"PM":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | } |
| | | |
| | | if(type == 1){//用户分享 |
| | | UserInfo userInfo1 = userInfoMapper.selectById(uid); |
| | | List<Map<String, Object>> query = userActivityInviteMapper.query(userInfo1.getCompanyId()); |
| | |
| | | french_date.text("Cette promotion est valide du" + startTime + "au" + endTime); |
| | | } |
| | | EmailUtil.send(userInfo1.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon arrives" : "Le coupon arrive", document1.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document1.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/coupon_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "优惠券到账" : language == 2 ? "Coupon arrives" : "Le coupon arrive"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(language,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"AM":"Dans la matinée"); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"PM":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | |
| | | } |
| | |
| | | loginWarpper.setId(userInfo.getId()); |
| | | loginWarpper.setToken(token); |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | loginWarpper.setEmail(userInfo.getEmail()); |
| | | loginWarpper.setEmergencyContact(userInfo.getEmergencyContact()); |
| | | loginWarpper.setEmergencyContactNumber(userInfo.getEmergencyContactNumber()); |
| | | return ResultUtil.success(loginWarpper); |
| | |
| | | user_french.text("Bonjour " + userInfo.getNickName() + ","); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Successful registration" : "Inscription réussie", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/registration_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/registration_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "注册成功" : language == 2 ? "Successful registration" : "Inscription réussie"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(language,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"AM":"Dans la matinée"); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"PM":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | |
| | | |
| | |
| | | french_date.text("Cette promotion est valide du" + startTime + "au" + endTime); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon arrives" : "Le coupon arrive", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/coupon_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "优惠券到账" : language == 2 ? "Coupon arrives" : "Le coupon arrive"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(language,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"AM":"Dans la matinée"); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"PM":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public ResultUtil facebookLogin(String id, String name, String email, Double lat, Double lng, Integer uid, Integer language) throws Exception { |
| | | UserInfo userInfo = this.selectOne(new EntityWrapper<UserInfo>().eq("faceBookId", id).ne("flag", 3)); |
| | | public ResultUtil facebookLogin(String id, String name, String email, Double lat, Double lng, Integer uid, Integer language,int type) throws Exception { |
| | | UserInfo userInfo=null; |
| | | if(type==1){ |
| | | userInfo = this.selectOne(new EntityWrapper<UserInfo>().eq("faceBookId", id).ne("flag", 3)); |
| | | }else { |
| | | userInfo = this.selectOne(new EntityWrapper<UserInfo>().eq("twitterId", id).ne("flag", 3)); |
| | | } |
| | | if(null == userInfo){ |
| | | userInfo = new UserInfo(); |
| | | userInfo.setEmail(email); |
| | |
| | | userInfo.setBalance(0D); |
| | | userInfo.setIntegral(0); |
| | | userInfo.setPassWord(ShiroKit.md5("", salt)); |
| | | userInfo.setFaceBookId(id); |
| | | if(type==1){ |
| | | userInfo.setFaceBookId(id); |
| | | }else { |
| | | userInfo.setTwitterId(id); |
| | | } |
| | | userInfo.setState(1); |
| | | userInfo.setFlag(1); |
| | | userInfo.setInsertTime(new Date()); |
| | |
| | | user_french.text("Bonjour " + userInfo.getNickName() + ","); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Successful registration" : "Inscription réussie", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/registration_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/registration_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "注册成功" : language == 2 ? "Successful registration" : "Inscription réussie"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(language,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"AM":"Dans la matinée"); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"PM":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | |
| | | |
| | | this.addCoupon(userInfo, language);//添加优惠券 |
| | | } |
| | | |
| | |
| | | french_date.text("Cette promotion est valide du" + startTime + "au" + endTime); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon arrives" : "Le coupon arrive", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/coupon_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setType(1); |
| | | tEmail.setName( language == 1 ? "优惠券到账" : language == 2 ? "Coupon arrives" : "Le coupon arrive"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(language,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"AM":"Dans la matinée"); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"PM":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "重置密码" : language == 2 ? "Reset password" : "Réinitialiser le mot de passe", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/password_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/password_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/password_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "重置密码" : language == 2 ? "Reset password" : "Réinitialiser le mot de passe"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(language,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"AM":"Dans la matinée"); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"PM":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | french_date.text("Cette promotion est valide du" + startTime + "au" + endTime); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon arrives" : "Le coupon arrive", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/coupon_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "优惠券到账" : language == 2 ? "Coupon arrives" : "Le coupon arrive"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(language,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"AM":"Dans la matinée"); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"PM":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | } |
| | | } |
| | |
| | | french_date.text("Cette promotion est valide du" + startTime + "au" + endTime); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon arrives" : "Le coupon arrive", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/coupon_" + randomString + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "优惠券到账" : language == 2 ? "Coupon arrives" : "Le coupon arrive"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"Morning":""); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"Afternoon":""); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @param id |
| | | */ |
| | | private void singlePointLogin(Integer id) throws Exception{ |
| | | pushUtil.pushOffline(id, 1); |
| | | //开始验证当前账号是否在别处登录 |
| | | String value = redisUtil.getValue("USER_" + id); |
| | | if(ToolUtil.isNotEmpty(value)){//将另外设备上的强迫下线 |