| | |
| | | orderLogistics.setTravelTime(null == travelTime ? new Date() : travelTime); |
| | | orderLogistics.setOrderSource(orderSource); |
| | | orderLogistics.setIsDelete(1); |
| | | orderLogistics.setTripId(tripId); |
| | | orderLogistics.setIsover(0); |
| | | this.insert(orderLogistics); |
| | | |
| | | //添加消息 |
| | |
| | | orderLogistics.setIsReassign(1); |
| | | orderLogistics.setIsDelete(1); |
| | | orderLogistics.setTripId(tripId); |
| | | orderLogistics.setIsover(0); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | Long distance1 = distancematrix1.getDistance(); |
| | | orderLogistics.setEstimatedMileage(new BigDecimal(distance1).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | |
| | | dr.getCompanyId() != null && dr.getCompanyId() != 0 ? dr.getCompanyId() : 1)); |
| | | orderLogistics.setState(2); |
| | | orderLogistics.setCarId(dr.getCarId()); |
| | | CarService query1 = carServiceMapper.query(1, dr.getCarId()); |
| | | CarService query1 = carServiceMapper.query(4, dr.getCarId()); |
| | | orderLogistics.setServerCarModelId(query1.getServerCarModelId()); |
| | | orderLogistics.setSnatchOrderTime(new Date()); |
| | | |
| | | String value = redisUtil.getValue("DRIVER" + driver1.getId()); |
| | | if(ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderLogistics.setEstimateArriveTime(new Date(timeOut)); |
| | | orderLogistics.setEstimateArriveMileage(distancematrix.getDistance()); |
| | | } |
| | | |
| | | dr.setState(3); |
| | | driverService.updateById(dr); |
| | |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, 2, 0, finalAudioUrl); |
| | | } |
| | | }).start(); |
| | | |
| | | } |
| | | } |
| | | } |