| | |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.*; |
| | | import com.stylefeng.guns.modular.system.util.itextpdf.HtmlToPdfUtils; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryHomeData(Integer uid, Integer language) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | driver.setLanguage(language); |
| | | this.updateById(driver); |
| | | Map<String, Object> map = driverMapper.queryHomeData(uid); |
| | | int size = this.queryMyActivity(uid, new Date(), language).size(); |
| | | map.put("activity", size); |
| | |
| | | public ResultUtil work(Integer uid, String type, Integer language) throws Exception { |
| | | DriverWork driverWork = driverWorkMapper.queryNewWork(uid, null, 1); |
| | | Driver driver = this.selectById(uid); |
| | | driver.setLanguage(language); |
| | | Car car = carService.selectById(driver.getCarId()); |
| | | String audioUrl = ""; |
| | | LoginWarpper loginWarpper = new LoginWarpper(); |
| | | if(null != driverWork){//作下班操作 |
| | | //检测是否有未完成的订单 |
| | | List<Map<String, Object>> list = orderService.queryOrderList(1, 1, 10, uid, language); |
| | |
| | | } |
| | | switch (language){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AfterWork-CN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AfterWork-EN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AfterWork-FR.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AfterWork-FR.mp3"; |
| | | break; |
| | | } |
| | | }else{ |
| | | LoginWarpper loginWarpper = new LoginWarpper(); |
| | | if(driver.getCompanyId()==null){ |
| | | loginWarpper.setJumpCode("100000"); |
| | | return ResultUtil.success(loginWarpper); |
| | |
| | | |
| | | switch (language){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AtWork-CN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AtWork-EN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/AtWork-FR.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/AtWork-FR.mp3"; |
| | | break; |
| | | } |
| | | } |
| | | this.updateById(driver); |
| | | return ResultUtil.success(audioUrl); |
| | | loginWarpper.setAudioUrl(audioUrl); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | | |
| | |
| | | public Double getThisWeekMoney(Integer driverId) { |
| | | return this.baseMapper.getThisWeekMoney(driverId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取给定车型且空闲的司机 |
| | | * @param type |
| | | * @param serverCarModelId |
| | | * @param lon |
| | | * @param lat |
| | | * @param distance |
| | | * @param companyId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | List<Driver> drivers = driverMapper.queryIdleDriver_(type, serverCarModelId, companyId); |
| | | List<Driver> list = new ArrayList<>(); |
| | | for(Driver driver : drivers){ |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(lat, lon, Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0])); |
| | | if(null != distancematrix){ |
| | | if(distancematrix.getDistance() < (distance * 1000)){ |
| | | list.add(driver); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | } |