| | |
| | | private SystemPriceMapper systemPriceMapper; |
| | | |
| | | @Autowired |
| | | private ISystemPriceCityService systemPriceCityService; |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private IOpenCityService openCityService; |
| | | |
| | | |
| | | /** |
| | | * 获取司机端首页订单列表 |
| | | * |
| | |
| | | |
| | | // 是否推广订单 |
| | | Integer promotion = isPromotion(orderPrivateCar.getUserId()); |
| | | if(promotion!=null){ |
| | | if(null != promotion){ |
| | | orderPrivateCar.setPromotion(2); |
| | | Driver driver1 = driverService.selectById(promotion); |
| | | orderPrivateCar.setPromotionUser(driver1.getName()); |
| | | orderPrivateCar.setPromotionPhone(driver1.getPhone()); |
| | | orderPrivateCar.setPromotionDriverId(promotion); |
| | | }else{ |
| | | orderPrivateCar.setPromotion(1); |
| | | } |
| | | |
| | | orderPrivateCar.setPromotion(promotion); |
| | | |
| | | if(null == oldDriverId){ |
| | | UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId()); |
| | |
| | | |
| | | private Integer isPromotion(Integer userId){ |
| | | UserInfo userInfo = userInfoMapper.selectById(userId); |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()>System.currentTimeMillis()){ |
| | | String registAreaCode = userInfo.getRegistAreaCode(); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("state",1).eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 1 + ", bizType) limit 1")); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("state",1).eq("districtCode", registAreaCode).last(" and now() between startTime and endTime AND FIND_IN_SET(" + 1 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | return 2; |
| | | return userInfo.getBindDriverId(); |
| | | } |
| | | } |
| | | return null; |
| | |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER" + String.valueOf(orderPrivateCar.getDriverId())); |
| | | String value = (String) redisTemplate.opsForValue().get("dache:DRIVER" + String.valueOf(orderPrivateCar.getDriverId())); |
| | | order = this.baseMapper.queryOrderInfo(orderId,5,value.split(",")[0],value.split(",")[1]); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER" + String.valueOf(orderPrivateCar.getDriverId())); |
| | | String value = (String) redisTemplate.opsForValue().get("dache:DRIVER" + String.valueOf(orderPrivateCar.getDriverId())); |
| | | order = this.baseMapper.queryOrderInfo(orderPrivateCar.getPid(),5,value.split(",")[0],value.split(",")[1]); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | |
| | | orders.addAll(order); |
| | | } |
| | | OrderPrivateCar orderPrivateCar = this.baseMapper.selectById(orderId); |
| | | String value = redisUtil.getValue("DRIVER" + String.valueOf(orderPrivateCar.getDriverId())); |
| | | String value = redisUtil.getValue("dache:DRIVER" + String.valueOf(orderPrivateCar.getDriverId())); |
| | | order = this.baseMapper.queryOrderInfo(orderId,5,value.split(",")[0],value.split(",")[1]); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | |
| | | map.put("emergencyCall", "110"); |
| | | map.put("orders", JSON.toJSONString(orders)); |
| | | return map;*/ |
| | | Map<String,Object> map = orderPrivateCarMapper.queryOrderInfo2(orderId); |
| | | OrderPrivateCar orderPrivateCar1 = orderPrivateCarMapper.selectById(orderId); |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar1.getStartLon().toString(), orderPrivateCar1.getStartLat().toString()); |
| | | Map<String,Object> map = orderPrivateCarMapper.queryOrderInfo2(orderId, openCity.getId()); |
| | | OrderPrivateCar orderPrivateCar = this.baseMapper.selectById(orderId); |
| | | Integer canOperation=1; |
| | | if(orderPrivateCar.getState()<5){ |
| | |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderMoney", new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2,BigDecimal.ROUND_DOWN));//订单金额 |
| | | map.put("orderMoney", orderPrivateCar.getOrderMoney()==null?0:new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2,BigDecimal.ROUND_DOWN));//订单金额 |
| | | map.put("startMileage", orderPrivateCar.getStartMileage());//起步价 |
| | | map.put("startMoney", orderPrivateCar.getStartMoney());//起步价 |
| | | map.put("mileageKilometers", orderPrivateCar.getMileageKilometers());//里程费 |
| | |
| | | * @throws Exception |
| | | */ |
| | | public OrderPrivateCar setMoney(OrderPrivateCar orderPrivateCar, Double parkingFee, Double crossingFee) throws Exception { |
| | | Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId()); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | SystemPriceCity systemPriceCity = systemPriceCityService.queryOne(geocode.get("provinceCode"), geocode.get("cityCode"), geocode.get("districtCode")); |
| | | Map<String, Object> query1 = systemPriceMapper.query(systemPriceCity.getId(), 1, orderPrivateCar.getServerCarModelId()); |
| | | //开始根据不同的方式计算金额 |
| | | double amount = 0; |
| | | JSONObject jsonObject = JSON.parseObject(String.valueOf(query1.get("content"))); |