From e450b6ffb2b6cea8cca12b21d0003fb66fde7b36 Mon Sep 17 00:00:00 2001 From: zhibing.pu <393733352@qq.com> Date: 星期一, 02 九月 2024 13:35:54 +0800 Subject: [PATCH] 修改bug --- ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/FleetEngineUtil.java | 248 ++++++++++---------- ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java | 18 - ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java | 12 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java | 6 ManagementIGOTravel/guns-admin/src/main/resources/logback-spring.xml | 2 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderCrossCityMapper.xml | 4 ManagementIGOTravel/guns-admin/src/main/resources/application-dev.yml | 2 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLineMapper.xml | 4 ZuulIGOTravel/src/main/resources/application.yml | 2 EurekaIGOTravel/pom.xml | 24 +- ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_edit.html | 4 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/PushUtil.java | 19 ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tLine/tLine_edit.html | 2 ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderPrivateCar/tOrderPrivateCar.html | 2 ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderCrossCity/tOrderCrossCity.html | 2 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSystemPriceMapper.xml | 4 ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_add.html | 4 ZuulIGOTravel/pom.xml | 22 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java | 6 ManagementIGOTravel/guns-admin/pom.xml | 20 + ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TReportLossController.java | 6 EurekaIGOTravel/src/main/java/com/sinata/eureka/EurekaApplication.java | 6 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java | 170 +++++-------- ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UediterController.java | 3 ManagementIGOTravel/guns-admin/src/main/resources/application-produce.yml | 10 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java | 6 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml | 6 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleCloudStorageUtil.java | 70 +++++ ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java | 6 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponActivityController.java | 6 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/UploadUtil.java | 9 ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_auth.html | 4 ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tLine/tLine_add.html | 2 ManagementIGOTravel/guns-admin/src/main/resources/application-test.yml | 2 ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/TextToSpeechUtil.java | 4 35 files changed, 374 insertions(+), 343 deletions(-) diff --git a/EurekaIGOTravel/pom.xml b/EurekaIGOTravel/pom.xml index 0744038..0832ace 100644 --- a/EurekaIGOTravel/pom.xml +++ b/EurekaIGOTravel/pom.xml @@ -14,7 +14,7 @@ <name>eureka</name> <description>Eureka project for Spring Boot</description> - <packaging>war</packaging> + <packaging>jar</packaging> <properties> <java.version>1.8</java.version> @@ -33,17 +33,17 @@ </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> diff --git a/EurekaIGOTravel/src/main/java/com/sinata/eureka/EurekaApplication.java b/EurekaIGOTravel/src/main/java/com/sinata/eureka/EurekaApplication.java index 1e9c18d..2ef7167 100644 --- a/EurekaIGOTravel/src/main/java/com/sinata/eureka/EurekaApplication.java +++ b/EurekaIGOTravel/src/main/java/com/sinata/eureka/EurekaApplication.java @@ -8,15 +8,11 @@ @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); - } } diff --git a/ManagementIGOTravel/guns-admin/pom.xml b/ManagementIGOTravel/guns-admin/pom.xml index 492ac58..251aabf 100644 --- a/ManagementIGOTravel/guns-admin/pom.xml +++ b/ManagementIGOTravel/guns-admin/pom.xml @@ -259,10 +259,24 @@ <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> diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TReportLossController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TReportLossController.java index c444f44..2dbbbab 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TReportLossController.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/TReportLossController.java @@ -196,12 +196,12 @@ } //开始生成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(); } @@ -210,7 +210,7 @@ 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()); diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponActivityController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponActivityController.java index 6739784..2db1585 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponActivityController.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponActivityController.java @@ -288,12 +288,12 @@ 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()); //开始生成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(); } @@ -302,7 +302,7 @@ 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()); diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java index 3008ffb..5e7cd10 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java @@ -185,12 +185,12 @@ } //开始生成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(); } @@ -199,7 +199,7 @@ 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()); diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java index 97936dd..13dbce5 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java @@ -215,12 +215,12 @@ } //开始生成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(); } @@ -229,7 +229,7 @@ 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()); diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java index 65a54fd..23d2f9b 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java @@ -9,6 +9,7 @@ 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; @@ -120,23 +121,8 @@ @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(); diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java index bd2526f..0a8a7dd 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java @@ -168,12 +168,12 @@ 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(); } @@ -182,7 +182,7 @@ 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()); diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java index cadb4e5..22b7d48 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java @@ -23,6 +23,8 @@ 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; @@ -47,6 +49,8 @@ @Controller @RequestMapping("/tOrderPrivateCar") public class TOrderPrivateCarController extends BaseController { + + Logger log = LoggerFactory.getLogger(this.getClass()); private String PREFIX = "/system/tOrderPrivateCar/"; @@ -206,7 +210,7 @@ orderPrivateCar.setOrderMoney(money); orderPrivateCar.setPayMoney(money); orderPrivateCar.setState(7); - orderPrivateCar.setIsDispute(3); + orderPrivateCar.setIsDispute(1); orderPrivateCar.updateById(); return SUCCESS_TIP; } @@ -217,115 +221,74 @@ 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() { @@ -333,30 +296,25 @@ 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 @@ -645,8 +603,8 @@ 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()); diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UediterController.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UediterController.java index 97e3140..61cb775 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UediterController.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UediterController.java @@ -3,6 +3,7 @@ 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; @@ -104,7 +105,7 @@ String pictureName = ""; try { //文件上传,具体根据实际替换 - pictureName = OBSUploadUtil.inputStreamUpload(picture); + pictureName = GoogleCloudStorageUtil.upload(picture); String result = "{'original': '" + picture.getOriginalFilename() + "', 'state': 'SUCCESS', 'url': '" + pictureName + "'}"; if (callback == null) { diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/PushUtil.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/PushUtil.java index fd365f8..17be056 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/PushUtil.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/PushUtil.java @@ -4,6 +4,7 @@ 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; @@ -67,7 +68,7 @@ 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")); @@ -104,7 +105,7 @@ 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")); @@ -143,7 +144,7 @@ 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")); @@ -178,7 +179,7 @@ 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")); @@ -216,7 +217,7 @@ 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")); @@ -252,7 +253,7 @@ 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")); @@ -291,7 +292,7 @@ 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")); @@ -339,7 +340,7 @@ 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")); @@ -380,7 +381,7 @@ 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")); diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/TextToSpeechUtil.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/TextToSpeechUtil.java index 8f81f8e..803c2d8 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/TextToSpeechUtil.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/TextToSpeechUtil.java @@ -50,9 +50,9 @@ 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(); } diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/UploadUtil.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/UploadUtil.java index c7f3e67..2b5e52b 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/UploadUtil.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/UploadUtil.java @@ -5,6 +5,7 @@ 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; @@ -67,7 +68,7 @@ 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); } @@ -84,10 +85,10 @@ 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; } } @@ -126,7 +127,7 @@ // 文件全路径 //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) { diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLineMapper.xml b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLineMapper.xml index 52db9f7..8efd21f 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLineMapper.xml +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLineMapper.xml @@ -21,7 +21,7 @@ <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 @@ -51,7 +51,7 @@ <!--根据线路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> diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderCrossCityMapper.xml b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderCrossCityMapper.xml index dfe45c9..8ca56f2 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderCrossCityMapper.xml +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderCrossCityMapper.xml @@ -74,7 +74,7 @@ <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 @@ -143,7 +143,7 @@ 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, diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml index e5ed740..8306070 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml @@ -78,7 +78,7 @@ <!--根据条件查询专车订单列表--> <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 @@ -150,7 +150,7 @@ 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, @@ -176,7 +176,7 @@ <!--根据条件查询专车订单列表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 diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSystemPriceMapper.xml b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSystemPriceMapper.xml index 6e92c48..ae17306 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSystemPriceMapper.xml +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSystemPriceMapper.xml @@ -20,7 +20,7 @@ <!--查询专车价格设置--> <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} @@ -35,7 +35,7 @@ </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} diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java index 922f959..32c08ec 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java @@ -343,12 +343,12 @@ 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()); //开始生成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(); } @@ -357,7 +357,7 @@ 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()); diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleCloudStorageUtil.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleCloudStorageUtil.java new file mode 100644 index 0000000..27fe457 --- /dev/null +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleCloudStorageUtil.java @@ -0,0 +1,70 @@ +package com.stylefeng.guns.modular.system.util; + +import com.google.cloud.WriteChannel; +import com.google.cloud.storage.BlobId; +import com.google.cloud.storage.BlobInfo; +import com.google.cloud.storage.Storage; +import com.google.cloud.storage.StorageOptions; +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 bucketName = "i-go"; + Storage storage = StorageOptions.newBuilder().setProjectId("i-go-gcp").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); + return "https://storage.cloud.google.com/" + bucketName + "/" + fileName + "?authuser=1"; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + + +} diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/FleetEngineUtil.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/FleetEngineUtil.java index 22fe443..087dfcd 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/FleetEngineUtil.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GoogleMap/FleetEngineUtil.java @@ -25,6 +25,7 @@ /** * Fleet Engine API 工具类 + * * @author zhibing.pu * @Date 2024/5/17 9:59 */ @@ -34,72 +35,78 @@ 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 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 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(); @@ -110,23 +117,24 @@ 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(); @@ -136,16 +144,14 @@ } - - - /** * 添加车辆 + * * @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<>(); @@ -171,16 +177,16 @@ 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); } @@ -210,9 +216,10 @@ */ return response.body(); } - + /** * 上报google可结算订单 + * * @param tripId 行程id * @return */ @@ -227,16 +234,8 @@ JSONObject body = new JSONObject(); body.put("related_ids", "[\"" + tripId + "\"]"); post.body(body.toJSONString()); - - - - - - - - - - + + //上线客户测试和上线运营开放 // HttpResponse response = post.execute(); // if(200 != response.getStatus()){ @@ -245,23 +244,25 @@ // } 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(",")); @@ -279,13 +280,13 @@ * 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)); @@ -302,16 +303,16 @@ 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); } @@ -345,10 +346,11 @@ /** * 获取车辆信息 + * * @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<>(); @@ -360,19 +362,19 @@ 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); } @@ -429,16 +431,16 @@ } - /** * 获取最后一个数字 + * * @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); } } @@ -448,16 +450,17 @@ /** * 创建新的行程 - * @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<>(); @@ -466,7 +469,7 @@ post.addHeaders(headers); JSONObject body = new JSONObject(); - if(StringUtils.hasLength(vehicleId)){ + if (StringUtils.hasLength(vehicleId)) { body.put("vehicleId", vehicleId); } body.put("tripStatus", "NEW"); @@ -492,16 +495,16 @@ 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); } @@ -629,33 +632,34 @@ /** * 修改行程 - * @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(",")); @@ -668,7 +672,7 @@ put.addHeaders(headers); JSONObject body = new JSONObject(); - if(StringUtils.hasLength(vehicleId)){ + if (StringUtils.hasLength(vehicleId)) { body.put("vehicleId", vehicleId); } /** @@ -682,13 +686,13 @@ * 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); @@ -697,7 +701,7 @@ 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); @@ -711,16 +715,16 @@ 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); } @@ -849,9 +853,9 @@ } - /** * 获取行程信息 + * * @param tripId 订单id * @return */ @@ -867,19 +871,19 @@ 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); } diff --git a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java index 7770e0a..7c30dc9 100644 --- a/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java +++ b/ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java @@ -1,12 +1,12 @@ 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"; diff --git a/ManagementIGOTravel/guns-admin/src/main/resources/application-dev.yml b/ManagementIGOTravel/guns-admin/src/main/resources/application-dev.yml index 4b37a89..d8d8b55 100644 --- a/ManagementIGOTravel/guns-admin/src/main/resources/application-dev.yml +++ b/ManagementIGOTravel/guns-admin/src/main/resources/application-dev.yml @@ -104,7 +104,7 @@ 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/ --- #支付回调地址 diff --git a/ManagementIGOTravel/guns-admin/src/main/resources/application-produce.yml b/ManagementIGOTravel/guns-admin/src/main/resources/application-produce.yml index 29e17d7..aeea63a 100644 --- a/ManagementIGOTravel/guns-admin/src/main/resources/application-produce.yml +++ b/ManagementIGOTravel/guns-admin/src/main/resources/application-produce.yml @@ -41,8 +41,8 @@ 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 @@ -62,7 +62,7 @@ --- -filePath: /usr/local/server/orderPostionFile/ #存储订单轨迹文件路径 +filePath: /home/igotechgh/orderPostionFile/ #存储订单轨迹文件路径 #quartz配置 spring: @@ -102,10 +102,10 @@ 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 --- \ No newline at end of file diff --git a/ManagementIGOTravel/guns-admin/src/main/resources/application-test.yml b/ManagementIGOTravel/guns-admin/src/main/resources/application-test.yml index b74f6c4..5da98f5 100644 --- a/ManagementIGOTravel/guns-admin/src/main/resources/application-test.yml +++ b/ManagementIGOTravel/guns-admin/src/main/resources/application-test.yml @@ -103,7 +103,7 @@ 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/ --- #支付回调地址 diff --git a/ManagementIGOTravel/guns-admin/src/main/resources/logback-spring.xml b/ManagementIGOTravel/guns-admin/src/main/resources/logback-spring.xml index fcdfef9..24eb650 100644 --- a/ManagementIGOTravel/guns-admin/src/main/resources/logback-spring.xml +++ b/ManagementIGOTravel/guns-admin/src/main/resources/logback-spring.xml @@ -7,7 +7,7 @@ <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. 日志格式和颜色渲染 --> <!-- 彩色日志依赖的渲染类 --> diff --git a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_add.html b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_add.html index d3b93ed..2f049ba 100644 --- a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_add.html +++ b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_add.html @@ -78,7 +78,7 @@ <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> @@ -89,7 +89,7 @@ <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> diff --git a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_auth.html b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_auth.html index e1ee362..53ebcf3 100644 --- a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_auth.html +++ b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_auth.html @@ -24,7 +24,7 @@ <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> @@ -35,7 +35,7 @@ <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> diff --git a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_edit.html b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_edit.html index 47a2d43..1571a61 100644 --- a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_edit.html +++ b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tCar/tCar_edit.html @@ -80,7 +80,7 @@ <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> @@ -91,7 +91,7 @@ <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> diff --git a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tLine/tLine_add.html b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tLine/tLine_add.html index 6c53261..9e90cc3 100644 --- a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tLine/tLine_add.html +++ b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tLine/tLine_add.html @@ -74,7 +74,7 @@ <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> diff --git a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tLine/tLine_edit.html b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tLine/tLine_edit.html index 1049c11..e22f7a2 100644 --- a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tLine/tLine_edit.html +++ b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tLine/tLine_edit.html @@ -74,7 +74,7 @@ <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> diff --git a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderCrossCity/tOrderCrossCity.html b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderCrossCity/tOrderCrossCity.html index e3a09d2..1f54e1a 100644 --- a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderCrossCity/tOrderCrossCity.html +++ b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderCrossCity/tOrderCrossCity.html @@ -41,7 +41,7 @@ <#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> diff --git a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderPrivateCar/tOrderPrivateCar.html b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderPrivateCar/tOrderPrivateCar.html index b125109..8d042cb 100644 --- a/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderPrivateCar/tOrderPrivateCar.html +++ b/ManagementIGOTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderPrivateCar/tOrderPrivateCar.html @@ -43,7 +43,7 @@ <#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> diff --git a/ZuulIGOTravel/pom.xml b/ZuulIGOTravel/pom.xml index a70e075..5e3844d 100644 --- a/ZuulIGOTravel/pom.xml +++ b/ZuulIGOTravel/pom.xml @@ -44,17 +44,17 @@ <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 --> diff --git a/ZuulIGOTravel/src/main/resources/application.yml b/ZuulIGOTravel/src/main/resources/application.yml index d4de3e8..b14369c 100644 --- a/ZuulIGOTravel/src/main/resources/application.yml +++ b/ZuulIGOTravel/src/main/resources/application.yml @@ -1,5 +1,5 @@ server: - port: 80 + port: 5000 spring: application: name: zuul-gateway #服务名称 -- Gitblit v1.7.1