Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/IgoTravel into 2.0
| | |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.sun.mail</groupId> |
| | | <artifactId>javax.mail</artifactId> |
| | | <version>1.6.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | </dependency> |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName + ".mp3"); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName + ".mp3"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language, Integer uid) throws Exception; |
| | | ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String pickUpCode, Integer language, Integer uid) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.itextpdf.HtmlToPdfUtils; |
| | | import com.stylefeng.guns.modular.system.util.quartz.QuartzUtil; |
| | | import com.stylefeng.guns.modular.system.util.quartz.jobs.OrderTimeOutJob; |
| | |
| | | orderLogistics.setTripId(UUIDUtil.getRandomCode()); |
| | | } |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | String tripId = redisUtil.getValue("trip" + orderLogistics.getUserId()); |
| | | if(ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderLogistics.setEstimateArriveTime(new Date(timeOut)); |
| | |
| | | * @param state |
| | | * @param lon |
| | | * @param lat |
| | | * @param address |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String pickUpCode, Integer language, Integer uid) throws Exception { |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String pickUpCode, Integer language, Integer uid) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | String tripId = redisUtil.getValue("trip" + orderLogistics.getUserId()); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lon, tripId); |
| | | if(null == reverseGeocode){ |
| | | return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides"); |
| | | } |
| | | String address = reverseGeocode.getAddress(); |
| | | if(!uid.equals(orderLogistics.getDriverId())){ |
| | | return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande"); |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "取件码邮件" : language == 2 ? "Pickup code" : "Code de ramassage", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/code_" + orderId + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/code_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/code_" + orderId + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/code_" + orderId + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address,String phone, Integer language, Integer uid) throws Exception; |
| | | ResultUtil process(Integer orderId, Integer state, Double lon, Double lat,String phone, Integer language, Integer uid) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.quartz.QuartzUtil; |
| | | import com.stylefeng.guns.modular.system.util.quartz.jobs.OrderTimeOutJob; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | |
| | | @Override |
| | | public synchronized ResultUtil grabOrder(Integer orderId, Integer uid, Integer language) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | String tripId = redisUtil.getValue("trip" + orderPrivateCar.getUserId()); |
| | | //处理摆渡车的情况 |
| | | if(orderPrivateCar.getType() == 2){ |
| | | //查看用户下的摆渡车是否已被人抢了 |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderPrivateCar.setEstimateArriveTime(new Date(timeOut)); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address,String phone, Integer language, Integer uid) throws Exception { |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat,String phone, Integer language, Integer uid) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | String tripId = redisUtil.getValue("trip" + orderPrivateCar.getUserId()); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lon, tripId); |
| | | if(null == reverseGeocode){ |
| | | return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides"); |
| | | } |
| | | String address = reverseGeocode.getAddress(); |
| | | if(!uid.equals(orderPrivateCar.getDriverId())){ |
| | | return ResultUtil.error(language == 1 ? "操作失败,请刷新订单" : language == 2 ? "Operation failed, please refresh the order" : "L’opération a échoué, veuillez actualiser la commande"); |
| | | } |
| | |
| | | tripStatus = "ENROUTE_TO_DROPOFF"; |
| | | switch (language){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-CN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/OnboardReminder-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-EN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/OnboardReminder-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/OnboardReminder-FR.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/OnboardReminder-FR.mp3"; |
| | | break; |
| | | } |
| | | break; |
| | |
| | | tripStatus = "COMPLETE"; |
| | | switch (language){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-CN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/ReachDestination-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-EN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/ReachDestination-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ReachDestination-FR.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/ReachDestination-FR.mp3"; |
| | | break; |
| | | } |
| | | break; |
| | |
| | | |
| | | <select id="queryByCompanyId" resultType="Driver"> |
| | | select * |
| | | from t_driver where flag != 3 |
| | | from t_driver where flag != 3 and authState = 2 |
| | | <choose> |
| | | <when test="companyId == 1"> |
| | | and (companyId = 1 or companyId is null or companyId = 0) and (franchiseeId = 0 or franchiseeId is null) |
| | |
| | | * @throws Exception |
| | | */ |
| | | Company query(String lon, String lat) throws Exception; |
| | | Company query1(String lon, String lat) throws Exception; |
| | | Company query1(Integer uid, String lon, String lat) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception; |
| | | List<Driver> queryIdleDriver(Integer userId, Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Company query1(String lon, String lat) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(lat), Double.valueOf(lon)); |
| | | public Company query1(Integer uid, String lon, String lat) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(lat), Double.valueOf(lon), tripId); |
| | | if(null == reverseGeocode){ |
| | | return null; |
| | | } |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/invitation_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/invitation_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/invitation_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/invitation_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/registration_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/registration_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/reset_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/reset_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/reset_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/reset_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryPhone(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, null); |
| | | if(null == reverseGeocode){ |
| | | System.err.println("获取地址异常"); |
| | | return null; |
| | |
| | | }).start(); |
| | | switch (language){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-CN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/AfterWork-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-EN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/AfterWork-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-FR.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/AfterWork-FR.mp3"; |
| | | break; |
| | | } |
| | | }else{ |
| | |
| | | |
| | | switch (language){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-CN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/AtWork-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-EN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/AtWork-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-FR.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/AtWork-FR.mp3"; |
| | | break; |
| | | } |
| | | } |
| | |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/reset_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/reset_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/reset_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/reset_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | Element rewardToday_award = document1.getElementById("rewardToday_award"); |
| | | rewardToday_award.text("奖金 GHS" + driverActivityHistory.getMoney()); |
| | | Element rewardToday_content = document1.getElementById("rewardToday_content"); |
| | | rewardToday_content.text("邀请司机注册即可获得奖励。\n注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | rewardToday_content.html("邀请司机注册即可获得奖励。<br/>注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element rewardToday1_award = document1.getElementById("rewardToday1_award"); |
| | | rewardToday1_award.text("GHS " + driverActivityHistory.getMoney() + " BONUS"); |
| | | Element rewardToday1_content = document1.getElementById("rewardToday1_content"); |
| | | rewardToday1_content.text("Get a bonus on I-GO today.\nInvite drivers to register to get the bonus.\nNote that this is a limited-time offer. Check your app for more details."); |
| | | rewardToday1_content.html("Invite drivers to register to get the bonus.<br/>Note that this is a limited-time offer. Check your app for more details."); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element rewardToday2_award = document1.getElementById("rewardToday2_award"); |
| | | rewardToday2_award.text("Bonus GHS " + driverActivityHistory.getMoney()); |
| | | Element rewardToday2_content = document1.getElementById("rewardToday2_content"); |
| | | rewardToday2_content.text("Obtenez un bonus sur I-GO dès aujourd’hui.\nInvitez les chauffeurs à s’inscrire pour obtenir le bonus.\nNotez qu’il s’agit d’une offre d’une durée limitée. Consultez votre application pour plus de détails."); |
| | | rewardToday2_content.html("Invitez les chauffeurs à s’inscrire pour obtenir le bonus.<br/>Notez qu’il s’agit d’une offre d’une durée limitée. Consultez votre application pour plus de détails."); |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/activity_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/activity_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | Element rewardToday_award = document1.getElementById("rewardToday_award"); |
| | | rewardToday_award.text("奖金 GHS" + driverActivityHistory.getMoney()); |
| | | Element rewardToday_content = document1.getElementById("rewardToday_content"); |
| | | rewardToday_content.text("邀请用户注册即可获得奖励。\n 注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | rewardToday_content.html("邀请用户注册即可获得奖励。<br/> 注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element rewardToday1_award = document1.getElementById("rewardToday1_award"); |
| | | rewardToday1_award.text("GHS " + driverActivityHistory.getMoney() + " BONUS"); |
| | | Element rewardToday1_content = document1.getElementById("rewardToday1_content"); |
| | | rewardToday1_content.text("Get a bonus on I-GO today.\nInvite users to register to get the bonus.\nNote that this is a limited-time offer. Check your app for more details."); |
| | | rewardToday1_content.html("Invite users to register to get the bonus.<br/>Note that this is a limited-time offer. Check your app for more details."); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element rewardToday2_award = document1.getElementById("rewardToday2_award"); |
| | | rewardToday2_award.text("Bonus GHS " + driverActivityHistory.getMoney()); |
| | | Element rewardToday2_content = document1.getElementById("rewardToday2_content"); |
| | | rewardToday2_content.text("Obtenez un bonus sur I-GO dès aujourd’hui.\nInvitez les utilisateurs à s’inscrire pour obtenir le bonus.\nNotez qu’il s’agit d’une offre d’une durée limitée. Consultez votre application pour plus de détails."); |
| | | rewardToday2_content.html("Invitez les utilisateurs à s’inscrire pour obtenir le bonus.<br/>Notez qu’il s’agit d’une offre d’une durée limitée. Consultez votre application pour plus de détails."); |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/activity_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/activity_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | Element rewardToday_award = document1.getElementById("rewardToday_award"); |
| | | rewardToday_award.text("奖金 GHS" + driverActivityHistory.getMoney()); |
| | | Element rewardToday_content = document1.getElementById("rewardToday_content"); |
| | | rewardToday_content.text("今日累计在线" + driverActivityOnline.getOnline() + "小时即可活动奖励。\n 注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | rewardToday_content.html("今日累计在线" + driverActivityOnline.getOnline() + "小时即可活动奖励。<br/> 注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element rewardToday1_award = document1.getElementById("rewardToday1_award"); |
| | | rewardToday1_award.text("GHS " + driverActivityHistory.getMoney() + " BONUS"); |
| | | Element rewardToday1_content = document1.getElementById("rewardToday1_content"); |
| | | rewardToday1_content.text("Get a bonus for driving on I-GO today.\nStay online for " + driverActivityOnline.getOnline() + " hours to get the bonus.\nNote that this is a limited-time offer. Check your app for more details."); |
| | | rewardToday1_content.html("Stay online for " + driverActivityOnline.getOnline() + " hours to get the bonus.<br/>Note that this is a limited-time offer. Check your app for more details."); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element rewardToday2_award = document1.getElementById("rewardToday2_award"); |
| | | rewardToday2_award.text("Bonus GHS " + driverActivityHistory.getMoney()); |
| | | Element rewardToday2_content = document1.getElementById("rewardToday2_content"); |
| | | rewardToday2_content.text("Obtenez un bonus pour conduire sur I-GO dès aujourd’hui.\nRestez en ligne pendant " + driverActivityOnline.getOnline() + " heures pour obtenir le bonus.\nNotez qu’il s’agit d’une offre d’une durée limitée. Consultez votre application pour plus de détails."); |
| | | rewardToday2_content.html("Restez en ligne pendant " + driverActivityOnline.getOnline() + " heures pour obtenir le bonus.<br/>Notez qu’il s’agit d’une offre d’une durée limitée. Consultez votre application pour plus de détails."); |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/activity_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/activity_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | Element rewardToday_award = document1.getElementById("rewardToday_award"); |
| | | rewardToday_award.text("奖金 GHS" + driverActivityHistory.getMoney()); |
| | | Element rewardToday_content = document1.getElementById("rewardToday_content"); |
| | | rewardToday_content.text("今日累计完成" + driverActivityOrder.getOrderNum() + "单即可活动奖励。\n 注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | rewardToday_content.html("今日累计完成" + driverActivityOrder.getOrderNum() + "单即可活动奖励。<br/> 注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element rewardToday1_award = document1.getElementById("rewardToday1_award"); |
| | | rewardToday1_award.text("GHS " + driverActivityHistory.getMoney() + " BONUS"); |
| | | Element rewardToday1_content = document1.getElementById("rewardToday1_content"); |
| | | rewardToday1_content.text("Get a bonus for driving on I-GO today.\nStay online and complete " + driverActivityOrder.getOrderNum() + " trips to get the bonus.\nNote that this is a limited-time offer. Check your app for more details."); |
| | | rewardToday1_content.html("Stay online and complete " + driverActivityOrder.getOrderNum() + " trips to get the bonus.<br/>Note that this is a limited-time offer. Check your app for more details."); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element rewardToday2_award = document1.getElementById("rewardToday2_award"); |
| | | rewardToday2_award.text("Bonus GHS " + driverActivityHistory.getMoney()); |
| | | Element rewardToday2_content = document1.getElementById("rewardToday2_content"); |
| | | rewardToday2_content.text("Obtenez un bonus pour conduire sur I-GO dès aujourd’hui.\nRestez en ligne et effectuez " + driverActivityOrder.getOrderNum() + " trajets pour obtenir le bonus.\nNotez qu’il s’agit d’une offre d’une durée limitée. Consultez votre application pour plus de détails."); |
| | | rewardToday2_content.html("Restez en ligne et effectuez " + driverActivityOrder.getOrderNum() + " trajets pour obtenir le bonus.<br/>Notez qu’il s’agit d’une offre d’une durée limitée. Consultez votre application pour plus de détails."); |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/activity_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/activity_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/activity_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | Element reward_user = document1.getElementById("reward_user"); |
| | | reward_user.text("您好 " + driver.getFirstName() + "" + driver.getLastName() + ","); |
| | | Element reward_content = document1.getElementById("reward_content"); |
| | | reward_content.text("今日累计在线" + dao.getOnline() + "小时,获得奖励GHS" + dah.getMoney() + ",请查收。\n详情请查看I-GO平台。"); |
| | | reward_content.html("今日累计在线" + dao.getOnline() + "小时,获得奖励GHS" + dah.getMoney() + ",请查收。<br/>详情请查看I-GO平台。"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element reward1_user = document1.getElementById("reward1_user"); |
| | | reward1_user.text("Hello " + driver.getFirstName() + "" + driver.getLastName() + ","); |
| | | Element reward1_content = document1.getElementById("reward1_content"); |
| | | reward1_content.text("You stayed online for " + dao.getOnline() + " hours today, and got a bonus of GHS" + dah.getMoney() + ", please check.\nCheck your app for more details."); |
| | | reward1_content.html("You stayed online for " + dao.getOnline() + " hours today, and got a bonus of GHS" + dah.getMoney() + ", please check.<br/>Check your app for more details."); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element reward2_user = document1.getElementById("reward2_user"); |
| | | reward2_user.text("Cher(ère) " + driver.getFirstName() + "" + driver.getLastName() + ","); |
| | | Element reward2_content = document1.getElementById("reward2_content"); |
| | | reward2_content.text("Vous êtes resté en ligne pendant " + dao.getOnline() + " heures aujourd’hui et avez obtenu un bonus de GHS" + dah.getMoney() + ", veuillez vérifier.\nConsultez votre application pour plus de détails."); |
| | | reward2_content.html("Vous êtes resté en ligne pendant " + dao.getOnline() + " heures aujourd’hui et avez obtenu un bonus de GHS" + dah.getMoney() + ", veuillez vérifier.<br/>Consultez votre application pour plus de détails."); |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/rewards_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/rewards_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/rewards_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/rewards_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | Element reward_user = document1.getElementById("reward_user"); |
| | | reward_user.text("您好 " + driver.getFirstName() + "" + driver.getLastName() + ","); |
| | | Element reward_content = document1.getElementById("reward_content"); |
| | | reward_content.text("今日累计接单" + dao.getOrderNum() + "单,获得奖励GHS" + dah.getMoney() + ",请查收。\n详情请查看I-GO平台。"); |
| | | reward_content.html("今日累计接单" + dao.getOrderNum() + "单,获得奖励GHS" + dah.getMoney() + ",请查收。<br/>详情请查看I-GO平台。"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element reward1_user = document1.getElementById("reward1_user"); |
| | | reward1_user.text("Hello " + driver.getFirstName() + "" + driver.getLastName() + ","); |
| | | Element reward1_content = document1.getElementById("reward1_content"); |
| | | reward1_content.text("You completed " + dao.getOrderNum() + " trips today, and got a bonus of GHS" + dah.getMoney() + ", please check.\nCheck your app for more details."); |
| | | reward1_content.html("You completed " + dao.getOrderNum() + " trips today, and got a bonus of GHS" + dah.getMoney() + ", please check.<br/>Check your app for more details."); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").remove(); |
| | |
| | | Element reward2_user = document1.getElementById("reward2_user"); |
| | | reward2_user.text("Cher(ère) " + driver.getFirstName() + "" + driver.getLastName() + ","); |
| | | Element reward2_content = document1.getElementById("reward2_content"); |
| | | reward2_content.text("Vous avez effectué " + dao.getOrderNum() + " trajets aujourd’hui et avez reçu un bonus de GHS" + dah.getMoney() + ", veuillez vérifier.\nConsultez votre application pour plus de détails."); |
| | | reward2_content.html("Vous avez effectué " + dao.getOrderNum() + " trajets aujourd’hui et avez reçu un bonus de GHS" + dah.getMoney() + ", veuillez vérifier.<br/>Consultez votre application pour plus de détails."); |
| | | } |
| | | |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/rewards_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/rewards_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/rewards_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/rewards_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | public List<Driver> queryIdleDriver(Integer userId, Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | List<Driver> drivers = driverMapper.queryIdleDriver_(type, serverCarModelId, companyId); |
| | | String tripId = redisUtil.getValue("trip" + userId); |
| | | List<Driver> list = new ArrayList<>(); |
| | | for(Driver driver : drivers){ |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(lat, lon, Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(lat, lon, Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0]), tripId); |
| | | if(null != distancematrix){ |
| | | if(distancematrix.getDistance() < (distance * 1000)){ |
| | | list.add(driver); |
| | |
| | | switch (orderType){ |
| | | case 1://专车 |
| | | map = orderPrivateCarService.queryPushOrder(orderId, language); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon)); |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | String tripId = redisUtil.getValue("trip" + orderPrivateCar.getUserId()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon), tripId); |
| | | map.put("startDistance", null != distancematrix ? distancematrix.getDistance() / 1000 : 0); |
| | | |
| | | //总距离 |
| | | distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(map.get("endLat").toString()), Double.valueOf(map.get("endLon").toString())); |
| | | distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(map.get("endLat").toString()), Double.valueOf(map.get("endLon").toString()), tripId); |
| | | map.put("totalDistance", null != distancematrix ? distancematrix.getDistance() / 1000 : 0); |
| | | |
| | | Integer orderSource = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | |
| | | break; |
| | | case 4://市内小件物流 |
| | | map = orderLogisticsService.queryPushOrder(orderId, language); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon)); |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | String tripId1 = redisUtil.getValue("trip" + orderLogistics.getUserId()); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon), tripId1); |
| | | map.put("startDistance", null != distancematrix1 ? distancematrix1.getDistance() / 1000 : 0); |
| | | |
| | | //总距离 |
| | | distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(map.get("endLat").toString()), Double.valueOf(map.get("endLon").toString())); |
| | | distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(map.get("endLat").toString()), Double.valueOf(map.get("endLon").toString()), tripId1); |
| | | map.put("totalDistance", null != distancematrix1 ? distancematrix1.getDistance() / 1000 : 0); |
| | | |
| | | Integer orderSource3 = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat,String phone, String pickUpCode, Integer language) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lon); |
| | | if(null == reverseGeocode){ |
| | | return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides"); |
| | | } |
| | | String address = reverseGeocode.getAddress(); |
| | | switch (orderType){ |
| | | case 1://专车 |
| | | return orderPrivateCarService.process(orderId, state, lon, lat, address, phone, language, uid); |
| | | return orderPrivateCarService.process(orderId, state, lon, lat, phone, language, uid); |
| | | case 2://出租 |
| | | // return orderTaxiService.process(orderId, state, lon, lat, address); |
| | | case 3://城际 |
| | | // return orderCrossCityService.process(orderId, state, lon, lat, address); |
| | | case 4://同城小件 |
| | | return orderLogisticsService.process(orderId, state, lon, lat, address, pickUpCode, language, uid); |
| | | return orderLogisticsService.process(orderId, state, lon, lat, pickUpCode, language, uid); |
| | | case 5://跨城小件 |
| | | // return orderLogisticsService.process(orderId, state, lon, lat, address); |
| | | case 6: |
| | |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | ResultUtil resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, uid, 2, orderId, orderType, 1, money, null, 1);//添加预支付数据 |
| | |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | ResultUtil resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | |
| | | if(resultUtil.getCode()==200){ |
| | |
| | | |
| | | /** |
| | | * 获取客服电话(个人中心) |
| | | * @param code |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryCustomerPhone(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lat); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lat, null); |
| | | if(null == reverseGeocode){ |
| | | System.err.println("获取地图信息出错"); |
| | | return new HashMap<>(); |
| | |
| | | reassign.setInsertTime(new Date()); |
| | | reassign.setState(2); |
| | | this.insert(reassign); |
| | | |
| | | String tripId = ""; |
| | | //修改改派通知状态 |
| | | switch (reassign.getOrderType()){ |
| | | case 1: |
| | |
| | | orderPrivateCar.setState(11); |
| | | orderPrivateCar.setReassignNotice(2); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | tripId = redisUtil.getValue("trip" + orderPrivateCar.getUserId()); |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(reassign.getOrderId()); |
| | |
| | | orderTaxi.setState(11); |
| | | orderTaxi.setReassignNotice(2); |
| | | orderTaxiService.updateById(orderTaxi); |
| | | tripId = redisUtil.getValue("trip" + orderTaxi.getUserId()); |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(reassign.getOrderId()); |
| | |
| | | orderLogistics.setState(11); |
| | | orderLogistics.setReassignNotice(2); |
| | | orderLogisticsService.updateById(orderLogistics); |
| | | tripId = redisUtil.getValue("trip" + orderLogistics.getUserId()); |
| | | break; |
| | | case 5: |
| | | OrderLogistics orderLogistics1 = orderLogisticsService.selectById(reassign.getOrderId()); |
| | |
| | | orderLogistics1.setState(11); |
| | | orderLogistics1.setReassignNotice(2); |
| | | orderLogisticsService.updateById(orderLogistics1); |
| | | tripId = redisUtil.getValue("trip" + orderLogistics1.getUserId()); |
| | | break; |
| | | } |
| | | systemNoticeService.addSystemNotice(2, language == 1 ? "您的改派申请已成功提交,我们会尽快为你处理!" : language == 2 ? |
| | | "Your request for reassignment was submitted, we shall handle it for you as soon as possible." : |
| | | "Votre demande de réaffectation a été soumise. Nous la traiterons pour vous dans les plus brefs délais.", uid); |
| | | |
| | | |
| | | |
| | | //开始自动完成改派 |
| | | switch (reassign.getOrderType()){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(reassign.getOrderId()); |
| | | Company company = companyCityService.query1(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | Company company = companyCityService.query1(orderPrivateCar.getUserId(), String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | PushOrder pushOrder = pushOrderService.querys(1, 1, company.getId()).get(0); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(orderPrivateCar.getUserId(), 1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | System.err.println("【" + orderPrivateCar.getId() + "】空闲司机:" + JSON.toJSONString(list)); |
| | | if(list.size() > 0){ |
| | | String text = ""; |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver1.getId()); |
| | | if(ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderPrivateCar.setEstimateArriveTime(new Date(timeOut)); |
| | |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(reassign.getOrderId()); |
| | | Company company1 = companyCityService.query1(String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司 |
| | | Company company1 = companyCityService.query1(orderLogistics.getUserId(), String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司 |
| | | PushOrder pushOrder1 = pushOrderService.querys(1, 1, company1.getId()).get(0); |
| | | //获取空闲司机 |
| | | List<Driver> list1 = driverService.queryIdleDriver(orderLogistics.getType(), orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder1.getPushDistance(), null);//所有附近空闲司机 |
| | | List<Driver> list1 = driverService.queryIdleDriver(orderLogistics.getUserId(), orderLogistics.getType(), orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder1.getPushDistance(), null);//所有附近空闲司机 |
| | | System.err.println("【" + orderLogistics.getId() + "】空闲司机:" + JSON.toJSONString(list1)); |
| | | if(list1.size() > 0){ |
| | | Driver driver1 = list1.get(0); |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver1.getId()); |
| | | if(ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderLogistics.setEstimateArriveTime(new Date(timeOut)); |
| | |
| | | List<Integer> collect = settlementRecords.stream().map(SettlementRecord::getId).collect(Collectors.toList()); |
| | | Wrapper<SettlementDetail> wrapper = new EntityWrapper<SettlementDetail>(); |
| | | if(collect.size() > 0){ |
| | | wrapper.in("settlementRecordId", collect).or().isNull("settlementRecordId"); |
| | | wrapper.eq("driverId", driverId).in("settlementRecordId", collect).or().eq("driverId", driverId).isNull("settlementRecordId"); |
| | | }else{ |
| | | wrapper.isNull("settlementRecordId"); |
| | | wrapper.eq("driverId", driverId).isNull("settlementRecordId"); |
| | | } |
| | | settlementDetailList = settlementDetailService.selectList(wrapper.orderBy("createTime desc")); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | |
| | | checkoutRequest.setRequestDescription("Settlement cost"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/settlementRecord/paymentSettlementAmountCallback"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | |
| | | if(resultUtil.getCode()!=200){ |
| | |
| | | checkoutRequest.setRequestDescription("Settlement cost"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/settlementRecord/paymentSettlementAmountCallback"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | |
| | | if(resultUtil.getCode()!=200){ |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import javax.mail.Authenticator; |
| | | import javax.mail.PasswordAuthentication; |
| | | import javax.mail.Session; |
| | | import javax.mail.Transport; |
| | | import javax.mail.*; |
| | | import javax.mail.internet.InternetAddress; |
| | | import javax.mail.internet.MimeBodyPart; |
| | | import javax.mail.internet.MimeMessage; |
| | |
| | | Properties props = new Properties(); |
| | | //选择ssl方式 |
| | | gmailssl(props); |
| | | |
| | | |
| | | final String username = "i-gotech@i-go.group";// gmail 邮箱 |
| | | final String password = "mhizkqkhuknbitps";// Google应用专用密码 |
| | | // 当做多商户的时候需要使用getInstance, 如果只是一个邮箱发送的话就用getDefaultInstance |
| | | // Session.getDefaultInstance 会将username,password保存在session会话中 |
| | | // Session.getInstance 不进行保存 |
| | | final String password = "rvbmuovvpocmhast";// Google应用专用密码 |
| | | Session session = Session.getInstance(props, |
| | | new Authenticator() { |
| | | protected PasswordAuthentication getPasswordAuthentication() { |
| | | return new PasswordAuthentication(username, password); |
| | | } |
| | | }); |
| | | MimeMessage msg = new MimeMessage(session); |
| | | //2.设置发件人地址 |
| | | msg.setFrom(new InternetAddress(sentToEmail)); |
| | | /** |
| | | * 3.设置收件人地址(可以增加多个收件人、抄送、密送),即下面这一行代码书写多行 |
| | | * MimeMessage.RecipientType.TO:发送 |
| | | * MimeMessage.RecipientType.CC:抄送 |
| | | * MimeMessage.RecipientType.BCC:密送 |
| | | */ |
| | | msg.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress(sentToEmail)); |
| | | //4.设置邮件主题 |
| | | msg.setSubject(subject, "UTF-8"); |
| | | // 6. 创建文本"节点" |
| | | // 创建默认的MimeMessage对象 |
| | | MimeMessage message = new MimeMessage(session); |
| | | // 设置发件人 |
| | | message.setFrom(new InternetAddress(username)); |
| | | // 设置收件人 |
| | | message.addRecipient(Message.RecipientType.TO, new InternetAddress(sentToEmail)); |
| | | // 设置邮件主题 |
| | | message.setSubject(subject,"UTF-8"); |
| | | // 设置邮件内容 |
| | | MimeBodyPart text = new MimeBodyPart(); |
| | | // 这里添加图片的方式是将整个图片包含到邮件内容中, 实际上也可以以 http 链接的形式添加网络图片 |
| | | text.setContent(content, "text/html;charset=UTF-8"); |
| | | // 7. (文本+图片)设置 文本 和 图片"节点"的关系(将 文本 和 图片"节点"合成一个混合"节点") |
| | | MimeMultipart mm_text_image = new MimeMultipart(); |
| | | mm_text_image.addBodyPart(text); |
| | | mm_text_image.setSubType("related"); // 关联关系 |
| | | // 11. 设置整个邮件的关系(将最终的混合"节点"作为邮件的内容添加到邮件对象) |
| | | msg.setContent(mm_text_image); |
| | | text.setContent(content,"text/html;charset=UTF-8"); |
| | | MimeMultipart mimeMultipart = new MimeMultipart(); |
| | | mimeMultipart.addBodyPart(text); |
| | | mimeMultipart.setSubType("related"); |
| | | message.setContent(mimeMultipart); |
| | | //设置邮件的发送时间,默认立即发送 |
| | | msg.setSentDate(new Date()); |
| | | |
| | | Transport transport = session.getTransport(); |
| | | transport.connect(); |
| | | transport.sendMessage(msg, msg.getAllRecipients()); |
| | | transport.close(); |
| | | message.setSentDate(new Date()); |
| | | |
| | | // 发送消息 |
| | | Transport.send(message); |
| | | System.out.println("Sent message successfully...."); |
| | | return true; |
| | | } |
| | | |
| | |
| | | |
| | | static Logger logger = LoggerFactory.getLogger(FleetEngineUtil.class); |
| | | |
| | | private final String SERVICE_ACCOUNT = "odrd-fleetengine-ondemandadmin@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String DRIVER_ACCOUNT = "odrd-fleetengine-driversdkuser@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String CONSUMER_ACCOUNT = "odrd-fleetengine-consumersdkus@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String serverPrivateKeyId = "254e18eefa9fdcca64d5899cdcd793d466c47c7d"; |
| | | |
| | | private final String serverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCfbNAWnukqLKIxItqmSABxsH5glySEHJ2gfL5KsRF0M02e0Z8/KNKZkoh7I6bOMt1fEtttFaWOeq70IdI2WAd5wVazL3upvl5FW4P08ly33LklfGyLljlJ7ChPny9x6OjAaiS0yD9fh7NWti7rZKU7gzcGL8HddNYXgXV5OajvoG3TGdu52WTxce9AUzU6gLPboz/RbGqrdrmgVJVb0EPlhTJf/NSsaiW4NoL8SEzf/pJGYBmqJs97mXwCHTY4avaC+CP/zz9yS8AQEJlApbVT6lSOhYoR0hNOBj5B886EZOssjubO6hQaiwRnGrV2RdpHynqA1iekfGpUGEtWTsqjAgMBAAECggEALyPbMd0iP8y71sCiG4nty7Au5ju62e+mMkbAc9CAwzXKTVxZdLEK+MsJ3TNxBsami47FYC+G6SbgpaJ8iIImD7v5+XjgXZRDRsnlLmAdx2YWPv3YELxGS1PvpX+B5XJDpGWeXfBaQNKc1lZ/cC4t53eIpSUo82UxSvkGNea1S8lR6vIByhNyCQOvLG4yqaxUy0hZi0kge37XrjYMGS+BivBBnDiVlBPLBVbrNBxOf31Lzz+XX0iwXX7Zl2jN759oe0xQyuIGWUSj8xBDIF8nNaJrla7rWVml3sZJh6/3r1Acj0mhZtE0ZMu5hiPGiIXgb1ng30j3dMP4yVPhXrpAtQKBgQDaU01VnHsnHxc0DQHE2vEOPGmPxVS0/JAssePAEUmKEueUogGef91YY+Vm/ItbhLwGjbytnXxe88zRAdB1u07efZ83ey93TrGl2CJUzLHIcgb+Q1tT642rqlfl+q8ep86hcZ+63pDiIPt2Z+HkbKIR0SWf5LIH4flquQOTQufXXQKBgQC674qDsjOJepZjMMN6PkVMcWBYDNmXHnqa5Oto0rZM745UulbXqEFGuBOsXPU7O33Kfz1vbtoluubKZi5B6cFNnPypE2SCfvdObHq4FuTuKPV6lN93SyhZchmSEXEs0PU4cGDRt+RRqQcjft1Wigiy4Y1y1SInCtcaP1hLejEJ/wKBgFAhvwKrGnBzctrB42JTUaJ9/eis7rg28tvUttjp/2nUIndlNt7r41vr3mj8TFHc1/43y4aVhO584THdTpvHkd0LkoKUjglmMsHCIGercZ02bOap5j1Y+XiGXxij995yjN6oi43U3qyAmosM+dYTITEU6JBVKhrGj/rhyTQlnF5pAoGBAKFGmo0mR/pbDbYD0xH6+VSLGCC+7VbIT+SkjUjBSdA0eOo2XUfvfGmj1C1HgbcZi1wRzJH/5CrbBdQmtc/d+QyZ3Q2NkpBXM8uwIWwDLH0gTzDzkZvc9rG8k70GWUrd+EI6Cf3FFjExj9wazqCjs/+IQr2Ijc97NbsKXYW4pOhHAoGAKf5wYk+cn0cVTsyAom0UbGD5Uijqh5732MeqFYs2Rcwx0OErJZo68COSFFF40hJmmIKn7p3qycIyd1FcYlXN1l4s8mEWTGTInRE0OlBU0+jLtIV9pwNgffpbPYcrWZU6s6YVeJ2nDwl+aD+4QvN0rkPTfho9kjgeyF3PW0I2u4E="; |
| | | |
| | | private final String driverPrivateKeyId = "859e85fb3aa4d18b4afaac3e24e8f65700da5cc9"; |
| | | |
| | | private final String driverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmzL1BqSH+Zh9Fct5mXqe5sYOMTnJtOJhwKXnjjo2tNPXv4alzUHz8Vbj6nMar5u5IuKRZMeRBlhoRSFrLm+J1+sfvpH8N4wsnG7hDANknqWzdsk9a68qMHxNQF3hFzs9+KKrR1LAG8e9ytMfliN0kX+xls4uPZDPu1Q39K6V9KXrH/GrMA56i3TtWi7Hmakt5YTELeGjhx4nGrfuQLFFovs1Z9uJtf7E8R95+65StrOAmbJNf7VciEqwBpWYlU5VeyLXMg/oHwnTv2cjdcFozyDrlUHbDmtTiVeBBsYFVLyAsDGfl1p6eiVTiBBuo56YSYLWfaLgYvTyEcZ9jBQsfAgMBAAECggEAQzbTuObX3PT3+vtb5XKVMf33XY2rDJo2y1PbWzhxnO9vf3e22dIAW4qLnOmaIWFQeht1lr/FFCzRWk+Gzu+FJTemY8osrMLmFp9T9CQeXZ4nUXruAVxs5WQMW0Tp4W+CK3tlwmJrgJDzhYyV1Mf/HQ5Oa3kbbu/ZAY/3MCLrb/ClJQvD2rZSDdzAkNMQm8P2hsE71+rH7mI2hHrSCHl2OIp2A64QT8HjtyRc5yHZtTp6ZST1ge9SSIsT0ZfmXKtKF7yGEIPtKNU+oLrGyK5P30xBWJ/bwb3PEz2MZcPvz31+B2+UvZMm7OTkqfcRwEztAf8Ckiuo4im2BRYbVmd9OQKBgQDd0MeLxR+Qtv12bVA0bHtagFEq36THgWG7IM1/1vS4Cl9sveKSOS8A6oKLy624fGE7PKcuTTIzkVA81GXtWBQ9Coq/4TmllQkFTH7pz9C2PNHSCychPwNNV8qUx3lE3d4DOjGKgoVFD4l90AO7lOvmLTSc3pDpr+jSjUH4lqGrbQKBgQDAgXBmpXfCTxwqkBzGwxX+hwJen9qSkCM47qnQ1L4NnXPL6s0EN6rQ3FnFemGIzBUGJ2tajntkKlUu5DzsQeoBGu/SaSwgqD+1UQDcUyo+retmqZ+QYbpeyd3l53bLJJuJNsfak0X76Ft6hrm4julx6RGlmboQyx4kZWbhx4YNOwKBgEG9/2aNpi1eDwFqpLrk7CqGnYf3gP8gebbcoguhyiZB7MZuARkVmbjLyKVmWLa1JpxH/cTbXGWsS/u7d/pAgL8WwMjeGBfbdDD92x+xWEqq/AUlCRPxeSkTPBech3TBzWtndAd5Z8ZwNG/1lyWhnck63L0huhGI8Zh2BXeILaKBAoGAKK3xq69BvGztPc1QV2w4RJ4RER/kl14gI1LDzd52/veL1cabZk3BKfu2eLWg0MCXnMJNvEgpqQQNFiii+yX+phckIKma6pfDRrSEYwqr/azQ9tPXZTJRqOAtpPyhrNHikD9kQjsm6dGzKxQ3QNnqWOjwkrcGi6/wga5v7Dw2hqsCgYEA2T/kSNQ9dqpVBAkfi2J50hqnfFESPjKeirJJZllqhVqsiV0ly8a8Fz8SjGqTzrq+UErko+QmtSlo5h3Uq9Ln+0CwYfrUL+74q2zLHdS0DpY3QsGTEDJXTxCyy9kO26X2UsM3Ez3YUAkdMwdpVz0uVZtinv2735QZOBxoVQV2kQ8="; |
| | | |
| | | private final String consumerPrivateKeyId = "40acf82cbd5250de2f5123caff40738bdd403b08"; |
| | | |
| | | private final String consumerPrivateKey = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDSwtbSBFgIXna6mWeKFWCK31NXUJH6uGduR1XrODGRedrqrTgr0BdNg8PDo6/zh/T+K0Svor6kgqpwnl9soOdn73oC4Nu+Ad7EiKa38j650jlZdLAr4hR0Ou9Kcnv45x/94auUO8jBz844cu24swLKiPsK9OnX65wVlKRfhhkGFuS/4OI76CmE7NqZDqPOW16o8tBO5TsgPVNkglFAU73fTp0kcHoLauT9QOB0+yZi39mnNXyU+2cL3Ylp5oaQCJpyssDRUqz/EiHa7FxUUgzCadG00+ePf5iYSnZKQRKWoOIawFvcCfcHx8GAl8Nn+79HtVQHB9hLsQ5+jqcdfKPfAgMBAAECggEAE9Ufz912xzrUY1TCKH1Ae3Dub732Lqihmv/9dsfv6ieUURcBvSW0u6eViVhi20DE7hH2QazH0cU18qkEg71UaTRgv9qW8vdMFiRhw9d4zZWZrfBMD6UTlahiEhhZ0B83pHVS5v0FNC+w0SEHe6Tks1hWfz5yrs3N/z3ghdihjC/5i1jeBoHXs1262SMazuwNGHblLApGPG+86taeFtbDI+31TKvZ8nomZHkEVFnARRUoBBcIwowRMqNfwlpcJhlz6kDWnoD08kHJ2zzJokozu7Lim+Ugt/MWwUOcA0hgq2QdymZFpkRkDl7tZmJtwTfTirjbGlpnPHVXEc1bWM7ocQKBgQD0LJ8e7JXf6bVFngq0jSJNKK7XDHYg0KhHXMApF59xxi29hdHXWPzgRJ45KkoUJc7MITpIJLXfCmi1XyDMf9m8lIf/oaqhJ7idYi7iAAPOJkdnHbSt0lebyjBWzCQ6OgS4NfF1+LEibTzRqiFs5K8EAyPYAVSTrpWoguoWtTzIGQKBgQDc9/I2PS+91Eb5RvuidTNsDqZJliTJQFlBjlDViFo3+l1N7jDFYwPBR/Tv4TVM5p9Zb+/Lo9X1pjDbm8QriTR4V+4HaLXkcCnmOsdSRInFUW4UIafwLX5ifjgfyaWgdKdn2UP1Lu/1qBN6GU1xjSfBQ6N3UqQiKkNPb7tuPJGqtwKBgQCQ4hU8vTclGMC14VQK1B/BVt1/vuYtDIJ9bZycBWdXlDc52LitpiDOVgjodJ5mHBT77M9vVVERWlTNIfgNP+OL0TptRZlAbJhP0p1s/oNDhFUj6211InVXfH54UkNAxYJdZ6yxynIYsma/JcsVmQ/8Ony/Q/LSempVBfEurjW1qQKBgQCQWPjFLdtOKqnildg0HFPnNvqx/38waPTluk5b76LgBpGFIyCBEVmWnacIPRpQjidyiYkggnp26oXoMC1KM2svYmGAPYr1G8CDQcqLl3JYkAVU6VeHsnBpbwLC4TttQkdJs8iNFohy9cUjcfwBPbDGs6TJghbuqqUl81uBe9e8qQKBgQDZm8T2KB34J7HAc5A+vqkmAo7mQLZg51OrzB1KnDU86pSAf0o3eSvfDUT6dpU9fRuZ1XYnbPnpoJwjFH3m4u9gqKF3PtVYfZyJrEqYwmhB9z6vd+dcsUlXM0fi37bGZkKBD0JGGt5OljM1qJG15x/LYfC/nwOmqWoOhNPCst2Z7w=="; |
| | | |
| | | private final String provider = "i-go-odrd-testing"; |
| | | // private final String SERVICE_ACCOUNT = "odrd-fleetengine-ondemandadmin@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | // |
| | | // private final String DRIVER_ACCOUNT = "odrd-fleetengine-driversdkuser@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | // |
| | | // private final String CONSUMER_ACCOUNT = "odrd-fleetengine-consumersdkus@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | // |
| | | // private final String serverPrivateKeyId = "254e18eefa9fdcca64d5899cdcd793d466c47c7d"; |
| | | // |
| | | // private final String serverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCfbNAWnukqLKIxItqmSABxsH5glySEHJ2gfL5KsRF0M02e0Z8/KNKZkoh7I6bOMt1fEtttFaWOeq70IdI2WAd5wVazL3upvl5FW4P08ly33LklfGyLljlJ7ChPny9x6OjAaiS0yD9fh7NWti7rZKU7gzcGL8HddNYXgXV5OajvoG3TGdu52WTxce9AUzU6gLPboz/RbGqrdrmgVJVb0EPlhTJf/NSsaiW4NoL8SEzf/pJGYBmqJs97mXwCHTY4avaC+CP/zz9yS8AQEJlApbVT6lSOhYoR0hNOBj5B886EZOssjubO6hQaiwRnGrV2RdpHynqA1iekfGpUGEtWTsqjAgMBAAECggEALyPbMd0iP8y71sCiG4nty7Au5ju62e+mMkbAc9CAwzXKTVxZdLEK+MsJ3TNxBsami47FYC+G6SbgpaJ8iIImD7v5+XjgXZRDRsnlLmAdx2YWPv3YELxGS1PvpX+B5XJDpGWeXfBaQNKc1lZ/cC4t53eIpSUo82UxSvkGNea1S8lR6vIByhNyCQOvLG4yqaxUy0hZi0kge37XrjYMGS+BivBBnDiVlBPLBVbrNBxOf31Lzz+XX0iwXX7Zl2jN759oe0xQyuIGWUSj8xBDIF8nNaJrla7rWVml3sZJh6/3r1Acj0mhZtE0ZMu5hiPGiIXgb1ng30j3dMP4yVPhXrpAtQKBgQDaU01VnHsnHxc0DQHE2vEOPGmPxVS0/JAssePAEUmKEueUogGef91YY+Vm/ItbhLwGjbytnXxe88zRAdB1u07efZ83ey93TrGl2CJUzLHIcgb+Q1tT642rqlfl+q8ep86hcZ+63pDiIPt2Z+HkbKIR0SWf5LIH4flquQOTQufXXQKBgQC674qDsjOJepZjMMN6PkVMcWBYDNmXHnqa5Oto0rZM745UulbXqEFGuBOsXPU7O33Kfz1vbtoluubKZi5B6cFNnPypE2SCfvdObHq4FuTuKPV6lN93SyhZchmSEXEs0PU4cGDRt+RRqQcjft1Wigiy4Y1y1SInCtcaP1hLejEJ/wKBgFAhvwKrGnBzctrB42JTUaJ9/eis7rg28tvUttjp/2nUIndlNt7r41vr3mj8TFHc1/43y4aVhO584THdTpvHkd0LkoKUjglmMsHCIGercZ02bOap5j1Y+XiGXxij995yjN6oi43U3qyAmosM+dYTITEU6JBVKhrGj/rhyTQlnF5pAoGBAKFGmo0mR/pbDbYD0xH6+VSLGCC+7VbIT+SkjUjBSdA0eOo2XUfvfGmj1C1HgbcZi1wRzJH/5CrbBdQmtc/d+QyZ3Q2NkpBXM8uwIWwDLH0gTzDzkZvc9rG8k70GWUrd+EI6Cf3FFjExj9wazqCjs/+IQr2Ijc97NbsKXYW4pOhHAoGAKf5wYk+cn0cVTsyAom0UbGD5Uijqh5732MeqFYs2Rcwx0OErJZo68COSFFF40hJmmIKn7p3qycIyd1FcYlXN1l4s8mEWTGTInRE0OlBU0+jLtIV9pwNgffpbPYcrWZU6s6YVeJ2nDwl+aD+4QvN0rkPTfho9kjgeyF3PW0I2u4E="; |
| | | // |
| | | // private final String driverPrivateKeyId = "859e85fb3aa4d18b4afaac3e24e8f65700da5cc9"; |
| | | // |
| | | // private final String driverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmzL1BqSH+Zh9Fct5mXqe5sYOMTnJtOJhwKXnjjo2tNPXv4alzUHz8Vbj6nMar5u5IuKRZMeRBlhoRSFrLm+J1+sfvpH8N4wsnG7hDANknqWzdsk9a68qMHxNQF3hFzs9+KKrR1LAG8e9ytMfliN0kX+xls4uPZDPu1Q39K6V9KXrH/GrMA56i3TtWi7Hmakt5YTELeGjhx4nGrfuQLFFovs1Z9uJtf7E8R95+65StrOAmbJNf7VciEqwBpWYlU5VeyLXMg/oHwnTv2cjdcFozyDrlUHbDmtTiVeBBsYFVLyAsDGfl1p6eiVTiBBuo56YSYLWfaLgYvTyEcZ9jBQsfAgMBAAECggEAQzbTuObX3PT3+vtb5XKVMf33XY2rDJo2y1PbWzhxnO9vf3e22dIAW4qLnOmaIWFQeht1lr/FFCzRWk+Gzu+FJTemY8osrMLmFp9T9CQeXZ4nUXruAVxs5WQMW0Tp4W+CK3tlwmJrgJDzhYyV1Mf/HQ5Oa3kbbu/ZAY/3MCLrb/ClJQvD2rZSDdzAkNMQm8P2hsE71+rH7mI2hHrSCHl2OIp2A64QT8HjtyRc5yHZtTp6ZST1ge9SSIsT0ZfmXKtKF7yGEIPtKNU+oLrGyK5P30xBWJ/bwb3PEz2MZcPvz31+B2+UvZMm7OTkqfcRwEztAf8Ckiuo4im2BRYbVmd9OQKBgQDd0MeLxR+Qtv12bVA0bHtagFEq36THgWG7IM1/1vS4Cl9sveKSOS8A6oKLy624fGE7PKcuTTIzkVA81GXtWBQ9Coq/4TmllQkFTH7pz9C2PNHSCychPwNNV8qUx3lE3d4DOjGKgoVFD4l90AO7lOvmLTSc3pDpr+jSjUH4lqGrbQKBgQDAgXBmpXfCTxwqkBzGwxX+hwJen9qSkCM47qnQ1L4NnXPL6s0EN6rQ3FnFemGIzBUGJ2tajntkKlUu5DzsQeoBGu/SaSwgqD+1UQDcUyo+retmqZ+QYbpeyd3l53bLJJuJNsfak0X76Ft6hrm4julx6RGlmboQyx4kZWbhx4YNOwKBgEG9/2aNpi1eDwFqpLrk7CqGnYf3gP8gebbcoguhyiZB7MZuARkVmbjLyKVmWLa1JpxH/cTbXGWsS/u7d/pAgL8WwMjeGBfbdDD92x+xWEqq/AUlCRPxeSkTPBech3TBzWtndAd5Z8ZwNG/1lyWhnck63L0huhGI8Zh2BXeILaKBAoGAKK3xq69BvGztPc1QV2w4RJ4RER/kl14gI1LDzd52/veL1cabZk3BKfu2eLWg0MCXnMJNvEgpqQQNFiii+yX+phckIKma6pfDRrSEYwqr/azQ9tPXZTJRqOAtpPyhrNHikD9kQjsm6dGzKxQ3QNnqWOjwkrcGi6/wga5v7Dw2hqsCgYEA2T/kSNQ9dqpVBAkfi2J50hqnfFESPjKeirJJZllqhVqsiV0ly8a8Fz8SjGqTzrq+UErko+QmtSlo5h3Uq9Ln+0CwYfrUL+74q2zLHdS0DpY3QsGTEDJXTxCyy9kO26X2UsM3Ez3YUAkdMwdpVz0uVZtinv2735QZOBxoVQV2kQ8="; |
| | | // |
| | | // private final String consumerPrivateKeyId = "40acf82cbd5250de2f5123caff40738bdd403b08"; |
| | | // |
| | | // private final String consumerPrivateKey = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDSwtbSBFgIXna6mWeKFWCK31NXUJH6uGduR1XrODGRedrqrTgr0BdNg8PDo6/zh/T+K0Svor6kgqpwnl9soOdn73oC4Nu+Ad7EiKa38j650jlZdLAr4hR0Ou9Kcnv45x/94auUO8jBz844cu24swLKiPsK9OnX65wVlKRfhhkGFuS/4OI76CmE7NqZDqPOW16o8tBO5TsgPVNkglFAU73fTp0kcHoLauT9QOB0+yZi39mnNXyU+2cL3Ylp5oaQCJpyssDRUqz/EiHa7FxUUgzCadG00+ePf5iYSnZKQRKWoOIawFvcCfcHx8GAl8Nn+79HtVQHB9hLsQ5+jqcdfKPfAgMBAAECggEAE9Ufz912xzrUY1TCKH1Ae3Dub732Lqihmv/9dsfv6ieUURcBvSW0u6eViVhi20DE7hH2QazH0cU18qkEg71UaTRgv9qW8vdMFiRhw9d4zZWZrfBMD6UTlahiEhhZ0B83pHVS5v0FNC+w0SEHe6Tks1hWfz5yrs3N/z3ghdihjC/5i1jeBoHXs1262SMazuwNGHblLApGPG+86taeFtbDI+31TKvZ8nomZHkEVFnARRUoBBcIwowRMqNfwlpcJhlz6kDWnoD08kHJ2zzJokozu7Lim+Ugt/MWwUOcA0hgq2QdymZFpkRkDl7tZmJtwTfTirjbGlpnPHVXEc1bWM7ocQKBgQD0LJ8e7JXf6bVFngq0jSJNKK7XDHYg0KhHXMApF59xxi29hdHXWPzgRJ45KkoUJc7MITpIJLXfCmi1XyDMf9m8lIf/oaqhJ7idYi7iAAPOJkdnHbSt0lebyjBWzCQ6OgS4NfF1+LEibTzRqiFs5K8EAyPYAVSTrpWoguoWtTzIGQKBgQDc9/I2PS+91Eb5RvuidTNsDqZJliTJQFlBjlDViFo3+l1N7jDFYwPBR/Tv4TVM5p9Zb+/Lo9X1pjDbm8QriTR4V+4HaLXkcCnmOsdSRInFUW4UIafwLX5ifjgfyaWgdKdn2UP1Lu/1qBN6GU1xjSfBQ6N3UqQiKkNPb7tuPJGqtwKBgQCQ4hU8vTclGMC14VQK1B/BVt1/vuYtDIJ9bZycBWdXlDc52LitpiDOVgjodJ5mHBT77M9vVVERWlTNIfgNP+OL0TptRZlAbJhP0p1s/oNDhFUj6211InVXfH54UkNAxYJdZ6yxynIYsma/JcsVmQ/8Ony/Q/LSempVBfEurjW1qQKBgQCQWPjFLdtOKqnildg0HFPnNvqx/38waPTluk5b76LgBpGFIyCBEVmWnacIPRpQjidyiYkggnp26oXoMC1KM2svYmGAPYr1G8CDQcqLl3JYkAVU6VeHsnBpbwLC4TttQkdJs8iNFohy9cUjcfwBPbDGs6TJghbuqqUl81uBe9e8qQKBgQDZm8T2KB34J7HAc5A+vqkmAo7mQLZg51OrzB1KnDU86pSAf0o3eSvfDUT6dpU9fRuZ1XYnbPnpoJwjFH3m4u9gqKF3PtVYfZyJrEqYwmhB9z6vd+dcsUlXM0fi37bGZkKBD0JGGt5OljM1qJG15x/LYfC/nwOmqWoOhNPCst2Z7w=="; |
| | | // |
| | | // private final String provider = "i-go-odrd-testing"; |
| | | |
| | | private final static String key = "AIzaSyCG6PsfkaCEc94VK2vIAZk1YYKvOS_Ewts"; |
| | | |
| | | private final String SERVICE_ACCOUNT = "odrd-fleetengine-ondemandadmin@i-go-gcp.iam.gserviceaccount.com"; |
| | | |
| | | private final String DRIVER_ACCOUNT = "odrd-fleetengine-driversdkuser@i-go-gcp.iam.gserviceaccount.com"; |
| | | |
| | | private final String CONSUMER_ACCOUNT = "odrd-fleetengine-consumersdkus@i-go-gcp.iam.gserviceaccount.com"; |
| | | |
| | | private final String provider = "i-go-gcp"; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | |
| | | public Map<String, Object> fleetEngineAuth(int type, String id){ |
| | | try { |
| | | //谷歌云服务器使用这部分代码 |
| | | // AuthTokenMinter minter = AuthTokenMinter.builder() |
| | | // //服务端签名 |
| | | // .setServerSigner(ImpersonatedSigner.create(SERVICE_ACCOUNT)) |
| | | // //司机端签名 |
| | | // .setDriverSigner(ImpersonatedSigner.create(DRIVER_ACCOUNT)) |
| | | // //乘客端签名 |
| | | // .setConsumerSigner(ImpersonatedSigner.create(CONSUMER_ACCOUNT)) |
| | | // .build(); |
| | | AuthTokenMinter minter = AuthTokenMinter.builder() |
| | | //服务端签名 |
| | | .setServerSigner(LocalSigner.create(SERVICE_ACCOUNT, serverPrivateKeyId, serverPrivateKey)) |
| | | .setServerSigner(ImpersonatedSigner.create(SERVICE_ACCOUNT)) |
| | | //司机端签名 |
| | | .setDriverSigner(LocalSigner.create(DRIVER_ACCOUNT, driverPrivateKeyId, driverPrivateKey)) |
| | | .setDriverSigner(ImpersonatedSigner.create(DRIVER_ACCOUNT)) |
| | | //乘客端签名 |
| | | .setConsumerSigner(LocalSigner.create(CONSUMER_ACCOUNT, consumerPrivateKeyId, consumerPrivateKey)) |
| | | .setConsumerSigner(ImpersonatedSigner.create(CONSUMER_ACCOUNT)) |
| | | .build(); |
| | | // AuthTokenMinter minter = AuthTokenMinter.builder() |
| | | // //服务端签名 |
| | | // .setServerSigner(LocalSigner.create(SERVICE_ACCOUNT, serverPrivateKeyId, serverPrivateKey)) |
| | | // //司机端签名 |
| | | // .setDriverSigner(LocalSigner.create(DRIVER_ACCOUNT, driverPrivateKeyId, driverPrivateKey)) |
| | | // //乘客端签名 |
| | | // .setConsumerSigner(LocalSigner.create(CONSUMER_ACCOUNT, consumerPrivateKeyId, consumerPrivateKey)) |
| | | // .build(); |
| | | |
| | | String jwt = ""; |
| | | Long expirationTimestamp = 0L; |
| | |
| | | return map; |
| | | } catch (SigningTokenException e) { |
| | | throw new RuntimeException(e); |
| | | } catch (SignerInitializationException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.maps.*; |
| | | import com.google.maps.model.*; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | |
| | | /** |
| | | * 谷歌地图工具类 |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static ReverseGeocodeVo getReverseGeocode(double lat, double lng) throws Exception{ |
| | | public static ReverseGeocodeVo getReverseGeocode(double lat, double lng, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | GeocodingApiRequest request = GeocodingApi.reverseGeocode(context, new LatLng(lat, lng)); |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | GeocodingResult[] results = request.await(); |
| | | ReverseGeocodeVo vo = null; |
| | | if(results.length > 0){ |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static DistancematrixVo getDistancematrix(Double sLat, Double sLnt, Double eLat, Double eLnt) throws Exception{ |
| | | public static DistancematrixVo getDistancematrix(Double sLat, Double sLnt, Double eLat, Double eLnt, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | |
| | | request.origins(new LatLng(sLat, sLnt)); |
| | | request.destinations(new LatLng(eLat, eLnt)); |
| | | request.mode(TravelMode.DRIVING);//出行方式(驾车) |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | DistanceMatrix distanceMatrix = request.await(); |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.out.println(gson.toJson(distanceMatrix)); |
| | |
| | | |
| | | |
| | | |
| | | public static void main(String[] ages){ |
| | | try { |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | Integer oldState = 0; |
| | | Long startServiceTime = null; |
| | | Double servedMileage = null; |
| | | String tripId = ""; |
| | | switch (orderType){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | tripId = redisUtil.getValue("trip" + orderPrivateCar.getUserId()); |
| | | if(orderPrivateCar == null){ |
| | | this.removeTask(orderId, orderType); |
| | | }else{ |
| | |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | tripId = redisUtil.getValue("trip" + orderTaxi.getUserId()); |
| | | if(orderTaxi == null){ |
| | | this.removeTask(orderId, orderType); |
| | | }else{ |
| | |
| | | break; |
| | | case 3: |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId); |
| | | tripId = redisUtil.getValue("trip" + orderCrossCity.getUserId()); |
| | | if(orderCrossCity == null){ |
| | | this.removeTask(orderId, orderType); |
| | | }else{ |
| | |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | tripId = redisUtil.getValue("trip" + orderLogistics.getUserId()); |
| | | if(orderLogistics == null){ |
| | | this.removeTask(orderId, orderType); |
| | | }else{ |
| | |
| | | break; |
| | | case 5: |
| | | OrderLogistics orderLogistics1 = orderLogisticsService.selectById(orderId); |
| | | tripId = redisUtil.getValue("trip" + orderLogistics1.getUserId()); |
| | | if(orderLogistics1 == null){ |
| | | this.removeTask(orderId, orderType); |
| | | }else{ |
| | |
| | | if(ToolUtil.isNotEmpty(value) && ToolUtil.isNotEmpty(startLonLat)){ |
| | | String[] split = value.split(","); |
| | | String[] split1 = startLonLat.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), Double.valueOf(split1[1]), Double.valueOf(split1[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), Double.valueOf(split1[1]), Double.valueOf(split1[0]), tripId); |
| | | if(null == distancematrix){ |
| | | System.err.println("地图获取距离出错"); |
| | | }else{ |
| | |
| | | if(ToolUtil.isNotEmpty(value) && ToolUtil.isNotEmpty(endLonLat)){ |
| | | String[] split = value.split(","); |
| | | String[] split1 = endLonLat.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), Double.valueOf(split1[1]), Double.valueOf(split1[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), Double.valueOf(split1[1]), Double.valueOf(split1[0]), tripId); |
| | | if(null == distancematrix){ |
| | | System.err.println("地图获取距离出错"); |
| | | }else{ |
| | |
| | | params.put("msisdn", toPhone); |
| | | params.put("message", msg); |
| | | params.put("sender_id", "I-GO"); |
| | | params.put("callback_url", "http://182.160.16.251:80/driver/base/sendCellulantMessageCallback"); |
| | | params.put("callback_url", "https://igo.i-go.group/driver/base/sendCellulantMessageCallback"); |
| | | post.body(params.toJSONString()); |
| | | System.err.println("短信请求:\n请求地址:" + url + "\n请求参数:" + params.toJSONString()); |
| | | HttpResponse execute = post.execute(); |
| | |
| | | ByteString audioContents = response.getAudioContent(); |
| | | |
| | | // Write the response to the output file. |
| | | try (OutputStream out = new FileOutputStream("/usr/local/nginx/html/files/audio/" + fileName)) { |
| | | try (OutputStream out = new FileOutputStream("/home/igotechgh/nginx/html/files/audio/" + fileName)) { |
| | | out.write(audioContents.toByteArray()); |
| | | return "http://182.160.16.251:81/files/audio/" + fileName; |
| | | return "https://igo.i-go.group/files/audio/" + fileName; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | |
| | | |
| | | #支付回调地址 |
| | | callbackPath: http://182.160.16.251/driver |
| | | callbackPath: https://igo.i-go.group/driver |
| | | |
| | | |
| | | --- |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /usr/local/nginx/html/mailbox/ |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | |
| | | share: |
| | | url: http://182.160.16.251:81/share/share/pages/changeStyle/changeStyle.html |
| | | url: https://igo.i-go.group/share/share/pages/changeStyle/changeStyle.html |
| | |
| | | port: 8007 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | swagger-open: false #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | # file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/igotravel2.0?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | username: root |
| | | url: jdbc:mysql://172.16.0.4:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | username: i-go |
| | | password: HjKbXilb9zajmXbl |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | |
| | | |
| | | --- |
| | | |
| | | filePath: /usr/local/server/orderPostionFile/ #存储订单轨迹文件路径 |
| | | filePath: /home/igotechgh/orderPostionFile/ #存储订单轨迹文件路径 |
| | | |
| | | |
| | | |
| | | #支付回调地址 |
| | | callbackPath: http://182.160.16.251/driver |
| | | callbackPath: https://igo.i-go.group/driver |
| | | |
| | | |
| | | --- |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /usr/local/nginx/html/mailbox/ |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | |
| | | share: |
| | | url: http://182.160.16.251:81/share/share/pages/changeStyle/changeStyle.html |
| | | url: https://igo.i-go.group/share/share/pages/changeStyle/changeStyle.html |
| | |
| | | <contextName>logback</contextName> |
| | | |
| | | <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 --> |
| | | <property name="log.path" value="/usr/local/server/logs/driver"/> |
| | | <property name="log.path" value="/home/igotechgh/app/log/driver"/> |
| | | |
| | | <!--0. 日志格式和颜色渲染 --> |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | |
| | | # 数据源配置 |
| | | org.quartz.jobStore.dataSource=myDS |
| | | org.quartz.dataSource.myDS.driver=com.mysql.cj.jdbc.Driver |
| | | org.quartz.dataSource.myDS.URL=jdbc:mysql://127.0.0.1:3306/igotravel2.0?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | org.quartz.dataSource.myDS.user=root |
| | | org.quartz.dataSource.myDS.URL=jdbc:mysql://172.16.0.4:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | org.quartz.dataSource.myDS.user=i-go |
| | | org.quartz.dataSource.myDS.password=HjKbXilb9zajmXbl |
| | | org.quartz.dataSource.myDS.maxConnections=10 |
| | |
| | | <name>eureka</name> |
| | | <description>Eureka project for Spring Boot</description> |
| | | |
| | | <packaging>war</packaging> |
| | | <packaging>jar</packaging> |
| | | |
| | | <properties> |
| | | <java.version>1.8</java.version> |
| | |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-tomcat</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>javax.servlet-api</artifactId> |
| | | <version>3.1.0</version> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-starter-tomcat</artifactId>--> |
| | | <!-- <scope>provided</scope>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>javax.servlet</groupId>--> |
| | | <!-- <artifactId>javax.servlet-api</artifactId>--> |
| | | <!-- <version>3.1.0</version>--> |
| | | <!-- <scope>provided</scope>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | |
| | | @EnableEurekaServer//开启服务治理 |
| | | @SpringBootApplication |
| | | public class EurekaApplication extends SpringBootServletInitializer { |
| | | public class EurekaApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(EurekaApplication.class, args); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { |
| | | return builder.sources(EurekaApplication.class); |
| | | } |
| | | } |
| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-quartz</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.sun.mail</groupId> |
| | | <artifactId>javax.mail</artifactId> |
| | | <version>1.6.2</version> |
| | | </dependency> |
| | | |
| | | <!--谷歌地图依赖--> |
| | | <dependency> |
| | |
| | | <artifactId>google-cloud-texttospeech</artifactId> |
| | | <version>2.46.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.cloud</groupId> |
| | | <artifactId>google-cloud-storage</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <dependencyManagement> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.google.cloud</groupId> |
| | | <artifactId>libraries-bom</artifactId> |
| | | <version>26.45.0</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | | <build> |
| | | <plugins> |
| | |
| | | try { |
| | | TUser userInfo = userService.selectById(tReportLoss.getUserId()); |
| | | if(ToolUtil.isNotEmpty(userInfo.getEmail())){ |
| | | Integer language = userInfo.getLanguage(); |
| | | String path = templatePath + "user/reportLossResult.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Notification of the result of the loss report"); |
| | | Element english_user = document.getElementById("english_user"); |
| | | english_user.text("Hello " + userInfo.getNickName() + ","); |
| | | Element english_content = document.getElementById("english_content"); |
| | | english_content.text(info); |
| | | EmailUtil.send(userInfo.getEmail(), "Notification of the result of the loss report", document.html()); |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("物品报失处理结果"); |
| | | Element chinese_user = document.getElementById("chinese_user"); |
| | | chinese_user.text("您好 " + userInfo.getNickName() + ","); |
| | | Element chinese_content = document.getElementById("chinese_content"); |
| | | chinese_content.text(info); |
| | | EmailUtil.send(userInfo.getEmail(), "物品报失处理结果", document.html()); |
| | | } |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Solutions for reporting lost items"); |
| | | Element english_user = document.getElementById("english_user"); |
| | | english_user.text("Hello " + userInfo.getNickName() + ","); |
| | | Element english_content = document.getElementById("english_content"); |
| | | english_content.text(info); |
| | | EmailUtil.send(userInfo.getEmail(), "Solutions for reporting lost items", document.html()); |
| | | } |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | document.getElementsByTag("title").get(0).text("Soumis avec succès, veuillez attendre notre réponse."); |
| | | Element french_user = document.getElementById("french_user"); |
| | | french_user.text("Bonjour " + userInfo.getNickName() + ","); |
| | | Element french_content = document.getElementById("french_content"); |
| | | french_content.text(info); |
| | | EmailUtil.send(userInfo.getEmail(), "Soumis avec succès, veuillez attendre notre réponse.", document.html()); |
| | | } |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/reportLossResult_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/reportLossResult_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/reportLossResult_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/reportLossResult_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName("Notification of the result of the loss report"); |
| | | tEmail.setName(language == 1 ? "物品报失处理结果" : language == 2 ? "Solutions for reporting lost items" : "Soumis avec succès, veuillez attendre notre réponse"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(2,i)); |
| | |
| | | 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"); |
| | | 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 " + startTime + " to " + 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(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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | 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("Coupon is in"); |
| | | 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)); |
| | |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | Integer language = tDriver.getLanguage(); |
| | | String path = templatePath + "driver/index.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | document.getElementById("chinese").remove(); |
| | |
| | | document.getElementById("reward1").remove(); |
| | | document.getElementById("rewardToday1").remove(); |
| | | document.getElementById("driverAudit1").remove(); |
| | | |
| | | document.getElementsByTag("title").get(0).text(2 == finalTCar.getAuthState() ? "Vehicle is verified and qualified" : "Vehicle is not verified and qualified"); |
| | | Element car_audit1_user = document.getElementById("car_audit1_user"); |
| | | car_audit1_user.text("Hello " + tDriver.getFirstName() + " " + tDriver.getLastName() + ","); |
| | | Element car_audit1_content = document.getElementById("car_audit1_content"); |
| | | if(2 == finalTCar.getAuthState()){ |
| | | car_audit1_content.text("You vehicle application has been approved. See the I-GO platform for details."); |
| | | }else{ |
| | | car_audit1_content.text("We are sorry to inform you that your vehicle application was rejected. Please contact our service for relevant details, call 0577777767 or send e-mail to support@i-go.group"); |
| | | if(1 == language){ |
| | | document.getElementsByTag("title").get(0).text(2 == finalTCar.getAuthState() ? "车辆审核通过" : "车辆审核不通过"); |
| | | Element car_audit1_user = document.getElementById("car_audit1_user"); |
| | | car_audit1_user.text("Hello " + tDriver.getFirstName() + " " + tDriver.getLastName() + ","); |
| | | Element car_audit1_content = document.getElementById("car_audit1_content"); |
| | | if(2 == finalTCar.getAuthState()){ |
| | | car_audit1_content.html("您的车辆注册申请已获批准<br>详情请查看I-GO APP"); |
| | | }else{ |
| | | car_audit1_content.html("我们很遗憾地通知您: 您的车辆申请已被拒绝。相关详情,请与我们的客服联系,致电0577777767或发送电子邮件至support@i-go.group"); |
| | | } |
| | | EmailUtil.send(tDriver.getEmail(), 2 == finalTCar.getAuthState() ? "车辆审核通过" : "车辆审核不通过", document.html()); |
| | | } |
| | | EmailUtil.send(tDriver.getEmail(), 2 == finalTCar.getAuthState() ? "Vehicle is verified and qualified" : "Vehicle is not verified and qualified", document.html()); |
| | | if(2 == language){ |
| | | document.getElementsByTag("title").get(0).text(2 == finalTCar.getAuthState() ? "Vehicle is verified and qualified" : "Vehicle is not verified and qualified"); |
| | | Element car_audit2_user = document.getElementById("car_audit2_user"); |
| | | car_audit2_user.text("Hello " + tDriver.getFirstName() + " " + tDriver.getLastName() + ","); |
| | | Element car_audit2_content = document.getElementById("car_audit2_content"); |
| | | if(2 == finalTCar.getAuthState()){ |
| | | car_audit2_content.html("Your vehicle application has been approved. <br>See the I-GO platform for details."); |
| | | }else{ |
| | | car_audit2_content.html("We are sorry to inform you that your vehicle application was rejected. Please contact our service for relevant details, call 0577777767 or send e-mail to support@i-go.group"); |
| | | } |
| | | EmailUtil.send(tDriver.getEmail(), 2 == finalTCar.getAuthState() ? "Vehicle is verified and qualified" : "Vehicle is not verified and qualified", document.html()); |
| | | } |
| | | if(3 == language){ |
| | | document.getElementsByTag("title").get(0).text(2 == finalTCar.getAuthState() ? "Le véhicule est vérifié et qualifié" : "Le véhicule n’est pas vérifié et qualifié"); |
| | | Element car_audit3_user = document.getElementById("car_audit3_user"); |
| | | car_audit3_user.text("Bonjour " + tDriver.getFirstName() + " " + tDriver.getLastName() + ","); |
| | | Element car_audit3_content = document.getElementById("car_audit3_content"); |
| | | if(2 == finalTCar.getAuthState()){ |
| | | car_audit3_content.html("Votre demande de véhicule a été approuvée.<br>Veuillez consulter la plateforme I-GO pour plus de détails."); |
| | | }else{ |
| | | car_audit3_content.html("Nous avons le regret de vous informer que votre demande de véhicule a été rejetée. Veuillez contacter notre service pour plus de détails, appelez 0577777767 ou envoyez un e-mail à support@i-go.group"); |
| | | } |
| | | EmailUtil.send(tDriver.getEmail(), 2 == finalTCar.getAuthState() ? "Le véhicule est vérifié et qualifié" : "Le véhicule n’est pas vérifié et qualifié", document.html()); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | if(ToolUtil.isNotEmpty(tUser.getEmail())){ |
| | | String path = templatePath + "user/complaintResult.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Solutions for complaints"); |
| | | Element english_user = document.getElementById("english_user"); |
| | | english_user.text("Hello " + tUser.getNickName() + ","); |
| | | Element english_content = document.getElementById("english_content"); |
| | | english_content.text(handleResult); |
| | | EmailUtil.send(tUser.getEmail(), "Solutions for complaints", document.html()); |
| | | Integer language = tUser.getLanguage(); |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("投诉反馈处理结果"); |
| | | Element chinese_user = document.getElementById("chinese_user"); |
| | | chinese_user.text("您好 " + tUser.getNickName() + ","); |
| | | Element chinese_content = document.getElementById("chinese_content"); |
| | | chinese_content.text(handleResult); |
| | | EmailUtil.send(tUser.getEmail(), "投诉反馈处理结果", document.html()); |
| | | } |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Solutions for complaints"); |
| | | Element english_user = document.getElementById("english_user"); |
| | | english_user.text("Hello " + tUser.getNickName() + ","); |
| | | Element english_content = document.getElementById("english_content"); |
| | | english_content.text(handleResult); |
| | | EmailUtil.send(tUser.getEmail(), "Solutions for complaints", document.html()); |
| | | } |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | document.getElementsByTag("title").get(0).text("Solutions pour plaintes"); |
| | | Element french_user = document.getElementById("french_user"); |
| | | french_user.text("Bonjour " + tUser.getNickName() + ","); |
| | | Element french_content = document.getElementById("french_content"); |
| | | french_content.text(handleResult); |
| | | EmailUtil.send(tUser.getEmail(), "Solutions pour plaintes", document.html()); |
| | | } |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/complaintResult_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/complaintResult_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/complaintResult_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/complaintResult_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(tUser.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName("Solutions for complaints"); |
| | | tEmail.setName(1 == language ? "投诉反馈处理结果" : 2 == language ? "Solutions for complaints" : "Solutions pour plaintes"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(2,i)); |
| | |
| | | driver_audit1_user.text("Hello " + tDriver.getFirstName() + " " + tDriver.getLastName() + ","); |
| | | Element driver_audit1_content = document.getElementById("driver_audit1_content"); |
| | | if(1 == authState){ |
| | | driver_audit1_content.text("You application has been approved."); |
| | | driver_audit1_content.text("Your application has been approved."); |
| | | }else{ |
| | | driver_audit1_content.text("We are sorry to inform you that your application was rejected. Please contact our service for relevant details, call 0577777767 or send e-mail to support@i-go.group"); |
| | | } |
| | |
| | | if(ToolUtil.isNotEmpty(userInfo.getEmail())){ |
| | | String path = templatePath + "user/feedbackResult.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Solutions for feedback"); |
| | | Element english_user = document.getElementById("english_user"); |
| | | english_user.text("Hello " + userInfo.getNickName() + ","); |
| | | Element english_content = document.getElementById("english_content"); |
| | | english_content.text(remark); |
| | | EmailUtil.send(userInfo.getEmail(), "Feedback Processing Results", document.html()); |
| | | |
| | | Integer language = userInfo.getLanguage(); |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("意见反馈处理结果"); |
| | | Element chinese_user = document.getElementById("chinese_user"); |
| | | chinese_user.text("您好 " + userInfo.getNickName() + ","); |
| | | Element chinese_content = document.getElementById("chinese_content"); |
| | | chinese_content.text(remark); |
| | | EmailUtil.send(userInfo.getEmail(), "意见反馈处理结果", document.html()); |
| | | } |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Solutions for feedback"); |
| | | Element english_user = document.getElementById("english_user"); |
| | | english_user.text("Hello " + userInfo.getNickName() + ","); |
| | | Element english_content = document.getElementById("english_content"); |
| | | english_content.text(remark); |
| | | EmailUtil.send(userInfo.getEmail(), "Solutions for feedback", document.html()); |
| | | } |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | document.getElementsByTag("title").get(0).text("Solutions pour avis"); |
| | | Element french_user = document.getElementById("french_user"); |
| | | french_user.text("Bonjour " + userInfo.getNickName() + ","); |
| | | Element french_content = document.getElementById("french_content"); |
| | | french_content.text(remark); |
| | | EmailUtil.send(userInfo.getEmail(), "Solutions pour avis", document.html()); |
| | | } |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/feedbackResult_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/feedbackResult_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/feedbackResult_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/feedbackResult_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName("Solutions for feedback"); |
| | | tEmail.setName(1 == language ? "意见反馈处理结果" : 2 == language ? "Solutions for feedback" : "Solutions pour avis"); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | tEmail.setWeek(EmailUtil.getWeek(2,i)); |
| | |
| | | public Object immediately(@RequestParam Integer id,@RequestParam Integer state,@RequestParam String remark) { |
| | | TPubWithdrawal tPubWithdrawal = tPubWithdrawalService.selectById(id); |
| | | if (SinataUtil.isNotEmpty(tPubWithdrawal)){ |
| | | TDriver tDriver = driverService.selectById(tPubWithdrawal.getUserId()); |
| | | Integer language = tDriver.getLanguage(); |
| | | tPubWithdrawal.setRemark(remark); |
| | | |
| | | String serviceCode = ""; |
| | | String phone = ""; |
| | | Integer language = null; |
| | | if(tPubWithdrawal.getUserType() == 1){ |
| | | TUser tUser = userService.selectById(tPubWithdrawal.getUserId()); |
| | | language = tUser.getLanguage(); |
| | | serviceCode = tUser.getPhoneOperator(); |
| | | phone = tUser.getPhone(); |
| | | }else{ |
| | | TDriver tDriver = driverService.selectById(tPubWithdrawal.getUserId()); |
| | | language = tDriver.getLanguage(); |
| | | serviceCode = tDriver.getPhoneOperator(); |
| | | phone = tDriver.getPhone(); |
| | | } |
| | |
| | | tUser.setBalance(tUser.getBalance().add(tPubWithdrawal.getMoney())); |
| | | userService.updateById(tUser); |
| | | }else{ |
| | | TDriver tDriver = driverService.selectById(tPubWithdrawal.getUserId()); |
| | | tDriver.setBalance(tDriver.getBalance().add(tPubWithdrawal.getMoney())); |
| | | if(tPubWithdrawal.getType() == 1){//活动提现 |
| | | tDriver.setLaveActivityMoney(new BigDecimal(tDriver.getLaveActivityMoney()).add(tPubWithdrawal.getMoney()).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.TPubWithdrawal; |
| | | import com.stylefeng.guns.modular.system.util.GoogleCloudStorageUtil; |
| | | import com.stylefeng.guns.modular.system.util.OBSUploadUtil; |
| | | import com.stylefeng.guns.modular.system.util.OssUploadUtil; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | @RequestMapping("/saveApk") |
| | | public Map<String, Object> saveApk(@RequestPart("myfile") MultipartFile myfile, HttpServletRequest request){ |
| | | Map<String, Object> m = new HashMap<>(); |
| | | /*try { |
| | | String pictureName = UUID.randomUUID().toString() + "." + ToolUtil.getFileSuffix(file.getOriginalFilename()); |
| | | try { |
| | | String fileSavePath = gunsProperties.getFileUploadPath()+"apk\\"; |
| | | file.transferTo(new File(fileSavePath + pictureName)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | m.put("imgUrl", gunsProperties.getPictureServerAddress()+"apk/"+pictureName); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | }*/ |
| | | try { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) myfile; |
| | | |
| | | String pictureName = OBSUploadUtil.inputStreamUpload(file); |
| | | String pictureName = GoogleCloudStorageUtil.upload(myfile); |
| | | m.put("imgUrl", pictureName); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | EmailUtil.send(email, language == 1 ? "积分兑换已通过审核" : language == 2 ? "Points redemption approved" : "Approbation de l’échange de points", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/complaint_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/complaint_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/complaint_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/complaint_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(tUser.getId()); |
| | |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.controller.util.PushUtil; |
| | | import com.stylefeng.guns.modular.system.controller.util.TextToSpeechUtil; |
| | | import com.stylefeng.guns.modular.system.dao.OrderCancelMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TSystemPriceMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ChinaMobileUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | @Controller |
| | | @RequestMapping("/tOrderPrivateCar") |
| | | public class TOrderPrivateCarController extends BaseController { |
| | | |
| | | Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | private String PREFIX = "/system/tOrderPrivateCar/"; |
| | | |
| | |
| | | public Object frozenOrder(@RequestParam Integer tOrderPrivateCarId) throws Exception { |
| | | TOrderPrivateCar orderPrivateCar = tOrderPrivateCarService.selectById(tOrderPrivateCarId); |
| | | |
| | | //添加已收入明细 |
| | | TDriver tDriver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | orderPrivateCar = this.setMoney(orderPrivateCar, 0D, 0D);//计算费用 |
| | | |
| | | //添加已收入明细 |
| | | TCompany company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double taxi = company.getSpeMoney().doubleValue(); |
| | | Integer language =tDriver.getLanguage(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(taxi); |
| | | c = orderPrivateCar.getOrderMoney().subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | Double price = orderPrivateCar.getStartMoney().doubleValue() + orderPrivateCar.getMileageMoney().doubleValue() + orderPrivateCar.getWaitMoney().doubleValue()+ orderPrivateCar.getDurationMoney().doubleValue() + orderPrivateCar.getLongDistanceMoney().doubleValue(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(taxi).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | c = orderPrivateCar.getOrderMoney().subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | if(orderPrivateCar.getIsFrozen()==1){ |
| | | TDriver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance((null != driver.getBalance() ? driver.getBalance() : BigDecimal.ZERO).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | driver.setFrozenMoney(driver.getFrozenMoney().add(c)); |
| | | driverService.updateById(driver); |
| | | }else{ |
| | | TDriver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance((null != driver.getBalance() ? driver.getBalance() : BigDecimal.ZERO).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | driver.setFrozenMoney(driver.getFrozenMoney().subtract(c)); |
| | | driverService.updateById(driver); |
| | | } |
| | | if (orderPrivateCar.getIsFrozen() == 1){ |
| | | TOrderPrivateCar orderPrivateCar1 = tOrderPrivateCarService.selectById(tOrderPrivateCarId); |
| | | if(orderPrivateCar1.getArriveTime()==null){ |
| | | orderPrivateCar1.setArriveTime(orderPrivateCar1.getStartServiceTime()); |
| | | if(orderPrivateCar.getIsFrozen() == 1 && orderPrivateCar.getState() < 7){ |
| | | if(orderPrivateCar.getArriveTime()==null){ |
| | | orderPrivateCar.setArriveTime(orderPrivateCar.getStartServiceTime()); |
| | | } |
| | | orderPrivateCar1 = this.setMoney(orderPrivateCar1, 0D, 0D);//计算费用 |
| | | |
| | | orderPrivateCar1.setOrderMoney(orderPrivateCar1.getOrderMoney().add(orderPrivateCar1.getParkMoney()).add(orderPrivateCar1.getRoadTollMoney())); |
| | | orderPrivateCar = this.setMoney(orderPrivateCar, 0D, 0D);//计算费用 |
| | | orderPrivateCar.setPayManner(1); |
| | | orderPrivateCar.setParkMoney(new BigDecimal(0)); |
| | | orderPrivateCar.setRoadTollMoney(new BigDecimal(0)); |
| | | //判断是否首单免费-免费直接完成 |
| | | Integer orderNumber = tOrderPrivateCarService.selectCount(new EntityWrapper<TOrderPrivateCar>().eq("userId",orderPrivateCar1.getUserId()).last("and (state=8 or state=9)")); |
| | | |
| | | Integer orderNumber = tOrderPrivateCarService.selectCount(new EntityWrapper<TOrderPrivateCar>().eq("userId",orderPrivateCar.getUserId()).last("and (state=8 or state=9)")); |
| | | |
| | | if(orderNumber<=0){//判断是否是首单 |
| | | //判断是否免单 |
| | | TUser userInfo = userService.selectById(orderPrivateCar1.getUserId()); |
| | | TUser userInfo = userService.selectById(orderPrivateCar.getUserId()); |
| | | if(userInfo.getFreeMoney().doubleValue()>0d){ |
| | | if(orderPrivateCar1.getOrderMoney().compareTo(userInfo.getFreeMoney())<=-1){ |
| | | orderPrivateCar1.setState(8); |
| | | orderPrivateCar1.setIsFree(2); |
| | | if(orderPrivateCar.getOrderMoney().compareTo(userInfo.getFreeMoney())<=0){ |
| | | orderPrivateCar.setState(8); |
| | | orderPrivateCar.setIsFree(2); |
| | | //添加已收入明细 |
| | | TCompany tCompany = companyService.selectById(orderPrivateCar1.getCompanyId()); |
| | | BigDecimal speMoney = tCompany.getSpeMoney(); |
| | | |
| | | if(tCompany.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = speMoney; |
| | | c = orderPrivateCar1.getOrderMoney().subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | TCompany company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double speMoney = company.getSpeMoney().doubleValue(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = orderPrivateCar.getOrderMoney().subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | } |
| | | if(tCompany.getIsSpeFixedOrProportional() == 1){//比例 |
| | | BigDecimal price = orderPrivateCar1.getStartMoney().add(orderPrivateCar1.getMileageMoney()).add(new BigDecimal(orderPrivateCar1.getWaitMoney())).add(orderPrivateCar1.getDurationMoney()).add(orderPrivateCar1.getLongDistanceMoney()); |
| | | d = price.multiply(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | c = orderPrivateCar1.getOrderMoney().subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | Double price = orderPrivateCar.getStartMoney().add(orderPrivateCar.getMileageMoney()).add(new BigDecimal(orderPrivateCar.getWaitMoney())).add(orderPrivateCar.getDurationMoney()).add(orderPrivateCar.getLongDistanceMoney()).doubleValue(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))); |
| | | c = orderPrivateCar.getOrderMoney().subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderPrivateCar1.getCompanyId(), 2, orderPrivateCar1.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar1.getDriverId(), 2, orderPrivateCar1.getId(), 1, c.doubleValue()); |
| | | TDriver driver = driverService.selectById(orderPrivateCar1.getDriverId()); |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | TDriver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | if (null != driver.getBalance()){ |
| | | driver.setBalance(driver.getBalance().add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | }else{ |
| | | driver.setBalance(BigDecimal.ZERO.add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | } |
| | | driver.setBalance((null != driver.getBalance() ? driver.getBalance() : new BigDecimal("0")).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN)); |
| | | driverService.updateById(driver); |
| | | }else{ |
| | | orderPrivateCar1.setState(7); |
| | | orderPrivateCar1.setOrderMoney(orderPrivateCar1.getOrderMoney().subtract(userInfo.getFreeMoney())); |
| | | orderPrivateCar1.setFreeMoney(userInfo.getFreeMoney()); |
| | | |
| | | orderPrivateCar.setState(7); |
| | | orderPrivateCar.setOrderMoney(orderPrivateCar.getOrderMoney().subtract(userInfo.getFreeMoney())); |
| | | orderPrivateCar.setFreeMoney(userInfo.getFreeMoney()); |
| | | |
| | | } |
| | | |
| | | |
| | | }else{ |
| | | orderPrivateCar1.setState(7); |
| | | orderPrivateCar.setState(7); |
| | | } |
| | | |
| | | |
| | | }else{ |
| | | orderPrivateCar1.setState(7); |
| | | orderPrivateCar.setState(7); |
| | | } |
| | | |
| | | Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(orderPrivateCar1.getBindId(),orderPrivateCar1.getTelX()); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar1.setTelX(""); |
| | | orderPrivateCar1.setBindId(""); |
| | | } |
| | | tOrderPrivateCarService.updateById(orderPrivateCar1); |
| | | |
| | | |
| | | pushUtil.removeTask(orderPrivateCar1.getId(), 1);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "司机已结束本次行程,谢谢使用" : language == 2 ? |
| | | "The driver has finished the trip,thank you for using I-GO" : "Le chauffeur a terminé le trajet, merci d'utiliser I-GO", orderPrivateCar1.getUserId()); |
| | | |
| | | |
| | | tOrderPrivateCarService.updateById(orderPrivateCar); |
| | | |
| | | |
| | | TUser userInfo = userService.selectById(orderPrivateCar.getUserId()); |
| | | Integer language1 = userInfo.getLanguage(); |
| | | systemNoticeService.addSystemNotice(1, language1 == 1 ? "司机已结束本次行程,谢谢使用" : language1 == 2 ? |
| | | "The driver has finished the trip,thank you for using I-GO" : "Le chauffeur a terminé le trajet, merci d'utiliser I-GO", orderPrivateCar.getUserId()); |
| | | |
| | | //回滚司机状态为空闲 |
| | | TDriver driver = driverService.selectById(orderPrivateCar1.getDriverId()); |
| | | TDriver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | |
| | | TOrderPrivateCar finalOrderTaxi = orderPrivateCar1; |
| | | |
| | | TOrderPrivateCar finalOrderTaxi = orderPrivateCar; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState(), 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | | TOrderPrivateCar finalOrderPrivateCar = orderPrivateCar1; |
| | | |
| | | TOrderPrivateCar finalOrderPrivateCar = orderPrivateCar; |
| | | new Thread(()->{ |
| | | try { |
| | | //上报google |
| | | fleetEngineUtil.reportBillableEvent(finalOrderPrivateCar.getTripId()); |
| | | System.err.println("上报时间:{},tripid:{},created_at:{},completed_at:{}"+ System.currentTimeMillis()+ finalOrderPrivateCar.getTripId()+ |
| | | finalOrderPrivateCar.getInsertTime().getTime()+finalOrderPrivateCar.getEndServiceTime().getTime()); |
| | | log.warn("上报时间:{},tripid:{},created_at:{},completed_at:{}", System.currentTimeMillis(), finalOrderPrivateCar.getTripId(), |
| | | finalOrderPrivateCar.getInsertTime().getTime(), finalOrderPrivateCar.getEndServiceTime().getTime()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | }).start(); |
| | | // 冻结订单需要给司机推送一个消息; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.frozenOrder(finalOrderPrivateCar.getDriverId(),2); |
| | | pushUtil.pushOrderState(2, finalOrderPrivateCar.getDriverId(), finalOrderPrivateCar.getId(), 1, 7, 0, ""); |
| | | } |
| | | }).start(); |
| | | |
| | | pushUtil.frozenOrder(orderPrivateCar.getDriverId(), 2); |
| | | } |
| | | |
| | | orderPrivateCar.setIsFrozen(orderPrivateCar.getIsFrozen()==1?2:1); |
| | | tOrderPrivateCarService.updateAllColumnById(orderPrivateCar); |
| | | |
| | | orderPrivateCar.setIsDispute(1); |
| | | tOrderPrivateCarService.updateById(orderPrivateCar); |
| | | return SUCCESS_TIP; |
| | | } |
| | | @Autowired |
| | | private ChinaMobileUtil chinaMobileUtil; |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | @Autowired |
| | |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(tOrderPrivateCarId); |
| | | orderCancel.setOrderType(1); |
| | | orderCancel.setReason(language == 1 ? "平台取消订单" : language == 2 ? "The platform cancelled the order" : "La plateforme a annulé la commande"); |
| | | orderCancel.setRemark(language == 1 ? "平台取消订单" : language == 2 ? "The platform cancelled the order" : "La plateforme a annulé la commande"); |
| | | orderCancel.setReason("The platform cancelled the order"); |
| | | orderCancel.setRemark("The platform cancelled the order"); |
| | | orderCancel.setUserType(2); |
| | | orderCancel.setState(2); |
| | | orderCancel.setInsertTime(new Date()); |
| | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TServerCarmodel tServerCarmodel,@RequestParam Integer isPrivateCar) { |
| | | int count = tServerCarmodelService.selectCount(new EntityWrapper<TServerCarmodel>().eq("type", 1) |
| | | .eq("name", tServerCarmodel.getName()).last(" and not FIND_IN_SET(state,'3')")); |
| | | if (count > 0){ |
| | | return new ErrorTip(500, "【"+tServerCarmodel.getName()+"】已存在,请重新输入"); |
| | | } |
| | | tServerCarmodel.setInsertTime(new Date()); |
| | | tServerCarmodel.setState(1); |
| | | tServerCarmodel.setType(isPrivateCar); |
| | |
| | | @RequestMapping(value = "/addAcrossCity") |
| | | @ResponseBody |
| | | public Object addAcrossCity(TServerCarmodel tServerCarmodel) { |
| | | int count = tServerCarmodelService.selectCount(new EntityWrapper<TServerCarmodel>().eq("type", 2) |
| | | .eq("name", tServerCarmodel.getName()).last(" and not FIND_IN_SET(state,'3')")); |
| | | if (count > 0){ |
| | | return new ErrorTip(500, "【"+tServerCarmodel.getName()+"】已存在,请重新输入"); |
| | | } |
| | | tServerCarmodel.setInsertTime(new Date()); |
| | | tServerCarmodel.setState(1); |
| | | tServerCarmodel.setType(2); |
| | |
| | | @RequestMapping(value = "/addCharter") |
| | | @ResponseBody |
| | | public Object addCharter(TServerCarmodel tServerCarmodel) { |
| | | int count = tServerCarmodelService.selectCount(new EntityWrapper<TServerCarmodel>().eq("type", 3) |
| | | .eq("name", tServerCarmodel.getName()).last(" and not FIND_IN_SET(state,'3')")); |
| | | if (count > 0){ |
| | | return new ErrorTip(500, "【"+tServerCarmodel.getName()+"】已存在,请重新输入"); |
| | | } |
| | | tServerCarmodel.setInsertTime(new Date()); |
| | | tServerCarmodel.setState(1); |
| | | tServerCarmodel.setType(3); |
| | |
| | | .last(" and not FIND_IN_SET(state,'3')")); |
| | | if (count > 0){ |
| | | TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId()); |
| | | return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择"); |
| | | return new ErrorTip(500, "【"+one.getChineseName()+"】已存在,请重新选择"); |
| | | } |
| | | tSystemPrice.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | tSystemPrice.setType(1); |
| | |
| | | .last(" and not FIND_IN_SET(state,'3')")); |
| | | if (count > 0){ |
| | | TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId()); |
| | | return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择"); |
| | | return new ErrorTip(500, "【"+one.getChineseName()+"】已存在,请重新选择"); |
| | | } |
| | | tSystemPrice.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | tSystemPrice.setType(4); |
| | |
| | | @ResponseBody |
| | | public Object update(TSystemPrice tSystemPrice) { |
| | | TSystemPrice obj = tSystemPriceService.selectById(tSystemPrice.getId()); |
| | | if (obj.getServerCarModelId() != tSystemPrice.getServerCarModelId()){ |
| | | if (obj.getServerCarModelId().compareTo(tSystemPrice.getServerCarModelId()) != 0){ |
| | | //判断当前公司是否添加过该专车车型价格配置 |
| | | int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>() |
| | | .eq("type", 1) |
| | |
| | | .last(" and not FIND_IN_SET(state,'3')")); |
| | | if (count > 0){ |
| | | TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId()); |
| | | return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择"); |
| | | return new ErrorTip(500, "【"+one.getChineseName()+"】已存在,请重新选择"); |
| | | } |
| | | } |
| | | tSystemPriceService.updateById(tSystemPrice); |
| | |
| | | @ResponseBody |
| | | public Object smallupdate(TSystemPrice tSystemPrice) { |
| | | TSystemPrice obj = tSystemPriceService.selectById(tSystemPrice.getId()); |
| | | if (obj.getServerCarModelId() != tSystemPrice.getServerCarModelId()){ |
| | | if (obj.getServerCarModelId().compareTo(tSystemPrice.getServerCarModelId()) != 0){ |
| | | //判断当前公司是否添加过该专车车型价格配置 |
| | | int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>() |
| | | .eq("isPackage", 1) |
| | |
| | | .last(" and not FIND_IN_SET(state,'3')")); |
| | | if (count > 0){ |
| | | TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId()); |
| | | return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择"); |
| | | return new ErrorTip(500, "【"+one.getChineseName()+"】已存在,请重新选择"); |
| | | } |
| | | } |
| | | tSystemPriceService.updateById(tSystemPrice); |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.stylefeng.guns.modular.system.util.GoogleCloudStorageUtil; |
| | | import com.stylefeng.guns.modular.system.util.OBSUploadUtil; |
| | | import com.stylefeng.guns.modular.system.util.OssUploadUtil ; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | String pictureName = ""; |
| | | try { |
| | | //文件上传,具体根据实际替换 |
| | | pictureName = OBSUploadUtil.inputStreamUpload(picture); |
| | | pictureName = GoogleCloudStorageUtil.upload(picture); |
| | | |
| | | String result = "{'original': '" + picture.getOriginalFilename() + "', 'state': 'SUCCESS', 'url': '" + pictureName + "'}"; |
| | | if (callback == null) { |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | |
| | | |
| | |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject(PushURL.zull_user_url + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println("后台 冻结订单 向司机端推送消息"+jsonObject1.getString("msg")); |
| | |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject(PushURL.zull_user_url + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject(PushURL.zull_user_url + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject(PushURL.zull_user_url + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject(PushURL.zull_user_url + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject(PushURL.zull_user_url + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject(PushURL.zull_user_url + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject(PushURL.zull_user_url + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject(PushURL.zull_user_url + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | ByteString audioContents = response.getAudioContent(); |
| | | |
| | | // Write the response to the output file. |
| | | try (OutputStream out = new FileOutputStream("/usr/local/nginx/html/files/audio/" + fileName)) { |
| | | try (OutputStream out = new FileOutputStream("/home/igotechgh/nginx/html/files/audio/" + fileName)) { |
| | | out.write(audioContents.toByteArray()); |
| | | return "http://182.160.16.251:81/files/audio/" + fileName; |
| | | return "https://igo.i-go.group/files/audio/" + fileName; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | import com.stylefeng.guns.core.common.exception.BizExceptionEnum; |
| | | import com.stylefeng.guns.core.exception.GunsException; |
| | | import com.stylefeng.guns.core.util.ObsUploadUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleCloudStorageUtil; |
| | | import com.stylefeng.guns.modular.system.util.OBSUploadUtil; |
| | | import com.stylefeng.guns.modular.system.util.OssUploadUtil; |
| | | import org.slf4j.Logger; |
| | |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile"); |
| | | if (file.getSize() != 0) { |
| | | ossUpload = OBSUploadUtil.inputStreamUpload(file); |
| | | ossUpload = GoogleCloudStorageUtil.upload(file); |
| | | // ossUpload = ObsUploadUtil.obsUpload(super.getHttpServletRequest(), file); |
| | | m.put("imgUrl", ossUpload); |
| | | } |
| | |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) picture; |
| | | |
| | | String pictureName = OBSUploadUtil.inputStreamUpload(file); |
| | | String pictureName = GoogleCloudStorageUtil.upload(file); |
| | | // String pictureName = ObsUploadUtil.obsUpload(super.getHttpServletRequest(), picture); |
| | | return pictureName; |
| | | } catch (IOException e1) { |
| | | } catch (Exception e1) { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | // 文件全路径 |
| | | //pictureName = gunsProperties.getPictureServerAddress() + pictureName; |
| | | // pictureName = ObsUploadUtil.obsUpload(super.getHttpServletRequest(), picture); |
| | | pictureName = OBSUploadUtil.inputStreamUpload(picture); |
| | | pictureName = GoogleCloudStorageUtil.upload(picture); |
| | | |
| | | String result = "{'original': '" + picture.getOriginalFilename() + "', 'state': 'SUCCESS', 'url': '" + pictureName + "'}"; |
| | | if (callback == null) { |
| | |
| | | <select id="getLineList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT model.modelStr,IFNULL(ls.num,0) as shiftNum,su.`name` as insertUser,IFNULL(lc.num,0) as companyNum,ll.* FROM t_line as ll |
| | | LEFT JOIN ( |
| | | SELECT GROUP_CONCAT(sc.`name` SEPARATOR '、') as modelStr,lp.lineId FROM t_line_price as lp |
| | | SELECT GROUP_CONCAT(sc.chineseName SEPARATOR '、') as modelStr,lp.lineId FROM t_line_price as lp |
| | | LEFT JOIN t_server_carmodel as sc on sc.id = lp.serverCarModelId |
| | | where sc.type = 2 and lp.state != 3 GROUP BY lp.lineId) as model on model.lineId = ll.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,lineId FROM t_line_shift where state != 3 GROUP BY lineId) as ls on ls.lineId = ll.id |
| | |
| | | |
| | | <!--根据线路ID查询线路价格--> |
| | | <select id="getLinePriceList" resultType="java.util.Map"> |
| | | SELECT sc.`name`,lp.* FROM t_line_price as lp |
| | | SELECT sc.chineseName as `name`,lp.* FROM t_line_price as lp |
| | | LEFT JOIN t_server_carmodel as sc on sc.id = lp.serverCarModelId |
| | | where lp.lineId = #{lineId} and lp.state != 3 |
| | | </select> |
| | |
| | | <select id="getCrossCityOrderList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM ( |
| | | SELECT ui.nickName as userName,ui.phone as userPhone,CONCAT(di.firstName, ' ', di.lastName,'-',di.phone) as driver,CONCAT(cb.`name`,'-',ci.carLicensePlate) as car, |
| | | sc.`name` as serverCarModel,ll.`name` as lineName,ot.* FROM t_order_cross_city as ot |
| | | sc.chineseName as serverCarModel,ll.`name` as lineName,ot.* FROM t_order_cross_city as ot |
| | | LEFT JOIN t_user as ui on ui.id = ot.userId |
| | | LEFT JOIN t_driver as di on di.id = ot.driverId |
| | | LEFT JOIN t_car as ci on ci.id= ot.carId |
| | |
| | | case when ot.payType = 1 then '微信' |
| | | when ot.payType = 2 then '支付宝' |
| | | when ot.payType = 3 then '余额' else '' end as payTypeStr, |
| | | sc.`name` as serverCarModel, |
| | | sc.chineseName as serverCarModel, |
| | | CONCAT(di.firstName, ' ', di.lastName,'-',di.phone) as driver, |
| | | CONCAT(cb.`name`,'-',ci.carLicensePlate) as car, |
| | | ll.`name` as lineName, |
| | |
| | | <!--根据条件查询专车订单列表--> |
| | | <select id="getPrivateCarOrderList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT ui.nickName as userName,ui.phone as userPhone,CONCAT(di.firstName, " ", di.lastName,'-',di.phone) as driver,CONCAT(cb.`name`,'-',ci.carLicensePlate) as car, |
| | | sc.`name` as serverCarModel,ot.* FROM t_order_private_car as ot |
| | | sc.chineseName as serverCarModel,ot.* FROM t_order_private_car as ot |
| | | LEFT JOIN t_user as ui on ui.id = ot.userId |
| | | LEFT JOIN t_driver as di on di.id = ot.driverId |
| | | LEFT JOIN t_car as ci on ci.id= ot.carId |
| | |
| | | |
| | | case when ot.isFree = 2 then ot.orderMoney |
| | | when ot.freeMoney > ot.orderMoney then ot.orderMoney else ot.freeMoney end as freeMoney1, |
| | | sc.`name` as serverCarModel, |
| | | sc.chineseName as serverCarModel, |
| | | case when income1.type = 1 then income1.money else 0 end as platIncome, |
| | | case when income1.type = 2 then income1.money else 0 end as companyIncome, |
| | | case when income1.type = 3 then income1.money else 0 end as franchiseeIncome, |
| | |
| | | <!--根据条件查询专车订单列表noPage--> |
| | | <select id="getPrivateCarOrderListNoPage" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT ui.nickName as userName,ui.phone as userPhone,CONCAT(di.firstName, " ", di.lastName,'-',di.phone) as driver,CONCAT(cb.`name`,'-',ci.carLicensePlate) as car, |
| | | sc.`name` as serverCarModel,ot.* FROM t_order_private_car as ot |
| | | sc.chineseName as serverCarModel,ot.* FROM t_order_private_car as ot |
| | | LEFT JOIN t_user as ui on ui.id = ot.userId |
| | | LEFT JOIN t_driver as di on di.id = ot.driverId |
| | | LEFT JOIN t_car as ci on ci.id= ot.carId |
| | |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TServerCarmodel"> |
| | | <id column="id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="name" property="name" /> |
| | | <result column="chineseName" property="chineseName" /> |
| | | <result column="englishName" property="englishName" /> |
| | | <result column="frenchName" property="frenchName" /> |
| | | <result column="img" property="img" /> |
| | | <result column="state" property="state" /> |
| | | <result column="insertTime" property="insertTime" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, type, name, img, state, insertTime |
| | | id, type, chineseName, englishName, frenchName, img, state, insertTime |
| | | </sql> |
| | | |
| | | <!--根据条件查询服务车型列表--> |
| | |
| | | SELECT * FROM t_server_carmodel as o |
| | | <where> |
| | | <if test="name != null and name != ''"> |
| | | and o.name LIKE CONCAT('%',#{name},'%') |
| | | and o.chineseName LIKE CONCAT('%',#{name},'%') or o.englishName LIKE CONCAT('%',#{name},'%') or o.frenchName LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="state != null and state != ''"> |
| | | and o.state = #{state} |
| | |
| | | |
| | | <!--查询专车价格设置--> |
| | | <select id="getSpecialPriceList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT sp.id,sp.type,sp.companyId,sc.`name`,sc.img,sp.state from t_system_price as sp |
| | | SELECT * FROM (SELECT sp.id,sp.type,sp.companyId,sc.chineseName as `name`,sc.img,sp.state from t_system_price as sp |
| | | LEFT JOIN t_server_carmodel as sc on sc.id = sp.serverCarModelId) as o |
| | | <where> |
| | | o.type = 1 and o.state != 3 and o.companyId = #{companyId} |
| | |
| | | </select> |
| | | <!--查询小件物流价格设置--> |
| | | <select id="getSpecialPriceList1" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT sp.id,sp.type,sp.companyId,sc.`name`,sc.img,sp.state from t_system_price as sp |
| | | SELECT * FROM (SELECT sp.id,sp.type,sp.companyId,sc.chineseName as `name`,sc.img,sp.state from t_system_price as sp |
| | | LEFT JOIN t_server_carmodel as sc on sc.id = sp.serverCarModelId) as o |
| | | <where> |
| | | o.type = 4 and o.state != 3 and o.companyId = #{companyId} |
| | |
| | | /** |
| | | * 车型名称 |
| | | */ |
| | | private String name; |
| | | private String chineseName; |
| | | /** |
| | | * 车型名称 |
| | | */ |
| | | private String englishName; |
| | | /** |
| | | * 车型名称 |
| | | */ |
| | | private String frenchName; |
| | | /** |
| | | * 车型图片 |
| | | */ |
| | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | |
| | | public String getChineseName() { |
| | | return chineseName; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | |
| | | public void setChineseName(String chineseName) { |
| | | this.chineseName = chineseName; |
| | | } |
| | | |
| | | |
| | | public String getEnglishName() { |
| | | return englishName; |
| | | } |
| | | |
| | | public void setEnglishName(String englishName) { |
| | | this.englishName = englishName; |
| | | } |
| | | |
| | | public String getFrenchName() { |
| | | return frenchName; |
| | | } |
| | | |
| | | public void setFrenchName(String frenchName) { |
| | | this.frenchName = frenchName; |
| | | } |
| | | |
| | | public String getImg() { |
| | | return img; |
| | | } |
| | |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TServerCarmodel{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", name=" + name + |
| | | ", img=" + img + |
| | | ", state=" + state + |
| | | ", insertTime=" + insertTime + |
| | | "}"; |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", chineseName='" + chineseName + '\'' + |
| | | ", englishName='" + englishName + '\'' + |
| | | ", frenchName='" + frenchName + '\'' + |
| | | ", img='" + img + '\'' + |
| | | ", price='" + price + '\'' + |
| | | ", state=" + state + |
| | | ", insertTime=" + insertTime + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | |
| | | for (TUser user : tUsers) { |
| | | if(ToolUtil.isNotEmpty(user.getEmail())){ |
| | | Integer language = user.getLanguage(); |
| | | for (String key : strings) { |
| | | Double aDouble = map.get(key); |
| | | String path1 = templatePath + "user/discount.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | document1.getElementById("chinese").remove(); |
| | | document1.getElementById("french").remove(); |
| | | document1.getElementsByTag("title").get(0).text("Discount activities"); |
| | | Element english_user = document1.getElementById("english_user"); |
| | | english_user.text("Hello " + user.getNickName() + ","); |
| | | Element english_ride = document1.getElementById("english_ride"); |
| | | english_ride.text("Discount for I-GO " + key); |
| | | Element english_discount = document1.getElementById("english_discount"); |
| | | english_discount.text(" Enjoy " + new BigDecimal((100 - aDouble)).setScale(2, RoundingMode.HALF_EVEN).doubleValue() + "% off your trip fare."); |
| | | |
| | | EmailUtil.send(user.getEmail(), "Discount activities", document1.html()); |
| | | 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("您好 " + user.getNickName() + ","); |
| | | Element chinese_ride = document1.getElementById("chinese_ride"); |
| | | chinese_ride.text("I-GO" + key + "打折活动奖励"); |
| | | Element chinese_go = document1.getElementById("chinese_go"); |
| | | if("ride".equals(key)){ |
| | | chinese_go.text("去打车"); |
| | | }else{ |
| | | chinese_go.text("寄包裹"); |
| | | } |
| | | Element chinese_discount = document1.getElementById("chinese_discount"); |
| | | chinese_discount.text("每单费用折扣" + new BigDecimal((100 - aDouble)).setScale(2, RoundingMode.HALF_EVEN).doubleValue() + "%"); |
| | | EmailUtil.send(user.getEmail(), "折扣活动", document1.html()); |
| | | } |
| | | if(2 == language){ |
| | | document1.getElementById("chinese").remove(); |
| | | document1.getElementById("french").remove(); |
| | | document1.getElementsByTag("title").get(0).text("Discount activities"); |
| | | Element english_user = document1.getElementById("english_user"); |
| | | english_user.text("Hello " + user.getNickName() + ","); |
| | | Element english_ride = document1.getElementById("english_ride"); |
| | | english_ride.text("Discount for I-GO " + key); |
| | | Element english_go = document1.getElementById("english_go"); |
| | | if("ride".equals(key)){ |
| | | english_go.text("REQUEST A RIDE"); |
| | | }else{ |
| | | english_go.text("REQUEST A DELIVERY"); |
| | | } |
| | | Element english_discount = document1.getElementById("english_discount"); |
| | | english_discount.text(" Enjoy " + new BigDecimal((100 - aDouble)).setScale(2, RoundingMode.HALF_EVEN).doubleValue() + "% off your trip fare."); |
| | | EmailUtil.send(user.getEmail(), "Discount activities", document1.html()); |
| | | } |
| | | if(3 == language){ |
| | | document1.getElementById("chinese").remove(); |
| | | document1.getElementById("english").remove(); |
| | | document1.getElementsByTag("title").get(0).text("Activités à rabais"); |
| | | Element french_user = document1.getElementById("french_user"); |
| | | french_user.text("Hello " + user.getNickName() + ","); |
| | | Element french_ride = document1.getElementById("french_ride"); |
| | | french_ride.text("Remise pour I-GO (commande de " + key + ")!"); |
| | | Element french_go = document1.getElementById("french_go"); |
| | | if("ride".equals(key)){ |
| | | french_go.text("Déplacez-vous avec I-GO"); |
| | | }else{ |
| | | french_go.text("Demander une livraison avec I-GO"); |
| | | } |
| | | Element french_discount = document1.getElementById("french_discount"); |
| | | french_discount.text("Profitez aujourd’hui de 10" + new BigDecimal((100 - aDouble)).setScale(2, RoundingMode.HALF_EVEN).doubleValue() + "% de réduction sur les commandes de course, allez sur la plate-forme I-GO pour voir le détail."); |
| | | EmailUtil.send(user.getEmail(), "Activités à rabais", document1.html()); |
| | | } |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/discount_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/discount_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/discount_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/discount_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(user.getId()); |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aliyuncs.CommonRequest; |
| | | import com.aliyuncs.CommonResponse; |
| | | import com.aliyuncs.DefaultAcsClient; |
| | | import com.aliyuncs.IAcsClient; |
| | | import com.aliyuncs.exceptions.ClientException; |
| | | import com.aliyuncs.exceptions.ServerException; |
| | | import com.aliyuncs.http.MethodType; |
| | | import com.aliyuncs.profile.DefaultProfile; |
| | | import com.stylefeng.guns.core.util.MD5Util; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 中国移动工具类 |
| | | */ |
| | | @Component |
| | | public class ChinaMobileUtil { |
| | | |
| | | private static String APIKey = "LTAI4G1BpRaihVRZp1RS8Stn"; |
| | | |
| | | private static String SecretKey = "PDR7uUEGNf0wIPPVCPCVdySgTwCr90"; |
| | | |
| | | @Autowired |
| | | private HttpClientUtil httpClientUtil; |
| | | |
| | | |
| | | /** |
| | | * 绑定小号 |
| | | * @param phoneA |
| | | * @param phoneB |
| | | * @param areaCode |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static Map<String, String> midAxbBindSend(String phoneA, String phoneB, Integer areaCode) throws Exception{ |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | map1.put("code", "-1"); |
| | | map1.put("msg", ""); |
| | | map1.put("telX", ""); |
| | | map1.put("bindId", ""); |
| | | return map1; |
| | | //暂时屏蔽-后期放开 |
| | | /*DefaultProfile profile = DefaultProfile.getProfile( |
| | | "cn-hangzhou", // 地域ID |
| | | APIKey, // 您的AccessKey ID |
| | | SecretKey ); // 您的AccessKey Secret |
| | | IAcsClient client = new DefaultAcsClient(profile); |
| | | |
| | | CommonRequest request = new CommonRequest(); |
| | | request.setMethod(MethodType.POST); |
| | | request.setDomain("dyplsapi.aliyuncs.com"); |
| | | request.setVersion("2017-05-25"); |
| | | request.setAction("BindAxb"); |
| | | // 绑定关系的过期时间。必须晚于当前时间1分钟以上。 |
| | | request.putQueryParameter("Expiration", DateUtil.format(new Date(new Date().getTime()+7 * 24 * 60 * 60*1000L),"yyyy-MM-dd HH:mm:ss")); |
| | | // 号码池Key |
| | | request.putQueryParameter("PoolKey", "FC100000119206151"); |
| | | // AXB中的B号码 |
| | | request.putQueryParameter("PhoneNoB", phoneB); |
| | | // AXB中的A号码 |
| | | request.putQueryParameter("PhoneNoA", phoneA); |
| | | // 指定城市进行X号码的选号。 |
| | | request.putQueryParameter("ExpectCity", "北京"); |
| | | // 是否需要针对该绑定关系产生的所有通话录制通话录音。 |
| | | request.putQueryParameter("IsRecordingEnabled", "false"); |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | try { |
| | | CommonResponse response = client.getCommonResponse(request); |
| | | // 处理请求结果 |
| | | System.out.println(response.getData()); |
| | | JSONObject jsonObject = JSONObject.parseObject(response.getData()); |
| | | if(jsonObject.getString("Code").equals("OK")){ |
| | | map1.put("code", "200"); |
| | | map1.put("msg", jsonObject.getString("Message")); |
| | | map1.put("telX", jsonObject.getJSONObject("SecretBindDTO").getString("SecretNo")); |
| | | map1.put("bindId", jsonObject.getJSONObject("SecretBindDTO").getString("SubsId")); |
| | | }else{ |
| | | map1.put("code", jsonObject.getString("Code")); |
| | | map1.put("msg", jsonObject.getString("Message")); |
| | | } |
| | | } catch (ServerException e) { |
| | | e.printStackTrace(); |
| | | map1.put("code", "-1"); |
| | | map1.put("msg", e.getErrMsg()); |
| | | } catch (ClientException e) { |
| | | System.out.println("ErrCode:" + e.getErrCode()); |
| | | System.out.println("ErrMsg:" + e.getErrMsg()); |
| | | System.out.println("RequestId:" + e.getRequestId()); |
| | | map1.put("code", "-1"); |
| | | map1.put("msg", e.getErrMsg()); |
| | | } |
| | | return map1;*/ |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 解绑小号关系 |
| | | * @param bindId 绑定关系id |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static Map<String, String> midAxbUnBindSend(String bindId,String secretNo) throws Exception{ |
| | | DefaultProfile profile = DefaultProfile.getProfile( |
| | | "cn-hangzhou", // 地域ID |
| | | APIKey, // 您的AccessKey ID |
| | | SecretKey ); // 您的AccessKey Secret |
| | | IAcsClient client = new DefaultAcsClient(profile); |
| | | |
| | | CommonRequest request = new CommonRequest(); |
| | | request.setMethod(MethodType.POST); |
| | | request.setDomain("dyplsapi.aliyuncs.com"); |
| | | request.setVersion("2017-05-25"); |
| | | request.setAction("UnbindSubscription"); |
| | | // 绑定关系的过期时间。必须晚于当前时间1分钟以上。 |
| | | // 号码池Key |
| | | request.putQueryParameter("PoolKey", "FC100000119206151"); |
| | | // 隐私号码。调用BindAXG等号码绑定接口时指定或自动分配的X号码。 |
| | | request.putQueryParameter("SecretNo", secretNo); |
| | | // 绑定关系ID。 |
| | | // |
| | | //可以在控制台的号码管理 > 号码详情中查看绑定关系ID,或者在调用BindAxb等号码绑定API时查看返回参数中的SubsId。 |
| | | request.putQueryParameter("SubsId", bindId); |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | try { |
| | | CommonResponse response = client.getCommonResponse(request); |
| | | // 处理请求结果 |
| | | System.out.println(response.getData()); |
| | | JSONObject jsonObject = JSONObject.parseObject(response.getData()); |
| | | if(jsonObject.getString("Code").equals("OK")){ |
| | | map1.put("code", "200"); |
| | | map1.put("msg", jsonObject.getString("Message")); |
| | | }else{ |
| | | map1.put("code", jsonObject.getString("Code")); |
| | | map1.put("msg", jsonObject.getString("Message")); |
| | | } |
| | | } catch (ServerException e) { |
| | | e.printStackTrace(); |
| | | map1.put("code", "-1"); |
| | | map1.put("msg", e.getErrMsg()); |
| | | } catch (ClientException e) { |
| | | System.out.println("ErrCode:" + e.getErrCode()); |
| | | System.out.println("ErrMsg:" + e.getErrMsg()); |
| | | System.out.println("RequestId:" + e.getRequestId()); |
| | | map1.put("code", "-1"); |
| | | map1.put("msg", e.getErrMsg()); |
| | | } |
| | | return map1; |
| | | } |
| | | |
| | | public static void main(String[] args) throws IOException { |
| | | try{ |
| | | // System.out.println(midAxbBindSend("18380476116","13688394165",null)); |
| | | System.out.println(midAxbUnBindSend("1000031640138366","17150145472")); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public Map<String, String> HeaderUtils(String APIKey, String SecretKey) throws Exception{ |
| | | Map<String, String> header = new HashMap<>(); |
| | | long time = System.currentTimeMillis(); |
| | | String signStr = MD5Util.encrypt(APIKey + SecretKey + time); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("apiKey", APIKey); |
| | | jsonObject.put("time", time); |
| | | jsonObject.put("sign", signStr); |
| | | Base64 base64 = new Base64(); |
| | | String s = base64.encodeToString(jsonObject.toJSONString().getBytes("UTF-8")); |
| | | header.put("header", s); |
| | | |
| | | jsonObject = new JSONObject(); |
| | | jsonObject.put("platformId", ""); |
| | | jsonObject.put("secret", ""); |
| | | s = base64.encodeToString(jsonObject.toJSONString().getBytes("UTF-8")); |
| | | header.put("accessCode", s); |
| | | return header; |
| | | } |
| | | } |
| | | //package com.stylefeng.guns.modular.system.util; |
| | | // |
| | | //import com.alibaba.fastjson.JSONObject; |
| | | //import com.aliyuncs.CommonRequest; |
| | | //import com.aliyuncs.CommonResponse; |
| | | //import com.aliyuncs.DefaultAcsClient; |
| | | //import com.aliyuncs.IAcsClient; |
| | | //import com.aliyuncs.exceptions.ClientException; |
| | | //import com.aliyuncs.exceptions.ServerException; |
| | | //import com.aliyuncs.http.MethodType; |
| | | //import com.aliyuncs.profile.DefaultProfile; |
| | | //import com.stylefeng.guns.core.util.MD5Util; |
| | | //import org.apache.commons.codec.binary.Base64; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.stereotype.Component; |
| | | // |
| | | //import java.io.IOException; |
| | | //import java.util.HashMap; |
| | | //import java.util.Map; |
| | | // |
| | | ///** |
| | | // * 中国移动工具类 |
| | | // */ |
| | | //@Component |
| | | //public class ChinaMobileUtil { |
| | | // |
| | | // private static String APIKey = "LTAI4G1BpRaihVRZp1RS8Stn"; |
| | | // |
| | | // private static String SecretKey = "PDR7uUEGNf0wIPPVCPCVdySgTwCr90"; |
| | | // |
| | | // @Autowired |
| | | // private HttpClientUtil httpClientUtil; |
| | | // |
| | | // |
| | | // /** |
| | | // * 绑定小号 |
| | | // * @param phoneA |
| | | // * @param phoneB |
| | | // * @param areaCode |
| | | // * @return |
| | | // * @throws Exception |
| | | // */ |
| | | // public static Map<String, String> midAxbBindSend(String phoneA, String phoneB, Integer areaCode) throws Exception{ |
| | | // Map<String, String> map1 = new HashMap<>(); |
| | | // map1.put("code", "-1"); |
| | | // map1.put("msg", ""); |
| | | // map1.put("telX", ""); |
| | | // map1.put("bindId", ""); |
| | | // return map1; |
| | | // //暂时屏蔽-后期放开 |
| | | // /*DefaultProfile profile = DefaultProfile.getProfile( |
| | | // "cn-hangzhou", // 地域ID |
| | | // APIKey, // 您的AccessKey ID |
| | | // SecretKey ); // 您的AccessKey Secret |
| | | // IAcsClient client = new DefaultAcsClient(profile); |
| | | // |
| | | // CommonRequest request = new CommonRequest(); |
| | | // request.setMethod(MethodType.POST); |
| | | // request.setDomain("dyplsapi.aliyuncs.com"); |
| | | // request.setVersion("2017-05-25"); |
| | | // request.setAction("BindAxb"); |
| | | // // 绑定关系的过期时间。必须晚于当前时间1分钟以上。 |
| | | // request.putQueryParameter("Expiration", DateUtil.format(new Date(new Date().getTime()+7 * 24 * 60 * 60*1000L),"yyyy-MM-dd HH:mm:ss")); |
| | | // // 号码池Key |
| | | // request.putQueryParameter("PoolKey", "FC100000119206151"); |
| | | // // AXB中的B号码 |
| | | // request.putQueryParameter("PhoneNoB", phoneB); |
| | | // // AXB中的A号码 |
| | | // request.putQueryParameter("PhoneNoA", phoneA); |
| | | // // 指定城市进行X号码的选号。 |
| | | // request.putQueryParameter("ExpectCity", "北京"); |
| | | // // 是否需要针对该绑定关系产生的所有通话录制通话录音。 |
| | | // request.putQueryParameter("IsRecordingEnabled", "false"); |
| | | // Map<String, String> map1 = new HashMap<>(); |
| | | // try { |
| | | // CommonResponse response = client.getCommonResponse(request); |
| | | // // 处理请求结果 |
| | | // System.out.println(response.getData()); |
| | | // JSONObject jsonObject = JSONObject.parseObject(response.getData()); |
| | | // if(jsonObject.getString("Code").equals("OK")){ |
| | | // map1.put("code", "200"); |
| | | // map1.put("msg", jsonObject.getString("Message")); |
| | | // map1.put("telX", jsonObject.getJSONObject("SecretBindDTO").getString("SecretNo")); |
| | | // map1.put("bindId", jsonObject.getJSONObject("SecretBindDTO").getString("SubsId")); |
| | | // }else{ |
| | | // map1.put("code", jsonObject.getString("Code")); |
| | | // map1.put("msg", jsonObject.getString("Message")); |
| | | // } |
| | | // } catch (ServerException e) { |
| | | // e.printStackTrace(); |
| | | // map1.put("code", "-1"); |
| | | // map1.put("msg", e.getErrMsg()); |
| | | // } catch (ClientException e) { |
| | | // System.out.println("ErrCode:" + e.getErrCode()); |
| | | // System.out.println("ErrMsg:" + e.getErrMsg()); |
| | | // System.out.println("RequestId:" + e.getRequestId()); |
| | | // map1.put("code", "-1"); |
| | | // map1.put("msg", e.getErrMsg()); |
| | | // } |
| | | // return map1;*/ |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 解绑小号关系 |
| | | // * @param bindId 绑定关系id |
| | | // * @return |
| | | // * @throws Exception |
| | | // */ |
| | | // public static Map<String, String> midAxbUnBindSend(String bindId,String secretNo) throws Exception{ |
| | | // DefaultProfile profile = DefaultProfile.getProfile( |
| | | // "cn-hangzhou", // 地域ID |
| | | // APIKey, // 您的AccessKey ID |
| | | // SecretKey ); // 您的AccessKey Secret |
| | | // IAcsClient client = new DefaultAcsClient(profile); |
| | | // |
| | | // CommonRequest request = new CommonRequest(); |
| | | // request.setMethod(MethodType.POST); |
| | | // request.setDomain("dyplsapi.aliyuncs.com"); |
| | | // request.setVersion("2017-05-25"); |
| | | // request.setAction("UnbindSubscription"); |
| | | // // 绑定关系的过期时间。必须晚于当前时间1分钟以上。 |
| | | // // 号码池Key |
| | | // request.putQueryParameter("PoolKey", "FC100000119206151"); |
| | | // // 隐私号码。调用BindAXG等号码绑定接口时指定或自动分配的X号码。 |
| | | // request.putQueryParameter("SecretNo", secretNo); |
| | | // // 绑定关系ID。 |
| | | // // |
| | | // //可以在控制台的号码管理 > 号码详情中查看绑定关系ID,或者在调用BindAxb等号码绑定API时查看返回参数中的SubsId。 |
| | | // request.putQueryParameter("SubsId", bindId); |
| | | // Map<String, String> map1 = new HashMap<>(); |
| | | // try { |
| | | // CommonResponse response = client.getCommonResponse(request); |
| | | // // 处理请求结果 |
| | | // System.out.println(response.getData()); |
| | | // JSONObject jsonObject = JSONObject.parseObject(response.getData()); |
| | | // if(jsonObject.getString("Code").equals("OK")){ |
| | | // map1.put("code", "200"); |
| | | // map1.put("msg", jsonObject.getString("Message")); |
| | | // }else{ |
| | | // map1.put("code", jsonObject.getString("Code")); |
| | | // map1.put("msg", jsonObject.getString("Message")); |
| | | // } |
| | | // } catch (ServerException e) { |
| | | // e.printStackTrace(); |
| | | // map1.put("code", "-1"); |
| | | // map1.put("msg", e.getErrMsg()); |
| | | // } catch (ClientException e) { |
| | | // System.out.println("ErrCode:" + e.getErrCode()); |
| | | // System.out.println("ErrMsg:" + e.getErrMsg()); |
| | | // System.out.println("RequestId:" + e.getRequestId()); |
| | | // map1.put("code", "-1"); |
| | | // map1.put("msg", e.getErrMsg()); |
| | | // } |
| | | // return map1; |
| | | // } |
| | | // |
| | | // public static void main(String[] args) throws IOException { |
| | | // try{ |
| | | // // System.out.println(midAxbBindSend("18380476116","13688394165",null)); |
| | | // System.out.println(midAxbUnBindSend("1000031640138366","17150145472")); |
| | | // }catch (Exception e){ |
| | | // |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // |
| | | // public Map<String, String> HeaderUtils(String APIKey, String SecretKey) throws Exception{ |
| | | // Map<String, String> header = new HashMap<>(); |
| | | // long time = System.currentTimeMillis(); |
| | | // String signStr = MD5Util.encrypt(APIKey + SecretKey + time); |
| | | // JSONObject jsonObject = new JSONObject(); |
| | | // jsonObject.put("apiKey", APIKey); |
| | | // jsonObject.put("time", time); |
| | | // jsonObject.put("sign", signStr); |
| | | // Base64 base64 = new Base64(); |
| | | // String s = base64.encodeToString(jsonObject.toJSONString().getBytes("UTF-8")); |
| | | // header.put("header", s); |
| | | // |
| | | // jsonObject = new JSONObject(); |
| | | // jsonObject.put("platformId", ""); |
| | | // jsonObject.put("secret", ""); |
| | | // s = base64.encodeToString(jsonObject.toJSONString().getBytes("UTF-8")); |
| | | // header.put("accessCode", s); |
| | | // return header; |
| | | // } |
| | | //} |
| | |
| | | Properties props = new Properties(); |
| | | //选择ssl方式 |
| | | gmailssl(props); |
| | | |
| | | |
| | | final String username = "i-gotech@i-go.group";// gmail 邮箱 |
| | | final String password = "mhizkqkhuknbitps";// Google应用专用密码 |
| | | // 当做多商户的时候需要使用getInstance, 如果只是一个邮箱发送的话就用getDefaultInstance |
| | | // Session.getDefaultInstance 会将username,password保存在session会话中 |
| | | // Session.getInstance 不进行保存 |
| | | final String password = "rvbmuovvpocmhast";// Google应用专用密码 |
| | | Session session = Session.getInstance(props, |
| | | new Authenticator() { |
| | | protected PasswordAuthentication getPasswordAuthentication() { |
| | | return new PasswordAuthentication(username, password); |
| | | } |
| | | }); |
| | | MimeMessage msg = new MimeMessage(session); |
| | | //2.设置发件人地址 |
| | | msg.setFrom(new InternetAddress(sentToEmail)); |
| | | /** |
| | | * 3.设置收件人地址(可以增加多个收件人、抄送、密送),即下面这一行代码书写多行 |
| | | * MimeMessage.RecipientType.TO:发送 |
| | | * MimeMessage.RecipientType.CC:抄送 |
| | | * MimeMessage.RecipientType.BCC:密送 |
| | | */ |
| | | msg.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress(sentToEmail)); |
| | | //4.设置邮件主题 |
| | | msg.setSubject(subject, "UTF-8"); |
| | | // 6. 创建文本"节点" |
| | | // 创建默认的MimeMessage对象 |
| | | MimeMessage message = new MimeMessage(session); |
| | | // 设置发件人 |
| | | message.setFrom(new InternetAddress(username)); |
| | | // 设置收件人 |
| | | message.addRecipient(Message.RecipientType.TO, new InternetAddress(sentToEmail)); |
| | | // 设置邮件主题 |
| | | message.setSubject(subject,"UTF-8"); |
| | | // 设置邮件内容 |
| | | MimeBodyPart text = new MimeBodyPart(); |
| | | // 这里添加图片的方式是将整个图片包含到邮件内容中, 实际上也可以以 http 链接的形式添加网络图片 |
| | | text.setContent(content, "text/html;charset=UTF-8"); |
| | | // 7. (文本+图片)设置 文本 和 图片"节点"的关系(将 文本 和 图片"节点"合成一个混合"节点") |
| | | MimeMultipart mm_text_image = new MimeMultipart(); |
| | | mm_text_image.addBodyPart(text); |
| | | mm_text_image.setSubType("related"); // 关联关系 |
| | | // 11. 设置整个邮件的关系(将最终的混合"节点"作为邮件的内容添加到邮件对象) |
| | | msg.setContent(mm_text_image); |
| | | text.setContent(content,"text/html;charset=UTF-8"); |
| | | MimeMultipart mimeMultipart = new MimeMultipart(); |
| | | mimeMultipart.addBodyPart(text); |
| | | mimeMultipart.setSubType("related"); |
| | | message.setContent(mimeMultipart); |
| | | //设置邮件的发送时间,默认立即发送 |
| | | msg.setSentDate(new Date()); |
| | | |
| | | Transport transport = session.getTransport(); |
| | | transport.connect(); |
| | | transport.sendMessage(msg, msg.getAllRecipients()); |
| | | transport.close(); |
| | | message.setSentDate(new Date()); |
| | | |
| | | // 发送消息 |
| | | Transport.send(message); |
| | | System.out.println("Sent message successfully...."); |
| | | return true; |
| | | } |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.google.cloud.WriteChannel; |
| | | import com.google.cloud.storage.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.nio.ByteBuffer; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.nio.file.Paths; |
| | | |
| | | /** |
| | | * google对象存储 |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/31 9:18 |
| | | */ |
| | | public class GoogleCloudStorageUtil { |
| | | |
| | | |
| | | |
| | | public static String upload(MultipartFile file){ |
| | | // The ID of your GCP project |
| | | // String projectId = "your-project-id"; |
| | | |
| | | // The ID of your GCS bucket |
| | | // String bucketName = "your-unique-bucket-name"; |
| | | |
| | | // The ID of your GCS object |
| | | // String objectName = "your-object-name"; |
| | | |
| | | // The path to your file to upload |
| | | // String filePath = "path/to/your/file" |
| | | String fileName = file.getOriginalFilename(); |
| | | String projectId = "i-go-gcp"; |
| | | String bucketName = "i-go"; |
| | | Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); |
| | | BlobId blobId = BlobId.of(bucketName, fileName); |
| | | BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build(); |
| | | |
| | | // Optional: set a generation-match precondition to avoid potential race |
| | | // conditions and data corruptions. The request returns a 412 error if the |
| | | // preconditions are not met. |
| | | Storage.BlobWriteOption precondition; |
| | | if (storage.get(bucketName, fileName) == null) { |
| | | // For a target object that does not yet exist, set the DoesNotExist precondition. |
| | | // This will cause the request to fail if the object is created before the request runs. |
| | | precondition = Storage.BlobWriteOption.doesNotExist(); |
| | | } else { |
| | | // If the destination already exists in your bucket, instead set a generation-match |
| | | // precondition. This will cause the request to fail if the existing object's generation |
| | | // changes before the request runs. |
| | | precondition = |
| | | Storage.BlobWriteOption.generationMatch( |
| | | storage.get(bucketName, fileName).getGeneration()); |
| | | } |
| | | try { |
| | | storage.createFrom(blobInfo, file.getInputStream(), precondition); |
| | | System.out.println( |
| | | "File uploaded to bucket " + bucketName + " as " + fileName); |
| | | |
| | | makeObjectPublic(projectId, bucketName, fileName); |
| | | return "https://storage.googleapis.com/i-go/" + fileName; |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置对象公开访问 |
| | | * @param projectId |
| | | * @param bucketName |
| | | * @param objectName |
| | | */ |
| | | public static void makeObjectPublic(String projectId, String bucketName, String objectName) { |
| | | // String projectId = "your-project-id"; |
| | | // String bucketName = "your-bucket-name"; |
| | | // String objectName = "your-object-name"; |
| | | Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); |
| | | BlobId blobId = BlobId.of(bucketName, objectName); |
| | | storage.createAcl(blobId, Acl.of(Acl.User.ofAllUsers(), Acl.Role.READER)); |
| | | |
| | | System.out.println( |
| | | "Object " + objectName + " in bucket " + bucketName + " was made publicly readable"); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * Fleet Engine API 工具类 |
| | | * |
| | | * @author zhibing.pu |
| | | * @Date 2024/5/17 9:59 |
| | | */ |
| | |
| | | |
| | | static Logger logger = LoggerFactory.getLogger(FleetEngineUtil.class); |
| | | |
| | | private final String SERVICE_ACCOUNT = "odrd-fleetengine-ondemandadmin@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String DRIVER_ACCOUNT = "odrd-fleetengine-driversdkuser@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String CONSUMER_ACCOUNT = "odrd-fleetengine-consumersdkus@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String serverPrivateKeyId = "254e18eefa9fdcca64d5899cdcd793d466c47c7d"; |
| | | |
| | | private final String serverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCfbNAWnukqLKIxItqmSABxsH5glySEHJ2gfL5KsRF0M02e0Z8/KNKZkoh7I6bOMt1fEtttFaWOeq70IdI2WAd5wVazL3upvl5FW4P08ly33LklfGyLljlJ7ChPny9x6OjAaiS0yD9fh7NWti7rZKU7gzcGL8HddNYXgXV5OajvoG3TGdu52WTxce9AUzU6gLPboz/RbGqrdrmgVJVb0EPlhTJf/NSsaiW4NoL8SEzf/pJGYBmqJs97mXwCHTY4avaC+CP/zz9yS8AQEJlApbVT6lSOhYoR0hNOBj5B886EZOssjubO6hQaiwRnGrV2RdpHynqA1iekfGpUGEtWTsqjAgMBAAECggEALyPbMd0iP8y71sCiG4nty7Au5ju62e+mMkbAc9CAwzXKTVxZdLEK+MsJ3TNxBsami47FYC+G6SbgpaJ8iIImD7v5+XjgXZRDRsnlLmAdx2YWPv3YELxGS1PvpX+B5XJDpGWeXfBaQNKc1lZ/cC4t53eIpSUo82UxSvkGNea1S8lR6vIByhNyCQOvLG4yqaxUy0hZi0kge37XrjYMGS+BivBBnDiVlBPLBVbrNBxOf31Lzz+XX0iwXX7Zl2jN759oe0xQyuIGWUSj8xBDIF8nNaJrla7rWVml3sZJh6/3r1Acj0mhZtE0ZMu5hiPGiIXgb1ng30j3dMP4yVPhXrpAtQKBgQDaU01VnHsnHxc0DQHE2vEOPGmPxVS0/JAssePAEUmKEueUogGef91YY+Vm/ItbhLwGjbytnXxe88zRAdB1u07efZ83ey93TrGl2CJUzLHIcgb+Q1tT642rqlfl+q8ep86hcZ+63pDiIPt2Z+HkbKIR0SWf5LIH4flquQOTQufXXQKBgQC674qDsjOJepZjMMN6PkVMcWBYDNmXHnqa5Oto0rZM745UulbXqEFGuBOsXPU7O33Kfz1vbtoluubKZi5B6cFNnPypE2SCfvdObHq4FuTuKPV6lN93SyhZchmSEXEs0PU4cGDRt+RRqQcjft1Wigiy4Y1y1SInCtcaP1hLejEJ/wKBgFAhvwKrGnBzctrB42JTUaJ9/eis7rg28tvUttjp/2nUIndlNt7r41vr3mj8TFHc1/43y4aVhO584THdTpvHkd0LkoKUjglmMsHCIGercZ02bOap5j1Y+XiGXxij995yjN6oi43U3qyAmosM+dYTITEU6JBVKhrGj/rhyTQlnF5pAoGBAKFGmo0mR/pbDbYD0xH6+VSLGCC+7VbIT+SkjUjBSdA0eOo2XUfvfGmj1C1HgbcZi1wRzJH/5CrbBdQmtc/d+QyZ3Q2NkpBXM8uwIWwDLH0gTzDzkZvc9rG8k70GWUrd+EI6Cf3FFjExj9wazqCjs/+IQr2Ijc97NbsKXYW4pOhHAoGAKf5wYk+cn0cVTsyAom0UbGD5Uijqh5732MeqFYs2Rcwx0OErJZo68COSFFF40hJmmIKn7p3qycIyd1FcYlXN1l4s8mEWTGTInRE0OlBU0+jLtIV9pwNgffpbPYcrWZU6s6YVeJ2nDwl+aD+4QvN0rkPTfho9kjgeyF3PW0I2u4E="; |
| | | |
| | | private final String driverPrivateKeyId = "859e85fb3aa4d18b4afaac3e24e8f65700da5cc9"; |
| | | |
| | | private final String driverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmzL1BqSH+Zh9Fct5mXqe5sYOMTnJtOJhwKXnjjo2tNPXv4alzUHz8Vbj6nMar5u5IuKRZMeRBlhoRSFrLm+J1+sfvpH8N4wsnG7hDANknqWzdsk9a68qMHxNQF3hFzs9+KKrR1LAG8e9ytMfliN0kX+xls4uPZDPu1Q39K6V9KXrH/GrMA56i3TtWi7Hmakt5YTELeGjhx4nGrfuQLFFovs1Z9uJtf7E8R95+65StrOAmbJNf7VciEqwBpWYlU5VeyLXMg/oHwnTv2cjdcFozyDrlUHbDmtTiVeBBsYFVLyAsDGfl1p6eiVTiBBuo56YSYLWfaLgYvTyEcZ9jBQsfAgMBAAECggEAQzbTuObX3PT3+vtb5XKVMf33XY2rDJo2y1PbWzhxnO9vf3e22dIAW4qLnOmaIWFQeht1lr/FFCzRWk+Gzu+FJTemY8osrMLmFp9T9CQeXZ4nUXruAVxs5WQMW0Tp4W+CK3tlwmJrgJDzhYyV1Mf/HQ5Oa3kbbu/ZAY/3MCLrb/ClJQvD2rZSDdzAkNMQm8P2hsE71+rH7mI2hHrSCHl2OIp2A64QT8HjtyRc5yHZtTp6ZST1ge9SSIsT0ZfmXKtKF7yGEIPtKNU+oLrGyK5P30xBWJ/bwb3PEz2MZcPvz31+B2+UvZMm7OTkqfcRwEztAf8Ckiuo4im2BRYbVmd9OQKBgQDd0MeLxR+Qtv12bVA0bHtagFEq36THgWG7IM1/1vS4Cl9sveKSOS8A6oKLy624fGE7PKcuTTIzkVA81GXtWBQ9Coq/4TmllQkFTH7pz9C2PNHSCychPwNNV8qUx3lE3d4DOjGKgoVFD4l90AO7lOvmLTSc3pDpr+jSjUH4lqGrbQKBgQDAgXBmpXfCTxwqkBzGwxX+hwJen9qSkCM47qnQ1L4NnXPL6s0EN6rQ3FnFemGIzBUGJ2tajntkKlUu5DzsQeoBGu/SaSwgqD+1UQDcUyo+retmqZ+QYbpeyd3l53bLJJuJNsfak0X76Ft6hrm4julx6RGlmboQyx4kZWbhx4YNOwKBgEG9/2aNpi1eDwFqpLrk7CqGnYf3gP8gebbcoguhyiZB7MZuARkVmbjLyKVmWLa1JpxH/cTbXGWsS/u7d/pAgL8WwMjeGBfbdDD92x+xWEqq/AUlCRPxeSkTPBech3TBzWtndAd5Z8ZwNG/1lyWhnck63L0huhGI8Zh2BXeILaKBAoGAKK3xq69BvGztPc1QV2w4RJ4RER/kl14gI1LDzd52/veL1cabZk3BKfu2eLWg0MCXnMJNvEgpqQQNFiii+yX+phckIKma6pfDRrSEYwqr/azQ9tPXZTJRqOAtpPyhrNHikD9kQjsm6dGzKxQ3QNnqWOjwkrcGi6/wga5v7Dw2hqsCgYEA2T/kSNQ9dqpVBAkfi2J50hqnfFESPjKeirJJZllqhVqsiV0ly8a8Fz8SjGqTzrq+UErko+QmtSlo5h3Uq9Ln+0CwYfrUL+74q2zLHdS0DpY3QsGTEDJXTxCyy9kO26X2UsM3Ez3YUAkdMwdpVz0uVZtinv2735QZOBxoVQV2kQ8="; |
| | | |
| | | private final String consumerPrivateKeyId = "40acf82cbd5250de2f5123caff40738bdd403b08"; |
| | | |
| | | private final String consumerPrivateKey = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDSwtbSBFgIXna6mWeKFWCK31NXUJH6uGduR1XrODGRedrqrTgr0BdNg8PDo6/zh/T+K0Svor6kgqpwnl9soOdn73oC4Nu+Ad7EiKa38j650jlZdLAr4hR0Ou9Kcnv45x/94auUO8jBz844cu24swLKiPsK9OnX65wVlKRfhhkGFuS/4OI76CmE7NqZDqPOW16o8tBO5TsgPVNkglFAU73fTp0kcHoLauT9QOB0+yZi39mnNXyU+2cL3Ylp5oaQCJpyssDRUqz/EiHa7FxUUgzCadG00+ePf5iYSnZKQRKWoOIawFvcCfcHx8GAl8Nn+79HtVQHB9hLsQ5+jqcdfKPfAgMBAAECggEAE9Ufz912xzrUY1TCKH1Ae3Dub732Lqihmv/9dsfv6ieUURcBvSW0u6eViVhi20DE7hH2QazH0cU18qkEg71UaTRgv9qW8vdMFiRhw9d4zZWZrfBMD6UTlahiEhhZ0B83pHVS5v0FNC+w0SEHe6Tks1hWfz5yrs3N/z3ghdihjC/5i1jeBoHXs1262SMazuwNGHblLApGPG+86taeFtbDI+31TKvZ8nomZHkEVFnARRUoBBcIwowRMqNfwlpcJhlz6kDWnoD08kHJ2zzJokozu7Lim+Ugt/MWwUOcA0hgq2QdymZFpkRkDl7tZmJtwTfTirjbGlpnPHVXEc1bWM7ocQKBgQD0LJ8e7JXf6bVFngq0jSJNKK7XDHYg0KhHXMApF59xxi29hdHXWPzgRJ45KkoUJc7MITpIJLXfCmi1XyDMf9m8lIf/oaqhJ7idYi7iAAPOJkdnHbSt0lebyjBWzCQ6OgS4NfF1+LEibTzRqiFs5K8EAyPYAVSTrpWoguoWtTzIGQKBgQDc9/I2PS+91Eb5RvuidTNsDqZJliTJQFlBjlDViFo3+l1N7jDFYwPBR/Tv4TVM5p9Zb+/Lo9X1pjDbm8QriTR4V+4HaLXkcCnmOsdSRInFUW4UIafwLX5ifjgfyaWgdKdn2UP1Lu/1qBN6GU1xjSfBQ6N3UqQiKkNPb7tuPJGqtwKBgQCQ4hU8vTclGMC14VQK1B/BVt1/vuYtDIJ9bZycBWdXlDc52LitpiDOVgjodJ5mHBT77M9vVVERWlTNIfgNP+OL0TptRZlAbJhP0p1s/oNDhFUj6211InVXfH54UkNAxYJdZ6yxynIYsma/JcsVmQ/8Ony/Q/LSempVBfEurjW1qQKBgQCQWPjFLdtOKqnildg0HFPnNvqx/38waPTluk5b76LgBpGFIyCBEVmWnacIPRpQjidyiYkggnp26oXoMC1KM2svYmGAPYr1G8CDQcqLl3JYkAVU6VeHsnBpbwLC4TttQkdJs8iNFohy9cUjcfwBPbDGs6TJghbuqqUl81uBe9e8qQKBgQDZm8T2KB34J7HAc5A+vqkmAo7mQLZg51OrzB1KnDU86pSAf0o3eSvfDUT6dpU9fRuZ1XYnbPnpoJwjFH3m4u9gqKF3PtVYfZyJrEqYwmhB9z6vd+dcsUlXM0fi37bGZkKBD0JGGt5OljM1qJG15x/LYfC/nwOmqWoOhNPCst2Z7w=="; |
| | | private final static String key = "AIzaSyCG6PsfkaCEc94VK2vIAZk1YYKvOS_Ewts"; |
| | | |
| | | private final String SERVICE_ACCOUNT = "odrd-fleetengine-ondemandadmin@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String DRIVER_ACCOUNT = "odrd-fleetengine-driversdkuser@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String CONSUMER_ACCOUNT = "odrd-fleetengine-consumersdkus@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String serverPrivateKeyId = "254e18eefa9fdcca64d5899cdcd793d466c47c7d"; |
| | | |
| | | private final String serverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCfbNAWnukqLKIxItqmSABxsH5glySEHJ2gfL5KsRF0M02e0Z8/KNKZkoh7I6bOMt1fEtttFaWOeq70IdI2WAd5wVazL3upvl5FW4P08ly33LklfGyLljlJ7ChPny9x6OjAaiS0yD9fh7NWti7rZKU7gzcGL8HddNYXgXV5OajvoG3TGdu52WTxce9AUzU6gLPboz/RbGqrdrmgVJVb0EPlhTJf/NSsaiW4NoL8SEzf/pJGYBmqJs97mXwCHTY4avaC+CP/zz9yS8AQEJlApbVT6lSOhYoR0hNOBj5B886EZOssjubO6hQaiwRnGrV2RdpHynqA1iekfGpUGEtWTsqjAgMBAAECggEALyPbMd0iP8y71sCiG4nty7Au5ju62e+mMkbAc9CAwzXKTVxZdLEK+MsJ3TNxBsami47FYC+G6SbgpaJ8iIImD7v5+XjgXZRDRsnlLmAdx2YWPv3YELxGS1PvpX+B5XJDpGWeXfBaQNKc1lZ/cC4t53eIpSUo82UxSvkGNea1S8lR6vIByhNyCQOvLG4yqaxUy0hZi0kge37XrjYMGS+BivBBnDiVlBPLBVbrNBxOf31Lzz+XX0iwXX7Zl2jN759oe0xQyuIGWUSj8xBDIF8nNaJrla7rWVml3sZJh6/3r1Acj0mhZtE0ZMu5hiPGiIXgb1ng30j3dMP4yVPhXrpAtQKBgQDaU01VnHsnHxc0DQHE2vEOPGmPxVS0/JAssePAEUmKEueUogGef91YY+Vm/ItbhLwGjbytnXxe88zRAdB1u07efZ83ey93TrGl2CJUzLHIcgb+Q1tT642rqlfl+q8ep86hcZ+63pDiIPt2Z+HkbKIR0SWf5LIH4flquQOTQufXXQKBgQC674qDsjOJepZjMMN6PkVMcWBYDNmXHnqa5Oto0rZM745UulbXqEFGuBOsXPU7O33Kfz1vbtoluubKZi5B6cFNnPypE2SCfvdObHq4FuTuKPV6lN93SyhZchmSEXEs0PU4cGDRt+RRqQcjft1Wigiy4Y1y1SInCtcaP1hLejEJ/wKBgFAhvwKrGnBzctrB42JTUaJ9/eis7rg28tvUttjp/2nUIndlNt7r41vr3mj8TFHc1/43y4aVhO584THdTpvHkd0LkoKUjglmMsHCIGercZ02bOap5j1Y+XiGXxij995yjN6oi43U3qyAmosM+dYTITEU6JBVKhrGj/rhyTQlnF5pAoGBAKFGmo0mR/pbDbYD0xH6+VSLGCC+7VbIT+SkjUjBSdA0eOo2XUfvfGmj1C1HgbcZi1wRzJH/5CrbBdQmtc/d+QyZ3Q2NkpBXM8uwIWwDLH0gTzDzkZvc9rG8k70GWUrd+EI6Cf3FFjExj9wazqCjs/+IQr2Ijc97NbsKXYW4pOhHAoGAKf5wYk+cn0cVTsyAom0UbGD5Uijqh5732MeqFYs2Rcwx0OErJZo68COSFFF40hJmmIKn7p3qycIyd1FcYlXN1l4s8mEWTGTInRE0OlBU0+jLtIV9pwNgffpbPYcrWZU6s6YVeJ2nDwl+aD+4QvN0rkPTfho9kjgeyF3PW0I2u4E="; |
| | | |
| | | private final String driverPrivateKeyId = "859e85fb3aa4d18b4afaac3e24e8f65700da5cc9"; |
| | | |
| | | private final String driverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmzL1BqSH+Zh9Fct5mXqe5sYOMTnJtOJhwKXnjjo2tNPXv4alzUHz8Vbj6nMar5u5IuKRZMeRBlhoRSFrLm+J1+sfvpH8N4wsnG7hDANknqWzdsk9a68qMHxNQF3hFzs9+KKrR1LAG8e9ytMfliN0kX+xls4uPZDPu1Q39K6V9KXrH/GrMA56i3TtWi7Hmakt5YTELeGjhx4nGrfuQLFFovs1Z9uJtf7E8R95+65StrOAmbJNf7VciEqwBpWYlU5VeyLXMg/oHwnTv2cjdcFozyDrlUHbDmtTiVeBBsYFVLyAsDGfl1p6eiVTiBBuo56YSYLWfaLgYvTyEcZ9jBQsfAgMBAAECggEAQzbTuObX3PT3+vtb5XKVMf33XY2rDJo2y1PbWzhxnO9vf3e22dIAW4qLnOmaIWFQeht1lr/FFCzRWk+Gzu+FJTemY8osrMLmFp9T9CQeXZ4nUXruAVxs5WQMW0Tp4W+CK3tlwmJrgJDzhYyV1Mf/HQ5Oa3kbbu/ZAY/3MCLrb/ClJQvD2rZSDdzAkNMQm8P2hsE71+rH7mI2hHrSCHl2OIp2A64QT8HjtyRc5yHZtTp6ZST1ge9SSIsT0ZfmXKtKF7yGEIPtKNU+oLrGyK5P30xBWJ/bwb3PEz2MZcPvz31+B2+UvZMm7OTkqfcRwEztAf8Ckiuo4im2BRYbVmd9OQKBgQDd0MeLxR+Qtv12bVA0bHtagFEq36THgWG7IM1/1vS4Cl9sveKSOS8A6oKLy624fGE7PKcuTTIzkVA81GXtWBQ9Coq/4TmllQkFTH7pz9C2PNHSCychPwNNV8qUx3lE3d4DOjGKgoVFD4l90AO7lOvmLTSc3pDpr+jSjUH4lqGrbQKBgQDAgXBmpXfCTxwqkBzGwxX+hwJen9qSkCM47qnQ1L4NnXPL6s0EN6rQ3FnFemGIzBUGJ2tajntkKlUu5DzsQeoBGu/SaSwgqD+1UQDcUyo+retmqZ+QYbpeyd3l53bLJJuJNsfak0X76Ft6hrm4julx6RGlmboQyx4kZWbhx4YNOwKBgEG9/2aNpi1eDwFqpLrk7CqGnYf3gP8gebbcoguhyiZB7MZuARkVmbjLyKVmWLa1JpxH/cTbXGWsS/u7d/pAgL8WwMjeGBfbdDD92x+xWEqq/AUlCRPxeSkTPBech3TBzWtndAd5Z8ZwNG/1lyWhnck63L0huhGI8Zh2BXeILaKBAoGAKK3xq69BvGztPc1QV2w4RJ4RER/kl14gI1LDzd52/veL1cabZk3BKfu2eLWg0MCXnMJNvEgpqQQNFiii+yX+phckIKma6pfDRrSEYwqr/azQ9tPXZTJRqOAtpPyhrNHikD9kQjsm6dGzKxQ3QNnqWOjwkrcGi6/wga5v7Dw2hqsCgYEA2T/kSNQ9dqpVBAkfi2J50hqnfFESPjKeirJJZllqhVqsiV0ly8a8Fz8SjGqTzrq+UErko+QmtSlo5h3Uq9Ln+0CwYfrUL+74q2zLHdS0DpY3QsGTEDJXTxCyy9kO26X2UsM3Ez3YUAkdMwdpVz0uVZtinv2735QZOBxoVQV2kQ8="; |
| | | |
| | | private final String consumerPrivateKeyId = "40acf82cbd5250de2f5123caff40738bdd403b08"; |
| | | |
| | | private final String consumerPrivateKey = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDSwtbSBFgIXna6mWeKFWCK31NXUJH6uGduR1XrODGRedrqrTgr0BdNg8PDo6/zh/T+K0Svor6kgqpwnl9soOdn73oC4Nu+Ad7EiKa38j650jlZdLAr4hR0Ou9Kcnv45x/94auUO8jBz844cu24swLKiPsK9OnX65wVlKRfhhkGFuS/4OI76CmE7NqZDqPOW16o8tBO5TsgPVNkglFAU73fTp0kcHoLauT9QOB0+yZi39mnNXyU+2cL3Ylp5oaQCJpyssDRUqz/EiHa7FxUUgzCadG00+ePf5iYSnZKQRKWoOIawFvcCfcHx8GAl8Nn+79HtVQHB9hLsQ5+jqcdfKPfAgMBAAECggEAE9Ufz912xzrUY1TCKH1Ae3Dub732Lqihmv/9dsfv6ieUURcBvSW0u6eViVhi20DE7hH2QazH0cU18qkEg71UaTRgv9qW8vdMFiRhw9d4zZWZrfBMD6UTlahiEhhZ0B83pHVS5v0FNC+w0SEHe6Tks1hWfz5yrs3N/z3ghdihjC/5i1jeBoHXs1262SMazuwNGHblLApGPG+86taeFtbDI+31TKvZ8nomZHkEVFnARRUoBBcIwowRMqNfwlpcJhlz6kDWnoD08kHJ2zzJokozu7Lim+Ugt/MWwUOcA0hgq2QdymZFpkRkDl7tZmJtwTfTirjbGlpnPHVXEc1bWM7ocQKBgQD0LJ8e7JXf6bVFngq0jSJNKK7XDHYg0KhHXMApF59xxi29hdHXWPzgRJ45KkoUJc7MITpIJLXfCmi1XyDMf9m8lIf/oaqhJ7idYi7iAAPOJkdnHbSt0lebyjBWzCQ6OgS4NfF1+LEibTzRqiFs5K8EAyPYAVSTrpWoguoWtTzIGQKBgQDc9/I2PS+91Eb5RvuidTNsDqZJliTJQFlBjlDViFo3+l1N7jDFYwPBR/Tv4TVM5p9Zb+/Lo9X1pjDbm8QriTR4V+4HaLXkcCnmOsdSRInFUW4UIafwLX5ifjgfyaWgdKdn2UP1Lu/1qBN6GU1xjSfBQ6N3UqQiKkNPb7tuPJGqtwKBgQCQ4hU8vTclGMC14VQK1B/BVt1/vuYtDIJ9bZycBWdXlDc52LitpiDOVgjodJ5mHBT77M9vVVERWlTNIfgNP+OL0TptRZlAbJhP0p1s/oNDhFUj6211InVXfH54UkNAxYJdZ6yxynIYsma/JcsVmQ/8Ony/Q/LSempVBfEurjW1qQKBgQCQWPjFLdtOKqnildg0HFPnNvqx/38waPTluk5b76LgBpGFIyCBEVmWnacIPRpQjidyiYkggnp26oXoMC1KM2svYmGAPYr1G8CDQcqLl3JYkAVU6VeHsnBpbwLC4TttQkdJs8iNFohy9cUjcfwBPbDGs6TJghbuqqUl81uBe9e8qQKBgQDZm8T2KB34J7HAc5A+vqkmAo7mQLZg51OrzB1KnDU86pSAf0o3eSvfDUT6dpU9fRuZ1XYnbPnpoJwjFH3m4u9gqKF3PtVYfZyJrEqYwmhB9z6vd+dcsUlXM0fi37bGZkKBD0JGGt5OljM1qJG15x/LYfC/nwOmqWoOhNPCst2Z7w=="; |
| | | private final String provider = "i-go-odrd-testing"; |
| | | |
| | | // private final String SERVICE_ACCOUNT = "odrd-fleetengine-ondemandadmin@i-go-gcp.iam.gserviceaccount.com"; |
| | | // |
| | | // private final String DRIVER_ACCOUNT = "odrd-fleetengine-driversdkuser@i-go-gcp.iam.gserviceaccount.com"; |
| | | // |
| | | // private final String CONSUMER_ACCOUNT = "odrd-fleetengine-consumersdkus@i-go-gcp.iam.gserviceaccount.com"; |
| | | // |
| | | // private final String provider = "i-go-gcp"; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取jwt token |
| | | * |
| | | * @param type 0=服务端,1=乘客,2=司机 |
| | | * @return |
| | | */ |
| | | public Map<String, Object> fleetEngineAuth(int type, String id){ |
| | | public Map<String, Object> fleetEngineAuth(int type, String id) { |
| | | try { |
| | | //谷歌云服务器使用这部分代码 |
| | | // AuthTokenMinter minter = AuthTokenMinter.builder() |
| | | // //服务端签名 |
| | | // .setServerSigner(ImpersonatedSigner.create(SERVICE_ACCOUNT)) |
| | | // //司机端签名 |
| | | // .setDriverSigner(ImpersonatedSigner.create(DRIVER_ACCOUNT)) |
| | | // //乘客端签名 |
| | | // .setConsumerSigner(ImpersonatedSigner.create(CONSUMER_ACCOUNT)) |
| | | // .build(); |
| | | AuthTokenMinter minter = AuthTokenMinter.builder() |
| | | //服务端签名 |
| | | .setServerSigner(LocalSigner.create(SERVICE_ACCOUNT, serverPrivateKeyId, serverPrivateKey)) |
| | | .setServerSigner(ImpersonatedSigner.create(SERVICE_ACCOUNT)) |
| | | //司机端签名 |
| | | .setDriverSigner(LocalSigner.create(DRIVER_ACCOUNT, driverPrivateKeyId, driverPrivateKey)) |
| | | .setDriverSigner(ImpersonatedSigner.create(DRIVER_ACCOUNT)) |
| | | //乘客端签名 |
| | | .setConsumerSigner(LocalSigner.create(CONSUMER_ACCOUNT, consumerPrivateKeyId, consumerPrivateKey)) |
| | | .setConsumerSigner(ImpersonatedSigner.create(CONSUMER_ACCOUNT)) |
| | | .build(); |
| | | // AuthTokenMinter minter = AuthTokenMinter.builder() |
| | | // //服务端签名 |
| | | // .setServerSigner(LocalSigner.create(SERVICE_ACCOUNT, serverPrivateKeyId, serverPrivateKey)) |
| | | // //司机端签名 |
| | | // .setDriverSigner(LocalSigner.create(DRIVER_ACCOUNT, driverPrivateKeyId, driverPrivateKey)) |
| | | // //乘客端签名 |
| | | // .setConsumerSigner(LocalSigner.create(CONSUMER_ACCOUNT, consumerPrivateKeyId, consumerPrivateKey)) |
| | | // .build(); |
| | | |
| | | String jwt = ""; |
| | | Long expirationTimestamp = 0L; |
| | | if(0 == type){ |
| | | if (0 == type) { |
| | | FleetEngineToken serverToken = minter.getServerToken(); |
| | | jwt = serverToken.jwt(); |
| | | expirationTimestamp = serverToken.expirationTimestamp().getTime(); |
| | | } |
| | | if(1 == type){ |
| | | if (1 == type) { |
| | | FleetEngineToken consumerToken = minter.getConsumerToken(TripClaims.create(id)); |
| | | jwt = consumerToken.jwt(); |
| | | expirationTimestamp = consumerToken.expirationTimestamp().getTime(); |
| | | } |
| | | if(2 == type){ |
| | | if (2 == type) { |
| | | FleetEngineToken driverToken = minter.getDriverToken(VehicleClaims.create(id)); |
| | | jwt = driverToken.jwt(); |
| | | expirationTimestamp = driverToken.expirationTimestamp().getTime(); |
| | |
| | | return map; |
| | | } catch (SigningTokenException e) { |
| | | throw new RuntimeException(e); |
| | | } catch (SignerInitializationException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public String getToken(){ |
| | | public String getToken() { |
| | | String token_json = redisUtil.getValue("google_token"); |
| | | String google_token = ""; |
| | | if(!StringUtils.hasLength(token_json)){ |
| | | if (!StringUtils.hasLength(token_json)) { |
| | | Map<String, Object> map = fleetEngineAuth(0, null); |
| | | redisUtil.setStrValue("google_token", JSON.toJSONString(map)); |
| | | google_token = map.get("token").toString(); |
| | | }else{ |
| | | } else { |
| | | JSONObject jsonObject1 = JSON.parseObject(token_json); |
| | | Long expirationTimestamp = jsonObject1.getLong("expirationTimestamp"); |
| | | google_token = jsonObject1.getString("token"); |
| | | if((expirationTimestamp - 10000L) <= System.currentTimeMillis()){ |
| | | if ((expirationTimestamp - 10000L) <= System.currentTimeMillis()) { |
| | | Map<String, Object> map = fleetEngineAuth(0, null); |
| | | redisUtil.setStrValue("google_token", JSON.toJSONString(map)); |
| | | google_token = map.get("token").toString(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加车辆 |
| | | * |
| | | * @param maximumCapacity 这辆车可以搭载的乘客总数 |
| | | * @param licensePlate 车牌号 |
| | | * @param id 车辆id |
| | | * @param licensePlate 车牌号 |
| | | * @param id 车辆id |
| | | */ |
| | | public String createVehicles(int maximumCapacity, String licensePlate, String id) throws Exception{ |
| | | public String createVehicles(int maximumCapacity, String licensePlate, String id) throws Exception { |
| | | String url = "https://fleetengine.googleapis.com/v1/providers/" + provider + "/vehicles?vehicleId=" + id; |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | Map<String, String> headers = new HashMap<>(); |
| | |
| | | logger.info("创建车辆结果:{}", response.body()); |
| | | JSONObject jsonObject = JSON.parseObject(response.body().replaceAll("@type", "type")); |
| | | JSONObject error = jsonObject.getJSONObject("error"); |
| | | if(null != error){ |
| | | if (null != error) { |
| | | Integer code = error.getInteger("code"); |
| | | if(code == 401){ |
| | | if (code == 401) { |
| | | String status = error.getString("status"); |
| | | if(StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")){ |
| | | if (StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")) { |
| | | redisUtil.remove("google_token"); |
| | | return createVehicles(maximumCapacity, licensePlate, id); |
| | | } |
| | | String reason = error.getJSONArray("details").getJSONObject(0).getString("reason"); |
| | | if(reason.equals("ACCESS_TOKEN_EXPIRED")){ |
| | | if (reason.equals("ACCESS_TOKEN_EXPIRED")) { |
| | | redisUtil.remove("google_token"); |
| | | return createVehicles(maximumCapacity, licensePlate, id); |
| | | } |
| | |
| | | */ |
| | | return response.body(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上报google可结算订单 |
| | | * |
| | | * @param tripId 行程id |
| | | * @return |
| | | */ |
| | |
| | | JSONObject body = new JSONObject(); |
| | | body.put("related_ids", "[\"" + tripId + "\"]"); |
| | | post.body(body.toJSONString()); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //上线客户测试和上线运营开放 |
| | | // HttpResponse response = post.execute(); |
| | | // if(200 != response.getStatus()){ |
| | |
| | | // } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 修改车辆信息 |
| | | * |
| | | * @param maximumCapacity |
| | | * @param licensePlate |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public String updateVehicles(String vehicleState, Integer maximumCapacity, String licensePlate, String id) throws Exception{ |
| | | public String updateVehicles(String vehicleState, Integer maximumCapacity, String licensePlate, String id) throws Exception { |
| | | String url = "https://fleetengine.googleapis.com/v1/providers/" + provider + "/vehicles/" + id + "?updateMask="; |
| | | List<String> sb = new ArrayList<>(); |
| | | if(StringUtils.hasLength(vehicleState)){ |
| | | if (StringUtils.hasLength(vehicleState)) { |
| | | sb.add("vehicleState"); |
| | | } |
| | | if(null != maximumCapacity){ |
| | | if (null != maximumCapacity) { |
| | | sb.add("maximumCapacity"); |
| | | } |
| | | if(StringUtils.hasLength(licensePlate)){ |
| | | if (StringUtils.hasLength(licensePlate)) { |
| | | sb.add("licensePlate"); |
| | | } |
| | | String collect = sb.stream().collect(Collectors.joining(",")); |
| | |
| | | * OFFLINE 车辆不接受新行程。注意:在完成分配给车辆的行程时,车辆仍可继续在此状态下运行。 |
| | | * ONLINE 车辆正在接受新行程。 |
| | | */ |
| | | if(StringUtils.hasLength(vehicleState)){ |
| | | if (StringUtils.hasLength(vehicleState)) { |
| | | body.put("vehicleState", vehicleState); |
| | | } |
| | | if(null != maximumCapacity){ |
| | | if (null != maximumCapacity) { |
| | | body.put("maximumCapacity", maximumCapacity); |
| | | } |
| | | if(StringUtils.hasLength(licensePlate)){ |
| | | if (StringUtils.hasLength(licensePlate)) { |
| | | JSONObject licensePlate1 = new JSONObject(); |
| | | licensePlate1.put("countryCode", "GH"); |
| | | licensePlate1.put("lastCharacter", getLastNumber(licensePlate)); |
| | |
| | | logger.info("修改车辆信息结果:{}", response.body()); |
| | | JSONObject jsonObject = JSON.parseObject(response.body().replaceAll("@type", "type")); |
| | | JSONObject error = jsonObject.getJSONObject("error"); |
| | | if(null != error){ |
| | | if (null != error) { |
| | | Integer code = error.getInteger("code"); |
| | | if(code == 401){ |
| | | if (code == 401) { |
| | | String status = error.getString("status"); |
| | | if(StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")){ |
| | | if (StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")) { |
| | | redisUtil.remove("google_token"); |
| | | return updateVehicles(vehicleState, maximumCapacity, licensePlate, id); |
| | | } |
| | | String reason = error.getJSONArray("details").getJSONObject(0).getString("reason"); |
| | | if(reason.equals("ACCESS_TOKEN_EXPIRED")){ |
| | | if (reason.equals("ACCESS_TOKEN_EXPIRED")) { |
| | | redisUtil.remove("google_token"); |
| | | return updateVehicles(vehicleState, maximumCapacity, licensePlate, id); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取车辆信息 |
| | | * |
| | | * @param id 车辆id |
| | | * @return |
| | | */ |
| | | public String getVehicles(String id) throws Exception{ |
| | | public String getVehicles(String id) throws Exception { |
| | | String url = "https://fleetengine.googleapis.com/v1/providers/" + provider + "/vehicles/" + (null != id ? id : ""); |
| | | HttpRequest get = HttpUtil.createGet(url); |
| | | Map<String, String> headers = new HashMap<>(); |
| | |
| | | logger.info("查询车辆结果:{}", response.body()); |
| | | JSONObject jsonObject = JSON.parseObject(response.body().replaceAll("@type", "type")); |
| | | JSONObject error = jsonObject.getJSONObject("error"); |
| | | if(null != error){ |
| | | if (null != error) { |
| | | Integer code = error.getInteger("code"); |
| | | if(code == 404){ |
| | | if (code == 404) { |
| | | return ""; |
| | | } |
| | | if(code == 401){ |
| | | if (code == 401) { |
| | | String status = error.getString("status"); |
| | | if(StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")){ |
| | | if (StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")) { |
| | | redisUtil.remove("google_token"); |
| | | return getVehicles(id); |
| | | } |
| | | String reason = error.getJSONArray("details").getJSONObject(0).getString("reason"); |
| | | if(reason.equals("ACCESS_TOKEN_EXPIRED")){ |
| | | if (reason.equals("ACCESS_TOKEN_EXPIRED")) { |
| | | redisUtil.remove("google_token"); |
| | | return getVehicles(id); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取最后一个数字 |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | | private String getLastNumber(String str){ |
| | | private String getLastNumber(String str) { |
| | | for (int i = str.length(); i > 0; i--) { |
| | | char c = str.charAt(i - 1); |
| | | if(String.valueOf(c).matches("\\d")){ |
| | | if (String.valueOf(c).matches("\\d")) { |
| | | return str.substring(i - 1, i); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 创建新的行程 |
| | | * @param vehicleId 车辆id |
| | | * |
| | | * @param vehicleId 车辆id |
| | | * @param numberOfPassengers 人数 |
| | | * @param tripId 订单id |
| | | * @param start_lat 起点纬度 |
| | | * @param start_lng 起点经度 |
| | | * @param end_lat 终点纬度 |
| | | * @param end_lng 终点经度 |
| | | * @param tripId 订单id |
| | | * @param start_lat 起点纬度 |
| | | * @param start_lng 起点经度 |
| | | * @param end_lat 终点纬度 |
| | | * @param end_lng 终点经度 |
| | | * @return |
| | | */ |
| | | public String createTrip(String vehicleId, Integer numberOfPassengers, String tripId, String start_lat, String start_lng, String end_lat, String end_lng) throws Exception{ |
| | | public String createTrip(String vehicleId, Integer numberOfPassengers, String tripId, String start_lat, String start_lng, String end_lat, String end_lng) throws Exception { |
| | | String url = "https://fleetengine.googleapis.com/v1/providers/" + provider + "/trips?tripId=" + tripId; |
| | | HttpRequest post = HttpUtil.createPost(url); |
| | | Map<String, String> headers = new HashMap<>(); |
| | |
| | | post.addHeaders(headers); |
| | | |
| | | JSONObject body = new JSONObject(); |
| | | if(StringUtils.hasLength(vehicleId)){ |
| | | if (StringUtils.hasLength(vehicleId)) { |
| | | body.put("vehicleId", vehicleId); |
| | | } |
| | | body.put("tripStatus", "NEW"); |
| | |
| | | logger.info("创建行程结果:{}", response.body()); |
| | | JSONObject jsonObject = JSON.parseObject(response.body().replaceAll("@type", "type")); |
| | | JSONObject error = jsonObject.getJSONObject("error"); |
| | | if(null != error){ |
| | | if (null != error) { |
| | | Integer code = error.getInteger("code"); |
| | | if(code == 401){ |
| | | if (code == 401) { |
| | | String status = error.getString("status"); |
| | | if(StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")){ |
| | | if (StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")) { |
| | | redisUtil.remove("google_token"); |
| | | return createTrip(vehicleId, numberOfPassengers, tripId, start_lat, start_lng, end_lat, end_lng); |
| | | } |
| | | String reason = error.getJSONArray("details").getJSONObject(0).getString("reason"); |
| | | if(reason.equals("ACCESS_TOKEN_EXPIRED")){ |
| | | if (reason.equals("ACCESS_TOKEN_EXPIRED")) { |
| | | redisUtil.remove("google_token"); |
| | | return createTrip(vehicleId, numberOfPassengers, tripId, start_lat, start_lng, end_lat, end_lng); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 修改行程 |
| | | * @param tripStatus 行程状态 |
| | | * @param vehicleId 车辆id |
| | | * |
| | | * @param tripStatus 行程状态 |
| | | * @param vehicleId 车辆id |
| | | * @param numberOfPassengers 人数 |
| | | * @param tripId 订单id |
| | | * @param start_lat 起点纬度 |
| | | * @param start_lng 起点经度 |
| | | * @param end_lat 终点纬度 |
| | | * @param end_lng 终点经度 |
| | | * @param tripId 订单id |
| | | * @param start_lat 起点纬度 |
| | | * @param start_lng 起点经度 |
| | | * @param end_lat 终点纬度 |
| | | * @param end_lng 终点经度 |
| | | * @return |
| | | */ |
| | | public String updateTrip(String tripStatus, String vehicleId, Integer numberOfPassengers, String tripId, String start_lat, String start_lng, String end_lat, String end_lng) throws Exception { |
| | | String url = "https://fleetengine.googleapis.com/v1/providers/" + provider + "/trips/" + tripId + "?updateMask="; |
| | | List<String> sb = new ArrayList<>(); |
| | | if(StringUtils.hasLength(vehicleId)){ |
| | | if (StringUtils.hasLength(vehicleId)) { |
| | | sb.add("vehicleId"); |
| | | } |
| | | if(StringUtils.hasLength(tripStatus)){ |
| | | if (StringUtils.hasLength(tripStatus)) { |
| | | sb.add("tripStatus"); |
| | | } |
| | | if(null != numberOfPassengers){ |
| | | if (null != numberOfPassengers) { |
| | | sb.add("numberOfPassengers"); |
| | | } |
| | | if(StringUtils.hasLength(start_lat) && StringUtils.hasLength(start_lng)){ |
| | | if (StringUtils.hasLength(start_lat) && StringUtils.hasLength(start_lng)) { |
| | | sb.add("pickupPoint"); |
| | | } |
| | | |
| | | if(StringUtils.hasLength(end_lat) && StringUtils.hasLength(end_lng)){ |
| | | if (StringUtils.hasLength(end_lat) && StringUtils.hasLength(end_lng)) { |
| | | sb.add("dropoffPoint"); |
| | | } |
| | | String collect = sb.stream().collect(Collectors.joining(",")); |
| | |
| | | put.addHeaders(headers); |
| | | |
| | | JSONObject body = new JSONObject(); |
| | | if(StringUtils.hasLength(vehicleId)){ |
| | | if (StringUtils.hasLength(vehicleId)) { |
| | | body.put("vehicleId", vehicleId); |
| | | } |
| | | /** |
| | |
| | | * COMPLETE 乘客已下车,行程已完成。 |
| | | * CANCELED 在司机、乘客或拼车服务提供商取车之前,行程被取消。 |
| | | */ |
| | | if(StringUtils.hasLength(tripStatus)){ |
| | | if (StringUtils.hasLength(tripStatus)) { |
| | | body.put("tripStatus", tripStatus); |
| | | } |
| | | if(null != numberOfPassengers){ |
| | | if (null != numberOfPassengers) { |
| | | body.put("numberOfPassengers", numberOfPassengers); |
| | | } |
| | | if(StringUtils.hasLength(start_lat) && StringUtils.hasLength(start_lng)){ |
| | | if (StringUtils.hasLength(start_lat) && StringUtils.hasLength(start_lng)) { |
| | | JSONObject pickupPoint = new JSONObject(); |
| | | JSONObject point = new JSONObject(); |
| | | point.put("latitude", start_lat); |
| | |
| | | body.put("pickupPoint", pickupPoint); |
| | | } |
| | | |
| | | if(StringUtils.hasLength(end_lat) && StringUtils.hasLength(end_lng)){ |
| | | if (StringUtils.hasLength(end_lat) && StringUtils.hasLength(end_lng)) { |
| | | JSONObject dropoffPoint = new JSONObject(); |
| | | JSONObject end_point = new JSONObject(); |
| | | end_point.put("latitude", end_lat); |
| | |
| | | logger.info("修改行程结果:{}", response.body()); |
| | | JSONObject jsonObject = JSON.parseObject(response.body().replaceAll("@type", "type")); |
| | | JSONObject error = jsonObject.getJSONObject("error"); |
| | | if(null != error){ |
| | | if (null != error) { |
| | | Integer code = error.getInteger("code"); |
| | | if(code == 401){ |
| | | if (code == 401) { |
| | | String status = error.getString("status"); |
| | | if(StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")){ |
| | | if (StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")) { |
| | | redisUtil.remove("google_token"); |
| | | return updateTrip(tripStatus, vehicleId, numberOfPassengers, tripId, start_lat, start_lng, end_lat, end_lng); |
| | | } |
| | | String reason = error.getJSONArray("details").getJSONObject(0).getString("reason"); |
| | | if(reason.equals("ACCESS_TOKEN_EXPIRED")){ |
| | | if (reason.equals("ACCESS_TOKEN_EXPIRED")) { |
| | | redisUtil.remove("google_token"); |
| | | return updateTrip(tripStatus, vehicleId, numberOfPassengers, tripId, start_lat, start_lng, end_lat, end_lng); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取行程信息 |
| | | * |
| | | * @param tripId 订单id |
| | | * @return |
| | | */ |
| | |
| | | logger.info("查询行程结果:{}", response.body()); |
| | | JSONObject jsonObject = JSON.parseObject(response.body().replaceAll("@type", "type")); |
| | | JSONObject error = jsonObject.getJSONObject("error"); |
| | | if(null != error){ |
| | | if (null != error) { |
| | | Integer code = error.getInteger("code"); |
| | | if(code == 404){ |
| | | if (code == 404) { |
| | | return ""; |
| | | } |
| | | if(code == 401){ |
| | | if (code == 401) { |
| | | String status = error.getString("status"); |
| | | if(StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")){ |
| | | if (StringUtils.hasLength(status) && status.equals("UNAUTHENTICATED")) { |
| | | redisUtil.remove("google_token"); |
| | | return getTrip(tripId); |
| | | } |
| | | String reason = error.getJSONArray("details").getJSONObject(0).getString("reason"); |
| | | if(reason.equals("ACCESS_TOKEN_EXPIRED")){ |
| | | if (reason.equals("ACCESS_TOKEN_EXPIRED")) { |
| | | redisUtil.remove("google_token"); |
| | | return getTrip(tripId); |
| | | } |
| | |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.maps.*; |
| | | import com.google.maps.model.*; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | |
| | | /** |
| | | * 谷歌地图工具类 |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static ReverseGeocodeVo getReverseGeocode(double lat, double lng) throws Exception{ |
| | | public static ReverseGeocodeVo getReverseGeocode(double lat, double lng, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | GeocodingApiRequest request = GeocodingApi.reverseGeocode(context, new LatLng(lat, lng)); |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | GeocodingResult[] results = request.await(); |
| | | ReverseGeocodeVo vo = null; |
| | | if(results.length > 0){ |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static FindPlaceFromTextVo findplacefromtext(String input) throws Exception{ |
| | | public static FindPlaceFromTextVo findplacefromtext(String input, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | FindPlaceFromTextRequest request = new FindPlaceFromTextRequest(context); |
| | | request.input(input); |
| | | request.inputType(FindPlaceFromTextRequest.InputType.TEXT_QUERY); |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | System.err.println("findplacefromtext(请求参数)--->" + input); |
| | | FindPlaceFromText findPlaceFromText = request.await(); |
| | | PlacesSearchResult[] candidates = findPlaceFromText.candidates; |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static FindPlaceFromTextVo textsearch(String query) throws Exception{ |
| | | public static FindPlaceFromTextVo textsearch(String query, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | TextSearchRequest request = new TextSearchRequest(context); |
| | | request.query(query); |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | PlacesSearchResponse placesSearchResponse = request.await(); |
| | | PlacesSearchResult[] results = placesSearchResponse.results; |
| | | System.err.println("textsearch--->" + JSON.toJSONString(results)); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static DistancematrixVo getDistancematrix(String origin, String destination) throws Exception{ |
| | | public static DistancematrixVo getDistancematrix(String origin, String destination, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | DistanceMatrixApiRequest request = DistanceMatrixApi.getDistanceMatrix(context, new String[]{origin}, new String[]{destination}); |
| | | request.mode(TravelMode.DRIVING);//出行方式(驾车) |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | DistanceMatrix distanceMatrix = request.await(); |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.out.println(gson.toJson(distanceMatrix)); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static DistancematrixVo getDistancematrix(Double sLat, Double sLnt, Double eLat, Double eLnt) throws Exception{ |
| | | ReverseGeocodeVo reverseGeocode = getReverseGeocode(sLat, sLnt); |
| | | ReverseGeocodeVo reverseGeocode1 = getReverseGeocode(eLat, eLnt); |
| | | public static DistancematrixVo getDistancematrix(Double sLat, Double sLnt, Double eLat, Double eLnt, String tripId) throws Exception{ |
| | | ReverseGeocodeVo reverseGeocode = getReverseGeocode(sLat, sLnt, tripId); |
| | | ReverseGeocodeVo reverseGeocode1 = getReverseGeocode(eLat, eLnt, tripId); |
| | | if(null != reverseGeocode && null != reverseGeocode1){ |
| | | String origin = reverseGeocode.getAddress(); |
| | | String destination = reverseGeocode1.getAddress(); |
| | | return getDistancematrix(origin, destination); |
| | | return getDistancematrix(origin, destination, tripId); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | * @param destination 终点 要计算方向的位置ID、地址或文本纬度/经度值。目标参数的选项与原点参数的相同。 |
| | | * |
| | | */ |
| | | public static void getDirections(String origin, String destination) throws Exception{ |
| | | public static void getDirections(String origin, String destination, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | DirectionsApiRequest directions = DirectionsApi.getDirections(context, origin, destination); |
| | | directions.mode(TravelMode.DRIVING);//出行方式(驾车) |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | directions.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | DirectionsResult result = directions.await(); |
| | | |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static void main(String[] ages){ |
| | | try { |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | public class PushURL { |
| | | public static String order_push_url = "http://182.160.16.251:80/driver/base/order/pushOrderState"; |
| | | public static String driver_auth_url = "http://182.160.16.251:80/driver/base/driver/sendsms"; |
| | | public static String withdraw_auth_url = "http://182.160.16.251:80/driver/base/withdrawal/withdrawalAudit"; |
| | | public static String cancel_order_url = "http://182.160.16.251:80/user/base/order/sendOrderState"; |
| | | public static String freeze_user_url = "http://182.160.16.251:80/user/base/user/freeze"; |
| | | public static String zull_user_url = "http://182.160.16.251:80"; |
| | | public static String order_push_url = "http://127.0.0.1:5000/driver/base/order/pushOrderState"; |
| | | public static String driver_auth_url = "http://127.0.0.1:5000/driver/base/driver/sendsms"; |
| | | public static String withdraw_auth_url = "http://127.0.0.1:5000/driver/base/withdrawal/withdrawalAudit"; |
| | | public static String cancel_order_url = "http://127.0.0.1:5000/user/base/order/sendOrderState"; |
| | | public static String freeze_user_url = "http://127.0.0.1:5000/user/base/user/freeze"; |
| | | public static String zull_user_url = "http://127.0.0.1:5000"; |
| | | |
| | | // public static String order_push_url = "http://express.feimadache.com:80/driver/base/order/pushOrderState"; |
| | | // public static String driver_auth_url = "http://express.feimadache.com:80/driver/base/driver/sendsms"; |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /usr/local/nginx/html/mailbox/ |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | #支付回调地址 |
| | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/igotravel2.0?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | username: root |
| | | url: jdbc:mysql://172.16.0.4:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | username: i-go |
| | | password: HjKbXilb9zajmXbl |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | |
| | | |
| | | --- |
| | | |
| | | filePath: /usr/local/server/orderPostionFile/ #存储订单轨迹文件路径 |
| | | filePath: /home/igotechgh/orderPostionFile/ #存储订单轨迹文件路径 |
| | | |
| | | #quartz配置 |
| | | spring: |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /usr/local/nginx/html/mailbox/ |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | #支付回调地址 |
| | | callbackPath: http://182.160.16.251:8010 |
| | | callbackPath: https://igo.i-go.group:8080 |
| | | |
| | | --- |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /usr/local/nginx/html/mailbox/ |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | #支付回调地址 |
| | |
| | | <contextName>logback</contextName> |
| | | |
| | | <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 --> |
| | | <property name="log.path" value="/usr/local/server/logs/admin"/> |
| | | <property name="log.path" value="/home/igotechgh/app/log/admin"/> |
| | | |
| | | <!--0. 日志格式和颜色渲染 --> |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">选择车型</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | <option value="${obj.id}">${obj.chineseName}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <select class="form-control" id="xjModel" name="xjModel"> |
| | | <option value="">选择车型</option> |
| | | @for(obj in xjModelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | <option value="${obj.id}">${obj.chineseName}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">选择车型</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.chineseName}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <select class="form-control" id="xjModel" name="xjModel"> |
| | | <option value="">选择车型</option> |
| | | @for(obj in xjModelList){ |
| | | <option value="${obj.id}"${obj.id == xjModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.id}"${obj.id == xjModel ? 'selected=selected' : ''}>${obj.chineseName}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">选择车型</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.chineseName}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <select class="form-control" id="xjModel" name="xjModel"> |
| | | <option value="">选择车型</option> |
| | | @for(obj in xjModelList){ |
| | | <option value="${obj.id}" ${obj.id == xjModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.id}" ${obj.id == xjModel ? 'selected=selected' : ''}>${obj.chineseName}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <select class="form-control" id="serverModelId" > |
| | | <option value="">选择车型</option> |
| | | @for(obj in carmodelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | <option value="${obj.id}">${obj.chineseName}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <select class="form-control" id="serverModelId" > |
| | | <option value="">选择车型</option> |
| | | @for(obj in carmodelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | <option value="${obj.id}">${obj.chineseName}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <#SelectCon id="serverCarModelId" name="车型" > |
| | | <option value="">全部</option> |
| | | @for(obj in carmodelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | <option value="${obj.id}">${obj.chineseName}</option> |
| | | @} |
| | | </#SelectCon> |
| | | </div> |
| | |
| | | <#SelectCon id="serverCarModelId" name="车型" > |
| | | <option value="">全部</option> |
| | | @for(obj in carmodelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | <option value="${obj.id}">${obj.chineseName}</option> |
| | | @} |
| | | </#SelectCon> |
| | | </div> |
| | |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <#input id="name" name="车型名称"/> |
| | | <#input id="chineseName" name="车型名称(中文)" /> |
| | | <#input id="englishName" name="车型名称(英文)" /> |
| | | <#input id="frenchName" name="车型名称(法文)" /> |
| | | <#avatar id="img" name="车型图片:" /> |
| | | </div> |
| | | </div> |
| | |
| | | <input type="hidden" id="id" value="${data.id}"> |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <#input id="name" name="车型名称" value="${data.name}"/> |
| | | <#input id="chineseName" name="车型名称(中文)" value="${data.chineseName}"/> |
| | | <#input id="englishName" name="车型名称(英文)" value="${data.englishName}"/> |
| | | <#input id="frenchName" name="车型名称(法文)" value="${data.frenchName}"/> |
| | | <#avatar id="img" name="车型图片:" avatarImg="${data.img}"/> |
| | | </div> |
| | | </div> |
| | |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '车型名称', field: 'name', visible: true, align: 'center', valign: 'middle', |
| | | {title: '车型名称(中文)', field: 'chineseName', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.name != '' && row.name != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.name + '" onfocus="TUser.tooltip()">' + row.name + '</p>'] |
| | | if(row.chineseName != '' && row.chineseName != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.chineseName + '" onfocus="TUser.tooltip()">' + row.chineseName + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '车型名称(英文)', field: 'englishName', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.englishName != '' && row.englishName != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.englishName + '" onfocus="TUser.tooltip()">' + row.englishName + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '车型名称(法文)', field: 'frenchName', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var btn = ""; |
| | | if(row.frenchName != '' && row.frenchName != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.frenchName + '" onfocus="TUser.tooltip()">' + row.frenchName + '</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | |
| | | var TServerCarmodelInfoDlg = { |
| | | tServerCarmodelInfoData : {}, |
| | | validateFields: { |
| | | name: { |
| | | chineseName: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '车型名称不能为空' |
| | | }, |
| | | regexp: { |
| | | regexp: /^.{1,15}$/, |
| | | message: '车型名称不能超过15个字' |
| | | message: '中文车型名称不能为空' |
| | | } |
| | | } |
| | | }, |
| | | englishName: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '英文车型名称不能为空' |
| | | } |
| | | } |
| | | }, |
| | | frenchName: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '法文车型名称不能为空' |
| | | } |
| | | } |
| | | }, |
| | |
| | | this |
| | | .set('id') |
| | | .set('type') |
| | | .set('name') |
| | | .set('chineseName') |
| | | .set('englishName') |
| | | .set('frenchName') |
| | | .set('img') |
| | | .set('state') |
| | | .set('insertTime'); |
| | |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.google.cloud</groupId> |
| | | <artifactId>libraries-bom</artifactId> |
| | | <version>26.45.0</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | <dependencies> |
| | |
| | | <dependency> |
| | | <groupId>com.google.maps</groupId> |
| | | <artifactId>google-maps-services</artifactId> |
| | | <version>2.0.0</version> |
| | | <version>2.2.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.slf4j</groupId> |
| | | <artifactId>slf4j-simple</artifactId> |
| | | <version>1.7.25</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.sun.mail</groupId> |
| | | <artifactId>javax.mail</artifactId> |
| | | <version>1.6.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.jsoup</groupId> |
| | | <artifactId>jsoup</artifactId> |
| | |
| | | <groupId>com.google.cloud</groupId> |
| | | <artifactId>google-cloud-texttospeech</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.cloud</groupId> |
| | | <artifactId>google-cloud-storage</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | | <build> |
| | | <!--打包jar包方式--> |
| | |
| | | * @param size |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryMyOrderList(@Param("uid") Integer uid, @Param("pageNum") Integer pageNum, |
| | | @Param("size") Integer size); |
| | | List<Map<String, Object>> queryMyOrderList(@Param("language") Integer language, @Param("uid") Integer uid, |
| | | @Param("pageNum") Integer pageNum, @Param("size") Integer size); |
| | | |
| | | } |
| | |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as orderTime, |
| | | DATE_FORMAT(traveltime, '%Y-%m-%d') as time, |
| | | carTime as carTime, |
| | | (select name from t_server_carmodel where state = 1 and type = 3 and id = a.serverCarModelId) as serverCarModel, |
| | | (select if(#{language} = 1, chineseName, if(#{language} = 2, englishName, frenchName)) as name from t_server_carmodel where state = 1 and type = 3 and id = a.serverCarModelId) as serverCarModel, |
| | | (6) as orderType, |
| | | state as state |
| | | from t_order_chartered_car as a where userId = #{uid} order by insertTime desc limit #{pageNum}, #{size} |
| | |
| | | String contactPerson, String contactPhone, String placeLonLat, Integer uid, Integer language) throws Exception { |
| | | OrderCharteredCar orderCharteredCar = new OrderCharteredCar(); |
| | | orderCharteredCar.setUserId(uid); |
| | | Company query = companyCityService.query1(placeLonLat.split(",")[0], placeLonLat.split(",")[1]); |
| | | Company query = companyCityService.query1(uid, placeLonLat.split(",")[0], placeLonLat.split(",")[1]); |
| | | if(null == query){ |
| | | return ResultUtil.error(language == 1 ? "该地点暂无企业服务" : language == 2 ? "No service yet at this area" : "Pas encore de service dans cette zone"); |
| | | } |
| | |
| | | @Override |
| | | public List<Map<String, Object>> queryMyOrderList(Integer language, Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Map<String, Object>> maps = orderCharteredCarMapper.queryMyOrderList(uid, pageNum, size); |
| | | List<Map<String, Object>> maps = orderCharteredCarMapper.queryMyOrderList(language, uid, pageNum, size); |
| | | for (Map<String, Object> map : maps) { |
| | | if(null != map.get("orderTime")){ |
| | | String orderTime = map.get("orderTime").toString(); |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.stylefeng.guns.modular.system.service.IAdvertisementService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.AdvertisementWarpper; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private IAdvertisementService advertisementService; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(value = "当前定位纬度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "当前定位经度", name = "lnt", required = true, dataType = "double") |
| | | }) |
| | | public ResultUtil<List<AdvertisementWarpper>> queryAdvertisement(Double lat, Double lnt, Integer type){ |
| | | public ResultUtil<List<AdvertisementWarpper>> queryAdvertisement(Double lat, Double lnt, Integer type, HttpServletRequest request){ |
| | | try { |
| | | List<AdvertisementWarpper> advertisementWarpper = advertisementService.queryAdvertisement(lat, lnt, type); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | List<AdvertisementWarpper> advertisementWarpper = advertisementService.queryAdvertisement(uid, lat, lnt, type); |
| | | return ResultUtil.success(advertisementWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "经度", name = "lnt", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"), |
| | | }) |
| | | public ResultUtil<List<BaseWarpper>> queryBusiness(Double lat, Double lnt, Integer language){ |
| | | public ResultUtil<List<BaseWarpper>> queryBusiness(Double lat, Double lnt, Integer language, HttpServletRequest request){ |
| | | try { |
| | | List<BaseWarpper> list = openCityBusinessService.queryBusiness(lat, lnt, language); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | List<BaseWarpper> list = openCityBusinessService.queryBusiness(uid, lat, lnt, language); |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "纬度", name = "lat", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "经度", name = "lnt", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil openCity(Double lat, Double lnt, Integer language){ |
| | | public ResultUtil openCity(Double lat, Double lnt, Integer language, HttpServletRequest request){ |
| | | try { |
| | | City city = openCityService.openCity(lat, lnt, language); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | City city = openCityService.openCity(uid, lat, lnt, language); |
| | | if(null == city){ |
| | | return ResultUtil.error(""); |
| | | } |
| | |
| | | |
| | | @Resource |
| | | private UserActivityDiscount1Mapper userActivityDiscount1Mapper; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取正在进行中的订单 |
| | |
| | | @ApiImplicitParam(value = "终点经度", name = "elon", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "终点纬度", name = "elat", required = true, dataType = "double") |
| | | }) |
| | | public ResultUtil<BaseWarpper> queryExpectedTime(Double slon, Double slat, Double elon, Double elat){ |
| | | public ResultUtil<BaseWarpper> queryExpectedTime(Double slon, Double slat, Double elon, Double elat, HttpServletRequest request){ |
| | | try { |
| | | return orderService.queryExpectedTime(slon, slat, elon, elat); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | return orderService.queryExpectedTime(uid, slon, slat, elon, elat); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/getNewTripId") |
| | | @ApiOperation(value = "获取google预定tripid【2.0】", tags = {"用户端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<String> getNewTripId(HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | String randomCode = UUIDUtil.getRandomCode(); |
| | | redisUtil.setStrValue("trip" + uid, randomCode); |
| | | return ResultUtil.success(randomCode); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.Phone; |
| | | import com.stylefeng.guns.modular.system.service.IPhoneService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IPhoneService phoneService; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取系统所有电话 |
| | |
| | | @ApiImplicitParam(value = "定位经度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "定位维度", name = "lnt", required = true, dataType = "double") |
| | | }) |
| | | public ResultUtil queryPhones(Double lat, Double lnt){ |
| | | public ResultUtil queryPhones(Double lat, Double lnt, HttpServletRequest request){ |
| | | try { |
| | | List<Phone> phones = phoneService.queryPhones(lat, lnt); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | List<Phone> phones = phoneService.queryPhones(uid, lat, lnt); |
| | | return ResultUtil.success(phones); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "定位维度", name = "lnt", required = true, dataType = "double"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryCustomerPhone(Double lat, Double lnt){ |
| | | public ResultUtil queryCustomerPhone(Double lat, Double lnt, HttpServletRequest request){ |
| | | try { |
| | | Map<String, Object> map = phoneService.queryCustomerPhone(lat, lnt); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | Map<String, Object> map = phoneService.queryCustomerPhone(uid, lat, lnt); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<UserRedPacketRecord> userRedPacketRecords = userRedPacketRecordService.selectList(new EntityWrapper<UserRedPacketRecord>().eq("userId", uid).ne("state", 0)); |
| | | List<UserRedPacketRecord> userRedPacketRecords = userRedPacketRecordService.selectList(new EntityWrapper<UserRedPacketRecord>() |
| | | .eq("userId", uid).ne("state", 0)); |
| | | List<Double> collect = userRedPacketRecords.stream().map(UserRedPacketRecord::getMoney).collect(Collectors.toList()); |
| | | double sum = collect.stream().mapToDouble(Double::doubleValue).sum(); |
| | | |
| | | double sum1 = userRedPacketRecords.stream().filter(v -> v.getRemainingAmount().compareTo(0D) > 0).map(UserRedPacketRecord::getRemainingAmount).mapToDouble(Double::doubleValue).sum(); |
| | | double sum1 = userRedPacketRecords.stream().filter(v -> v.getRemainingAmount().compareTo(0D) > 0) |
| | | .map(UserRedPacketRecord::getRemainingAmount).mapToDouble(Double::doubleValue).sum(); |
| | | |
| | | List<Map<String, Object>> list = userRedPacketRecordService.queryMyRedEnvelope(pageNum, size, uid); |
| | | List<MyRedEnvelope> baseWarppers = new ArrayList<>(); |
| | |
| | | |
| | | |
| | | import com.stylefeng.guns.modular.system.service.IServerCarModelService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.ServerCarModelWarpper; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IServerCarModelService serverCarModelService; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "type", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type, Integer language){ |
| | | public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type, Integer language, HttpServletRequest request){ |
| | | try { |
| | | return serverCarModelService.queryServerCarModel(startLonLat, endLonLat, type, language); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | return serverCarModelService.queryServerCarModel(uid, startLonLat, endLonLat, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | EmailUtil.send(email, language == 1 ? "邮箱验证" : language == 2 ? "Verification code" : "Code de validation", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/mainbox_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/mainbox_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/mainbox_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/mainbox_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("/base/user/image") |
| | | public String image(@RequestPart("file") MultipartFile file) { |
| | | public ResultUtil image(@RequestPart("file") MultipartFile file) { |
| | | try { |
| | | String pictureName = OBSUploadUtil.inputStreamUpload(file); |
| | | return pictureName; |
| | | } catch (IOException e1) { |
| | | return null; |
| | | String pictureName = GoogleCloudStorageUtil.upload(file); |
| | | return ResultUtil.success(pictureName); |
| | | } catch (Exception e1) { |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | if(orderType == 1){ |
| | | fileInputStream = new FileInputStream(new File("/usr/local/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf")); |
| | | fileInputStream = new FileInputStream(new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf")); |
| | | } |
| | | if(orderType == 4){ |
| | | fileInputStream = new FileInputStream(new File("/usr/local/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf")); |
| | | fileInputStream = new FileInputStream(new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf")); |
| | | } |
| | | BufferedInputStream bf = new BufferedInputStream(fileInputStream); |
| | | outputStream = response.getOutputStream(); |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName + ".mp3"); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName + ".mp3"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | //定义用户所属公司 |
| | | OrderTaxi orderTaxi = new OrderTaxi(); |
| | | UserInfo userInfo1 = userInfoService.selectById(uid); |
| | | Company query = companyCityService.query1(startLon, startLat); |
| | | Company query = companyCityService.query1(uid, startLon, startLat); |
| | | if(null == query){ |
| | | return ResultUtil.error("出发点暂未开通"); |
| | | } |
| | |
| | | if(orderType == 1){//专车 |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarMapper.selectById(orderId); |
| | | OrderPrivateCarServiceImpl.orderIds.add(orderPrivateCar.getId());//添加记录,防止调用接口重复提醒无人接单 |
| | | Company query = companyCityService.query1(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | Company query = companyCityService.query1(orderPrivateCar.getUserId(), String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | //订单被抢后的处理 |
| | |
| | | //开始进行推送的处理 |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(orderPrivateCar.getUserId(), 1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | if(list.size() > 0){ |
| | | double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数 |
| | | int lastIndex = Double.valueOf(list.size() * driverProportion).intValue();//计算占比转成整数(下标截取) |
| | |
| | | if(orderType == 2){//出租车 |
| | | OrderTaxi orderTaxi = orderTaxiMapper.selectById(orderId); |
| | | OrderTaxiServiceImpl.orderIds.add(orderTaxi.getId());//添加记录,防止调用接口重复提醒无人接单 |
| | | Company query = companyCityService.query1(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | Company query = companyCityService.query1(orderTaxi.getUserId(), String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | //处理订单被抢 |
| | |
| | | @ApiImplicitParam(value = "终点经纬度(103.23265,30.2312)", name = "endLonLat", required = true, paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(value = "终点详细地址", name = "endAddress", required = true, paramType = "query", dataType = "string") |
| | | }) |
| | | public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language){ |
| | | public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language, HttpServletRequest request){ |
| | | try { |
| | | return orderLogisticsService.queryPayMoney(number, type, startLonLat, endLonLat, endAddress, language); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | return orderLogisticsService.queryPayMoney(uid, number, type, startLonLat, endLonLat, endAddress, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OrderTimeInfo> queryTimeInfo(Integer orderId, Integer language){ |
| | | public ResultUtil<OrderTimeInfo> queryTimeInfo(Integer orderId, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | OrderTimeInfo orderTimeInfo = new OrderTimeInfo(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | usedTime = language == 1 ? h + "小时" + m + "分钟" : language == 2 ? h + "-hour" + m + "-minute(s)" : h + "-hour" + m + "-minute"; |
| | | } |
| | | orderTimeInfo.setUsedTime(usedTime); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | if(null != orderLogistics.getEndServiceTime()){ |
| | | orderTimeInfo.setEndServiceTime(DateUtil.conversionFormat(language, sdf.format(orderLogistics.getEndServiceTime()))); |
| | | }else{ |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | Long duration = distancematrix.getDuration(); |
| | | orderTimeInfo.setEndServiceTime(DateUtil.conversionFormat(language, sdf.format(new Date(System.currentTimeMillis() + duration * 1000)))); |
| | | } |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | Long distance = distancematrix.getDistance(); |
| | | orderTimeInfo.setAllMileage(Double.valueOf(distance / 1000)); |
| | | orderTimeInfo.setMileage(orderLogistics.getMileage() / 1000); |
| | | String value = redisUtil.getValue("DRIVER" + orderLogistics.getDriverId()); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | String[] split = value.split(","); |
| | | distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | //分钟 |
| | | Long duration = distancematrix.getDuration() / 60; |
| | | h = Double.valueOf(duration / 60).intValue(); |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as time, |
| | | ('包裹') as name, |
| | | UNIX_TIMESTAMP(insertTime) as insertTime |
| | | from t_order_logistics where userId = #{uid} and state in (8, 9) and redPacketId is not null |
| | | from t_order_logistics where userId = #{uid} and redPacketId is not null |
| | | </select> |
| | | |
| | | |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language) throws Exception; |
| | | ResultUtil queryPayMoney(Integer uid, Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | String[] split = endLonLat.split(","); |
| | | Double lng = Double.valueOf(split[0]); |
| | | Double lat = Double.valueOf(split[1]); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString(), language); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(uid, type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString(), language); |
| | | if(price.getCode() != 200){ |
| | | return price; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language) throws Exception{ |
| | | public ResultUtil queryPayMoney(Integer uid, Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language) throws Exception{ |
| | | String[] split = endLonLat.split(","); |
| | | Double lng = Double.valueOf(split[0]); |
| | | Double lat = Double.valueOf(split[1]); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString(), language); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(uid, type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString(), language); |
| | | if(price.getCode() == 200 && type == 5){ |
| | | Map<String, Object> data = price.getData(); |
| | | Double ordinary = Double.valueOf(data.get("ordinary").toString()); |
| | |
| | | endAddress = endAddress.replaceAll("& #40;", "("); |
| | | endAddress = endAddress.replaceAll("& #41;", ")"); |
| | | OrderLogistics orderLogistics = new OrderLogistics(); |
| | | Company query = companyCityService.query1(placementLon, placementLat); |
| | | Company query = companyCityService.query1(uid, placementLon, placementLat); |
| | | if(null == query){ |
| | | return ResultUtil.error(language == 1 ? "该地点暂无企业服务" : language == 2 ? "No service yet at this area" : "Pas encore de service dans cette zone"); |
| | | } |
| | |
| | | orderLogistics.setRemark(remark); |
| | | orderLogistics.setPlacementLon(Double.valueOf(placementLon)); |
| | | orderLogistics.setPlacementLat(Double.valueOf(placementLat)); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon)); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon), tripId); |
| | | if(null == reverseGeocode){ |
| | | return ResultUtil.error(language == 1 ? "解析地址出错" : language == 2 ? "Address resolution error" : "Erreur de résolution d’adresse"); |
| | | } |
| | |
| | | orderLogistics.setMileage(0D); |
| | | orderLogistics.setIsReassign(1); |
| | | orderLogistics.setReassignNotice(0); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(type, String.valueOf(startLon), String.valueOf(startLat), lng.toString(), lat.toString(), language); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(uid, type, String.valueOf(startLon), String.valueOf(startLat), lng.toString(), lat.toString(), language); |
| | | if(price.getCode() != 200){ |
| | | return price; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public ResultUtil<Map<String, Double>> getPrice(Integer type, String startLon, String startLat, String endLon, String endLat) throws Exception{ |
| | | Company query = companyCityService.query1(startLon, startLat); |
| | | public ResultUtil<Map<String, Double>> getPrice(Integer uid, Integer type, String startLon, String startLat, String endLon, String endLat) throws Exception{ |
| | | Company query = companyCityService.query1(uid, startLon, startLat); |
| | | if(null == query){ |
| | | return ResultUtil.error("预约取货点暂无企业服务"); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | public ResultUtil<Map<String, Object>> getPrice1(Integer type, String startLon, String startLat, String endLon, String endLat, Integer language) throws Exception{ |
| | | Company query = companyCityService.query1(startLon, startLat); |
| | | public ResultUtil<Map<String, Object>> getPrice1(Integer uid, Integer type, String startLon, String startLat, String endLon, String endLat, Integer language) throws Exception{ |
| | | Company query = companyCityService.query1(uid, startLon, startLat); |
| | | if(null == query){ |
| | | return ResultUtil.error(language == 1 ? "预约取货点暂无企业服务" : language == 2 ? |
| | | "No service yet at the reserved pickup point." : "Les points de ramassage prévus ne sont pas disponibles pour le moment."); |
| | |
| | | Integer activityId = null; |
| | | if(type == 4){//同城 |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(startLat), Double.valueOf(startLon), Double.valueOf(endLat), Double.valueOf(endLon)); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(startLat), Double.valueOf(startLon), Double.valueOf(endLat), Double.valueOf(endLon), tripId); |
| | | if(null == distancematrix){ |
| | | return ResultUtil.error(language == 1 ? "计算距离出错" : language == 2 ? "Errors in computing distance" : "Erreurs dans le calcul de la distance"); |
| | | } |
| | |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query1(String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司 |
| | | Company query = companyCityService.query1(orderLogistics.getUserId(), String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//用专车的推单配置 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(orderLogistics.getType(), orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(orderLogistics.getUserId(), orderLogistics.getType(), orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | System.err.println("【" + orderLogistics.getId() + "】空闲司机:" + JSON.toJSONString(list)); |
| | | if(list.size() > 0){ |
| | | double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数 |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | orderLogistics.setUrgent(1); |
| | | orderLogistics.setCargoNumber(1); |
| | | |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon)); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon), tripId); |
| | | orderLogistics.setPlacementAddress(reverseGeocode.getAddress()); |
| | | orderLogistics.setStartLon(Double.valueOf(startLon)); |
| | | orderLogistics.setStartLat(Double.valueOf(startLat)); |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderLogistics.setEstimateArriveTime(new Date(timeOut)); |
| | |
| | | |
| | | orderLogistics.setIsReassign(1); |
| | | orderLogistics.setIsDelete(1); |
| | | orderLogistics.setTripId(UUIDUtil.getRandomCode()); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | orderLogistics.setTripId(tripId); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | Long distance1 = distancematrix1.getDistance(); |
| | | orderLogistics.setEstimatedMileage(new BigDecimal(distance1).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | this.insert(orderLogistics); |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | |
| | | // TODO: 2021/5/11 修改,根据后台设定的派单范围查询范围内有无司机,将单子指派给距离最近的司机(距离相同随机取),范围内没有司机再进行推单流程 |
| | | if(orderLogistics.getState() == 1){ |
| | | Company query = companyCityService.query1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | Company query = companyCityService.query1(uid, orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | if(null == query){ |
| | | return ResultUtil.error(language == 1 ? "起点暂未企业提供服务" : language == 2 ? "Starting point no enterprise to provide services" : "Point de départ pas encore disponible pour les entreprises"); |
| | | } |
| | | AssignOrder assignOrder = assignOrderService.selectOne(new EntityWrapper<AssignOrder>().eq("companyId", query.getId()).eq("type", 1)); |
| | | if(null != assignOrder && assignOrder.getPeople() > 0){//配置了指派规则才处理 |
| | | //获取空闲司机 |
| | | List<Driver> drivers = driverService.queryIdleDriver(4, orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), assignOrder.getDistance(), null);//获取范围内空闲司机 |
| | | List<Driver> drivers = driverService.queryIdleDriver(uid, 4, orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), assignOrder.getDistance(), null);//获取范围内空闲司机 |
| | | if(drivers.size() > 0){//有司机,直接指派给司机 |
| | | Driver dr = null; |
| | | if(drivers.size() > 1){ |
| | |
| | | String value = redisUtil.getValue("DRIVER" + drivers.get(j).getId()); |
| | | if(null != value){ |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | Long distance = distancematrix.getDistance(); |
| | | if((0 == m && null == driver) || (distance < m)){ |
| | | driver = drivers.get(j); |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(null != value){ |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | Long d = distancematrix.getDistance(); |
| | | if((0 == m && null == dr) || (d.intValue() < m.intValue())){ |
| | | dr = driver; |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | } |
| | | |
| | | //计算红包 |
| | | if(null != redDeduction && 1 == redDeduction){ |
| | | if(null != redDeduction && 1 == redDeduction && null == orderLogistics.getRedPacketId()){ |
| | | RedEnvelopePaymentSettings redEnvelopePaymentSettings = redEnvelopePaymentSettingsService.getRedEnvelopePaymentSettings(); |
| | | if(null != redEnvelopePaymentSettings){ |
| | | Double total = userRedPacketRecordService.queryRemainingAmount(uid); |
| | | List<UserRedPacketRecord> userRedPacketRecords = userRedPacketRecordService.selectList(new EntityWrapper<UserRedPacketRecord>().eq("userId", uid) |
| | | .eq("state", 1).eq("companyId", orderLogistics.getCompanyId()).gt("remainingAmount", 0).orderBy("insertTime", false)); |
| | | |
| | | |
| | | BigDecimal deductionRatio = redEnvelopePaymentSettings.getDeductionRatio(); |
| | | BigDecimal multiply1 = orderMoney.multiply(deductionRatio.divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_EVEN); |
| | | if(total > 0 && multiply1.doubleValue() > 0 && total.compareTo(multiply1.doubleValue()) >= 0){ |
| | |
| | | //获取红包id |
| | | JSONArray jsonArray = new JSONArray(); |
| | | for (UserRedPacketRecord userRedPacketRecord : userRedPacketRecords) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("id", userRedPacketRecord.getId()); |
| | | BigDecimal remainingAmount = new BigDecimal(userRedPacketRecord.getRemainingAmount()); |
| | | if(multiply1.compareTo(BigDecimal.ZERO) == 0){ |
| | | break; |
| | | } |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("id", userRedPacketRecord.getId()); |
| | | BigDecimal remainingAmount = new BigDecimal(userRedPacketRecord.getRemainingAmount()); |
| | | if(multiply1.compareTo(remainingAmount) >= 0){ |
| | | userRedPacketRecord.setRemainingAmount(0D); |
| | | userRedPacketRecord.setEndTime(new Date()); |
| | |
| | | multiply1 = multiply1.subtract(remainingAmount).setScale(2, RoundingMode.HALF_EVEN); |
| | | jsonObject.put("money", remainingAmount); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | }else if(remainingAmount.compareTo(multiply1) > 0){ |
| | | userRedPacketRecord.setRemainingAmount(remainingAmount.subtract(multiply1).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | jsonObject.put("money", multiply1); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | multiply1 = BigDecimal.ZERO; |
| | | } |
| | | } |
| | | if(userRedPacketRecords.size() > 0){ |
| | | userRedPacketRecordService.updateBatchById(userRedPacketRecords); |
| | | } |
| | | orderLogistics.setRedPacketId(jsonArray.toJSONString()); |
| | | } |
| | |
| | | orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN); |
| | | //获取红包id |
| | | JSONArray jsonArray = new JSONArray(); |
| | | BigDecimal multiply = new BigDecimal(total); |
| | | for (UserRedPacketRecord userRedPacketRecord : userRedPacketRecords) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("id", userRedPacketRecord.getId()); |
| | | BigDecimal remainingAmount = new BigDecimal(userRedPacketRecord.getRemainingAmount()); |
| | | if(multiply.compareTo(BigDecimal.ZERO) == 0){ |
| | | break; |
| | | } |
| | | if(multiply.compareTo(remainingAmount) >= 0){ |
| | | userRedPacketRecord.setRemainingAmount(0D); |
| | | userRedPacketRecord.setEndTime(new Date()); |
| | | userRedPacketRecord.setState(2); |
| | | multiply = multiply.subtract(remainingAmount).setScale(2, RoundingMode.HALF_EVEN); |
| | | jsonObject.put("money", remainingAmount); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | }else if(remainingAmount.compareTo(multiply) > 0){ |
| | | userRedPacketRecord.setRemainingAmount(remainingAmount.subtract(multiply).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | jsonObject.put("money", multiply); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | multiply = BigDecimal.ZERO; |
| | | } |
| | | jsonObject.put("money", userRedPacketRecord.getRemainingAmount()); |
| | | jsonArray.add(jsonObject); |
| | | |
| | | userRedPacketRecord.setRemainingAmount(0D); |
| | | userRedPacketRecord.setEndTime(new Date()); |
| | | userRedPacketRecord.setState(2); |
| | | } |
| | | if(userRedPacketRecords.size() > 0){ |
| | | userRedPacketRecordService.updateBatchById(userRedPacketRecords); |
| | | } |
| | | orderLogistics.setRedPacketId(jsonArray.toJSONString()); |
| | | } |
| | |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, orderId, 4, 1, |
| | |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | |
| | | if(resultUtil.getCode()==200){ |
| | |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("I-GO电子收据"); |
| | | document.getElementsByTag("title").get(0).text("包裹收据"); |
| | | Element title_chinese = document.getElementById("title_chinese"); |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",您在I-GO此订单消费GHS " + orderLogistics.getPayMoney()); |
| | | Element qbj_chinese = document.getElementById("qbj_chinese"); |
| | |
| | | dispute_chinese.remove(); |
| | | } |
| | | Element pdf_chinese = document.getElementById("pdf_chinese"); |
| | | pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | Element lost_item_chinese = document.getElementById("lost_item_chinese"); |
| | | lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | // Element track_chinese = document.getElementById("track_chinese"); |
| | | // track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html"); |
| | | // 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()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Receipt"); |
| | | document.getElementsByTag("title").get(0).text("Delivery receipt"); |
| | | Element title_english = document.getElementById("title_english"); |
| | | title_english.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip "); |
| | | Element qbj_english = document.getElementById("qbj_english"); |
| | |
| | | dispute_english.remove(); |
| | | } |
| | | Element pdf_english = document.getElementById("pdf_english"); |
| | | pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | Element lost_item_english = document.getElementById("lost_item_english"); |
| | | lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | // Element track_english = document.getElementById("track_english"); |
| | | // track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html"); |
| | | // 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()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | document.getElementsByTag("title").get(0).text("Reçu"); |
| | | document.getElementsByTag("title").get(0).text("Reçu de livraison"); |
| | | Element title_french = document.getElementById("title_french"); |
| | | title_french.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande I-GO "); |
| | | Element qbj_french = document.getElementById("qbj_french"); |
| | |
| | | dispute_french.remove(); |
| | | } |
| | | Element pdf_french = document.getElementById("pdf_french"); |
| | | pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | Element lost_item_french = document.getElementById("lost_item_french"); |
| | | lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | // Element track_french = document.getElementById("track_french"); |
| | | // track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html"); |
| | | // 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()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | |
| | | server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : "")); |
| | | } |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu", document.html()); |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "包裹收据" : language == 2 ? "Delivery receipt" : "Reçu de livraison", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | | } |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/parcel_receipt_" + orderId + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/parcel_receipt_" + orderId + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu"); |
| | | tEmail.setName(language == 1 ? "包裹收据" : language == 2 ? "Delivery receipt" : "Reçu de livraison"); |
| | | tEmail.setOrderId(orderId); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("I-GO电子收据"); |
| | | document.getElementsByTag("title").get(0).text("包裹收据"); |
| | | Element title_chinese = document.getElementById("title_chinese"); |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",您在I-GO此订单消费GHS " + orderLogistics.getPayMoney()); |
| | | Element qbj_chinese = document.getElementById("qbj_chinese"); |
| | |
| | | dispute_chinese.remove(); |
| | | } |
| | | Element pdf_chinese = document.getElementById("pdf_chinese"); |
| | | pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | Element lost_item_chinese = document.getElementById("lost_item_chinese"); |
| | | lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | // Element track_chinese = document.getElementById("track_chinese"); |
| | | // track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html"); |
| | | // 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()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Receipt"); |
| | | document.getElementsByTag("title").get(0).text("Delivery receipt"); |
| | | Element title_english = document.getElementById("title_english"); |
| | | title_english.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip "); |
| | | Element qbj_english = document.getElementById("qbj_english"); |
| | |
| | | dispute_english.remove(); |
| | | } |
| | | Element pdf_english = document.getElementById("pdf_english"); |
| | | pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | Element lost_item_english = document.getElementById("lost_item_english"); |
| | | lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | // Element track_english = document.getElementById("track_english"); |
| | | // track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html"); |
| | | // 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()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | document.getElementsByTag("title").get(0).text("Reçu"); |
| | | document.getElementsByTag("title").get(0).text("Reçu de livraison"); |
| | | Element title_french = document.getElementById("title_french"); |
| | | title_french.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande I-GO "); |
| | | Element qbj_french = document.getElementById("qbj_french"); |
| | |
| | | dispute_french.remove(); |
| | | } |
| | | Element pdf_french = document.getElementById("pdf_french"); |
| | | pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=4"); |
| | | Element lost_item_french = document.getElementById("lost_item_french"); |
| | | lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=4"); |
| | | // Element track_french = document.getElementById("track_french"); |
| | | // track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html"); |
| | | // 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()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | |
| | | server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : "")); |
| | | } |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu", document.html()); |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "包裹收据" : language == 2 ? "Delivery receipt" : "Reçu de livraison", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | | } |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/parcel_receipt_" + orderId + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/parcel_receipt_" + orderId + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu"); |
| | | tEmail.setName(language == 1 ? "包裹收据" : language == 2 ? "Delivery receipt" : "Reçu de livraison"); |
| | | tEmail.setOrderId(orderId); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderLogisticsSpread"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | } |
| | | if(payType == 2){//银行卡支付 |
| | |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderLogisticsSpread"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | } |
| | | |
| | |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("I-GO电子收据"); |
| | | document.getElementsByTag("title").get(0).text("包裹收据"); |
| | | Element title_chinese = document.getElementById("title_chinese"); |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",您在I-GO此订单消费GHS " + orderLogistics.getPayMoney()); |
| | | Element qbj_chinese = document.getElementById("qbj_chinese"); |
| | |
| | | dispute_chinese.remove(); |
| | | } |
| | | Element pdf_chinese = document.getElementById("pdf_chinese"); |
| | | pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=4"); |
| | | pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=4"); |
| | | Element lost_item_chinese = document.getElementById("lost_item_chinese"); |
| | | lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=4"); |
| | | lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=4"); |
| | | // Element track_chinese = document.getElementById("track_chinese"); |
| | | // track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html"); |
| | | // 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()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Receipt"); |
| | | document.getElementsByTag("title").get(0).text("Delivery receipt"); |
| | | Element title_english = document.getElementById("title_english"); |
| | | title_english.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip "); |
| | | Element qbj_english = document.getElementById("qbj_english"); |
| | |
| | | dispute_english.remove(); |
| | | } |
| | | Element pdf_english = document.getElementById("pdf_english"); |
| | | pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=4"); |
| | | pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=4"); |
| | | Element lost_item_english = document.getElementById("lost_item_english"); |
| | | lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=4"); |
| | | lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=4"); |
| | | // Element track_english = document.getElementById("track_english"); |
| | | // track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html"); |
| | | // 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()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | document.getElementsByTag("title").get(0).text("Reçu"); |
| | | document.getElementsByTag("title").get(0).text("Reçu de livraison"); |
| | | Element title_french = document.getElementById("title_french"); |
| | | title_french.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande I-GO "); |
| | | Element qbj_french = document.getElementById("qbj_french"); |
| | |
| | | dispute_french.remove(); |
| | | } |
| | | Element pdf_french = document.getElementById("pdf_french"); |
| | | pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=4"); |
| | | pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=4"); |
| | | Element lost_item_french = document.getElementById("lost_item_french"); |
| | | lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=4"); |
| | | lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=4"); |
| | | // Element track_french = document.getElementById("track_french"); |
| | | // track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html"); |
| | | // 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()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | |
| | | server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : "")); |
| | | } |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu", document.html()); |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "包裹收据" : language == 2 ? "Delivery receipt" : "Reçu de livraison", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/parcel_receipt_" + id + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + id + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/parcel_receipt_" + id + ".pdf"); |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + id + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/parcel_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | | } |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/parcel_receipt_" + id + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/parcel_receipt_" + id + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu"); |
| | | tEmail.setName(language == 1 ? "包裹收据" : language == 2 ? "Delivery receipt" : "Reçu de livraison"); |
| | | tEmail.setOrderId(id); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | |
| | | Integer orderId = Integer.valueOf(String.valueOf(map.get("orderId"))); |
| | | Integer state = Integer.valueOf(String.valueOf(map.get("state"))); |
| | | if(state == 6){ |
| | | map.put("receipt", "http://182.160.16.251:81/files/html/parcel_receipt_" + orderId + ".html"); |
| | | map.put("receipt", "https://igo.i-go.group/files/html/parcel_receipt_" + orderId + ".html"); |
| | | }else{ |
| | | map.put("receipt", ""); |
| | | } |
| | |
| | | String audioUrl = ""; |
| | | switch (language1){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-CN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-EN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-FR.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-FR.mp3"; |
| | | break; |
| | | } |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); |
| | |
| | | map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1); |
| | | map.put("orderType", orderLogistics.getType()); |
| | | if(state == 8 || state == 9){ |
| | | map.put("receipt", "http://182.160.16.251:81/files/html/parcel_receipt_" + orderId + ".html"); |
| | | map.put("receipt", "https://igo.i-go.group/files/html/parcel_receipt_" + orderId + ".html"); |
| | | }else{ |
| | | map.put("receipt", ""); |
| | | } |
| | |
| | | checkoutRequest.setRequestDescription("Cancel a trip"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, id, 4, 1, amount, null, 1);//添加预支付数据 |
| | |
| | | checkoutRequest.setRequestDescription("Cancel a trip"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, id, 4, 2, amount, null, 1);//添加预支付数据 |
| | |
| | | String audioUrl = ""; |
| | | switch (language1){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-CN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-EN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-FR.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-FR.mp3"; |
| | | break; |
| | | } |
| | | pushUtil.pushModifyAddress(2, orderLogistics.getDriverId(), orderId, 4, 1, audioUrl); |
| | |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "红包活动" : language == 2 ? "Lucky-promo activities" : "Activités bonus", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/redpacket_" + orderId + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/redpacket_" + orderId + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | String lnt = "0"; |
| | | String lat = "0"; |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | lnt = value.split(",")[0]; |
| | | lat = value.split(",")[1]; |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt)); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt), tripId); |
| | | |
| | | if(null == distancematrix){ |
| | | System.err.println("查询距离出错了"); |
| | |
| | | orderServerWarpper.setLaveTime("0"); |
| | | } |
| | | if(orderLogistics.getState() == 5 || orderLogistics.getState() == 6){//服务中 |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | if(null == distancematrix){ |
| | | System.err.println("查询距离出错了"); |
| | | }else if(distancematrix.getDistance() == 0){ |
| | |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as time, |
| | | ('打车') as name, |
| | | UNIX_TIMESTAMP(insertTime) as insertTime |
| | | from t_order_private_car where userId = #{uid} and state in (8, 9) and redPacketId is not null |
| | | from t_order_private_car where userId = #{uid} and redPacketId is not null |
| | | </select> |
| | | |
| | | |
| | |
| | | baseWarpper.setId(orderPrivateCars.get(0).getId()); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | startAddress = startAddress.replaceAll("& #40;", "("); |
| | | startAddress = startAddress.replaceAll("& #41;", ")"); |
| | | endAddress = endAddress.replaceAll("& #40;", "("); |
| | |
| | | orderPrivateCar.setPlacementLon(Double.valueOf(placementLon)); |
| | | orderPrivateCar.setPlacementLat(Double.valueOf(placementLat)); |
| | | |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon)); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon), tripId); |
| | | orderPrivateCar.setPlacementAddress(reverseGeocode.getAddress()); |
| | | orderPrivateCar.setStartLon(Double.valueOf(startLon)); |
| | | orderPrivateCar.setStartLat(Double.valueOf(startLat)); |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderPrivateCar.setEstimateArriveTime(new Date(timeOut)); |
| | |
| | | |
| | | orderPrivateCar.setIsReassign(1); |
| | | orderPrivateCar.setIsDelete(1); |
| | | orderPrivateCar.setTripId(UUIDUtil.getRandomCode()); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon()); |
| | | orderPrivateCar.setTripId(tripId); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon(), tripId); |
| | | Long distance1 = distancematrix1.getDistance(); |
| | | orderPrivateCar.setEstimatedMileage(new BigDecimal(distance1).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | this.insert(orderPrivateCar); |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | |
| | | // TODO: 2021/5/11 修改,根据后台设定的派单范围查询范围内有无司机,将单子指派给距离最近的司机(距离相同随机取),范围内没有司机再进行推单流程 |
| | | if(orderPrivateCar.getState() == 1){ |
| | | Company query = companyCityService.query1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | Company query = companyCityService.query1(uid, orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | if(null == query){ |
| | | return ResultUtil.error(language == 1 ? "起点暂未企业提供服务" : language == 2 ? "Starting point no enterprise to provide services" : "Point de départ pas encore disponible pour les entreprises"); |
| | | } |
| | | AssignOrder assignOrder = assignOrderService.selectOne(new EntityWrapper<AssignOrder>().eq("companyId", query.getId()).eq("type", 1)); |
| | | if(null != assignOrder && assignOrder.getPeople() > 0){//配置了指派规则才处理 |
| | | //获取空闲司机 |
| | | List<Driver> drivers = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), assignOrder.getDistance(), null);//获取范围内空闲司机 |
| | | List<Driver> drivers = driverService.queryIdleDriver(orderPrivateCar.getUserId(), 1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), assignOrder.getDistance(), null);//获取范围内空闲司机 |
| | | if(drivers.size() > 0){//有司机,直接指派给司机 |
| | | Driver dr = null; |
| | | if(drivers.size() > 1){ |
| | |
| | | String value = redisUtil.getValue("DRIVER" + drivers.get(j).getId()); |
| | | if(null != value){ |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | Long distance = distancematrix.getDistance(); |
| | | if((0 == m && null == driver) || (distance < m)){ |
| | | driver = drivers.get(j); |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(null != value){ |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | Long d = distancematrix.getDistance(); |
| | | if((0 == m && null == dr) || (d.intValue() < m.intValue())){ |
| | | dr = driver; |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | switch (language1){ |
| | | case 1: |
| | | if(orderPrivateCar.getState() == 6){ |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-CN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/MidwayCancellation-CN.mp3"; |
| | | }else{ |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-CN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-CN.mp3"; |
| | | } |
| | | break; |
| | | case 2: |
| | | if(orderPrivateCar.getState() == 6){ |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-EN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/MidwayCancellation-EN.mp3"; |
| | | }else{ |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-EN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-EN.mp3"; |
| | | } |
| | | break; |
| | | case 3: |
| | | if(orderPrivateCar.getState() == 6){ |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-FR.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/MidwayCancellation-FR.mp3"; |
| | | }else{ |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-FR.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-FR.mp3"; |
| | | } |
| | | break; |
| | | } |
| | |
| | | checkoutRequest.setRequestDescription("Cancel a trip"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, id, 1, 1, amount, null, 1);//添加预支付数据 |
| | |
| | | checkoutRequest.setRequestDescription("Cancel a trip"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, id, 1, 2, amount, null, 1);//添加预支付数据 |
| | |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query1(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | Company query = companyCityService.query1(orderPrivateCar.getUserId(), String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(orderPrivateCar.getUserId(), 1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | System.err.println("【" + orderPrivateCar.getId() + "】空闲司机:" + JSON.toJSONString(list)); |
| | | if(list.size() > 0){ |
| | | double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数 |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | //获取红包id |
| | | JSONArray jsonArray = new JSONArray(); |
| | | for (UserRedPacketRecord userRedPacketRecord : userRedPacketRecords) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("id", userRedPacketRecord.getId()); |
| | | BigDecimal remainingAmount = new BigDecimal(userRedPacketRecord.getRemainingAmount()); |
| | | if(multiply1.compareTo(BigDecimal.ZERO) == 0){ |
| | | break; |
| | | } |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("id", userRedPacketRecord.getId()); |
| | | BigDecimal remainingAmount = new BigDecimal(userRedPacketRecord.getRemainingAmount()); |
| | | if(multiply1.compareTo(remainingAmount) >= 0){ |
| | | userRedPacketRecord.setRemainingAmount(0D); |
| | | userRedPacketRecord.setEndTime(new Date()); |
| | |
| | | multiply1 = multiply1.subtract(remainingAmount).setScale(2, RoundingMode.HALF_EVEN); |
| | | jsonObject.put("money", remainingAmount); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | }else if(remainingAmount.compareTo(multiply1) > 0){ |
| | | userRedPacketRecord.setRemainingAmount(remainingAmount.subtract(multiply1).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | jsonObject.put("money", multiply1); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | multiply1 = BigDecimal.ZERO; |
| | | } |
| | | } |
| | | if(userRedPacketRecords.size() > 0){ |
| | | userRedPacketRecordService.updateBatchById(userRedPacketRecords); |
| | | } |
| | | orderPrivateCar.setRedPacketId(jsonArray.toJSONString()); |
| | | } |
| | |
| | | orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN); |
| | | //获取红包id |
| | | JSONArray jsonArray = new JSONArray(); |
| | | BigDecimal multiply = new BigDecimal(total); |
| | | for (UserRedPacketRecord userRedPacketRecord : userRedPacketRecords) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("id", userRedPacketRecord.getId()); |
| | | BigDecimal remainingAmount = BigDecimal.valueOf(userRedPacketRecord.getRemainingAmount()); |
| | | if(multiply.compareTo(BigDecimal.ZERO) == 0){ |
| | | break; |
| | | } |
| | | if(multiply.compareTo(remainingAmount) >= 0){ |
| | | userRedPacketRecord.setRemainingAmount(0D); |
| | | userRedPacketRecord.setEndTime(new Date()); |
| | | userRedPacketRecord.setState(2); |
| | | multiply = multiply.subtract(remainingAmount).setScale(2, RoundingMode.HALF_EVEN); |
| | | jsonObject.put("money", remainingAmount); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | }else if(remainingAmount.compareTo(multiply) > 0){ |
| | | userRedPacketRecord.setRemainingAmount(remainingAmount.subtract(multiply).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | jsonObject.put("money", multiply); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | multiply = BigDecimal.ZERO; |
| | | } |
| | | jsonObject.put("money", userRedPacketRecord.getRemainingAmount()); |
| | | jsonArray.add(jsonObject); |
| | | |
| | | userRedPacketRecord.setRemainingAmount(0D); |
| | | userRedPacketRecord.setEndTime(new Date()); |
| | | userRedPacketRecord.setState(2); |
| | | } |
| | | if(userRedPacketRecords.size() > 0){ |
| | | userRedPacketRecordService.updateBatchById(userRedPacketRecords); |
| | | } |
| | | orderPrivateCar.setRedPacketId(jsonArray.toJSONString()); |
| | | } |
| | |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | |
| | | if(resultUtil.getCode()==200){ |
| | |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | |
| | | if(resultUtil.getCode()==200){ |
| | |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("I-GO电子收据"); |
| | | document.getElementsByTag("title").get(0).text("打车收据"); |
| | | Element title_chinese = document.getElementById("title_chinese"); |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | Element qbj_chinese = document.getElementById("qbj_chinese"); |
| | |
| | | dispute_chinese.remove(); |
| | | } |
| | | Element pdf_chinese = document.getElementById("pdf_chinese"); |
| | | pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | Element lost_item_chinese = document.getElementById("lost_item_chinese"); |
| | | lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | Element track_chinese = document.getElementById("track_chinese"); |
| | | track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId); |
| | | track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId); |
| | | Element pay_time_chinese = document.getElementById("pay_time_chinese"); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Receipt"); |
| | | document.getElementsByTag("title").get(0).text("Ride receipt"); |
| | | Element title_english = document.getElementById("title_english"); |
| | | title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip "); |
| | | Element qbj_english = document.getElementById("qbj_english"); |
| | |
| | | dispute_english.remove(); |
| | | } |
| | | Element pdf_english = document.getElementById("pdf_english"); |
| | | pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | Element lost_item_english = document.getElementById("lost_item_english"); |
| | | lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | Element track_english = document.getElementById("track_english"); |
| | | track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId); |
| | | track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId); |
| | | Element pay_time_english = document.getElementById("pay_time_english"); |
| | | pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | document.getElementsByTag("title").get(0).text("Reçu"); |
| | | document.getElementsByTag("title").get(0).text("Reçu de course"); |
| | | Element title_french = document.getElementById("title_french"); |
| | | title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage"); |
| | | Element qbj_french = document.getElementById("qbj_french"); |
| | |
| | | dispute_french.remove(); |
| | | } |
| | | Element pdf_french = document.getElementById("pdf_french"); |
| | | pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | Element lost_item_french = document.getElementById("lost_item_french"); |
| | | lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | Element track_french = document.getElementById("track_french"); |
| | | track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId); |
| | | track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId); |
| | | Element pay_time_french = document.getElementById("pay_time_french"); |
| | | pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | |
| | | Element server_tel_french = document.getElementById("server_tel_french"); |
| | | server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : "")); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu", document.html()); |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | | } |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu"); |
| | | tEmail.setName(language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course"); |
| | | tEmail.setType(1); |
| | | tEmail.setOrderId(orderId); |
| | | tEmail.setCreateTime(new Date()); |
| | |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("I-GO电子收据"); |
| | | document.getElementsByTag("title").get(0).text("打车收据"); |
| | | Element title_chinese = document.getElementById("title_chinese"); |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | Element qbj_chinese = document.getElementById("qbj_chinese"); |
| | |
| | | dispute_chinese.remove(); |
| | | } |
| | | Element pdf_chinese = document.getElementById("pdf_chinese"); |
| | | pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | Element lost_item_chinese = document.getElementById("lost_item_chinese"); |
| | | lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | Element track_chinese = document.getElementById("track_chinese"); |
| | | track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId); |
| | | track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId); |
| | | Element pay_time_chinese = document.getElementById("pay_time_chinese"); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Receipt"); |
| | | document.getElementsByTag("title").get(0).text("Ride receipt"); |
| | | Element title_english = document.getElementById("title_english"); |
| | | title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip "); |
| | | Element qbj_english = document.getElementById("qbj_english"); |
| | |
| | | dispute_english.remove(); |
| | | } |
| | | Element pdf_english = document.getElementById("pdf_english"); |
| | | pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | Element lost_item_english = document.getElementById("lost_item_english"); |
| | | lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | Element track_english = document.getElementById("track_english"); |
| | | track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId); |
| | | track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId); |
| | | Element pay_time_english = document.getElementById("pay_time_english"); |
| | | pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | document.getElementsByTag("title").get(0).text("Reçu"); |
| | | document.getElementsByTag("title").get(0).text("Reçu de course"); |
| | | Element title_french = document.getElementById("title_french"); |
| | | title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage"); |
| | | Element qbj_french = document.getElementById("qbj_french"); |
| | |
| | | dispute_french.remove(); |
| | | } |
| | | Element pdf_french = document.getElementById("pdf_french"); |
| | | pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1"); |
| | | Element lost_item_french = document.getElementById("lost_item_french"); |
| | | lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1"); |
| | | Element track_french = document.getElementById("track_french"); |
| | | track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId); |
| | | track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId); |
| | | Element pay_time_french = document.getElementById("pay_time_french"); |
| | | pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | |
| | | server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : "")); |
| | | } |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu", document.html()); |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | | } |
| | | String link ="http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu"); |
| | | tEmail.setName(language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course"); |
| | | tEmail.setType(1); |
| | | tEmail.setOrderId(orderId); |
| | | tEmail.setCreateTime(new Date()); |
| | |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "红包活动" : language == 2 ? "Lucky-promo activities" : "Activités bonus", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/redpacket_" + orderId + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/redpacket_" + orderId + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("I-GO电子收据"); |
| | | document.getElementsByTag("title").get(0).text("打车收据"); |
| | | Element title_chinese = document.getElementById("title_chinese"); |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | Element qbj_chinese = document.getElementById("qbj_chinese"); |
| | |
| | | dispute_chinese.remove(); |
| | | } |
| | | Element pdf_chinese = document.getElementById("pdf_chinese"); |
| | | pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1"); |
| | | pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1"); |
| | | Element lost_item_chinese = document.getElementById("lost_item_chinese"); |
| | | lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1"); |
| | | lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1"); |
| | | Element track_chinese = document.getElementById("track_chinese"); |
| | | track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + id); |
| | | track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + id); |
| | | Element pay_time_chinese = document.getElementById("pay_time_chinese"); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("french").remove(); |
| | | document.getElementsByTag("title").get(0).text("Receipt"); |
| | | document.getElementsByTag("title").get(0).text("Ride receipt"); |
| | | Element title_english = document.getElementById("title_english"); |
| | | title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip "); |
| | | Element qbj_english = document.getElementById("qbj_english"); |
| | |
| | | dispute_english.remove(); |
| | | } |
| | | Element pdf_english = document.getElementById("pdf_english"); |
| | | pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1"); |
| | | pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1"); |
| | | Element lost_item_english = document.getElementById("lost_item_english"); |
| | | lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1"); |
| | | lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1"); |
| | | Element track_english = document.getElementById("track_english"); |
| | | track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + id); |
| | | track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + id); |
| | | Element pay_time_english = document.getElementById("pay_time_english"); |
| | | pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | | document.getElementById("english").remove(); |
| | | document.getElementsByTag("title").get(0).text("Reçu"); |
| | | document.getElementsByTag("title").get(0).text("Reçu de course"); |
| | | Element title_french = document.getElementById("title_french"); |
| | | title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage"); |
| | | Element qbj_french = document.getElementById("qbj_french"); |
| | |
| | | dispute_french.remove(); |
| | | } |
| | | Element pdf_french = document.getElementById("pdf_french"); |
| | | pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1"); |
| | | pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1"); |
| | | Element lost_item_french = document.getElementById("lost_item_french"); |
| | | lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1"); |
| | | lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1"); |
| | | Element track_french = document.getElementById("track_french"); |
| | | track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + id); |
| | | track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + id); |
| | | Element pay_time_french = document.getElementById("pay_time_french"); |
| | | pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | |
| | | server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : "")); |
| | | } |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu", document.html()); |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/ride_receipt_" + id + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + id + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/ride_receipt_" + id + ".pdf"); |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + id + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | | } |
| | | |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/ride_receipt_" + id + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/ride_receipt_" + id + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu"); |
| | | tEmail.setName(language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course"); |
| | | tEmail.setUserId(userInfo.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setOrderId(id); |
| | |
| | | map.put("state", map.get("oldState")); |
| | | } |
| | | if(state == 8 || state == 9){ |
| | | map.put("receipt", "http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html"); |
| | | map.put("receipt", "https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html"); |
| | | }else{ |
| | | map.put("receipt", ""); |
| | | } |
| | |
| | | map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1); |
| | | map.put("orderType", 1); |
| | | if(state == 8 || state == 9){ |
| | | map.put("receipt", "http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html"); |
| | | map.put("receipt", "https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html"); |
| | | }else{ |
| | | map.put("receipt", ""); |
| | | } |
| | |
| | | |
| | | String lnt = "0"; |
| | | String lat = "0"; |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | lnt = value.split(",")[0]; |
| | | lat = value.split(",")[1]; |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt)); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt), tripId); |
| | | |
| | | if(null == distancematrix){ |
| | | System.err.println("查询距离出错了"); |
| | |
| | | orderServerWarpper.setLaveTime("0"); |
| | | } |
| | | if(orderPrivateCar.getState() == 5 || orderPrivateCar.getState() == 6){//服务中 |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon(), tripId); |
| | | if(null == distancematrix){ |
| | | System.err.println("查询距离出错了"); |
| | | }else if(distancematrix.getDistance() == 0){ |
| | |
| | | String audioUrl = ""; |
| | | switch (language1){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-CN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-EN.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-FR.mp3"; |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-FR.mp3"; |
| | | break; |
| | | } |
| | | pushUtil.pushModifyAddress(2, orderPrivateCar.getDriverId(), orderId, 1, 1, audioUrl); |
| | |
| | | CONCAT(F.`name`, d.`name`, '.', c.carColor) as carName, |
| | | (select sum(fraction) / count(id) from t_order_evaluate where driverId = a.id) as score, |
| | | ( |
| | | (select count(id) from t_order_private_car where state in (7, 8, 9) and driverId = a.id) + |
| | | (select count(id) from t_order_taxi where state in (7, 8, 9) and driverId = a.id) + |
| | | (select count(id) from t_order_cross_city where state in (6, 8, 9) and driverId = a.id) |
| | | (select count(id) from t_order_private_car where driverId = a.id and state in (6, 7, 8, 9)) + |
| | | (select count(id) from t_order_logistics where driverId = a.id and state in (6, 7, 8, 9)) |
| | | ) as num, |
| | | DATE_FORMAT(b.startServiceTime, '%m月%d日 %H:%i') as `time`, |
| | | b.startAddress as `start`, |
| | |
| | | (select count(id) from t_order_cross_city where state not in (6, 7, 8, 9, 10, 12) and driverId = a.id) |
| | | ) = 0, 2, 3)) as state, |
| | | ( |
| | | (select count(id) from t_order_private_car where state in (7, 8, 9) and driverId = a.id) + |
| | | (select count(id) from t_order_taxi where state in (7, 8, 9) and driverId = a.id) + |
| | | (select count(id) from t_order_cross_city where state in (6, 8, 9) and driverId = a.id) |
| | | (select count(id) from t_order_private_car where driverId = a.id and state in (6, 7, 8, 9)) + |
| | | (select count(id) from t_order_logistics where driverId = a.id and state in (6, 7, 8, 9)) |
| | | ) as orderNum, |
| | | ((select sum(fraction) from t_order_evaluate where driverId = a.id) / (select count(id) from t_order_evaluate where driverId = a.id)) as fraction |
| | | from t_driver a |
| | |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.ServerCarModel"> |
| | | <id column="id" property="id"/> |
| | | <result column="type" property="type"/> |
| | | <result column="name" property="name"/> |
| | | <result column="chineseName" property="chineseName"/> |
| | | <result column="englishName" property="englishName"/> |
| | | <result column="frenchName" property="frenchName"/> |
| | | <result column="img" property="img"/> |
| | | <result column="price" property="price"/> |
| | | <result column="state" property="state"/> |
| | |
| | | <select id="queryServerCarModel" resultType="map"> |
| | | select |
| | | id as id, |
| | | `name` as `name`, |
| | | chineseName, |
| | | englishName, |
| | | frenchName, |
| | | img as img, |
| | | price as price |
| | | from t_server_carmodel where state = 1 and `type` = #{type} |
| | |
| | | /** |
| | | * 车型名称 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | @TableField("chineseName") |
| | | private String chineseName; |
| | | /** |
| | | * 车型名称 |
| | | */ |
| | | @TableField("englishName") |
| | | private String englishName; |
| | | /** |
| | | * 车型名称 |
| | | */ |
| | | @TableField("frenchName") |
| | | private String frenchName; |
| | | /** |
| | | * 车型照片 |
| | | */ |
| | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | |
| | | public String getChineseName() { |
| | | return chineseName; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | |
| | | public void setChineseName(String chineseName) { |
| | | this.chineseName = chineseName; |
| | | } |
| | | |
| | | |
| | | public String getEnglishName() { |
| | | return englishName; |
| | | } |
| | | |
| | | public void setEnglishName(String englishName) { |
| | | this.englishName = englishName; |
| | | } |
| | | |
| | | public String getFrenchName() { |
| | | return frenchName; |
| | | } |
| | | |
| | | public void setFrenchName(String frenchName) { |
| | | this.frenchName = frenchName; |
| | | } |
| | | |
| | | public String getImg() { |
| | | return img; |
| | | } |
| | |
| | | public void setPrice(String price) { |
| | | this.price = price; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ServerCarModel{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", name='" + name + '\'' + |
| | | ", chineseName='" + chineseName + '\'' + |
| | | ", englishName='" + englishName + '\'' + |
| | | ", frenchName='" + frenchName + '\'' + |
| | | ", img='" + img + '\'' + |
| | | ", price='" + price + '\'' + |
| | | ", state=" + state + |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<AdvertisementWarpper> queryAdvertisement(Double lat, Double lnt, Integer type) throws Exception; |
| | | List<AdvertisementWarpper> queryAdvertisement(Integer uid, Double lat, Double lnt, Integer type) throws Exception; |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | Company query1(String lon, String lat) throws Exception; |
| | | Company query1(Integer uid, String lon, String lat) throws Exception; |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception; |
| | | List<Driver> queryIdleDriver(Integer uid, Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<BaseWarpper> queryBusiness(Double lat, Double lnt, Integer language) throws Exception; |
| | | List<BaseWarpper> queryBusiness(Integer uid, Double lat, Double lnt, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | City openCity(Double lat, Double lnt, Integer language) throws Exception; |
| | | City openCity(Integer uid, Double lat, Double lnt, Integer language) throws Exception; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil<BaseWarpper> queryExpectedTime(Double slon, Double slat, Double elon, Double elat) throws Exception; |
| | | ResultUtil<BaseWarpper> queryExpectedTime(Integer uid, Double slon, Double slat, Double elon, Double elat) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Phone> queryPhones(Double lat, Double lnt) throws Exception; |
| | | List<Phone> queryPhones(Integer uid, Double lat, Double lnt) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | Map<String, Object> queryCustomerPhone(Double lat, Double lnt) throws Exception; |
| | | Map<String, Object> queryCustomerPhone(Integer uid, Double lat, Double lnt) throws Exception; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type, Integer language) throws Exception; |
| | | ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(Integer uid, String startLonLat, String endLonLat, Integer type, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.AdvertisementWarpper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private AdvertisementMapper advertisementMapper; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<AdvertisementWarpper> queryAdvertisement(Double lat, Double lnt, Integer type) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | public List<AdvertisementWarpper> queryAdvertisement(Integer uid, Double lat, Double lnt, Integer type) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, tripId); |
| | | if(null == reverseGeocode){ |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Company query1(String lon, String lat) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(lat), Double.valueOf(lon)); |
| | | public Company query1(Integer uid, String lon, String lat) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(lat), Double.valueOf(lon), tripId); |
| | | if(null == reverseGeocode){ |
| | | return null; |
| | | } |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "投诉司机" : language == 2 ? "Complain against driver" : "Porter plainte contre le chauffeur", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/complain_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/complain_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/complain_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/complain_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | public List<Driver> queryIdleDriver(Integer uid, Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | List<Driver> drivers = driverMapper.queryIdleDriver_(type, serverCarModelId, companyId); |
| | | List<Driver> list = new ArrayList<>(); |
| | | for(Driver driver : drivers){ |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(null != value){ |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(lat, lon, Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(lat, lon, Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0]), tripId); |
| | | if(null != distancematrix){ |
| | | if(distancematrix.getDistance() < (distance * 1000)){ |
| | | list.add(driver); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "反馈意见" : language == 2 ? "Feedback" : "Avis", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/feedback_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/feedback_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/feedback_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/feedback_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private OpenCityBusinessMapper openCityBusinessMapper; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<BaseWarpper> queryBusiness(Double lat, Double lnt, Integer language) throws Exception { |
| | | public List<BaseWarpper> queryBusiness(Integer uid, Double lat, Double lnt, Integer language) throws Exception { |
| | | if(null == language){ |
| | | language = 2; |
| | | } |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, tripId); |
| | | if(null == reverseGeocode){ |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public City openCity(Double lat, Double lnt, Integer language) throws Exception { |
| | | public City openCity(Integer uid, Double lat, Double lnt, Integer language) throws Exception { |
| | | if(null == language){ |
| | | language = 2; |
| | | } |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, tripId); |
| | | if(null == reverseGeocode){ |
| | | return null; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ICarService carService; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil<BaseWarpper> queryExpectedTime(Double slon, Double slat, Double elon, Double elat) throws Exception { |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(slat, slon, elat, elon); |
| | | public ResultUtil<BaseWarpper> queryExpectedTime(Integer uid, Double slon, Double slat, Double elon, Double elat) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(slat, slon, elat, elon, tripId); |
| | | Long duration = distancematrix.getDuration() / 60; |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setMinute(duration.intValue()); |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private PhoneMapper phoneMapper; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取所有系统电话 |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Phone> queryPhones(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | public List<Phone> queryPhones(Integer uid, Double lat, Double lnt) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, tripId); |
| | | if(null == reverseGeocode){ |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryCustomerPhone(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | public Map<String, Object> queryCustomerPhone(Integer uid, Double lat, Double lnt) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, tripId); |
| | | if(null == reverseGeocode){ |
| | | return new HashMap<>(); |
| | | } |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "物品报失" : language == 2 ? "Report items lost" : "Signaler l'objet perdu", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/reportLoss_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/reportLoss_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/reportLoss_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/reportLoss_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.ServerCarModelWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type, Integer language) throws Exception { |
| | | public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(Integer uid, String startLonLat, String endLonLat, Integer type, Integer language) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | //查找与起点匹配的企业(经营范围) |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(startLonLat.split(",")[1]), Double.valueOf(startLonLat.split(",")[0])); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(startLonLat.split(",")[1]), Double.valueOf(startLonLat.split(",")[0]), tripId); |
| | | if(null == language){ |
| | | language = 2; |
| | | } |
| | |
| | | Double slat = Double.valueOf(startLonLat.split(",")[1]); |
| | | Double elnt = Double.valueOf(endLonLat.split(",")[0]); |
| | | Double elat = Double.valueOf(endLonLat.split(",")[1]); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(slat, slnt, elat, elnt); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(slat, slnt, elat, elnt, tripId); |
| | | if(null == distancematrix){ |
| | | return ResultUtil.error(language == 1 ? "获取预估距离出错" : language == 2 ? "Obtaining-estimated-distance error" : "Erreur d’obtention de la distance estimée", new ArrayList<>()); |
| | | }else if(distancematrix.getDistance() == 0){ |
| | |
| | | long duration = distancematrix.getDuration();//时间(秒) |
| | | long duration_ = Long.valueOf(duration).longValue(); |
| | | |
| | | List<ServerCarModelWarpper> price = this.getPrice(query.getId(), distance1_, duration_, 0, type); |
| | | List<ServerCarModelWarpper> price = this.getPrice(query.getId(), distance1_, duration_, 0, type, language); |
| | | if(price.size() == 0){ |
| | | return ResultUtil.error(language == 1 ? "未获取到可服务的车型" : language == 2 ? "Not obtaining available vehicle-type" : "Ne pas obtenir le type de véhicule disponible", new ArrayList<>()); |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public List<ServerCarModelWarpper> getPrice(Integer companyId, double distance, long duration, long wait, Integer type) throws Exception { |
| | | public List<ServerCarModelWarpper> getPrice(Integer companyId, double distance, long duration, long wait, Integer type, Integer language) throws Exception { |
| | | List<Map<String, Object>> list = serverCarModelMapper.queryServerCarModel(type); |
| | | List<ServerCarModelWarpper> data = new ArrayList<>(); |
| | | for(Map<String, Object> map : list){ |
| | | if(1 == language){ |
| | | map.put("name", map.get("chineseName")); |
| | | } |
| | | if(2 == language){ |
| | | map.put("name", map.get("englishName")); |
| | | } |
| | | if(3 == language){ |
| | | map.put("name", map.get("frenchName")); |
| | | } |
| | | Map<String, Object> query1 = systemPriceMapper.query(companyId, type, Integer.valueOf(map.get("id").toString())); |
| | | if(null == query1){//排除没有设置价格的车型 |
| | | continue; |
| | |
| | | import com.stylefeng.guns.modular.system.dao.UserCouponRecordMapper; |
| | | import com.stylefeng.guns.modular.system.model.UserCouponRecord; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private ISystemNoticeService systemNoticeService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | public ResultUtil handselCoupon(Integer id, Integer uid, Integer userId, Integer language) throws Exception { |
| | | UserCouponRecord userCouponRecord = userCouponRecordMapper.selectById(id); |
| | | language = userInfoService.queryLanguage(uid, language); |
| | | UserInfo userInfo1 = userInfoService.selectById(uid); |
| | | String nickName = userInfo1.getNickName(); |
| | | String phone = userInfo1.getPhone(); |
| | | if(userCouponRecord.getUserId().compareTo(uid) != 0){ |
| | | return ResultUtil.error(language == 1 ? "您不能赠送此优惠券" : language == 2 ? "You cannot gift the coupon." : "Vous ne pouvez pas offrir le coupon."); |
| | | } |
| | |
| | | } |
| | | userCouponRecord.setUserId(userId); |
| | | userCouponRecordMapper.updateById(userCouponRecord); |
| | | UserInfo userInfo = userInfoService.selectById(userId); |
| | | Integer language1 = userInfo.getLanguage(); |
| | | systemNoticeService.addSystemNotice(1, language1 == 1 ? nickName + "(" + phone + ")刚赠送您了一张GHS 5.00的优惠券,请查看账户。" : language1 == 2 |
| | | ? nickName + "(" + phone + ")just gifted a GHS 5.00 coupon to you, please check your account." |
| | | : nickName + "(" + phone + ")vient de vous offrir un coupon de GHS 5.00, veuillez vérifier votre compte.", userId, 1); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | |
| | | //用户所属企业 |
| | | if(null != lat && null != lng){ |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lat); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lat, null); |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] citys = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Registered successfully" : "Enregistré avec succès", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/registration_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/registration_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/invitation_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/invitation_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Registered successfully" : "Enregistré avec succès", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/registration_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/registration_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/invitation_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/invitation_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/invitation_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(driver.getId()); |
| | |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Registered successfully" : "Enregistré avec succès", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/registration_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/registration_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | } |
| | | //用户所属企业 |
| | | if(null != lat && null != lng){ |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lng); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lng, null); |
| | | if(null != reverseGeocode){ |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] citys = new String[addressComponentsVos.length]; |
| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "注册成功" : language == 2 ? "Registered successfully" : "Enregistré avec succès", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/registration_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/registration_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/registration_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | checkoutRequest.setRequestDescription("Account top-up"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelUserBalance"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | } |
| | | |
| | |
| | | checkoutRequest.setRequestDescription("Account top-up"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelUserBalance"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | } |
| | | return ResultUtil.success(""); |
| | |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "重置密码" : language == 2 ? "Reset password" : "Réinitialiser le mot de passe", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/password_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/password_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/password_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/password_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | |
| | | } |
| | | 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("/usr/local/nginx/html/files/html/"); |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | String randomString = ToolUtil.getRandomString(10); |
| | | file = new File("/usr/local/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | file = new File("/home/igotechgh/nginx/html/files/html/coupon_" + randomString + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/coupon_" + randomString + ".html"; |
| | | String link ="https://igo.i-go.group/files/html/coupon_" + randomString + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TEmail; |
| | | import com.stylefeng.guns.modular.system.util.itextpdf.HtmlToPdfUtils; |
| | | import com.sun.mail.smtp.SMTPSSLTransport; |
| | | |
| | | import javax.mail.*; |
| | | import javax.mail.internet.InternetAddress; |
| | | import javax.mail.internet.MimeBodyPart; |
| | | import javax.mail.internet.MimeMessage; |
| | | import javax.mail.internet.MimeMultipart; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.FileWriter; |
| | | import java.util.Date; |
| | | import java.util.Properties; |
| | | |
| | |
| | | gmailssl(props); |
| | | |
| | | final String username = "i-gotech@i-go.group";// gmail 邮箱 |
| | | final String password = "mhizkqkhuknbitps";// Google应用专用密码 |
| | | // 当做多商户的时候需要使用getInstance, 如果只是一个邮箱发送的话就用getDefaultInstance |
| | | // Session.getDefaultInstance 会将username,password保存在session会话中 |
| | | // Session.getInstance 不进行保存 |
| | | final String password = "rvbmuovvpocmhast";// Google应用专用密码 |
| | | Session session = Session.getInstance(props, |
| | | new Authenticator() { |
| | | protected PasswordAuthentication getPasswordAuthentication() { |
| | | return new PasswordAuthentication(username, password); |
| | | } |
| | | }); |
| | | MimeMessage msg = new MimeMessage(session); |
| | | //2.设置发件人地址 |
| | | msg.setFrom(new InternetAddress(sentToEmail)); |
| | | /** |
| | | * 3.设置收件人地址(可以增加多个收件人、抄送、密送),即下面这一行代码书写多行 |
| | | * MimeMessage.RecipientType.TO:发送 |
| | | * MimeMessage.RecipientType.CC:抄送 |
| | | * MimeMessage.RecipientType.BCC:密送 |
| | | */ |
| | | msg.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress(sentToEmail)); |
| | | //4.设置邮件主题 |
| | | msg.setSubject(subject, "UTF-8"); |
| | | // 6. 创建文本"节点" |
| | | // 创建默认的MimeMessage对象 |
| | | MimeMessage message = new MimeMessage(session); |
| | | // 设置发件人 |
| | | message.setFrom(new InternetAddress(username)); |
| | | // 设置收件人 |
| | | message.addRecipient(Message.RecipientType.TO, new InternetAddress(sentToEmail)); |
| | | // 设置邮件主题 |
| | | message.setSubject(subject,"UTF-8"); |
| | | // 设置邮件内容 |
| | | MimeBodyPart text = new MimeBodyPart(); |
| | | // 这里添加图片的方式是将整个图片包含到邮件内容中, 实际上也可以以 http 链接的形式添加网络图片 |
| | | text.setContent(content, "text/html;charset=UTF-8"); |
| | | // 7. (文本+图片)设置 文本 和 图片"节点"的关系(将 文本 和 图片"节点"合成一个混合"节点") |
| | | MimeMultipart mm_text_image = new MimeMultipart(); |
| | | mm_text_image.addBodyPart(text); |
| | | mm_text_image.setSubType("related"); // 关联关系 |
| | | // 11. 设置整个邮件的关系(将最终的混合"节点"作为邮件的内容添加到邮件对象) |
| | | msg.setContent(mm_text_image); |
| | | text.setContent(content,"text/html;charset=UTF-8"); |
| | | MimeMultipart mimeMultipart = new MimeMultipart(); |
| | | mimeMultipart.addBodyPart(text); |
| | | mimeMultipart.setSubType("related"); |
| | | message.setContent(mimeMultipart); |
| | | //设置邮件的发送时间,默认立即发送 |
| | | msg.setSentDate(new Date()); |
| | | Transport transport = session.getTransport(); |
| | | transport.connect(); |
| | | transport.sendMessage(msg, msg.getAllRecipients()); |
| | | transport.close(); |
| | | message.setSentDate(new Date()); |
| | | |
| | | // 发送消息 |
| | | Transport.send(message); |
| | | System.out.println("Sent message successfully...."); |
| | | return true; |
| | | |
| | | |
| | | } |
| | | |
| | | public static String getWeek(int language,int i){ |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | try { |
| | | String week = getWeek(1, 3); |
| | | System.out.println(week); |
| | | // EmailUtil.send("393733352@qq.com", "验证码", "<html><span style=\"color:red;\">123456</span></html>"); |
| | | // String week = getWeek(1, 3); |
| | | // System.out.println(week); |
| | | EmailUtil.send("393733352@qq.com", "验证码", "<html><span style=\"color:red;\">123456</span></html>"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.google.cloud.storage.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * google对象存储 |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/31 9:18 |
| | | */ |
| | | public class GoogleCloudStorageUtil { |
| | | |
| | | |
| | | |
| | | public static String upload(MultipartFile file){ |
| | | // The ID of your GCP project |
| | | // String projectId = "your-project-id"; |
| | | |
| | | // The ID of your GCS bucket |
| | | // String bucketName = "your-unique-bucket-name"; |
| | | |
| | | // The ID of your GCS object |
| | | // String objectName = "your-object-name"; |
| | | |
| | | // The path to your file to upload |
| | | // String filePath = "path/to/your/file" |
| | | String fileName = file.getOriginalFilename(); |
| | | String projectId = "i-go-gcp"; |
| | | String bucketName = "i-go"; |
| | | Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); |
| | | BlobId blobId = BlobId.of(bucketName, fileName); |
| | | BlobInfo blobInfo = BlobInfo.newBuilder(blobId).build(); |
| | | |
| | | // Optional: set a generation-match precondition to avoid potential race |
| | | // conditions and data corruptions. The request returns a 412 error if the |
| | | // preconditions are not met. |
| | | Storage.BlobWriteOption precondition; |
| | | if (storage.get(bucketName, fileName) == null) { |
| | | // For a target object that does not yet exist, set the DoesNotExist precondition. |
| | | // This will cause the request to fail if the object is created before the request runs. |
| | | precondition = Storage.BlobWriteOption.doesNotExist(); |
| | | } else { |
| | | // If the destination already exists in your bucket, instead set a generation-match |
| | | // precondition. This will cause the request to fail if the existing object's generation |
| | | // changes before the request runs. |
| | | precondition = |
| | | Storage.BlobWriteOption.generationMatch( |
| | | storage.get(bucketName, fileName).getGeneration()); |
| | | } |
| | | try { |
| | | storage.createFrom(blobInfo, file.getInputStream(), precondition); |
| | | System.out.println( |
| | | "File uploaded to bucket " + bucketName + " as " + fileName); |
| | | makeObjectPublic(projectId, bucketName, fileName); |
| | | return "https://storage.googleapis.com/i-go/" + fileName; |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置对象公开访问 |
| | | * @param projectId |
| | | * @param bucketName |
| | | * @param objectName |
| | | */ |
| | | public static void makeObjectPublic(String projectId, String bucketName, String objectName) { |
| | | // String projectId = "your-project-id"; |
| | | // String bucketName = "your-bucket-name"; |
| | | // String objectName = "your-object-name"; |
| | | Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); |
| | | BlobId blobId = BlobId.of(bucketName, objectName); |
| | | storage.createAcl(blobId, Acl.of(Acl.User.ofAllUsers(), Acl.Role.READER)); |
| | | |
| | | System.out.println( |
| | | "Object " + objectName + " in bucket " + bucketName + " was made publicly readable"); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | static Logger logger = LoggerFactory.getLogger(FleetEngineUtil.class); |
| | | |
| | | private final String SERVICE_ACCOUNT = "odrd-fleetengine-ondemandadmin@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | // private final String SERVICE_ACCOUNT = "odrd-fleetengine-ondemandadmin@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | // |
| | | // private final String DRIVER_ACCOUNT = "odrd-fleetengine-driversdkuser@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | // |
| | | // private final String CONSUMER_ACCOUNT = "odrd-fleetengine-consumersdkus@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | // |
| | | // private final String serverPrivateKeyId = "254e18eefa9fdcca64d5899cdcd793d466c47c7d"; |
| | | // |
| | | // private final String serverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCfbNAWnukqLKIxItqmSABxsH5glySEHJ2gfL5KsRF0M02e0Z8/KNKZkoh7I6bOMt1fEtttFaWOeq70IdI2WAd5wVazL3upvl5FW4P08ly33LklfGyLljlJ7ChPny9x6OjAaiS0yD9fh7NWti7rZKU7gzcGL8HddNYXgXV5OajvoG3TGdu52WTxce9AUzU6gLPboz/RbGqrdrmgVJVb0EPlhTJf/NSsaiW4NoL8SEzf/pJGYBmqJs97mXwCHTY4avaC+CP/zz9yS8AQEJlApbVT6lSOhYoR0hNOBj5B886EZOssjubO6hQaiwRnGrV2RdpHynqA1iekfGpUGEtWTsqjAgMBAAECggEALyPbMd0iP8y71sCiG4nty7Au5ju62e+mMkbAc9CAwzXKTVxZdLEK+MsJ3TNxBsami47FYC+G6SbgpaJ8iIImD7v5+XjgXZRDRsnlLmAdx2YWPv3YELxGS1PvpX+B5XJDpGWeXfBaQNKc1lZ/cC4t53eIpSUo82UxSvkGNea1S8lR6vIByhNyCQOvLG4yqaxUy0hZi0kge37XrjYMGS+BivBBnDiVlBPLBVbrNBxOf31Lzz+XX0iwXX7Zl2jN759oe0xQyuIGWUSj8xBDIF8nNaJrla7rWVml3sZJh6/3r1Acj0mhZtE0ZMu5hiPGiIXgb1ng30j3dMP4yVPhXrpAtQKBgQDaU01VnHsnHxc0DQHE2vEOPGmPxVS0/JAssePAEUmKEueUogGef91YY+Vm/ItbhLwGjbytnXxe88zRAdB1u07efZ83ey93TrGl2CJUzLHIcgb+Q1tT642rqlfl+q8ep86hcZ+63pDiIPt2Z+HkbKIR0SWf5LIH4flquQOTQufXXQKBgQC674qDsjOJepZjMMN6PkVMcWBYDNmXHnqa5Oto0rZM745UulbXqEFGuBOsXPU7O33Kfz1vbtoluubKZi5B6cFNnPypE2SCfvdObHq4FuTuKPV6lN93SyhZchmSEXEs0PU4cGDRt+RRqQcjft1Wigiy4Y1y1SInCtcaP1hLejEJ/wKBgFAhvwKrGnBzctrB42JTUaJ9/eis7rg28tvUttjp/2nUIndlNt7r41vr3mj8TFHc1/43y4aVhO584THdTpvHkd0LkoKUjglmMsHCIGercZ02bOap5j1Y+XiGXxij995yjN6oi43U3qyAmosM+dYTITEU6JBVKhrGj/rhyTQlnF5pAoGBAKFGmo0mR/pbDbYD0xH6+VSLGCC+7VbIT+SkjUjBSdA0eOo2XUfvfGmj1C1HgbcZi1wRzJH/5CrbBdQmtc/d+QyZ3Q2NkpBXM8uwIWwDLH0gTzDzkZvc9rG8k70GWUrd+EI6Cf3FFjExj9wazqCjs/+IQr2Ijc97NbsKXYW4pOhHAoGAKf5wYk+cn0cVTsyAom0UbGD5Uijqh5732MeqFYs2Rcwx0OErJZo68COSFFF40hJmmIKn7p3qycIyd1FcYlXN1l4s8mEWTGTInRE0OlBU0+jLtIV9pwNgffpbPYcrWZU6s6YVeJ2nDwl+aD+4QvN0rkPTfho9kjgeyF3PW0I2u4E="; |
| | | // |
| | | // private final String driverPrivateKeyId = "859e85fb3aa4d18b4afaac3e24e8f65700da5cc9"; |
| | | // |
| | | // private final String driverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmzL1BqSH+Zh9Fct5mXqe5sYOMTnJtOJhwKXnjjo2tNPXv4alzUHz8Vbj6nMar5u5IuKRZMeRBlhoRSFrLm+J1+sfvpH8N4wsnG7hDANknqWzdsk9a68qMHxNQF3hFzs9+KKrR1LAG8e9ytMfliN0kX+xls4uPZDPu1Q39K6V9KXrH/GrMA56i3TtWi7Hmakt5YTELeGjhx4nGrfuQLFFovs1Z9uJtf7E8R95+65StrOAmbJNf7VciEqwBpWYlU5VeyLXMg/oHwnTv2cjdcFozyDrlUHbDmtTiVeBBsYFVLyAsDGfl1p6eiVTiBBuo56YSYLWfaLgYvTyEcZ9jBQsfAgMBAAECggEAQzbTuObX3PT3+vtb5XKVMf33XY2rDJo2y1PbWzhxnO9vf3e22dIAW4qLnOmaIWFQeht1lr/FFCzRWk+Gzu+FJTemY8osrMLmFp9T9CQeXZ4nUXruAVxs5WQMW0Tp4W+CK3tlwmJrgJDzhYyV1Mf/HQ5Oa3kbbu/ZAY/3MCLrb/ClJQvD2rZSDdzAkNMQm8P2hsE71+rH7mI2hHrSCHl2OIp2A64QT8HjtyRc5yHZtTp6ZST1ge9SSIsT0ZfmXKtKF7yGEIPtKNU+oLrGyK5P30xBWJ/bwb3PEz2MZcPvz31+B2+UvZMm7OTkqfcRwEztAf8Ckiuo4im2BRYbVmd9OQKBgQDd0MeLxR+Qtv12bVA0bHtagFEq36THgWG7IM1/1vS4Cl9sveKSOS8A6oKLy624fGE7PKcuTTIzkVA81GXtWBQ9Coq/4TmllQkFTH7pz9C2PNHSCychPwNNV8qUx3lE3d4DOjGKgoVFD4l90AO7lOvmLTSc3pDpr+jSjUH4lqGrbQKBgQDAgXBmpXfCTxwqkBzGwxX+hwJen9qSkCM47qnQ1L4NnXPL6s0EN6rQ3FnFemGIzBUGJ2tajntkKlUu5DzsQeoBGu/SaSwgqD+1UQDcUyo+retmqZ+QYbpeyd3l53bLJJuJNsfak0X76Ft6hrm4julx6RGlmboQyx4kZWbhx4YNOwKBgEG9/2aNpi1eDwFqpLrk7CqGnYf3gP8gebbcoguhyiZB7MZuARkVmbjLyKVmWLa1JpxH/cTbXGWsS/u7d/pAgL8WwMjeGBfbdDD92x+xWEqq/AUlCRPxeSkTPBech3TBzWtndAd5Z8ZwNG/1lyWhnck63L0huhGI8Zh2BXeILaKBAoGAKK3xq69BvGztPc1QV2w4RJ4RER/kl14gI1LDzd52/veL1cabZk3BKfu2eLWg0MCXnMJNvEgpqQQNFiii+yX+phckIKma6pfDRrSEYwqr/azQ9tPXZTJRqOAtpPyhrNHikD9kQjsm6dGzKxQ3QNnqWOjwkrcGi6/wga5v7Dw2hqsCgYEA2T/kSNQ9dqpVBAkfi2J50hqnfFESPjKeirJJZllqhVqsiV0ly8a8Fz8SjGqTzrq+UErko+QmtSlo5h3Uq9Ln+0CwYfrUL+74q2zLHdS0DpY3QsGTEDJXTxCyy9kO26X2UsM3Ez3YUAkdMwdpVz0uVZtinv2735QZOBxoVQV2kQ8="; |
| | | // |
| | | // private final String consumerPrivateKeyId = "40acf82cbd5250de2f5123caff40738bdd403b08"; |
| | | // |
| | | // private final String consumerPrivateKey = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDSwtbSBFgIXna6mWeKFWCK31NXUJH6uGduR1XrODGRedrqrTgr0BdNg8PDo6/zh/T+K0Svor6kgqpwnl9soOdn73oC4Nu+Ad7EiKa38j650jlZdLAr4hR0Ou9Kcnv45x/94auUO8jBz844cu24swLKiPsK9OnX65wVlKRfhhkGFuS/4OI76CmE7NqZDqPOW16o8tBO5TsgPVNkglFAU73fTp0kcHoLauT9QOB0+yZi39mnNXyU+2cL3Ylp5oaQCJpyssDRUqz/EiHa7FxUUgzCadG00+ePf5iYSnZKQRKWoOIawFvcCfcHx8GAl8Nn+79HtVQHB9hLsQ5+jqcdfKPfAgMBAAECggEAE9Ufz912xzrUY1TCKH1Ae3Dub732Lqihmv/9dsfv6ieUURcBvSW0u6eViVhi20DE7hH2QazH0cU18qkEg71UaTRgv9qW8vdMFiRhw9d4zZWZrfBMD6UTlahiEhhZ0B83pHVS5v0FNC+w0SEHe6Tks1hWfz5yrs3N/z3ghdihjC/5i1jeBoHXs1262SMazuwNGHblLApGPG+86taeFtbDI+31TKvZ8nomZHkEVFnARRUoBBcIwowRMqNfwlpcJhlz6kDWnoD08kHJ2zzJokozu7Lim+Ugt/MWwUOcA0hgq2QdymZFpkRkDl7tZmJtwTfTirjbGlpnPHVXEc1bWM7ocQKBgQD0LJ8e7JXf6bVFngq0jSJNKK7XDHYg0KhHXMApF59xxi29hdHXWPzgRJ45KkoUJc7MITpIJLXfCmi1XyDMf9m8lIf/oaqhJ7idYi7iAAPOJkdnHbSt0lebyjBWzCQ6OgS4NfF1+LEibTzRqiFs5K8EAyPYAVSTrpWoguoWtTzIGQKBgQDc9/I2PS+91Eb5RvuidTNsDqZJliTJQFlBjlDViFo3+l1N7jDFYwPBR/Tv4TVM5p9Zb+/Lo9X1pjDbm8QriTR4V+4HaLXkcCnmOsdSRInFUW4UIafwLX5ifjgfyaWgdKdn2UP1Lu/1qBN6GU1xjSfBQ6N3UqQiKkNPb7tuPJGqtwKBgQCQ4hU8vTclGMC14VQK1B/BVt1/vuYtDIJ9bZycBWdXlDc52LitpiDOVgjodJ5mHBT77M9vVVERWlTNIfgNP+OL0TptRZlAbJhP0p1s/oNDhFUj6211InVXfH54UkNAxYJdZ6yxynIYsma/JcsVmQ/8Ony/Q/LSempVBfEurjW1qQKBgQCQWPjFLdtOKqnildg0HFPnNvqx/38waPTluk5b76LgBpGFIyCBEVmWnacIPRpQjidyiYkggnp26oXoMC1KM2svYmGAPYr1G8CDQcqLl3JYkAVU6VeHsnBpbwLC4TttQkdJs8iNFohy9cUjcfwBPbDGs6TJghbuqqUl81uBe9e8qQKBgQDZm8T2KB34J7HAc5A+vqkmAo7mQLZg51OrzB1KnDU86pSAf0o3eSvfDUT6dpU9fRuZ1XYnbPnpoJwjFH3m4u9gqKF3PtVYfZyJrEqYwmhB9z6vd+dcsUlXM0fi37bGZkKBD0JGGt5OljM1qJG15x/LYfC/nwOmqWoOhNPCst2Z7w=="; |
| | | // |
| | | // private final String provider = "i-go-odrd-testing"; |
| | | |
| | | private final String DRIVER_ACCOUNT = "odrd-fleetengine-driversdkuser@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String CONSUMER_ACCOUNT = "odrd-fleetengine-consumersdkus@i-go-odrd-testing.iam.gserviceaccount.com"; |
| | | |
| | | private final String serverPrivateKeyId = "254e18eefa9fdcca64d5899cdcd793d466c47c7d"; |
| | | |
| | | private final String serverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCfbNAWnukqLKIxItqmSABxsH5glySEHJ2gfL5KsRF0M02e0Z8/KNKZkoh7I6bOMt1fEtttFaWOeq70IdI2WAd5wVazL3upvl5FW4P08ly33LklfGyLljlJ7ChPny9x6OjAaiS0yD9fh7NWti7rZKU7gzcGL8HddNYXgXV5OajvoG3TGdu52WTxce9AUzU6gLPboz/RbGqrdrmgVJVb0EPlhTJf/NSsaiW4NoL8SEzf/pJGYBmqJs97mXwCHTY4avaC+CP/zz9yS8AQEJlApbVT6lSOhYoR0hNOBj5B886EZOssjubO6hQaiwRnGrV2RdpHynqA1iekfGpUGEtWTsqjAgMBAAECggEALyPbMd0iP8y71sCiG4nty7Au5ju62e+mMkbAc9CAwzXKTVxZdLEK+MsJ3TNxBsami47FYC+G6SbgpaJ8iIImD7v5+XjgXZRDRsnlLmAdx2YWPv3YELxGS1PvpX+B5XJDpGWeXfBaQNKc1lZ/cC4t53eIpSUo82UxSvkGNea1S8lR6vIByhNyCQOvLG4yqaxUy0hZi0kge37XrjYMGS+BivBBnDiVlBPLBVbrNBxOf31Lzz+XX0iwXX7Zl2jN759oe0xQyuIGWUSj8xBDIF8nNaJrla7rWVml3sZJh6/3r1Acj0mhZtE0ZMu5hiPGiIXgb1ng30j3dMP4yVPhXrpAtQKBgQDaU01VnHsnHxc0DQHE2vEOPGmPxVS0/JAssePAEUmKEueUogGef91YY+Vm/ItbhLwGjbytnXxe88zRAdB1u07efZ83ey93TrGl2CJUzLHIcgb+Q1tT642rqlfl+q8ep86hcZ+63pDiIPt2Z+HkbKIR0SWf5LIH4flquQOTQufXXQKBgQC674qDsjOJepZjMMN6PkVMcWBYDNmXHnqa5Oto0rZM745UulbXqEFGuBOsXPU7O33Kfz1vbtoluubKZi5B6cFNnPypE2SCfvdObHq4FuTuKPV6lN93SyhZchmSEXEs0PU4cGDRt+RRqQcjft1Wigiy4Y1y1SInCtcaP1hLejEJ/wKBgFAhvwKrGnBzctrB42JTUaJ9/eis7rg28tvUttjp/2nUIndlNt7r41vr3mj8TFHc1/43y4aVhO584THdTpvHkd0LkoKUjglmMsHCIGercZ02bOap5j1Y+XiGXxij995yjN6oi43U3qyAmosM+dYTITEU6JBVKhrGj/rhyTQlnF5pAoGBAKFGmo0mR/pbDbYD0xH6+VSLGCC+7VbIT+SkjUjBSdA0eOo2XUfvfGmj1C1HgbcZi1wRzJH/5CrbBdQmtc/d+QyZ3Q2NkpBXM8uwIWwDLH0gTzDzkZvc9rG8k70GWUrd+EI6Cf3FFjExj9wazqCjs/+IQr2Ijc97NbsKXYW4pOhHAoGAKf5wYk+cn0cVTsyAom0UbGD5Uijqh5732MeqFYs2Rcwx0OErJZo68COSFFF40hJmmIKn7p3qycIyd1FcYlXN1l4s8mEWTGTInRE0OlBU0+jLtIV9pwNgffpbPYcrWZU6s6YVeJ2nDwl+aD+4QvN0rkPTfho9kjgeyF3PW0I2u4E="; |
| | | |
| | | private final String driverPrivateKeyId = "859e85fb3aa4d18b4afaac3e24e8f65700da5cc9"; |
| | | |
| | | private final String driverPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmzL1BqSH+Zh9Fct5mXqe5sYOMTnJtOJhwKXnjjo2tNPXv4alzUHz8Vbj6nMar5u5IuKRZMeRBlhoRSFrLm+J1+sfvpH8N4wsnG7hDANknqWzdsk9a68qMHxNQF3hFzs9+KKrR1LAG8e9ytMfliN0kX+xls4uPZDPu1Q39K6V9KXrH/GrMA56i3TtWi7Hmakt5YTELeGjhx4nGrfuQLFFovs1Z9uJtf7E8R95+65StrOAmbJNf7VciEqwBpWYlU5VeyLXMg/oHwnTv2cjdcFozyDrlUHbDmtTiVeBBsYFVLyAsDGfl1p6eiVTiBBuo56YSYLWfaLgYvTyEcZ9jBQsfAgMBAAECggEAQzbTuObX3PT3+vtb5XKVMf33XY2rDJo2y1PbWzhxnO9vf3e22dIAW4qLnOmaIWFQeht1lr/FFCzRWk+Gzu+FJTemY8osrMLmFp9T9CQeXZ4nUXruAVxs5WQMW0Tp4W+CK3tlwmJrgJDzhYyV1Mf/HQ5Oa3kbbu/ZAY/3MCLrb/ClJQvD2rZSDdzAkNMQm8P2hsE71+rH7mI2hHrSCHl2OIp2A64QT8HjtyRc5yHZtTp6ZST1ge9SSIsT0ZfmXKtKF7yGEIPtKNU+oLrGyK5P30xBWJ/bwb3PEz2MZcPvz31+B2+UvZMm7OTkqfcRwEztAf8Ckiuo4im2BRYbVmd9OQKBgQDd0MeLxR+Qtv12bVA0bHtagFEq36THgWG7IM1/1vS4Cl9sveKSOS8A6oKLy624fGE7PKcuTTIzkVA81GXtWBQ9Coq/4TmllQkFTH7pz9C2PNHSCychPwNNV8qUx3lE3d4DOjGKgoVFD4l90AO7lOvmLTSc3pDpr+jSjUH4lqGrbQKBgQDAgXBmpXfCTxwqkBzGwxX+hwJen9qSkCM47qnQ1L4NnXPL6s0EN6rQ3FnFemGIzBUGJ2tajntkKlUu5DzsQeoBGu/SaSwgqD+1UQDcUyo+retmqZ+QYbpeyd3l53bLJJuJNsfak0X76Ft6hrm4julx6RGlmboQyx4kZWbhx4YNOwKBgEG9/2aNpi1eDwFqpLrk7CqGnYf3gP8gebbcoguhyiZB7MZuARkVmbjLyKVmWLa1JpxH/cTbXGWsS/u7d/pAgL8WwMjeGBfbdDD92x+xWEqq/AUlCRPxeSkTPBech3TBzWtndAd5Z8ZwNG/1lyWhnck63L0huhGI8Zh2BXeILaKBAoGAKK3xq69BvGztPc1QV2w4RJ4RER/kl14gI1LDzd52/veL1cabZk3BKfu2eLWg0MCXnMJNvEgpqQQNFiii+yX+phckIKma6pfDRrSEYwqr/azQ9tPXZTJRqOAtpPyhrNHikD9kQjsm6dGzKxQ3QNnqWOjwkrcGi6/wga5v7Dw2hqsCgYEA2T/kSNQ9dqpVBAkfi2J50hqnfFESPjKeirJJZllqhVqsiV0ly8a8Fz8SjGqTzrq+UErko+QmtSlo5h3Uq9Ln+0CwYfrUL+74q2zLHdS0DpY3QsGTEDJXTxCyy9kO26X2UsM3Ez3YUAkdMwdpVz0uVZtinv2735QZOBxoVQV2kQ8="; |
| | | |
| | | private final String consumerPrivateKeyId = "40acf82cbd5250de2f5123caff40738bdd403b08"; |
| | | |
| | | private final String consumerPrivateKey = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDSwtbSBFgIXna6mWeKFWCK31NXUJH6uGduR1XrODGRedrqrTgr0BdNg8PDo6/zh/T+K0Svor6kgqpwnl9soOdn73oC4Nu+Ad7EiKa38j650jlZdLAr4hR0Ou9Kcnv45x/94auUO8jBz844cu24swLKiPsK9OnX65wVlKRfhhkGFuS/4OI76CmE7NqZDqPOW16o8tBO5TsgPVNkglFAU73fTp0kcHoLauT9QOB0+yZi39mnNXyU+2cL3Ylp5oaQCJpyssDRUqz/EiHa7FxUUgzCadG00+ePf5iYSnZKQRKWoOIawFvcCfcHx8GAl8Nn+79HtVQHB9hLsQ5+jqcdfKPfAgMBAAECggEAE9Ufz912xzrUY1TCKH1Ae3Dub732Lqihmv/9dsfv6ieUURcBvSW0u6eViVhi20DE7hH2QazH0cU18qkEg71UaTRgv9qW8vdMFiRhw9d4zZWZrfBMD6UTlahiEhhZ0B83pHVS5v0FNC+w0SEHe6Tks1hWfz5yrs3N/z3ghdihjC/5i1jeBoHXs1262SMazuwNGHblLApGPG+86taeFtbDI+31TKvZ8nomZHkEVFnARRUoBBcIwowRMqNfwlpcJhlz6kDWnoD08kHJ2zzJokozu7Lim+Ugt/MWwUOcA0hgq2QdymZFpkRkDl7tZmJtwTfTirjbGlpnPHVXEc1bWM7ocQKBgQD0LJ8e7JXf6bVFngq0jSJNKK7XDHYg0KhHXMApF59xxi29hdHXWPzgRJ45KkoUJc7MITpIJLXfCmi1XyDMf9m8lIf/oaqhJ7idYi7iAAPOJkdnHbSt0lebyjBWzCQ6OgS4NfF1+LEibTzRqiFs5K8EAyPYAVSTrpWoguoWtTzIGQKBgQDc9/I2PS+91Eb5RvuidTNsDqZJliTJQFlBjlDViFo3+l1N7jDFYwPBR/Tv4TVM5p9Zb+/Lo9X1pjDbm8QriTR4V+4HaLXkcCnmOsdSRInFUW4UIafwLX5ifjgfyaWgdKdn2UP1Lu/1qBN6GU1xjSfBQ6N3UqQiKkNPb7tuPJGqtwKBgQCQ4hU8vTclGMC14VQK1B/BVt1/vuYtDIJ9bZycBWdXlDc52LitpiDOVgjodJ5mHBT77M9vVVERWlTNIfgNP+OL0TptRZlAbJhP0p1s/oNDhFUj6211InVXfH54UkNAxYJdZ6yxynIYsma/JcsVmQ/8Ony/Q/LSempVBfEurjW1qQKBgQCQWPjFLdtOKqnildg0HFPnNvqx/38waPTluk5b76LgBpGFIyCBEVmWnacIPRpQjidyiYkggnp26oXoMC1KM2svYmGAPYr1G8CDQcqLl3JYkAVU6VeHsnBpbwLC4TttQkdJs8iNFohy9cUjcfwBPbDGs6TJghbuqqUl81uBe9e8qQKBgQDZm8T2KB34J7HAc5A+vqkmAo7mQLZg51OrzB1KnDU86pSAf0o3eSvfDUT6dpU9fRuZ1XYnbPnpoJwjFH3m4u9gqKF3PtVYfZyJrEqYwmhB9z6vd+dcsUlXM0fi37bGZkKBD0JGGt5OljM1qJG15x/LYfC/nwOmqWoOhNPCst2Z7w=="; |
| | | |
| | | private final String provider = "i-go-odrd-testing"; |
| | | private final String SERVICE_ACCOUNT = "odrd-fleetengine-ondemandadmin@i-go-gcp.iam.gserviceaccount.com"; |
| | | |
| | | private final String DRIVER_ACCOUNT = "odrd-fleetengine-driversdkuser@i-go-gcp.iam.gserviceaccount.com"; |
| | | |
| | | private final String CONSUMER_ACCOUNT = "odrd-fleetengine-consumersdkus@i-go-gcp.iam.gserviceaccount.com"; |
| | | |
| | | private final String provider = "i-go-gcp"; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | |
| | | public Map<String, Object> fleetEngineAuth(int type, String id){ |
| | | try { |
| | | //谷歌云服务器使用这部分代码 |
| | | // AuthTokenMinter minter = AuthTokenMinter.builder() |
| | | // //服务端签名 |
| | | // .setServerSigner(ImpersonatedSigner.create(SERVICE_ACCOUNT)) |
| | | // //司机端签名 |
| | | // .setDriverSigner(ImpersonatedSigner.create(DRIVER_ACCOUNT)) |
| | | // //乘客端签名 |
| | | // .setConsumerSigner(ImpersonatedSigner.create(CONSUMER_ACCOUNT)) |
| | | // .build(); |
| | | AuthTokenMinter minter = AuthTokenMinter.builder() |
| | | //服务端签名 |
| | | .setServerSigner(LocalSigner.create(SERVICE_ACCOUNT, serverPrivateKeyId, serverPrivateKey)) |
| | | .setServerSigner(ImpersonatedSigner.create(SERVICE_ACCOUNT)) |
| | | //司机端签名 |
| | | .setDriverSigner(LocalSigner.create(DRIVER_ACCOUNT, driverPrivateKeyId, driverPrivateKey)) |
| | | .setDriverSigner(ImpersonatedSigner.create(DRIVER_ACCOUNT)) |
| | | //乘客端签名 |
| | | .setConsumerSigner(LocalSigner.create(CONSUMER_ACCOUNT, consumerPrivateKeyId, consumerPrivateKey)) |
| | | .setConsumerSigner(ImpersonatedSigner.create(CONSUMER_ACCOUNT)) |
| | | .build(); |
| | | // AuthTokenMinter minter = AuthTokenMinter.builder() |
| | | // //服务端签名 |
| | | // .setServerSigner(LocalSigner.create(SERVICE_ACCOUNT, serverPrivateKeyId, serverPrivateKey)) |
| | | // //司机端签名 |
| | | // .setDriverSigner(LocalSigner.create(DRIVER_ACCOUNT, driverPrivateKeyId, driverPrivateKey)) |
| | | // //乘客端签名 |
| | | // .setConsumerSigner(LocalSigner.create(CONSUMER_ACCOUNT, consumerPrivateKeyId, consumerPrivateKey)) |
| | | // .build(); |
| | | |
| | | String jwt = ""; |
| | | Long expirationTimestamp = 0L; |
| | |
| | | return map; |
| | | } catch (SigningTokenException e) { |
| | | throw new RuntimeException(e); |
| | | } catch (SignerInitializationException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.maps.*; |
| | | import com.google.maps.model.*; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | |
| | | /** |
| | | * 谷歌地图工具类 |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static ReverseGeocodeVo getReverseGeocode(double lat, double lng) throws Exception{ |
| | | public static ReverseGeocodeVo getReverseGeocode(double lat, double lng, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | GeocodingApiRequest request = GeocodingApi.reverseGeocode(context, new LatLng(lat, lng)); |
| | | request.language("en"); |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | GeocodingResult[] results = request.await(); |
| | | ReverseGeocodeVo vo = null; |
| | | if(results.length > 0){ |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static DistancematrixVo getDistancematrix(String origin, String destination) throws Exception{ |
| | | public static DistancematrixVo getDistancematrix(String origin, String destination, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | DistanceMatrixApiRequest request = DistanceMatrixApi.getDistanceMatrix(context, new String[]{origin}, new String[]{destination}); |
| | | request.language("en"); |
| | | request.mode(TravelMode.DRIVING);//出行方式(驾车) |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | DistanceMatrix distanceMatrix = request.await(); |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.err.println(gson.toJson(distanceMatrix)); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static DistancematrixVo getDistancematrix(Double sLat, Double sLnt, Double eLat, Double eLnt) throws Exception{ |
| | | public static DistancematrixVo getDistancematrix(Double sLat, Double sLnt, Double eLat, Double eLnt, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | |
| | | request.origins(new LatLng(sLat, sLnt)); |
| | | request.destinations(new LatLng(eLat, eLnt)); |
| | | request.mode(TravelMode.DRIVING);//出行方式(驾车) |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | DistanceMatrix distanceMatrix = request.await(); |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.out.println(gson.toJson(distanceMatrix)); |
| | |
| | | params.put("msisdn", toPhone); |
| | | params.put("message", msg); |
| | | params.put("sender_id", "I-GO"); |
| | | params.put("callback_url", "http://182.160.16.251:80/user/base/sendCellulantMessageCallback"); |
| | | params.put("callback_url", "https://igo.i-go.group/user/base/sendCellulantMessageCallback"); |
| | | post.body(params.toJSONString()); |
| | | System.err.println("短信请求:\n请求地址:" + url + "\n请求参数:" + params.toJSONString()); |
| | | HttpResponse execute = post.execute(); |
| | |
| | | } |
| | | |
| | | public static void main(String[] ages){ |
| | | //{"callback_url":"http://182.160.16.251:80/user/base/sendCellulantMessageCallback","msisdn":"233244915521","message":"Your verification code is 2358,it is valid within 5 minutes, please do not reveal it to others.","key":"ru#0flkf3993qh!!rg!@y4)nhwi08c#tg_vasek!ja)kvfnfjyoljoz(@nai(jkf","sender_id":"I-GO"} |
| | | //{"callback_url":"https://igo.i-go.group/user/base/sendCellulantMessageCallback","msisdn":"233244915521","message":"Your verification code is 2358,it is valid within 5 minutes, please do not reveal it to others.","key":"ru#0flkf3993qh!!rg!@y4)nhwi08c#tg_vasek!ja)kvfnfjyoljoz(@nai(jkf","sender_id":"I-GO"} |
| | | SMSUtil smsUtil = new SMSUtil(); |
| | | smsUtil.sendCellulantMessage("233244915521", "Your verification code is 2358,it is valid within 5 minutes, please do not reveal it to others."); |
| | | } |
| | |
| | | ByteString audioContents = response.getAudioContent(); |
| | | |
| | | // Write the response to the output file. |
| | | try (OutputStream out = new FileOutputStream("/usr/local/nginx/html/files/audio/" + fileName)) { |
| | | try (OutputStream out = new FileOutputStream("/home/igotechgh/nginx/html/files/audio/" + fileName)) { |
| | | out.write(audioContents.toByteArray()); |
| | | return "http://182.160.16.251:81/files/audio/" + fileName; |
| | | return "https://igo.i-go.group/files/audio/" + fileName; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | public synchronized ResultUtil<BaseWarpper> taxiOrder(OrderTaxi orderTaxi, Integer uid) throws Exception { |
| | | //定义用户所属公司 |
| | | UserInfo userInfo1 = userInfoService.selectById(uid); |
| | | Company query = companyCityService.query1(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat())); |
| | | Company query = companyCityService.query1(orderTaxi.getUserId(), String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat())); |
| | | if(null == query){ |
| | | return ResultUtil.error("出发点暂未开通"); |
| | | } |
| | |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query1(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | Company query = companyCityService.query1(orderTaxi.getUserId(), String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | PushOrder pushOrder = pushOrderService.querys(i, 2, query.getId()).get(0); |
| | |
| | | |
| | | #支付回调地址 |
| | | #测试环境 |
| | | callbackPath: http://182.160.16.251/user |
| | | callbackPath: https://igo.i-go.group/user |
| | | |
| | | --- |
| | | |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /usr/local/nginx/html/mailbox/ |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | |
| | | --- |
| | |
| | | port: 8006 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | swagger-open: false #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | # file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/igotravel2.0?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | username: root |
| | | url: jdbc:mysql://172.16.0.4:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B0 |
| | | username: i-go |
| | | password: HjKbXilb9zajmXbl |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | |
| | | |
| | | --- |
| | | |
| | | filePath: /usr/local/server/orderPostionFile/ #存储订单轨迹文件路径 |
| | | filePath: /home/igotechgh/orderPostionFile/ #存储订单轨迹文件路径 |
| | | |
| | | |
| | | |
| | | #支付回调地址 |
| | | callbackPath: http://182.160.16.251/user |
| | | callbackPath: https://igo.i-go.group/user |
| | | |
| | | --- |
| | | |
| | |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: i-gotech@i-go.group # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /usr/local/nginx/html/mailbox/ |
| | | template-path: /home/igotechgh/nginx/html/mailbox/ |
| | | |
| | | --- |
| | | |
| | | audioPath: /usr/local/nginx/html/files/audio |
| | | audioPath: /home/igotechgh/nginx/html/files/audio |
| | |
| | | <contextName>logback</contextName> |
| | | |
| | | <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 --> |
| | | <property name="log.path" value="/usr/local/server/logs/user"/> |
| | | <property name="log.path" value="/home/igotechgh/app/log/user"/> |
| | | |
| | | <!--0. 日志格式和颜色渲染 --> |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | |
| | | <version>2.9.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-tomcat</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>javax.servlet-api</artifactId> |
| | | <version>3.1.0</version> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-starter-tomcat</artifactId>--> |
| | | <!-- <scope>provided</scope>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>javax.servlet</groupId>--> |
| | | <!-- <artifactId>javax.servlet-api</artifactId>--> |
| | | <!-- <version>3.1.0</version>--> |
| | | <!-- <scope>provided</scope>--> |
| | | <!-- </dependency>--> |
| | | |
| | | |
| | | <!-- netty --> |
| | |
| | | server: |
| | | port: 80 |
| | | port: 5000 |
| | | spring: |
| | | application: |
| | | name: zuul-gateway #服务名称 |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 100MB |
| | | max-request-size: 100MB |
| | | |
| | | eureka: |
| | | client: |