| | |
| | | |
| | | // 是否推广订单 |
| | | Integer promotion = isPromotion(uid); |
| | | orderCrossCity.setPromotion(promotion); |
| | | if(promotion!=null){ |
| | | orderCrossCity.setPromotion(2); |
| | | Driver driver1 = driverService.selectById(promotion); |
| | | orderCrossCity.setPromotionUser(driver1.getName()); |
| | | orderCrossCity.setPromotionPhone(driver1.getPhone()); |
| | | orderCrossCity.setPromotionDriverId(promotion); |
| | | }else{ |
| | | orderCrossCity.setPromotion(1); |
| | | } |
| | | |
| | | this.insert(orderCrossCity); |
| | | |
| | |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | |
| | | private Integer isPromotion(Integer userId){ |
| | | UserInfo userInfo = userInfoService.selectById(userId); |
| | | if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ |
| | | String registAreaCode = userInfo.getRegistAreaCode(); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 3 + ", bizType) limit 1")); |
| | | TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("state",1).eq("districtCode", registAreaCode).le("startTime", new Date()).ge("endTime", new Date()).last("AND FIND_IN_SET(" + 3 + ", bizType) limit 1")); |
| | | if(tDriverPromotionActivity!=null){ |
| | | return 2; |
| | | return userInfo.getBindDriverId(); |
| | | } |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | /** |
| | | * 获取订单 |
| | |
| | | OrderCrossCity orderCrossCity = this.selectById(orderId); |
| | | if(null != orderCrossCity){ |
| | | //计算预计距离和剩余时间 |
| | | String value = (String) redisTemplate.opsForValue().get("dache_DRIVER" + String.valueOf(orderCrossCity.getDriverId())); |
| | | String value = (String) redisTemplate.opsForValue().get("dache:DRIVER" + String.valueOf(orderCrossCity.getDriverId())); |
| | | if (null == value || "".equals(value)) { |
| | | System.err.println("司机没有上传位置信息"); |
| | | |