| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | | import com.supersavedriving.driver.modular.system.dao.OrderMapper; |
| | | import com.supersavedriving.driver.modular.system.model.*; |
| | | import com.supersavedriving.driver.modular.system.service.*; |
| | | import com.supersavedriving.driver.modular.system.util.*; |
| | | import com.supersavedriving.driver.modular.system.util.GaoDe.MapUtil; |
| | | import com.supersavedriving.driver.modular.system.util.GaoDe.model.District; |
| | | import com.supersavedriving.driver.modular.system.util.juhe.WeatherUtil; |
| | | import com.supersavedriving.driver.modular.system.util.mongodb.model.Location; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | | import com.supersavedriving.driver.modular.system.util.*; |
| | | import com.supersavedriving.driver.modular.system.util.GaoDe.model.District; |
| | | import com.supersavedriving.driver.modular.system.util.juhe.WeatherUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | import com.supersavedriving.driver.modular.system.model.*; |
| | | import com.supersavedriving.driver.modular.system.service.*; |
| | | import com.supersavedriving.driver.modular.system.util.PushUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.AddOrderWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.HallOrderList; |
| | | import com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.geo.Circle; |
| | |
| | | |
| | | @Autowired |
| | | private ICancelOrderService cancelOrderService; |
| | | |
| | | @Autowired |
| | | private IAccountChangeDetailService accountChangeDetailService; |
| | | |
| | | @Autowired |
| | | private IRevenueService revenueService; |
| | |
| | | String city = ""; |
| | | District geocode = MapUtil.geocode(order.getStartLng(), order.getStartLat()); |
| | | if(null != geocode){ |
| | | WeatherCity weatherCity = weatherCityService.selectOne(new EntityWrapper<WeatherCity>().where(" '" + geocode.getProvince() + "' like district")); |
| | | WeatherCity weatherCity = weatherCityService.selectOne(new EntityWrapper<WeatherCity>().where(" '" + geocode.getDistrict() + "' like district")); |
| | | city = null != weatherCity ? weatherCity.getId().toString() : ""; |
| | | } |
| | | order = getOrderPrice(1, d, 0, order, city); |
| | | order.setHallOrder(0); |
| | | order.setState(null == order.getDriverId() ? 101 : 102); |
| | | order.setStatus(1); |
| | | order.setCreateTime(new Date()); |
| | |
| | | |
| | | //1 |
| | | //找到中心点 |
| | | GeoJsonPoint geoJsonPoint = new GeoJsonPoint(Double.valueOf(startLat), Double.valueOf(startLng)); |
| | | GeoJsonPoint geoJsonPoint = new GeoJsonPoint(Double.valueOf(startLng), Double.valueOf(startLat)); |
| | | Double num = num3 / 1000;//范围公里 |
| | | //构造半径 |
| | | Distance distanceR = new Distance(num, Metrics.KILOMETERS); |
| | |
| | | List<Location> locations = mongoTemplate.find(query, Location.class); |
| | | List<Integer> driverIds = locations.stream().map(Location::getDriverId).collect(Collectors.toList()); |
| | | Integer driver = null; |
| | | YouTuiDriver youTuiDriver1 = null; |
| | | if(driverIds.size() > 0){ |
| | | List<YouTuiDriver> youTuiDrivers = youTuiDriverService.selectList(new EntityWrapper<YouTuiDriver>().in("driverId", driverIds).last(" and now() < failureTime")); |
| | | List<YouTuiDriver> youTuiDrivers = youTuiDriverService.selectList(new EntityWrapper<YouTuiDriver>().in("driverId", driverIds) |
| | | .eq("state", 2).last(" and (surplusQuantity > 0 or now() < endTime) and now() < failureTime")); |
| | | Double d = null; |
| | | for (YouTuiDriver youTuiDriver : youTuiDrivers) { |
| | | String value = redisUtil.getValue("DRIVER" + youTuiDriver.getDriverId()); |
| | |
| | | if(d == null || d.compareTo(wgs84) > 0){ |
| | | d = wgs84; |
| | | driver = youTuiDriver.getDriverId(); |
| | | youTuiDriver1 = youTuiDriver; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(null != youTuiDriver1 && youTuiDriver1.getType() == 1){ |
| | | youTuiDriver1.setSurplusQuantity(youTuiDriver1.getSurplusQuantity() - 1); |
| | | youTuiDriverService.updateById(youTuiDriver1); |
| | | } |
| | | |
| | | //开始范围查找 |
| | | if(null == driver){ |
| | |
| | | pageNum = (pageNum - 1) * pageSize; |
| | | List<HallOrderList> hallOrderLists = this.baseMapper.queryOrderHall(pageNum, pageSize); |
| | | hallOrderLists.forEach(hallOrderList -> { |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(hallOrderList.getStartLng() + "," + hallOrderList.getStartLat(), hallOrderList.getEndLng() + "," + hallOrderList.getEndLat()); |
| | | Double wgs84 = distance.get("WGS84"); |
| | | hallOrderList.setCurrentDistance(wgs84); |
| | | hallOrderList.setCurrentDistance(0D); |
| | | if(ToolUtil.isNotEmpty(hallOrderList.getEndLng())){ |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(hallOrderList.getStartLng() + "," + hallOrderList.getStartLat(), hallOrderList.getEndLng() + "," + hallOrderList.getEndLat()); |
| | | Double wgs84 = distance.get("WGS84"); |
| | | hallOrderList.setCurrentDistance(wgs84); |
| | | } |
| | | }); |
| | | return hallOrderLists; |
| | | } |
| | |
| | | orderRefusal.setStartAddress(order.getStartAddress()); |
| | | orderRefusal.setOrderId(orderId); |
| | | orderRefusalService.insert(orderRefusal); |
| | | |
| | | Driver driver = driverService.selectById(order.getDriverId()); |
| | | //扣除积分 |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 4)); |
| | | if(null != systemConfig) { |
| | | //{"num1":"10:00","num2":"14:00","num3":10,"num4":10,"num5":10,"num6":10,"num7":10,"num8":10,"num9":5,"num10":5} |
| | | //拒绝订单扣除积分 |
| | | Integer num10 = JSON.parseObject(systemConfig.getContent()).getInteger("num10"); |
| | | if (num10 > 0) { |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); |
| | | accountChangeDetail.setUserType(2); |
| | | accountChangeDetail.setUserId(order.getDriverId()); |
| | | accountChangeDetail.setType(2); |
| | | accountChangeDetail.setOldData(driver.getIntegral().doubleValue()); |
| | | driver.setIntegral(driver.getIntegral() - num10); |
| | | accountChangeDetail.setNewData(driver.getIntegral().doubleValue()); |
| | | accountChangeDetail.setExplain("拒绝订单扣除积分"); |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | driverService.updateById(driver); |
| | | } |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | if(null == driverWork){ |
| | | return ResultUtil.error("请先上班"); |
| | | } |
| | | boolean lock = redisUtil.lock(5); |
| | | boolean lock = redisUtil.lock(); |
| | | if(!lock){ |
| | | int num1 = 1; |
| | | while (num1 <= 10){ |
| | | Thread.sleep(3000);//等待3秒 |
| | | lock = redisUtil.lock(5); |
| | | if(lock){ |
| | | break; |
| | | }else{ |
| | | num1++; |
| | | } |
| | | } |
| | | return ResultUtil.error("请重试"); |
| | | } |
| | | Order order = this.selectById(orderId); |
| | | Integer state = order.getState(); |
| | | Integer oldDriverId = order.getDriverId(); |
| | | if(state != 301){ |
| | | if(state == 301){ |
| | | redisUtil.unlock(); |
| | | return ResultUtil.error("订单已被取消"); |
| | | } |
| | |
| | | order.setOrderTakingTime(new Date()); |
| | | this.updateById(order); |
| | | redisUtil.unlock(); |
| | | |
| | | if(null != order.getUserId()){ |
| | | AppUser appUser = appUserService.selectById(order.getUserId()); |
| | | appUser.setCancelCount(0); |
| | | appUserService.updateById(appUser); |
| | | } |
| | | |
| | | driver.setServerStatus(2); |
| | | driverService.updateById(driver); |
| | |
| | | } |
| | | |
| | | //推动订单数据 |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | //发送系统消息 |
| | | systemMessageService.addSystemMessage(uid, 2, "接单成功", "您已成功接到用户订单,请尽快联系客户!"); |
| | | pushUtil.pushOrderStatus(order.getDriverId(), 2, order.getId(), order.getState()); |
| | | if(null != order.getUserId()){ |
| | | systemMessageService.addSystemMessage(order.getUserId(), 1, "接单成功", driver.getName() + "师傅已成功接到您的订单,请保持电话畅通!"); |
| | | pushUtil.pushOrderStatus(order.getUserId(), 1, order.getId(), order.getState()); |
| | | } |
| | | } |
| | | }).start(); |
| | | //发送系统消息 |
| | | systemMessageService.addSystemMessage(uid, 2, "接单成功", "您已成功接到用户订单,请尽快联系客户!"); |
| | | pushUtil.pushOrderStatus(order.getDriverId(), 2, order.getId(), order.getState()); |
| | | if(null != order.getUserId()){ |
| | | systemMessageService.addSystemMessage(order.getUserId(), 1, "接单成功", driver.getName() + "师傅已成功接到您的订单,请保持电话畅通!"); |
| | | pushUtil.pushOrderStatus(order.getUserId(), 1, order.getId(), order.getState()); |
| | | } |
| | | }catch (Exception e){ |
| | | redisUtil.unlock(); |
| | | e.printStackTrace(); |
| | |
| | | @Override |
| | | public OrderInfoWarpper queryOrderInfo(Integer uid, Long orderId) throws Exception { |
| | | OrderInfoWarpper orderInfoWarpper = this.baseMapper.queryOrderInfo(orderId); |
| | | AppUser appUser = appUserService.selectById(uid); |
| | | orderInfoWarpper.setBalance(appUser.getAccountBalance()); |
| | | orderInfoWarpper.setCurrentDistance(0D); |
| | | String value = redisUtil.getValue("DRIVER" + uid); |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(orderInfoWarpper.getStartLng() + "," + orderInfoWarpper.getStartLat(), value); |
| | | Double wgs84 = distance.get("WGS84"); |
| | | orderInfoWarpper.setCurrentDistance(wgs84); |
| | | orderInfoWarpper.setPickUpTime(0); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(orderInfoWarpper.getStartLng() + "," + orderInfoWarpper.getStartLat(), value); |
| | | Double wgs84 = distance.get("WGS84"); |
| | | orderInfoWarpper.setCurrentDistance(null == wgs84 ? 0d : wgs84); |
| | | Map<String, String> distance1 = MapUtil.getDistance(orderInfoWarpper.getStartLng() + "," + orderInfoWarpper.getStartLat(), value, 0); |
| | | orderInfoWarpper.setPickUpTime(Integer.valueOf(distance1.get("duration")) / 60); |
| | | } |
| | | return orderInfoWarpper; |
| | | } |
| | | |
| | |
| | | String city = ""; |
| | | District geocode = MapUtil.geocode(order.getEndLng(), order.getEndLat()); |
| | | if(null != geocode){ |
| | | WeatherCity weatherCity = weatherCityService.selectOne(new EntityWrapper<WeatherCity>().where(" '" + geocode.getProvince() + "' like district")); |
| | | WeatherCity weatherCity = weatherCityService.selectOne(new EntityWrapper<WeatherCity>().where(" '" + geocode.getDistrict() + "' like district")); |
| | | city = null != weatherCity ? weatherCity.getId().toString() : ""; |
| | | } |
| | | order = getOrderPrice(2, Double.valueOf(order.getActualMileage() / 1000), order.getWaitTime(), order, city); |
| | | |
| | | //修改司机状态 |
| | | //修改司机状态和积分 |
| | | Driver driver = driverService.selectById(order.getDriverId()); |
| | | driver.setServerStatus(1); |
| | | driverService.updateById(driver); |
| | | saveIntegral(order); |
| | | break; |
| | | case 401: |
| | | order.setStartWaitTime(new Date()); |
| | |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加订单积分奖励 |
| | | * @param order |
| | | * @throws Exception |
| | | */ |
| | | public void saveIntegral(Order order) throws Exception{ |
| | | Driver driver = driverService.selectById(order.getDriverId()); |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 4)); |
| | | if(null != systemConfig){ |
| | | //{"num1":"10:00","num2":"14:00","num3":10,"num4":10,"num5":10,"num6":10,"num7":10,"num8":10,"num9":5,"num10":5} |
| | | //完成订单奖励 |
| | | Integer num5 = JSON.parseObject(systemConfig.getContent()).getInteger("num5"); |
| | | if(num5 > 0){ |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); |
| | | accountChangeDetail.setUserType(2); |
| | | accountChangeDetail.setUserId(order.getDriverId()); |
| | | accountChangeDetail.setType(2); |
| | | accountChangeDetail.setOldData(driver.getIntegral().doubleValue()); |
| | | driver.setIntegral(driver.getIntegral() + num5); |
| | | accountChangeDetail.setNewData(driver.getIntegral().doubleValue()); |
| | | accountChangeDetail.setExplain("完成订单奖励"); |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | } |
| | | //恶劣天气完成订单奖励 |
| | | Integer num8 = JSON.parseObject(systemConfig.getContent()).getInteger("num8"); |
| | | if(num8 > 0){ |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); |
| | | accountChangeDetail.setUserType(2); |
| | | accountChangeDetail.setUserId(order.getDriverId()); |
| | | accountChangeDetail.setType(2); |
| | | accountChangeDetail.setOldData(driver.getIntegral().doubleValue()); |
| | | driver.setIntegral(driver.getIntegral() + num8); |
| | | accountChangeDetail.setNewData(driver.getIntegral().doubleValue()); |
| | | accountChangeDetail.setExplain("恶劣天气完成订单奖励"); |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | } |
| | | driverService.updateById(driver); |
| | | |
| | | if(null == order.getUserId()){ |
| | | return; |
| | | } |
| | | //推荐用户首单完成奖励 |
| | | Integer num4 = JSON.parseObject(systemConfig.getContent()).getInteger("num4"); |
| | | if(num4 > 0){ |
| | | List<Integer> state = Arrays.asList(105); |
| | | int count = this.selectCount(new EntityWrapper<Order>().eq("userId", order.getUserId()).eq("status", 1).in("state", state)); |
| | | if(count > 1){ |
| | | return; |
| | | } |
| | | AppUser appUser = appUserService.selectById(order.getUserId()); |
| | | if(appUser.getInviterType() == 1){ |
| | | return; |
| | | } |
| | | Driver driver1 = driverService.selectById(appUser.getInviterId()); |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); |
| | | accountChangeDetail.setUserType(2); |
| | | accountChangeDetail.setUserId(driver1.getId()); |
| | | accountChangeDetail.setType(2); |
| | | accountChangeDetail.setOldData(driver1.getIntegral().doubleValue()); |
| | | driver1.setIntegral(driver1.getIntegral() + num4); |
| | | accountChangeDetail.setNewData(driver1.getIntegral().doubleValue()); |
| | | accountChangeDetail.setExplain("推荐用户完成首单奖励"); |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | driverService.updateById(driver1); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | String city = ""; |
| | | District geocode = MapUtil.geocode(order.getStartLng(), order.getStartLat()); |
| | | if(null != geocode){ |
| | | WeatherCity weatherCity = weatherCityService.selectOne(new EntityWrapper<WeatherCity>().where(" '" + geocode.getProvince() + "' like district")); |
| | | WeatherCity weatherCity = weatherCityService.selectOne(new EntityWrapper<WeatherCity>().where(" '" + geocode.getDistrict() + "' like district")); |
| | | city = null != weatherCity ? weatherCity.getId().toString() : ""; |
| | | } |
| | | order = getOrderPrice(1, d, 0, order, city); |
| | |
| | | public void saveRevenue(Order order){ |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取司机的订单列表 |
| | | * @param driverId |
| | | * @param state |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<DriverOrderListWarpper> queryDriverOrderList(Integer driverId, Integer state, Integer pageNum, Integer pageSize) throws Exception { |
| | | pageNum = (pageNum - 1) * pageSize; |
| | | return this.baseMapper.queryDriverOrderList(driverId, state, pageNum, pageSize); |
| | | } |
| | | |
| | | /** |
| | | * 司机邀请列表 |
| | | * @param driverId |
| | | * @param time |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<InviteListWarpper> queryInviteList(Integer driverId, String time, Integer pageNum, Integer pageSize) throws Exception { |
| | | pageNum = (pageNum - 1) * pageSize; |
| | | return this.baseMapper.queryInviteList(driverId, time, pageNum, pageSize); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取业绩汇总数据 |
| | | * @param driverId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public PerformanceSummaryWarpper queryPerformanceSummary(Integer driverId, Integer type, String time, Integer dayType) throws Exception { |
| | | Driver driver = driverService.selectById(driverId); |
| | | PerformanceSummaryWarpper performanceSummaryWarpper = new PerformanceSummaryWarpper(); |
| | | BeanUtils.copyProperties(driver, performanceSummaryWarpper); |
| | | Double amount = revenueService.queryTotalAmount(driverId); |
| | | performanceSummaryWarpper.setGrossIncome(amount); |
| | | List<Integer> state = Arrays.asList(107, 108, 109); |
| | | int count = this.selectCount(new EntityWrapper<Order>().eq("driverId", driverId).in("state", state).eq("status", 1)); |
| | | performanceSummaryWarpper.setTotalOrder(count); |
| | | List<PerformanceRankingWarpper> list = new ArrayList<>(); |
| | | int position = 0; |
| | | Double d = 0D; |
| | | List<PerformanceRankingWarpper> performanceRankingWarppers = null; |
| | | if(type == 1){//订单量 |
| | | performanceRankingWarppers = this.baseMapper.queryDriverRank(time, dayType); |
| | | } |
| | | if(type == 2){//佣金 |
| | | performanceRankingWarppers = revenueService.queryDriverRank(2, time, dayType); |
| | | } |
| | | if(type == 3){//收入 |
| | | performanceRankingWarppers = revenueService.queryDriverRank(null, time, dayType); |
| | | } |
| | | for (int i = 0; i < performanceRankingWarppers.size(); i++) { |
| | | PerformanceRankingWarpper performanceRankingWarpper = performanceRankingWarppers.get(i); |
| | | Double amountOfData = performanceRankingWarpper.getAmountOfData(); |
| | | if(amountOfData.compareTo(d) != 0){ |
| | | position++; |
| | | d = amountOfData; |
| | | } |
| | | if(position <= 10){ |
| | | list.add(performanceRankingWarpper); |
| | | } |
| | | if(performanceRankingWarpper.getDriverId().compareTo(driverId) == 0){ |
| | | break; |
| | | } |
| | | } |
| | | performanceSummaryWarpper.setPosition(position); |
| | | performanceSummaryWarpper.setList(list); |
| | | return performanceSummaryWarpper; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取我的业绩 |
| | | * @param driverId |
| | | * @param time |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<MyAchievementWarpper> queryMyAchievement(Integer driverId, String time) throws Exception { |
| | | List<MyAchievementWarpper> list = new ArrayList<>(); |
| | | time = time.replaceAll("-", "年") + "月"; |
| | | //订单量 |
| | | List<PerformanceRankingWarpper> performanceRankingWarppers = performanceRankingWarppers = this.baseMapper.queryDriverRank(time, 2); |
| | | int position = 0; |
| | | Double d = 0D; |
| | | for (int i = 0; i < performanceRankingWarppers.size(); i++) { |
| | | PerformanceRankingWarpper performanceRankingWarpper = performanceRankingWarppers.get(i); |
| | | Double amountOfData = performanceRankingWarpper.getAmountOfData(); |
| | | if(amountOfData.compareTo(d) != 0){ |
| | | position++; |
| | | d = amountOfData; |
| | | } |
| | | if(performanceRankingWarpper.getDriverId().compareTo(driverId) == 0){ |
| | | break; |
| | | } |
| | | } |
| | | MyAchievementWarpper myAchievementWarpper = new MyAchievementWarpper(); |
| | | myAchievementWarpper.setType("订单"); |
| | | myAchievementWarpper.setTime(time); |
| | | myAchievementWarpper.setRank(position); |
| | | myAchievementWarpper.setAmountOfData(d); |
| | | list.add(myAchievementWarpper); |
| | | |
| | | //收入 |
| | | performanceRankingWarppers = revenueService.queryDriverRank(null, time, 2); |
| | | position = 0; |
| | | d = 0D; |
| | | for (int i = 0; i < performanceRankingWarppers.size(); i++) { |
| | | PerformanceRankingWarpper performanceRankingWarpper = performanceRankingWarppers.get(i); |
| | | Double amountOfData = performanceRankingWarpper.getAmountOfData(); |
| | | if(amountOfData.compareTo(d) != 0){ |
| | | position++; |
| | | d = amountOfData; |
| | | } |
| | | if(performanceRankingWarpper.getDriverId().compareTo(driverId) == 0){ |
| | | break; |
| | | } |
| | | } |
| | | myAchievementWarpper = new MyAchievementWarpper(); |
| | | myAchievementWarpper.setType("收入"); |
| | | myAchievementWarpper.setTime(time); |
| | | myAchievementWarpper.setRank(position); |
| | | myAchievementWarpper.setAmountOfData(d); |
| | | list.add(myAchievementWarpper); |
| | | |
| | | //佣金 |
| | | performanceRankingWarppers = revenueService.queryDriverRank(2, time, 2); |
| | | position = 0; |
| | | d = 0D; |
| | | for (int i = 0; i < performanceRankingWarppers.size(); i++) { |
| | | PerformanceRankingWarpper performanceRankingWarpper = performanceRankingWarppers.get(i); |
| | | Double amountOfData = performanceRankingWarpper.getAmountOfData(); |
| | | if(amountOfData.compareTo(d) != 0){ |
| | | position++; |
| | | d = amountOfData; |
| | | } |
| | | if(performanceRankingWarpper.getDriverId().compareTo(driverId) == 0){ |
| | | break; |
| | | } |
| | | } |
| | | myAchievementWarpper = new MyAchievementWarpper(); |
| | | myAchievementWarpper.setType("佣金"); |
| | | myAchievementWarpper.setTime(time); |
| | | myAchievementWarpper.setRank(position); |
| | | myAchievementWarpper.setAmountOfData(d); |
| | | list.add(myAchievementWarpper); |
| | | return list; |
| | | } |
| | | } |