| | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(GunsApplication.class, args); |
| | | //启动定时任务调度器 |
| | | // QuartzUtil.start(GunsApplication.class.getClassLoader().getResourceAsStream("quartz.properties")); |
| | | logger.info("GunsApplication is success!"); |
| | | } |
| | | |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName + ".mp3"); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName + ".mp3"); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "取件码邮件" : language == 2 ? "Pickup code" : "Code de ramassage", 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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/code_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/code_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | if(orderPrivateCar.getArriveTime()==null){ |
| | | orderPrivateCar.setArriveTime(orderPrivateCar.getStartServiceTime()); |
| | | } |
| | | |
| | | if(null == orderPrivateCar.getEndServiceTime()){ |
| | | orderPrivateCar.setEndServiceTime(new Date()); |
| | | } |
| | | //使用原始里程计算费用 |
| | | orderPrivateCar = this.setMoney(orderPrivateCar, 0D, 0D);//计算费用 |
| | | Double mileage = orderPrivateCar.getMileage(); |
| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<DriverActivityHistory> driverActivityHistories = driverActivityHistoryMapper.selectList(new EntityWrapper<DriverActivityHistory>().eq("driverId", driverId) |
| | | .eq("type", 3).eq("carryOut", 1).last(" and day = '" + sdf.format(new Date()) + "' and driverActivityId in (select id from t_driver_activity where status = 3 and now() between startTime and endTime)")); |
| | | if(!driverActivityHistories.isEmpty()){ |
| | | //如果一直属于上班中,则需要从任务开始时间计算时间 |
| | | Date insertTime = driverActivityHistories.get(0).getInsertTime(); |
| | | if(driverWork.getStartTime().getTime() < insertTime.getTime()){ |
| | | driverWork.setStartTime(insertTime); |
| | | } |
| | | } |
| | | //生成每个活动从开始上班到当前时间的时长记录 |
| | | for (DriverActivityHistory driverActivityHistory : driverActivityHistories) { |
| | | String value = redisUtil.getValue("driverActivity_" + driverId + "_" + driverActivityHistory.getId()); |
| | |
| | | continue; |
| | | } |
| | | Integer driverId = driverOnline.getDriverId(); |
| | | Driver driver1 = driverService.selectById(driverId); |
| | | long m = Double.valueOf(driverActivityOnline.getOfflineTime() * 3600000L).longValue(); |
| | | |
| | | //找出最后一次接单的时间 |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | //在线时长累计 |
| | | Long time = jsonObject.getLong("time") / 60000; |
| | | int count1 = orderPrivateCarService.selectCount(new EntityWrapper<OrderPrivateCar>().eq("driverId", driverActivityHistory.getDriverId()) |
| | | .eq("isDelete", 1).ne("state", 10).last(" and UNIX_TIMESTAMP(snatchOrderTime) > " + (startTime) / 1000)); |
| | | .eq("isDelete", 1).ne("state", 10).last(" and UNIX_TIMESTAMP(snatchOrderTime) > " + (startTime / 1000))); |
| | | int count2 = orderLogisticsService.selectCount(new EntityWrapper<OrderLogistics>().eq("driverId", driverActivityHistory.getDriverId()) |
| | | .eq("isDelete", 1).ne("state", 10).last(" and UNIX_TIMESTAMP(snatchOrderTime) > " + (startTime) / 1000)); |
| | | .eq("isDelete", 1).ne("state", 10).last(" and UNIX_TIMESTAMP(snatchOrderTime) > " + (startTime / 1000))); |
| | | |
| | | Driver driver = driverService.selectById(driverWork.getDriverId()); |
| | | //阶段时间累计时长超过设定时长且没有接单,不计入累计总时长(司机服务中不下班) |
| | | if(m <= time && count1 + count2 == 0 && driver.getState() != 3){ |
| | | if(m <= time && (count1 + count2) == 0){ |
| | | //司机下班,清空当前阶段的累计时长 |
| | | driverWork.setState(2); |
| | | driverWork.setEndTime(new Date()); |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | } |
| | | } |
| | | }, 30000); |
| | | } |
| | | } else if(m <= time && (count1 + count2) > 0){ |
| | | //阶段时间累计有新的订单,计入累计总时长,重置新的开始统计时间戳 |
| | | if(m <= time && count1 + count2 > 0){ |
| | | DriverOnline driverOnline = this.selectOne(new EntityWrapper<DriverOnline>().eq("DATE_FORMAT(date, '%Y-%m-%d')", sdf.format(new Date())) |
| | | .eq("driverId", driverActivityHistory.getDriverId())); |
| | | if(null == driverOnline){ |
| | |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "司机奖励通知" : language == 2 ? "Reward-driver notice" : "Avis de chauffeur de récompense", document.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(finalDriver.getEmail(), language == 1 ? "司机奖励通知" : language == 2 ? "Reward-driver notice" : "Avis de chauffeur de récompense", document.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "成功注册" : language == 2 ? "Registered successfully" : "Enregistré avec succès", document1.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "密码重置" : language == 2 ? "Reset password" : "Réinitialiser le mot de passe", document1.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/reset_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/reset_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "密码重置" : language == 2 ? "Reset password" : "Réinitialiser le mot de passe", document1.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/reset_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/reset_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "邀请司机奖励(活动)" : language == 2 ? "Invite drivers and earn" : "Invitez des chauffeurs et gagnez de l’argent", document1.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "邀请用户奖励(活动)" : language == 2 ? "Invite users and earn" : "Invitez des utilisateurs et gagnez de l’argent", document1.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "在线时长奖励(活动)" : language == 2 ? "Online-duration reward activity" : "Activité de récompense en ligne", document1.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "累计接单奖励(活动)" : language == 2 ? "Cumulative order activity" : "Activité cumulée des commandes", document1.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | if(null == dao){ |
| | | continue; |
| | | } |
| | | //秒 |
| | | Long duration = Double.valueOf(dao.getOnline() * 3600).longValue(); |
| | | List<DriverOnline> driverOnlines = driverOnlineMapper.queryList(sdf.format(new Date()), null, dah.getDriverId(), duration); |
| | | if(driverOnlines.size() > 0){ |
| | |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "司机奖励通知" : language == 2 ? "Reward-driver notice" : "Avis de chauffeur de récompense", document1.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/rewards_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/rewards_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "司机奖励通知" : language == 2 ? "Reward-driver notice" : "Avis de chauffeur de récompense", document1.html()); |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | //开始生成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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/rewards_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/rewards_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void taskMinute(){ |
| | | try { |
| | | //处理司机连续不接单的情况 |
| | | driverOnlineService.deductionDuration1(); |
| | | //修改满足活动条件的数据(在线时长,订单量) |
| | | driverService.taskMinute(); |
| | | //处于预约单 |
| | | orderService.reservationOrder(); |
| | | // //处理结束订单后30分钟解绑小号功能 |
| | | // orderService.taskMidAxbUnBindSend(); |
| | | //处理司机连续不接单的情况 |
| | | driverOnlineService.deductionDuration1(); |
| | | //处理google订单状态 |
| | | orderService.overGoogleOrder(); |
| | | } catch (Exception e) { |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.google.api.gax.core.FixedCredentialsProvider; |
| | | import com.google.auth.oauth2.GoogleCredentials; |
| | | import com.google.cloud.texttospeech.v1.*; |
| | | import com.google.protobuf.ByteString; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.OutputStream; |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | public static String create(String languageCode, String text, String fileName) throws Exception { |
| | | // Instantiates a client |
| | | try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) { |
| | | GoogleCredentials googleCredentials = GoogleCredentials |
| | | .fromStream(new FileInputStream("/home/igotechgh/i-go-gcp-f83e2d02152a.json")) |
| | | .createScoped("https://www.googleapis.com/auth/cloud-platform"); |
| | | |
| | | FixedCredentialsProvider provider = FixedCredentialsProvider.create(googleCredentials); |
| | | TextToSpeechSettings textToSpeechSettings = TextToSpeechSettings.newBuilder().setCredentialsProvider(provider).build(); |
| | | try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create(textToSpeechSettings)) { |
| | | // Set the text input to be synthesized |
| | | SynthesisInput input = SynthesisInput.newBuilder().setText(text).build(); |
| | | |
| | |
| | | ByteString audioContents = response.getAudioContent(); |
| | | |
| | | // Write the response to the output file. |
| | | try (OutputStream out = new FileOutputStream("/home/igotechgh/nginx/html/files/audio/" + fileName)) { |
| | | File file = new File("/data/nginx/html/files/audio/" + fileName); |
| | | if (!file.exists()) { |
| | | file.createNewFile(); |
| | | } |
| | | try (OutputStream out = new FileOutputStream("/data/nginx/html/files/audio/" + fileName)) { |
| | | out.write(audioContents.toByteArray()); |
| | | return "https://igo.i-go.group/files/audio/" + fileName; |
| | | }catch (Exception e){ |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | filters: wall,mergeStat |
| | | |
| | | |
| | | #多数据源情况的配置 |
| | | guns: |
| | | muti-datasource: |
| | | open: false |
| | | url: jdbc:mysql://127.0.0.1:3306/guns_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | dataSourceNames: |
| | | - dataSourceGuns |
| | | - dataSourceBiz |
| | | |
| | | |
| | | |
| | | wx: |
| | | grantType: authorization_code #填authorization_code |
| | | appid: wx97c33c052b2222f7 #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | template-path: /data/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | |
| | |
| | | file-size-threshold: 100MB |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 16379 |
| | | host: 172.17.0.3 |
| | | port: 6379 |
| | | password: mPMHThYzlT8DWgl8HLqwPEyPOiHDPPB5 |
| | | |
| | | mybatis-plus: |
| | |
| | | password: _6)S]<vpfvj?N#t2 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | |
| | | |
| | | #多数据源情况的配置 |
| | | guns: |
| | | muti-datasource: |
| | | open: false |
| | | url: jdbc:mysql://127.0.0.1:3306/guns_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | dataSourceNames: |
| | | - dataSourceGuns |
| | | - dataSourceBiz |
| | | |
| | | |
| | | |
| | |
| | | |
| | | spring: |
| | | mail: |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | template-path: /data/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | } |
| | | |
| | | //开始生成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(); |
| | | } |
| | |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Integer companyType = null; |
| | | Integer companyId = null; |
| | | if(1 != user.getRoleType()){ |
| | | companyType = user.getRoleType(); |
| | | companyId = user.getObjectId(); |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(driverActivityService.getList(page,beginTime,endTime,name,user.getRoleType(),user.getObjectId())); |
| | | page.setRecords(driverActivityService.getList(page,beginTime,endTime,name,companyType,companyId)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/updateStatus") |
| | | @ResponseBody |
| | | public Object updateStatus(DriverActivity driverActivity) { |
| | | DriverActivity driverActivity1 = driverActivityService.selectById(driverActivity.getId()); |
| | | if(System.currentTimeMillis() >= driverActivity1.getEndTime().getTime()){ |
| | | return ResultUtil.error("活动已结束,修改状态失败"); |
| | | } |
| | | driverActivityService.updateById(driverActivity); |
| | | return SUCCESS_TIP; |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @RequestMapping("/driverActivity_detail/{driverActivityId}") |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | 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.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ISysCouponActivityService; |
| | | import com.stylefeng.guns.modular.system.service.ISysCouponRecordService; |
| | | 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.service.ISysCouponActivityService; |
| | | 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.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | public void sendEmail(TUser userInfo1, Integer num, String startTime, String endTime, Double fullMoney){ |
| | | try { |
| | | if(ToolUtil.isNotEmpty(userInfo1.getEmail())){ |
| | | Integer language = userInfo1.getLanguage(); |
| | | String path1 = templatePath + "user/coupon.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if(1 == language){ |
| | | document1.getElementById("english").remove(); |
| | | document1.getElementById("french").remove(); |
| | | document1.getElementsByTag("title").get(0).text("优惠券到账"); |
| | | Element chinese_user = document1.getElementById("chinese_user"); |
| | | chinese_user.text("您好 " + userInfo1.getNickName() + ","); |
| | | Element chinese_number = document1.getElementById("chinese_number"); |
| | | chinese_number.text("您有" + num + "张优惠券到账"); |
| | | Element chinese_date = document1.getElementById("chinese_date"); |
| | | chinese_date.text("此活动有效期在" + startTime + "至" + endTime + ",详情请查看I-GO平台"); |
| | | Element chinese_remark = document1.getElementById("chinese_remark"); |
| | | chinese_remark.text("注意:满减活动,每单消费至少GHS " + fullMoney + ",才可享用。"); |
| | | EmailUtil.send(userInfo1.getEmail(), "优惠券到账", document1.html()); |
| | | } |
| | | if(2 == language){ |
| | | document1.getElementById("chinese").remove(); |
| | | document1.getElementById("french").remove(); |
| | | document1.getElementsByTag("title").get(0).text("Coupon is in"); |
| | | Element english_user = document1.getElementById("english_user"); |
| | | english_user.text("Hello " + userInfo1.getNickName() + ","); |
| | | Element english_number = document1.getElementById("english_number"); |
| | | english_number.text("You have received " + num + " coupons"); |
| | | Element english_date = document1.getElementById("english_date"); |
| | | english_date.text("You could use them from " + com.stylefeng.guns.modular.system.util.DateUtil.conversionFormat(2, startTime) + " to " + com.stylefeng.guns.modular.system.util.DateUtil.conversionFormat(2, endTime)); |
| | | Element english_remark = document1.getElementById("english_remark"); |
| | | english_remark.text("NB! Coupon is valid only for the trip fare not less than GHS " + fullMoney + " per ride."); |
| | | EmailUtil.send(userInfo1.getEmail(), "Coupon is in", document1.html()); |
| | | } |
| | | if(3 == language){ |
| | | document1.getElementById("chinese").remove(); |
| | | document1.getElementById("english").remove(); |
| | | document1.getElementsByTag("title").get(0).text("Le coupon est arrivé"); |
| | | Element french_user = document1.getElementById("french_user"); |
| | | french_user.text("Cher(ère) " + userInfo1.getNickName() + ","); |
| | | Element french_number = document1.getElementById("french_number"); |
| | | french_number.text("Vous avez reçu " + num + " coupons."); |
| | | Element french_date = document1.getElementById("french_date"); |
| | | french_date.text("Vous devriez les utiliser du " + com.stylefeng.guns.modular.system.util.DateUtil.conversionFormat(3, startTime) + " au " + com.stylefeng.guns.modular.system.util.DateUtil.conversionFormat(3, endTime) + ", voir le détail sur la plate-forme I-GO."); |
| | | Element french_remark = document1.getElementById("french_remark"); |
| | | french_remark.text("Remarque! Le coupon n'est valable que pour le tarif d'au moins GHS " + fullMoney + " par trajet."); |
| | | EmailUtil.send(userInfo1.getEmail(), "Le coupon est arrivé", document1.html()); |
| | | } |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/data/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/data/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(); |
| | | |
| | | String link ="https://igo.i-go.group/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo1.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "优惠券到账" : language == 2 ? "Coupon is in" : "Le coupon est arrivé"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(2,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm("AM"); |
| | | }else { |
| | | tEmail.setAmOrPm("PM"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer sysCouponActivityId) { |
| | | SysCouponActivity sysCouponActivity = new SysCouponActivity(); |
| | | sysCouponActivity.setId(sysCouponActivityId); |
| | | sysCouponActivity.setStatus(4); |
| | | sysCouponActivityService.updateById(sysCouponActivity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(SysCouponActivity sysCouponActivity,Integer activityId) { |
| | | SysCouponRecord sysCouponRecord = couponRecordService.selectById(activityId); |
| | | sysCouponActivity.setCouponType(sysCouponRecord.getCouponType()); |
| | | sysCouponActivity.setCouponUseType(sysCouponRecord.getCouponUseType()); |
| | | sysCouponActivity.setMoney(sysCouponRecord.getMoney()); |
| | | sysCouponActivity.setFullMoney(sysCouponRecord.getFullMoney()); |
| | | sysCouponActivity.setInsertTime(new Date()); |
| | | sysCouponActivity.setCouponId(activityId); |
| | | sysCouponActivity.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | sysCouponActivity.setCompanyType(ShiroKit.getUser().getRoleType()); |
| | | sysCouponActivity.setStatus(sysCouponActivity.getCompanyType()==1?3:1); |
| | | sysCouponActivityService.updateById(sysCouponActivity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{sysCouponActivityId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("sysCouponActivityId") Integer sysCouponActivityId) { |
| | | return sysCouponActivityService.selectById(sysCouponActivityId); |
| | | } |
| | | |
| | | class timerTaskTest extends TimerTask { |
| | | private Integer id; |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | public void sendEmail(TUser userInfo1, Integer num, String startTime, String endTime, Double fullMoney){ |
| | | try { |
| | | if(ToolUtil.isNotEmpty(userInfo1.getEmail())){ |
| | | Integer language = userInfo1.getLanguage(); |
| | | String path1 = templatePath + "user/coupon.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if(1 == language){ |
| | | document1.getElementById("english").remove(); |
| | | document1.getElementById("french").remove(); |
| | | document1.getElementsByTag("title").get(0).text("优惠券到账"); |
| | | Element chinese_user = document1.getElementById("chinese_user"); |
| | | chinese_user.text("您好 " + userInfo1.getNickName() + ","); |
| | | Element chinese_number = document1.getElementById("chinese_number"); |
| | | chinese_number.text("您有" + num + "张优惠券到账"); |
| | | Element chinese_date = document1.getElementById("chinese_date"); |
| | | chinese_date.text("此活动有效期在" + startTime + "至" + endTime + ",详情请查看I-GO平台"); |
| | | Element chinese_remark = document1.getElementById("chinese_remark"); |
| | | chinese_remark.text("注意:满减活动,每单消费至少GHS " + fullMoney + ",才可享用。"); |
| | | EmailUtil.send(userInfo1.getEmail(), "优惠券到账", document1.html()); |
| | | } |
| | | if(2 == language){ |
| | | document1.getElementById("chinese").remove(); |
| | | document1.getElementById("french").remove(); |
| | | document1.getElementsByTag("title").get(0).text("Coupon is in"); |
| | | Element english_user = document1.getElementById("english_user"); |
| | | english_user.text("Hello " + userInfo1.getNickName() + ","); |
| | | Element english_number = document1.getElementById("english_number"); |
| | | english_number.text("You have received " + num + " coupons"); |
| | | Element english_date = document1.getElementById("english_date"); |
| | | english_date.text("You could use them from " + com.stylefeng.guns.modular.system.util.DateUtil.conversionFormat(2, startTime) + " to " + com.stylefeng.guns.modular.system.util.DateUtil.conversionFormat(2, endTime)); |
| | | Element english_remark = document1.getElementById("english_remark"); |
| | | english_remark.text("NB! Coupon is valid only for the trip fare not less than GHS " + fullMoney + " per ride."); |
| | | EmailUtil.send(userInfo1.getEmail(), "Coupon is in", document1.html()); |
| | | } |
| | | if(3 == language){ |
| | | document1.getElementById("chinese").remove(); |
| | | document1.getElementById("english").remove(); |
| | | document1.getElementsByTag("title").get(0).text("Le coupon est arrivé"); |
| | | Element french_user = document1.getElementById("french_user"); |
| | | french_user.text("Cher(ère) " + userInfo1.getNickName() + ","); |
| | | Element french_number = document1.getElementById("french_number"); |
| | | french_number.text("Vous avez reçu " + num + " coupons."); |
| | | Element french_date = document1.getElementById("french_date"); |
| | | french_date.text("Vous devriez les utiliser du " + com.stylefeng.guns.modular.system.util.DateUtil.conversionFormat(3, startTime) + " au " + com.stylefeng.guns.modular.system.util.DateUtil.conversionFormat(3, endTime) + ", voir le détail sur la plate-forme I-GO."); |
| | | Element french_remark = document1.getElementById("french_remark"); |
| | | french_remark.text("Remarque! Le coupon n'est valable que pour le tarif d'au moins GHS " + fullMoney + " par trajet."); |
| | | EmailUtil.send(userInfo1.getEmail(), "Le coupon est arrivé", document1.html()); |
| | | } |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/home/igotechgh/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(); |
| | | |
| | | String link ="https://igo.i-go.group/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo1.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "优惠券到账" : language == 2 ? "Coupon is in" : "Le coupon est arrivé"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(2,i)); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm("AM"); |
| | | }else { |
| | | tEmail.setAmOrPm("PM"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer sysCouponActivityId) { |
| | | SysCouponActivity sysCouponActivity = new SysCouponActivity(); |
| | | sysCouponActivity.setId(sysCouponActivityId); |
| | | sysCouponActivity.setStatus(4); |
| | | sysCouponActivityService.updateById(sysCouponActivity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(SysCouponActivity sysCouponActivity,Integer activityId) { |
| | | SysCouponRecord sysCouponRecord = couponRecordService.selectById(activityId); |
| | | sysCouponActivity.setCouponType(sysCouponRecord.getCouponType()); |
| | | sysCouponActivity.setCouponUseType(sysCouponRecord.getCouponUseType()); |
| | | sysCouponActivity.setMoney(sysCouponRecord.getMoney()); |
| | | sysCouponActivity.setFullMoney(sysCouponRecord.getFullMoney()); |
| | | sysCouponActivity.setInsertTime(new Date()); |
| | | sysCouponActivity.setCouponId(activityId); |
| | | sysCouponActivity.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | sysCouponActivity.setCompanyType(ShiroKit.getUser().getRoleType()); |
| | | sysCouponActivity.setStatus(sysCouponActivity.getCompanyType()==1?3:1); |
| | | sysCouponActivityService.updateById(sysCouponActivity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{sysCouponActivityId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("sysCouponActivityId") Integer sysCouponActivityId) { |
| | | return sysCouponActivityService.selectById(sysCouponActivityId); |
| | | } |
| | | } |
| | |
| | | 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.TComplaint; |
| | | import com.stylefeng.guns.modular.system.model.TEmail; |
| | | import com.stylefeng.guns.modular.system.model.TSystemNotice; |
| | | import com.stylefeng.guns.modular.system.model.TUser; |
| | | import com.stylefeng.guns.modular.system.service.ITComplaintService; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; |
| | | 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 org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TComplaint; |
| | | import com.stylefeng.guns.modular.system.service.ITComplaintService; |
| | | 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; |
| | | |
| | | import static org.bouncycastle.asn1.x500.style.RFC4519Style.uid; |
| | | |
| | | /** |
| | | * 投诉列表控制器 |
| | |
| | | } |
| | | |
| | | //开始生成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/complaintResult_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/complaintResult_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | 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.TFeedback; |
| | | import com.stylefeng.guns.modular.system.model.TSystemNotice; |
| | | import com.stylefeng.guns.modular.system.model.TUser; |
| | | import com.stylefeng.guns.modular.system.service.ITFeedbackService; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; |
| | | 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.TFeedback; |
| | | import com.stylefeng.guns.modular.system.service.ITFeedbackService; |
| | | 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; |
| | |
| | | } |
| | | |
| | | //开始生成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/feedbackResult_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/feedbackResult_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | if (SinataUtil.isNotEmpty(userActivityDiscount1)) { |
| | | // 专车 |
| | | Map<String, Object> resultMap = userCouponRecordService.getDiscountStatic(startTimes, endTimes, userActivityDiscount1.getId()); |
| | | BigDecimal bigDecimal = new BigDecimal(resultMap.get("money").toString()); |
| | | String string = resultMap.get("number").toString(); |
| | | Integer i = Integer.valueOf(string); |
| | | // 小件物流 |
| | | Map<String, Object> resultMap1 = userCouponRecordService.getDiscountStatic1(startTimes, endTimes, userActivityDiscount1.getId()); |
| | | if (null != resultMap1) { |
| | | BigDecimal bigDecimal1 = new BigDecimal(resultMap1.get("money").toString()); |
| | | String string1 = resultMap1.get("number").toString(); |
| | | Integer i1 = Integer.valueOf(string1); |
| | | BigDecimal add = bigDecimal.add(bigDecimal1); |
| | | i += i1; |
| | | map.put("userActivityDiscount1Money", add); |
| | | map.put("userActivityDiscount1Number", i); |
| | | } else { |
| | | map.put("userActivityDiscount1Money", 0); |
| | | map.put("userActivityDiscount1Number", 0); |
| | | BigDecimal bigDecimal = BigDecimal.ZERO; |
| | | String string = ""; |
| | | if(null != resultMap){ |
| | | bigDecimal = new BigDecimal(resultMap.get("money").toString()); |
| | | string = resultMap.get("number").toString(); |
| | | } |
| | | map.put("userActivityDiscount1Money", bigDecimal); |
| | | map.put("userActivityDiscount1Number", string); |
| | | } else { |
| | | map.put("userActivityDiscount1Money", 0); |
| | | map.put("userActivityDiscount1Number", 0); |
| | |
| | | @RequestMapping(value = "/updateStatus") |
| | | @ResponseBody |
| | | public Object updateStatus(UserActivity driverActivity) { |
| | | UserActivity userActivity = userActivityService.selectById(driverActivity.getId()); |
| | | if(System.currentTimeMillis() >= userActivity.getEndTime().getTime()){ |
| | | return ResultUtil.error("活动已结束,修改状态失败"); |
| | | } |
| | | userActivityService.updateById(driverActivity); |
| | | return SUCCESS_TIP; |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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.*; |
| | | import com.stylefeng.guns.modular.system.model.TEmail; |
| | | import com.stylefeng.guns.modular.system.model.TIntegralGoods; |
| | | import com.stylefeng.guns.modular.system.model.TIntegralOrder; |
| | | import com.stylefeng.guns.modular.system.model.TUser; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.EmailUtil; |
| | | 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 org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | |
| | | EmailUtil.send(email, language == 1 ? "积分兑换已通过审核" : language == 2 ? "Points redemption approved" : "Approbation de l’échange de points", 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/complaint_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/complaint_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + finalFileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + finalFileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | ByteString audioContents = response.getAudioContent(); |
| | | |
| | | // Write the response to the output file. |
| | | try (OutputStream out = new FileOutputStream("/home/igotechgh/nginx/html/files/audio/" + fileName)) { |
| | | try (OutputStream out = new FileOutputStream("/data/nginx/html/files/audio/" + fileName)) { |
| | | out.write(audioContents.toByteArray()); |
| | | return "https://igo.i-go.group/files/audio/" + fileName; |
| | | }catch (Exception e){ |
| | |
| | | // String pictureName = ObsUploadUtil.obsUpload(super.getHttpServletRequest(), picture); |
| | | return pictureName; |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | (select count(id) from t_order_cross_city where state in (6,8,9) and activityId = a.id) |
| | | ) as number |
| | | from t_user_activity a |
| | | where a.companyId = #{companyId} |
| | | where 1 = 1 |
| | | <if test="null != companyId"> |
| | | and a.companyId = #{companyId} |
| | | </if> |
| | | <if test="null != start and null != end"> |
| | | and a.insertTime between #{start} and #{end} |
| | | </if> |
| | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id |
| | | , money, fullMoney, expirationTime, insertTime, companyId, state, couponUseType, couponType, userId, couponId, couponActivityId, activityType |
| | | , money, fullMoney, expirationTime, insertTime, companyId, state, couponUseType, couponType, userId, couponId, |
| | | couponActivityId, activityType |
| | | </sql> |
| | | |
| | | <select id="getList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | |
| | | ) as aa group by aa.userId |
| | | </select> |
| | | <select id="getDiscountStatic" resultType="map"> |
| | | SELECT IFNULL(SUM(aa.money), 0) money, COUNT(aa.userId) number |
| | | FROM (select IFNULL(SUM(discountMoney), 0) money, userId |
| | | from t_order_private_car |
| | | WHERE activityId = #{activityId} |
| | | group by userId) as aa |
| | | select count(aa.userId) as number, IFNULL(SUM(aa.money), 0) money from ( |
| | | select |
| | | a.userId, IFNULL(SUM(a.discountMoney), 0) money |
| | | from ( |
| | | select userId, discountMoney |
| | | from t_order_private_car WHERE activityId = #{activityId} |
| | | union all |
| | | select userId, discountMoney |
| | | from t_order_logistics WHERE activityId = #{activityId} |
| | | ) as a group by a.userId |
| | | ) as aa |
| | | </select> |
| | | <select id="getDiscountStatic1" resultType="map"> |
| | | SELECT IFNULL(SUM(aa.money), 0) money, COUNT(aa.userId) number |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.UserActivityDiscount1Mapper; |
| | | import com.stylefeng.guns.modular.system.model.TEmail; |
| | | import com.stylefeng.guns.modular.system.model.TUser; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import com.stylefeng.guns.modular.system.model.UserActivityDiscount1; |
| | | import com.stylefeng.guns.modular.system.dao.UserActivityDiscount1Mapper; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyService; |
| | | import com.stylefeng.guns.modular.system.service.ITUserService; |
| | | import com.stylefeng.guns.modular.system.service.IUserActivityDiscount1Service; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | 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.apache.poi.hssf.usermodel.*; |
| | | import org.apache.poi.ss.usermodel.CellType; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.FileWriter; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | EmailUtil.send(user.getEmail(), "Activités à rabais", document1.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/discount_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/discount_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | @Override |
| | | public Map<String, Object> queryUserActivityList(Integer uid, Date start, Date end, String name, Integer status, Integer offset, Integer limit) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Integer objectId = userService.selectById(uid).getObjectId(); |
| | | List<Map<String, Object>> list = userActivityMapper.queryUserActivityList(objectId, start, end, name, status, offset, limit); |
| | | int i = userActivityMapper.queryUserActivityListCount(objectId, start, end, name, status); |
| | | Integer companyId = null; |
| | | if(1 != ShiroKit.getUser().getRoleType()){ |
| | | companyId = ShiroKit.getUser().getObjectId(); |
| | | } |
| | | List<Map<String, Object>> list = userActivityMapper.queryUserActivityList(companyId, start, end, name, status, offset, limit); |
| | | int i = userActivityMapper.queryUserActivityListCount(companyId, start, end, name, status); |
| | | map.put("rows", list); |
| | | map.put("total", i); |
| | | return map; |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.google.auth.oauth2.GoogleCredentials; |
| | | import com.google.cloud.WriteChannel; |
| | | import com.google.cloud.storage.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | |
| | | |
| | | public static String upload(MultipartFile file){ |
| | | |
| | | |
| | | |
| | | |
| | | // The ID of your GCP project |
| | | // String projectId = "your-project-id"; |
| | | |
| | |
| | | String fileName = file.getOriginalFilename(); |
| | | String projectId = "i-go-gcp"; |
| | | String bucketName = "i-go"; |
| | | Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); |
| | | GoogleCredentials defaultCredentials = null; |
| | | try { |
| | | defaultCredentials = GoogleCredentials.getApplicationDefault(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | defaultCredentials.createScoped("https://www.googleapis.com/auth/cloud-platform"); |
| | | Storage storage = StorageOptions |
| | | .newBuilder() |
| | | .setProjectId(projectId) |
| | | .setCredentials(defaultCredentials) |
| | | .build() |
| | | .getService(); |
| | | BlobId blobId = BlobId.of(bucketName, fileName); |
| | | BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build(); |
| | | |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.google.api.gax.core.FixedCredentialsProvider; |
| | | import com.google.auth.oauth2.GoogleCredentials; |
| | | import com.google.cloud.texttospeech.v1.*; |
| | | import com.google.protobuf.ByteString; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.OutputStream; |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | public static String create(String languageCode, String text, String fileName) throws Exception { |
| | | // Instantiates a client |
| | | try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) { |
| | | GoogleCredentials googleCredentials = GoogleCredentials |
| | | .fromStream(new FileInputStream("/home/igotechgh/i-go-gcp-f83e2d02152a.json")) |
| | | .createScoped("https://www.googleapis.com/auth/cloud-platform"); |
| | | |
| | | FixedCredentialsProvider provider = FixedCredentialsProvider.create(googleCredentials); |
| | | TextToSpeechSettings textToSpeechSettings = TextToSpeechSettings.newBuilder().setCredentialsProvider(provider).build(); |
| | | try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create(textToSpeechSettings)) { |
| | | // Set the text input to be synthesized |
| | | SynthesisInput input = SynthesisInput.newBuilder().setText(text).build(); |
| | | |
| | |
| | | ByteString audioContents = response.getAudioContent(); |
| | | |
| | | // Write the response to the output file. |
| | | try (OutputStream out = new FileOutputStream("/home/igotechgh/nginx/html/files/audio/" + fileName)) { |
| | | File file = new File("/data/nginx/html/files/audio/" + fileName); |
| | | if (!file.exists()) { |
| | | file.createNewFile(); |
| | | } |
| | | try (OutputStream out = new FileOutputStream("/data/nginx/html/files/audio/" + fileName)) { |
| | | out.write(audioContents.toByteArray()); |
| | | return "https://igo.i-go.group/files/audio/" + fileName; |
| | | }catch (Exception e){ |
| | |
| | | @Resource |
| | | private QuartzUtil quartzUtil; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext){ |
| | | run(jobExecutionContext); |
| | | } |
| | | |
| | | /** |
| | | * 执行的业务逻辑 |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext){ |
| | | run(jobExecutionContext); |
| | | } |
| | | |
| | | |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | template-path: /data/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | #支付回调地址 |
| | |
| | | max-file-size: 100MB |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 16379 |
| | | host: 172.17.0.3 |
| | | port: 6379 |
| | | password: mPMHThYzlT8DWgl8HLqwPEyPOiHDPPB5 |
| | | |
| | | mybatis-plus: |
| | |
| | | password: _6)S]<vpfvj?N#t2 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | |
| | | #多数据源情况的配置 |
| | | guns: |
| | | muti-datasource: |
| | | open: false |
| | | url: jdbc:mysql://120.24.34.190:3306/mask?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: Root2020! |
| | | dataSourceNames: |
| | | - dataSourceGuns |
| | | - dataSourceBiz |
| | | |
| | | |
| | | --- |
| | | |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | template-path: /data/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | #支付回调地址 |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | template-path: /data/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | #支付回调地址 |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>优惠券管理</h5> |
| | | <h5>用户端补贴领用情况</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | |
| | | DriverActivity.updateStatus = function () { |
| | | if (this.check(3)) { |
| | | var ajax = new $ax(Feng.ctxPath + "/driverActivity/updateStatus", function (data) { |
| | | if(200 == data.code){ |
| | | Feng.success("启动/暂停成功!"); |
| | | DriverActivity.table.refresh(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("动/暂停失败!" + data.responseJSON.message + "!"); |
| | | Feng.error("启动/暂停失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.set("status",this.seItem.status==3?4:3); |
| | |
| | | UserActivity.updateStatus = function () { |
| | | if (this.check(3)) { |
| | | var ajax = new $ax(Feng.ctxPath + "/userActivity/updateStatus", function (data) { |
| | | if(200 == data.code){ |
| | | Feng.success("启动/暂停成功!"); |
| | | UserActivity.table.refresh(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("动/暂停失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | EmailUtil.send(email, language == 1 ? "邮箱验证" : language == 2 ? "Verification code" : "Code de validation", 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/mainbox_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/mainbox_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | if(orderType == 1){ |
| | | fileInputStream = new FileInputStream(new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf")); |
| | | fileInputStream = new FileInputStream(new File("/data/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf")); |
| | | } |
| | | if(orderType == 4){ |
| | | fileInputStream = new FileInputStream(new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf")); |
| | | fileInputStream = new FileInputStream(new File("/data/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf")); |
| | | } |
| | | BufferedInputStream bf = new BufferedInputStream(fileInputStream); |
| | | outputStream = response.getOutputStream(); |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName + ".mp3"); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName + ".mp3"); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | // Element track_chinese = document.getElementById("track_chinese"); |
| | | // track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_chinese = document.getElementById("pay_time_chinese"); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | | for (int i = 0; i < driver_chinese.size(); i++) { |
| | | Element element = driver_chinese.get(i); |
| | |
| | | // Element track_english = document.getElementById("track_english"); |
| | | // track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_english = document.getElementById("pay_time_english"); |
| | | pay_time_english.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_english.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | | for (int i = 0; i < driver_english.size(); i++) { |
| | | Element element = driver_english.get(i); |
| | |
| | | // Element track_french = document.getElementById("track_french"); |
| | | // track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_french = document.getElementById("pay_time_french"); |
| | | pay_time_french.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_french.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | | for (int i = 0; i < driver_french.size(); i++) { |
| | | Element element = driver_french.get(i); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), finalLanguage1 == 1 ? "包裹收据" : finalLanguage1 == 2 ? "Delivery receipt" : "Reçu de livraison", 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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | // Element track_chinese = document.getElementById("track_chinese"); |
| | | // track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_chinese = document.getElementById("pay_time_chinese"); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | | for (int i = 0; i < driver_chinese.size(); i++) { |
| | | Element element = driver_chinese.get(i); |
| | |
| | | // Element track_english = document.getElementById("track_english"); |
| | | // track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_english = document.getElementById("pay_time_english"); |
| | | pay_time_english.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_english.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | | for (int i = 0; i < driver_english.size(); i++) { |
| | | Element element = driver_english.get(i); |
| | |
| | | // Element track_french = document.getElementById("track_french"); |
| | | // track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_french = document.getElementById("pay_time_french"); |
| | | pay_time_french.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_french.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | | for (int i = 0; i < driver_french.size(); i++) { |
| | | Element element = driver_french.get(i); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), finalLanguage == 1 ? "包裹收据" : finalLanguage == 2 ? "Delivery receipt" : "Reçu de livraison", 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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | // Element track_chinese = document.getElementById("track_chinese"); |
| | | // track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_chinese = document.getElementById("pay_time_chinese"); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | | for (int i = 0; i < driver_chinese.size(); i++) { |
| | | Element element = driver_chinese.get(i); |
| | |
| | | // Element track_english = document.getElementById("track_english"); |
| | | // track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_english = document.getElementById("pay_time_english"); |
| | | pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | | for (int i = 0; i < driver_english.size(); i++) { |
| | | Element element = driver_english.get(i); |
| | |
| | | // Element track_french = document.getElementById("track_french"); |
| | | // track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_french = document.getElementById("pay_time_french"); |
| | | pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | | for (int i = 0; i < driver_french.size(); i++) { |
| | | Element element = driver_french.get(i); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "包裹收据" : language == 2 ? "Delivery receipt" : "Reçu de livraison", 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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + id + ".html"); |
| | | file = new File("/data/nginx/html/files/html/parcel_receipt_" + id + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + id + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/parcel_receipt_" + id + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/parcel_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(null == lon || null == lat){ |
| | | return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides"); |
| | | } |
| | | language = userInfoService.queryLanguage(uid, language); |
| | | OrderLogistics orderLogistics = this.selectById(id); |
| | | Integer integer = null; |
| | |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "红包活动" : language == 2 ? "Lucky-promo activities" : "Activités bonus", 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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(null == lon || null == lat){ |
| | | return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides"); |
| | | } |
| | | language = userInfoService.queryLanguage(uid, language); |
| | | OrderPrivateCar orderPrivateCar = this.selectById(id); |
| | | Integer integer = null; |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | if(null != query2){ |
| | | Integer orderNum=this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("userId",orderPrivateCar.getUserId()) |
| | | .eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())")); |
| | | if(query2.getDistance()*1000>orderPrivateCar.getMileage() && query2.getOrderNum()>orderNum){ |
| | | if(query2.getDistance() * 1000 > orderPrivateCar.getMileage() && query2.getOrderNum().compareTo(orderNum) > 0){ |
| | | Double special = query2.getSpecial(); |
| | | if(null != special){ |
| | | orderPrivateCar.setDiscount(special); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", 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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", 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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "红包活动" : language == 2 ? "Lucky-promo activities" : "Activités bonus", 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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", 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(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + id + ".html"); |
| | | file = new File("/data/nginx/html/files/html/ride_receipt_" + id + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + id + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/ride_receipt_" + id + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/ride_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "投诉司机" : language == 2 ? "Complain against driver" : "Porter plainte contre le chauffeur", 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/complain_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/complain_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "反馈意见" : language == 2 ? "Feedback" : "Avis", 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/feedback_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/feedback_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "物品报失" : language == 2 ? "Report items lost" : "Signaler l'objet perdu", 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/reportLoss_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/reportLoss_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Registered successfully" : "Enregistré avec succès", 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/registration_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | driverActivityHistoryMapper.updateById(driverActivityHistory); |
| | | } |
| | | |
| | | if(bigDecimal.compareTo(BigDecimal.ZERO) > 0){ |
| | | driver.setActivityMoney(bigDecimal.add(new BigDecimal(driver.getActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveActivityMoney(bigDecimal.add(new BigDecimal(driver.getLaveActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(bigDecimal.add(new BigDecimal(driver.getBalance())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "司机奖励通知" : language == 2 ? "Reward-driver notice" : "Avis de chauffeur de récompense", document1.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/invitation_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"afternoon":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | EmailUtil.send(userInfo1.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon is in" : "Le coupon est arrivé sur le compte", document1.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/coupon_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Registered successfully" : "Enregistré avec succès", 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/registration_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "司机奖励通知" : language == 2 ? "Reward-driver notice" : "Avis de chauffeur de récompense", document1.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/invitation_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(userInfo1.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon is in" : "Le coupon est arrivé sur le compte", document1.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/coupon_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Registered successfully" : "Enregistré avec succès", 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/registration_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon is in" : "Le coupon est arrivé sur le compte", document1.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/coupon_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Registered successfully" : "Enregistré avec succès", 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/registration_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon is in" : "Le coupon est arrivé sur le compte", document1.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/coupon_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "重置密码" : language == 2 ? "Reset password" : "Réinitialiser le mot de passe", 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/password_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/password_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon is in" : "Le coupon est arrivé sur le compte", document1.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/coupon_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "优惠券到账" : language == 2 ? "Coupon is in" : "Le coupon est arrivé sur le compte", document1.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/coupon_" + randomString + ".html"); |
| | | file = new File("/data/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.google.api.gax.core.FixedCredentialsProvider; |
| | | import com.google.auth.oauth2.GoogleCredentials; |
| | | import com.google.cloud.texttospeech.v1.*; |
| | | import com.google.protobuf.ByteString; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.OutputStream; |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | public static String create(String languageCode, String text, String fileName) throws Exception { |
| | | // Instantiates a client |
| | | try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) { |
| | | GoogleCredentials googleCredentials = GoogleCredentials |
| | | .fromStream(new FileInputStream("/home/igotechgh/i-go-gcp-f83e2d02152a.json")) |
| | | .createScoped("https://www.googleapis.com/auth/cloud-platform"); |
| | | |
| | | FixedCredentialsProvider provider = FixedCredentialsProvider.create(googleCredentials); |
| | | TextToSpeechSettings textToSpeechSettings = TextToSpeechSettings.newBuilder().setCredentialsProvider(provider).build(); |
| | | try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create(textToSpeechSettings)) { |
| | | // Set the text input to be synthesized |
| | | SynthesisInput input = SynthesisInput.newBuilder().setText(text).build(); |
| | | |
| | |
| | | ByteString audioContents = response.getAudioContent(); |
| | | |
| | | // Write the response to the output file. |
| | | try (OutputStream out = new FileOutputStream("/home/igotechgh/nginx/html/files/audio/" + fileName)) { |
| | | File file = new File("/data/nginx/html/files/audio/" + fileName); |
| | | if (!file.exists()) { |
| | | file.createNewFile(); |
| | | } |
| | | try (OutputStream out = new FileOutputStream("/data/nginx/html/files/audio/" + fileName)) { |
| | | out.write(audioContents.toByteArray()); |
| | | return "https://igo.i-go.group/files/audio/" + fileName; |
| | | }catch (Exception e){ |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | template-path: /data/nginx/html/mailbox/ |
| | | |
| | | --- |
| | |
| | | max-file-size: 100MB |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 16379 |
| | | host: 172.17.0.3 |
| | | port: 6379 |
| | | password: mPMHThYzlT8DWgl8HLqwPEyPOiHDPPB5 |
| | | |
| | | |
| | |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | |
| | | |
| | | #多数据源情况的配置 |
| | | guns: |
| | | muti-datasource: |
| | | open: false |
| | | url: jdbc:mysql://127.0.0.1:3306/guns_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | dataSourceNames: |
| | | - dataSourceGuns |
| | | - dataSourceBiz |
| | | |
| | | --- |
| | | |
| | |
| | | |
| | | spring: |
| | | mail: |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | template-path: /data/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | |
| | | audioPath: /home/igotechgh/nginx/html/files/audio |
| | | audioPath: /data/nginx/html/files/audio |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/sendMsgToClient") |
| | | public String sendMsgToClient(Integer id, Integer type, String msg){ |
| | | if(type == 1){//用户端 |
| | | public String sendMsgToClient(String id, String type, String msg){ |
| | | if("1".equals(type)){//用户端 |
| | | ChannelHandlerContext channel = NettyChannelMap.getData("Applets" + id);//小程序 |
| | | if(null != channel){ |
| | | NettyWebSocketController.sendMsgToClient(channel, msg); |
| | |
| | | |
| | | } |
| | | |
| | | if(type == 2){//司机端 |
| | | if("2".equals(type)){//司机端 |
| | | ChannelHandlerContext channel = NettyChannelMap.getData("DRIVER" + id); |
| | | if(null != channel){ |
| | | NettyServerController.sendMsgToClient(channel, msg); |
| | |
| | | file-size-threshold: 100MB |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 16379 |
| | | host: 172.17.0.3 |
| | | port: 6379 |
| | | password: mPMHThYzlT8DWgl8HLqwPEyPOiHDPPB5 |
| | | |
| | | eureka: |