driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/OrderController.java
@@ -24,6 +24,7 @@ import com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -261,9 +262,10 @@ @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), @ApiImplicitParam(value = "原因", name = "cause", required = true, dataType = "string"), @ApiImplicitParam(value = "手机号", name = "phone", required = true, dataType = "string"), @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) public ResponseWarpper transferOrder(Long orderId, String cause){ public ResponseWarpper transferOrder(Long orderId, String cause, String phone){ if(ToolUtil.isEmpty(orderId)){ return ResponseWarpper.success(ResultUtil.paranErr("orderId")); } @@ -275,7 +277,7 @@ if(null == uid){ return ResponseWarpper.tokenErr(); } ResultUtil resultUtil = orderService.transferOrder(uid, orderId, cause); ResultUtil resultUtil = orderService.transferOrder(uid, orderId, cause, phone); return ResponseWarpper.success(resultUtil); }catch (Exception e){ e.printStackTrace(); driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/IOrderService.java
@@ -109,7 +109,7 @@ * @return * @throws Exception */ ResultUtil transferOrder(Integer uid, Long orderId, String cause) throws Exception; ResultUtil transferOrder(Integer uid, Long orderId, String cause, String phone) throws Exception; /** driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/impl/OrderServiceImpl.java
@@ -247,14 +247,14 @@ * @param city 查询天气的城市 * @return */ public Order getOrderPrice(Integer type, Double distance, Integer waitTime, Order order, String city){ public Order getOrderPrice(Integer type, Double distance, Integer waitTime, Order order, String city) { order = getOrderInitialPrice(order); SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 5)); if(null == systemConfig){ if(type == 1){//预估金额 if (null == systemConfig) { if (type == 1) {//预估金额 order.setEstimatedPrice(0D); } if(type == 2){//订单金额 if (type == 2) {//订单金额 order.setOrderMoney(0D); } return order; @@ -294,19 +294,19 @@ e.set(Calendar.MINUTE, Integer.valueOf(split1[1])); e.set(Calendar.SECOND, 0); if(hour1 > hour2){ if(s.getTimeInMillis() > date.getTime()){ if (hour1 > hour2) { if (s.getTimeInMillis() > date.getTime()) { s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) - 1); }else{ } else { e.set(Calendar.DAY_OF_YEAR, e.get(Calendar.DAY_OF_YEAR) + 1); } } if(date.getTime() >= s.getTimeInMillis() && date.getTime() < e.getTimeInMillis()){ if(num3.compareTo(distance) >= 0){//起步里程内 if (date.getTime() >= s.getTimeInMillis() && date.getTime() < e.getTimeInMillis()) { if (num3.compareTo(distance) >= 0) {//起步里程内 order.setStartDistance(distance);//起步里程 order.setStartPrice(num4);//起步价 }else{ } else { Double distance1 = distance;//原始里程 order.setStartDistance(num3);//起步里程 order.setStartPrice(num4);//起步价 @@ -318,7 +318,7 @@ order.setOverDrivePrice(multiply.doubleValue());//超出起步里程费 //计算长途费(超出长途起始公里,费用开始按照长途规则计算。) if(distance.compareTo(num7) > 0){ if (distance.compareTo(num7) > 0) { order.setStartDistance(0D);//起步里程 order.setStartPrice(0D);//起步价 order.setOverDriveDistance(0D);//超出起步里程 @@ -328,7 +328,7 @@ order.setLongDistancePrice(num9);//长途费 } //计算长途里程超出的部分 if(distance.compareTo(num8) > 0){ if (distance.compareTo(num8) > 0) { order.setOverLongDistance(new BigDecimal(distance1 - num8).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//超出长途里程 BigDecimal divide1 = new BigDecimal(distance - num8).divide(new BigDecimal(num10), 2, BigDecimal.ROUND_HALF_EVEN); @@ -352,7 +352,7 @@ Double num9 = extraCost.getDouble("num9");//恶劣天气最高收取金额 //等待费用 if(waitTime.compareTo(num1 * 60) >= 0){ if (waitTime.compareTo(num1 * 60) >= 0) { order.setWaitTime(num1 * 60);//等待时长 order.setWaitTimePrice(num2);//等待费用 @@ -364,15 +364,15 @@ //恶劣天气 systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 8)); if(null != systemConfig) { if (null != systemConfig) { JSONObject jsonObject1 = JSON.parseObject(systemConfig.getContent()); Integer num11 = jsonObject1.getInteger("num1");//开启恶劣天气计价 if(1 == num11){ if (1 == num11) { boolean badWeather = WeatherUtil.isBadWeather(city); if(badWeather){ if (badWeather) { order.setBadWeatherDistance(num5);//恶劣天气公里 order.setBadWeatherPrice(num6);//恶劣天气费 if(distance.compareTo(num7) > 0){ if (distance.compareTo(num7) > 0) { BigDecimal subtract = new BigDecimal(distance).subtract(new BigDecimal(num7)); BigDecimal multiply = subtract.multiply(new BigDecimal(num8)); order.setOverBadWeatherDistance(subtract.doubleValue());//恶劣天气超出公里 @@ -380,36 +380,39 @@ } double add = new BigDecimal(order.getOverBadWeatherPrice()).add(new BigDecimal(order.getBadWeatherPrice())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); if(num9.compareTo(add) < 0){//超出最高金额(重新调整金额) if(num9.compareTo(num6) < 0){//如果恶劣天气费大于最高金额 if (num9.compareTo(add) < 0) {//超出最高金额(重新调整金额) if (num9.compareTo(num6) < 0) {//如果恶劣天气费大于最高金额 order.setBadWeatherPrice(num9);//恶劣天气费 order.setOverBadWeatherPrice(0D);//恶劣天气超出公里费 }else{ } else { BigDecimal subtract = new BigDecimal(num9).subtract(new BigDecimal(add)); order.setOverBadWeatherPrice(subtract.doubleValue());//恶劣天气超出公里费 } } } } } //计算折扣 if(null != order.getUserId()){ //计算折扣 if (null != order.getUserId()) { } } //计算总金额 BigDecimal bigDecimal = new BigDecimal(order.getStartPrice() + order.getOverDrivePrice() + order.getLongDistancePrice() + order.getOverLongDistancePrice() + order.getWaitTimePrice() + order.getOutWaitTimePrice() + order.getBadWeatherPrice() + order.getOverBadWeatherPrice() - order.getDiscountAmount()).setScale(2, BigDecimal.ROUND_HALF_EVEN); //计算总金额 BigDecimal bigDecimal = new BigDecimal(order.getStartPrice() + order.getOverDrivePrice() + order.getLongDistancePrice() + order.getOverLongDistancePrice() + order.getWaitTimePrice() + order.getOutWaitTimePrice() + order.getBadWeatherPrice() + order.getOverBadWeatherPrice() - order.getDiscountAmount()).setScale(2, BigDecimal.ROUND_HALF_EVEN); if(type == 1){//预估价 order.setEstimatedPrice(bigDecimal.doubleValue()); } if(type == 2){//订单金额 order.setOrderMoney(bigDecimal.doubleValue()); if (type == 1) {//预估价 order.setEstimatedPrice(bigDecimal.doubleValue()); } if (type == 2) {//订单金额 order.setOrderMoney(bigDecimal.doubleValue()); } return order; } return order; } /** @@ -1147,7 +1150,7 @@ * @throws Exception */ @Override public ResultUtil transferOrder(Integer uid, Long orderId, String cause) throws Exception { public ResultUtil transferOrder(Integer uid, Long orderId, String cause, String phone) throws Exception { // 7.13改动 OrderTransfer orderTransfer = new OrderTransfer(); Order order = this.selectById(orderId); @@ -1190,7 +1193,7 @@ new Thread(new Runnable() { @Override public void run() { pushOrder(finalOrder); pushOrder(finalOrder.getId()); } }).start(); } management/guns-admin/guns-admin (1).iml
File was deleted management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderServiceImpl.java
@@ -114,6 +114,20 @@ model.addAttribute("routeRecord",tOrder.getRouteRecord());//行程录音 model.addAttribute("userPhone",tOrder.getUserPhone());//用户手机号 model.addAttribute("userName",tOrder.getUserName());//用户名称 if(null != tOrder.getActualMileage()){ model.addAttribute("actualMileage",new BigDecimal(tOrder.getActualMileage() / 1000).setScale(2, RoundingMode.HALF_EVEN).doubleValue());//用户名称 }else{ model.addAttribute("actualMileage", 0); } if(null != tOrder.getGetoffTime() && null != tOrder.getBoardingTime()){ long t = tOrder.getGetoffTime().getTime() - tOrder.getBoardingTime().getTime(); int ti = Long.valueOf(t / 1000).intValue(); Integer s = ti % 60; Integer m = ti / 60; model.addAttribute("time", (m < 10 ? ("0" + m) : m) + ":" + (s < 10 ? ("0" + s) : s));//用户名称 }else{ model.addAttribute("time", 0); } // 查询用户 TAppUser tAppUser = tAppUserMapper.selectById(tOrder.getUserId()); management/guns-admin/src/main/resources/application.yml
@@ -15,8 +15,8 @@ spring: profiles: # active: dev active: produce active: dev # active: produce mvc: static-path-pattern: /static/** view: @@ -50,10 +50,10 @@ spring: datasource: url: jdbc:mysql://127.0.0.1:3306/super_save_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.110.80:3306/super_save_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 username: root password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj # password: 123456 # password: f4OfRjqoN3jSiNGiUoiNsQdOBtCOKYRj password: 123456 db-name: super_save_driving #用来搜集数据库的所有表 filters: wall,mergeStat management/guns-admin/src/main/resources/redis.properties
@@ -2,19 +2,19 @@ # RedisÊý¾Ý¿âË÷Òý£¨Ä¬ÈÏΪ0£© spring.redis.database=0 ## Redis·þÎñÆ÷µØÖ· spring.redis.host=127.0.0.1 ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú spring.redis.port=16379 ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© spring.redis.password=cKsEeyffDXG5PzNg8CIbrWxFluXrCprZ # Redis·þÎñÆ÷µØÖ· ### Redis·þÎñÆ÷µØÖ· #spring.redis.host=127.0.0.1 ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú #spring.redis.port=6379 ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© #spring.redis.password=123456 ### Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú #spring.redis.port=16379 ### Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© #spring.redis.password=cKsEeyffDXG5PzNg8CIbrWxFluXrCprZ Redis·þÎñÆ÷µØÖ· spring.redis.host=127.0.0.1 # Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú spring.redis.port=6379 # Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© spring.redis.password=123456 # Á¬½Ó³Ø×î´óÁ¬½ÓÊý£¨Ê¹ÓøºÖµ±íʾûÓÐÏÞÖÆ£© spring.redis.jedis.pool.max-active=1024 management/guns-admin/src/main/webapp/WEB-INF/view/system/tOrder/tOrderDetail.html
@@ -179,10 +179,21 @@ </div> </div> @} <div class="row" style="margin-top: 30px;"> <div class="col-sm-4"> <h2 class="h3Class" style="font-weight: 700;">线路轨迹</h2> <hr/> <div class="initialLevel col-sm-12 control-label form-group" > <div style="background-color: gray;height: 35px;line-height: 35px"> <label style="color: #0C0C0C">线路轨迹</label> </div> </div> <hr/> <div class="initialLevel col-sm-12 control-label form-group" > <div class="initialLevel col-sm-3 control-label form-group" > <label class="control-label" >行驶里程:</label> <label>${actualMileage}KM</label> </div> <div class="initialLevel col-sm-3 control-label form-group" > <label class="control-label" >行驶时长:</label> <label>${time}</label> </div> </div> <div class="row">