| | |
| | | <dependency> |
| | | <groupId>com.google.maps</groupId> |
| | | <artifactId>google-maps-services</artifactId> |
| | | <version>2.0.0</version> |
| | | <version>2.2.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.slf4j</groupId> |
| | | <artifactId>slf4j-simple</artifactId> |
| | | <version>1.7.25</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.google.appengine</groupId> |
| | | <artifactId>appengine-api-1.0-sdk</artifactId> |
| | | <version>2.0.29</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.jsoup</groupId> |
| | |
| | | String contactPerson, String contactPhone, String placeLonLat, Integer uid, Integer language) throws Exception { |
| | | OrderCharteredCar orderCharteredCar = new OrderCharteredCar(); |
| | | orderCharteredCar.setUserId(uid); |
| | | Company query = companyCityService.query1(placeLonLat.split(",")[0], placeLonLat.split(",")[1]); |
| | | Company query = companyCityService.query1(uid, placeLonLat.split(",")[0], placeLonLat.split(",")[1]); |
| | | if(null == query){ |
| | | return ResultUtil.error(language == 1 ? "该地点暂无企业服务" : language == 2 ? "No service yet at this area" : "Pas encore de service dans cette zone"); |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.stylefeng.guns.modular.system.service.IAdvertisementService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.AdvertisementWarpper; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private IAdvertisementService advertisementService; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(value = "当前定位纬度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "当前定位经度", name = "lnt", required = true, dataType = "double") |
| | | }) |
| | | public ResultUtil<List<AdvertisementWarpper>> queryAdvertisement(Double lat, Double lnt, Integer type){ |
| | | public ResultUtil<List<AdvertisementWarpper>> queryAdvertisement(Double lat, Double lnt, Integer type, HttpServletRequest request){ |
| | | try { |
| | | List<AdvertisementWarpper> advertisementWarpper = advertisementService.queryAdvertisement(lat, lnt, type); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | List<AdvertisementWarpper> advertisementWarpper = advertisementService.queryAdvertisement(uid, lat, lnt, type); |
| | | return ResultUtil.success(advertisementWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "经度", name = "lnt", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"), |
| | | }) |
| | | public ResultUtil<List<BaseWarpper>> queryBusiness(Double lat, Double lnt, Integer language){ |
| | | public ResultUtil<List<BaseWarpper>> queryBusiness(Double lat, Double lnt, Integer language, HttpServletRequest request){ |
| | | try { |
| | | List<BaseWarpper> list = openCityBusinessService.queryBusiness(lat, lnt, language); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | List<BaseWarpper> list = openCityBusinessService.queryBusiness(uid, lat, lnt, language); |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "纬度", name = "lat", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "经度", name = "lnt", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil openCity(Double lat, Double lnt, Integer language){ |
| | | public ResultUtil openCity(Double lat, Double lnt, Integer language, HttpServletRequest request){ |
| | | try { |
| | | City city = openCityService.openCity(lat, lnt, language); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | City city = openCityService.openCity(uid, lat, lnt, language); |
| | | if(null == city){ |
| | | return ResultUtil.error(""); |
| | | } |
| | |
| | | |
| | | @Resource |
| | | private UserActivityDiscount1Mapper userActivityDiscount1Mapper; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取正在进行中的订单 |
| | |
| | | @ApiImplicitParam(value = "终点经度", name = "elon", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "终点纬度", name = "elat", required = true, dataType = "double") |
| | | }) |
| | | public ResultUtil<BaseWarpper> queryExpectedTime(Double slon, Double slat, Double elon, Double elat){ |
| | | public ResultUtil<BaseWarpper> queryExpectedTime(Double slon, Double slat, Double elon, Double elat, HttpServletRequest request){ |
| | | try { |
| | | return orderService.queryExpectedTime(slon, slat, elon, elat); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | return orderService.queryExpectedTime(uid, slon, slat, elon, elat); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/getNewTripId") |
| | | @ApiOperation(value = "获取google预定tripid【2.0】", tags = {"用户端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<String> getNewTripId(HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | String randomCode = UUIDUtil.getRandomCode(); |
| | | redisUtil.setStrValue("trip" + uid, randomCode); |
| | | return ResultUtil.success(randomCode); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.Phone; |
| | | import com.stylefeng.guns.modular.system.service.IPhoneService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IPhoneService phoneService; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取系统所有电话 |
| | |
| | | @ApiImplicitParam(value = "定位经度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "定位维度", name = "lnt", required = true, dataType = "double") |
| | | }) |
| | | public ResultUtil queryPhones(Double lat, Double lnt){ |
| | | public ResultUtil queryPhones(Double lat, Double lnt, HttpServletRequest request){ |
| | | try { |
| | | List<Phone> phones = phoneService.queryPhones(lat, lnt); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | List<Phone> phones = phoneService.queryPhones(uid, lat, lnt); |
| | | return ResultUtil.success(phones); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "定位维度", name = "lnt", required = true, dataType = "double"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryCustomerPhone(Double lat, Double lnt){ |
| | | public ResultUtil queryCustomerPhone(Double lat, Double lnt, HttpServletRequest request){ |
| | | try { |
| | | Map<String, Object> map = phoneService.queryCustomerPhone(lat, lnt); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | Map<String, Object> map = phoneService.queryCustomerPhone(uid, lat, lnt); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | |
| | | |
| | | import com.stylefeng.guns.modular.system.service.IServerCarModelService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.ServerCarModelWarpper; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IServerCarModelService serverCarModelService; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "type", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type, Integer language){ |
| | | public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type, Integer language, HttpServletRequest request){ |
| | | try { |
| | | return serverCarModelService.queryServerCarModel(startLonLat, endLonLat, type, language); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | return serverCarModelService.queryServerCarModel(uid, startLonLat, endLonLat, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | //定义用户所属公司 |
| | | OrderTaxi orderTaxi = new OrderTaxi(); |
| | | UserInfo userInfo1 = userInfoService.selectById(uid); |
| | | Company query = companyCityService.query1(startLon, startLat); |
| | | Company query = companyCityService.query1(uid, startLon, startLat); |
| | | if(null == query){ |
| | | return ResultUtil.error("出发点暂未开通"); |
| | | } |
| | |
| | | if(orderType == 1){//专车 |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarMapper.selectById(orderId); |
| | | OrderPrivateCarServiceImpl.orderIds.add(orderPrivateCar.getId());//添加记录,防止调用接口重复提醒无人接单 |
| | | Company query = companyCityService.query1(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | Company query = companyCityService.query1(orderPrivateCar.getUserId(), String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | //订单被抢后的处理 |
| | |
| | | //开始进行推送的处理 |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(orderPrivateCar.getUserId(), 1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | if(list.size() > 0){ |
| | | double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数 |
| | | int lastIndex = Double.valueOf(list.size() * driverProportion).intValue();//计算占比转成整数(下标截取) |
| | |
| | | if(orderType == 2){//出租车 |
| | | OrderTaxi orderTaxi = orderTaxiMapper.selectById(orderId); |
| | | OrderTaxiServiceImpl.orderIds.add(orderTaxi.getId());//添加记录,防止调用接口重复提醒无人接单 |
| | | Company query = companyCityService.query1(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | Company query = companyCityService.query1(orderTaxi.getUserId(), String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | //处理订单被抢 |
| | |
| | | @ApiImplicitParam(value = "终点经纬度(103.23265,30.2312)", name = "endLonLat", required = true, paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(value = "终点详细地址", name = "endAddress", required = true, paramType = "query", dataType = "string") |
| | | }) |
| | | public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language){ |
| | | public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language, HttpServletRequest request){ |
| | | try { |
| | | return orderLogisticsService.queryPayMoney(number, type, startLonLat, endLonLat, endAddress, language); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | return orderLogisticsService.queryPayMoney(uid, number, type, startLonLat, endLonLat, endAddress, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OrderTimeInfo> queryTimeInfo(Integer orderId, Integer language){ |
| | | public ResultUtil<OrderTimeInfo> queryTimeInfo(Integer orderId, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | OrderTimeInfo orderTimeInfo = new OrderTimeInfo(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | usedTime = language == 1 ? h + "小时" + m + "分钟" : language == 2 ? h + "-hour" + m + "-minute(s)" : h + "-hour" + m + "-minute"; |
| | | } |
| | | orderTimeInfo.setUsedTime(usedTime); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | if(null != orderLogistics.getEndServiceTime()){ |
| | | orderTimeInfo.setEndServiceTime(DateUtil.conversionFormat(language, sdf.format(orderLogistics.getEndServiceTime()))); |
| | | }else{ |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | Long duration = distancematrix.getDuration(); |
| | | orderTimeInfo.setEndServiceTime(DateUtil.conversionFormat(language, sdf.format(new Date(System.currentTimeMillis() + duration * 1000)))); |
| | | } |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | Long distance = distancematrix.getDistance(); |
| | | orderTimeInfo.setAllMileage(Double.valueOf(distance / 1000)); |
| | | orderTimeInfo.setMileage(orderLogistics.getMileage() / 1000); |
| | | String value = redisUtil.getValue("DRIVER" + orderLogistics.getDriverId()); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | String[] split = value.split(","); |
| | | distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | //分钟 |
| | | Long duration = distancematrix.getDuration() / 60; |
| | | h = Double.valueOf(duration / 60).intValue(); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language) throws Exception; |
| | | ResultUtil queryPayMoney(Integer uid, Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | String[] split = endLonLat.split(","); |
| | | Double lng = Double.valueOf(split[0]); |
| | | Double lat = Double.valueOf(split[1]); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString(), language); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(uid, type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString(), language); |
| | | if(price.getCode() != 200){ |
| | | return price; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language) throws Exception{ |
| | | public ResultUtil queryPayMoney(Integer uid, Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language) throws Exception{ |
| | | String[] split = endLonLat.split(","); |
| | | Double lng = Double.valueOf(split[0]); |
| | | Double lat = Double.valueOf(split[1]); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString(), language); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(uid, type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString(), language); |
| | | if(price.getCode() == 200 && type == 5){ |
| | | Map<String, Object> data = price.getData(); |
| | | Double ordinary = Double.valueOf(data.get("ordinary").toString()); |
| | |
| | | endAddress = endAddress.replaceAll("& #40;", "("); |
| | | endAddress = endAddress.replaceAll("& #41;", ")"); |
| | | OrderLogistics orderLogistics = new OrderLogistics(); |
| | | Company query = companyCityService.query1(placementLon, placementLat); |
| | | Company query = companyCityService.query1(uid, placementLon, placementLat); |
| | | if(null == query){ |
| | | return ResultUtil.error(language == 1 ? "该地点暂无企业服务" : language == 2 ? "No service yet at this area" : "Pas encore de service dans cette zone"); |
| | | } |
| | |
| | | orderLogistics.setRemark(remark); |
| | | orderLogistics.setPlacementLon(Double.valueOf(placementLon)); |
| | | orderLogistics.setPlacementLat(Double.valueOf(placementLat)); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon)); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon), tripId); |
| | | if(null == reverseGeocode){ |
| | | return ResultUtil.error(language == 1 ? "解析地址出错" : language == 2 ? "Address resolution error" : "Erreur de résolution d’adresse"); |
| | | } |
| | |
| | | orderLogistics.setMileage(0D); |
| | | orderLogistics.setIsReassign(1); |
| | | orderLogistics.setReassignNotice(0); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(type, String.valueOf(startLon), String.valueOf(startLat), lng.toString(), lat.toString(), language); |
| | | ResultUtil<Map<String, Object>> price = this.getPrice1(uid, type, String.valueOf(startLon), String.valueOf(startLat), lng.toString(), lat.toString(), language); |
| | | if(price.getCode() != 200){ |
| | | return price; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public ResultUtil<Map<String, Double>> getPrice(Integer type, String startLon, String startLat, String endLon, String endLat) throws Exception{ |
| | | Company query = companyCityService.query1(startLon, startLat); |
| | | public ResultUtil<Map<String, Double>> getPrice(Integer uid, Integer type, String startLon, String startLat, String endLon, String endLat) throws Exception{ |
| | | Company query = companyCityService.query1(uid, startLon, startLat); |
| | | if(null == query){ |
| | | return ResultUtil.error("预约取货点暂无企业服务"); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | public ResultUtil<Map<String, Object>> getPrice1(Integer type, String startLon, String startLat, String endLon, String endLat, Integer language) throws Exception{ |
| | | Company query = companyCityService.query1(startLon, startLat); |
| | | public ResultUtil<Map<String, Object>> getPrice1(Integer uid, Integer type, String startLon, String startLat, String endLon, String endLat, Integer language) throws Exception{ |
| | | Company query = companyCityService.query1(uid, startLon, startLat); |
| | | if(null == query){ |
| | | return ResultUtil.error(language == 1 ? "预约取货点暂无企业服务" : language == 2 ? |
| | | "No service yet at the reserved pickup point." : "Les points de ramassage prévus ne sont pas disponibles pour le moment."); |
| | |
| | | Integer activityId = null; |
| | | if(type == 4){//同城 |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(startLat), Double.valueOf(startLon), Double.valueOf(endLat), Double.valueOf(endLon)); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(startLat), Double.valueOf(startLon), Double.valueOf(endLat), Double.valueOf(endLon), tripId); |
| | | if(null == distancematrix){ |
| | | return ResultUtil.error(language == 1 ? "计算距离出错" : language == 2 ? "Errors in computing distance" : "Erreurs dans le calcul de la distance"); |
| | | } |
| | |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query1(String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司 |
| | | Company query = companyCityService.query1(orderLogistics.getUserId(), String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//用专车的推单配置 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(orderLogistics.getType(), orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(orderLogistics.getUserId(), orderLogistics.getType(), orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | System.err.println("【" + orderLogistics.getId() + "】空闲司机:" + JSON.toJSONString(list)); |
| | | if(list.size() > 0){ |
| | | double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数 |
| | |
| | | orderLogistics.setUrgent(1); |
| | | orderLogistics.setCargoNumber(1); |
| | | |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon)); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon), tripId); |
| | | orderLogistics.setPlacementAddress(reverseGeocode.getAddress()); |
| | | orderLogistics.setStartLon(Double.valueOf(startLon)); |
| | | orderLogistics.setStartLat(Double.valueOf(startLat)); |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver.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])); |
| | | 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.setIsReassign(1); |
| | | orderLogistics.setIsDelete(1); |
| | | orderLogistics.setTripId(UUIDUtil.getRandomCode()); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | orderLogistics.setTripId(tripId); |
| | | 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()); |
| | | this.insert(orderLogistics); |
| | |
| | | |
| | | // TODO: 2021/5/11 修改,根据后台设定的派单范围查询范围内有无司机,将单子指派给距离最近的司机(距离相同随机取),范围内没有司机再进行推单流程 |
| | | if(orderLogistics.getState() == 1){ |
| | | Company query = companyCityService.query1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | Company query = companyCityService.query1(uid, orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | if(null == query){ |
| | | return ResultUtil.error(language == 1 ? "起点暂未企业提供服务" : language == 2 ? "Starting point no enterprise to provide services" : "Point de départ pas encore disponible pour les entreprises"); |
| | | } |
| | | AssignOrder assignOrder = assignOrderService.selectOne(new EntityWrapper<AssignOrder>().eq("companyId", query.getId()).eq("type", 1)); |
| | | if(null != assignOrder && assignOrder.getPeople() > 0){//配置了指派规则才处理 |
| | | //获取空闲司机 |
| | | List<Driver> drivers = driverService.queryIdleDriver(4, orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), assignOrder.getDistance(), null);//获取范围内空闲司机 |
| | | List<Driver> drivers = driverService.queryIdleDriver(uid, 4, orderLogistics.getServerCarModelId(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), assignOrder.getDistance(), null);//获取范围内空闲司机 |
| | | if(drivers.size() > 0){//有司机,直接指派给司机 |
| | | Driver dr = null; |
| | | if(drivers.size() > 1){ |
| | |
| | | String value = redisUtil.getValue("DRIVER" + drivers.get(j).getId()); |
| | | if(null != value){ |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | Long distance = distancematrix.getDistance(); |
| | | if((0 == m && null == driver) || (distance < m)){ |
| | | driver = drivers.get(j); |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(null != value){ |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | Long d = distancematrix.getDistance(); |
| | | if((0 == m && null == dr) || (d.intValue() < m.intValue())){ |
| | | dr = driver; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | String lnt = "0"; |
| | | String lat = "0"; |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | lnt = value.split(",")[0]; |
| | | lat = value.split(",")[1]; |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt)); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt), tripId); |
| | | |
| | | if(null == distancematrix){ |
| | | System.err.println("查询距离出错了"); |
| | |
| | | orderServerWarpper.setLaveTime("0"); |
| | | } |
| | | if(orderLogistics.getState() == 5 || orderLogistics.getState() == 6){//服务中 |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | if(null == distancematrix){ |
| | | System.err.println("查询距离出错了"); |
| | | }else if(distancematrix.getDistance() == 0){ |
| | |
| | | baseWarpper.setId(orderPrivateCars.get(0).getId()); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | startAddress = startAddress.replaceAll("& #40;", "("); |
| | | startAddress = startAddress.replaceAll("& #41;", ")"); |
| | | endAddress = endAddress.replaceAll("& #40;", "("); |
| | |
| | | orderPrivateCar.setPlacementLon(Double.valueOf(placementLon)); |
| | | orderPrivateCar.setPlacementLat(Double.valueOf(placementLat)); |
| | | |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon)); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon), tripId); |
| | | orderPrivateCar.setPlacementAddress(reverseGeocode.getAddress()); |
| | | orderPrivateCar.setStartLon(Double.valueOf(startLon)); |
| | | orderPrivateCar.setStartLat(Double.valueOf(startLat)); |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderPrivateCar.setEstimateArriveTime(new Date(timeOut)); |
| | |
| | | |
| | | orderPrivateCar.setIsReassign(1); |
| | | orderPrivateCar.setIsDelete(1); |
| | | orderPrivateCar.setTripId(UUIDUtil.getRandomCode()); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon()); |
| | | orderPrivateCar.setTripId(tripId); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon(), tripId); |
| | | Long distance1 = distancematrix1.getDistance(); |
| | | orderPrivateCar.setEstimatedMileage(new BigDecimal(distance1).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | this.insert(orderPrivateCar); |
| | |
| | | |
| | | // TODO: 2021/5/11 修改,根据后台设定的派单范围查询范围内有无司机,将单子指派给距离最近的司机(距离相同随机取),范围内没有司机再进行推单流程 |
| | | if(orderPrivateCar.getState() == 1){ |
| | | Company query = companyCityService.query1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | Company query = companyCityService.query1(uid, orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | if(null == query){ |
| | | return ResultUtil.error(language == 1 ? "起点暂未企业提供服务" : language == 2 ? "Starting point no enterprise to provide services" : "Point de départ pas encore disponible pour les entreprises"); |
| | | } |
| | | AssignOrder assignOrder = assignOrderService.selectOne(new EntityWrapper<AssignOrder>().eq("companyId", query.getId()).eq("type", 1)); |
| | | if(null != assignOrder && assignOrder.getPeople() > 0){//配置了指派规则才处理 |
| | | //获取空闲司机 |
| | | List<Driver> drivers = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), assignOrder.getDistance(), null);//获取范围内空闲司机 |
| | | List<Driver> drivers = driverService.queryIdleDriver(orderPrivateCar.getUserId(), 1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), assignOrder.getDistance(), null);//获取范围内空闲司机 |
| | | if(drivers.size() > 0){//有司机,直接指派给司机 |
| | | Driver dr = null; |
| | | if(drivers.size() > 1){ |
| | |
| | | String value = redisUtil.getValue("DRIVER" + drivers.get(j).getId()); |
| | | if(null != value){ |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | Long distance = distancematrix.getDistance(); |
| | | if((0 == m && null == driver) || (distance < m)){ |
| | | driver = drivers.get(j); |
| | |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(null != value){ |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | Long d = distancematrix.getDistance(); |
| | | if((0 == m && null == dr) || (d.intValue() < m.intValue())){ |
| | | dr = driver; |
| | |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query1(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | Company query = companyCityService.query1(orderPrivateCar.getUserId(), String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(orderPrivateCar.getUserId(), 1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | System.err.println("【" + orderPrivateCar.getId() + "】空闲司机:" + JSON.toJSONString(list)); |
| | | if(list.size() > 0){ |
| | | double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数 |
| | |
| | | |
| | | String lnt = "0"; |
| | | String lat = "0"; |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | lnt = value.split(",")[0]; |
| | | lat = value.split(",")[1]; |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt)); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt), tripId); |
| | | |
| | | if(null == distancematrix){ |
| | | System.err.println("查询距离出错了"); |
| | |
| | | orderServerWarpper.setLaveTime("0"); |
| | | } |
| | | if(orderPrivateCar.getState() == 5 || orderPrivateCar.getState() == 6){//服务中 |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon(), tripId); |
| | | if(null == distancematrix){ |
| | | System.err.println("查询距离出错了"); |
| | | }else if(distancematrix.getDistance() == 0){ |
| | |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.ServerCarModel"> |
| | | <id column="id" property="id"/> |
| | | <result column="type" property="type"/> |
| | | <result column="name" property="name"/> |
| | | <result column="chineseName" property="chineseName"/> |
| | | <result column="englishName" property="englishName"/> |
| | | <result column="frenchName" property="frenchName"/> |
| | | <result column="img" property="img"/> |
| | | <result column="price" property="price"/> |
| | | <result column="state" property="state"/> |
| | |
| | | <select id="queryServerCarModel" resultType="map"> |
| | | select |
| | | id as id, |
| | | `name` as `name`, |
| | | chineseName, |
| | | englishName, |
| | | frenchName, |
| | | img as img, |
| | | price as price |
| | | from t_server_carmodel where state = 1 and `type` = #{type} |
| | |
| | | /** |
| | | * 车型名称 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | @TableField("chineseName") |
| | | private String chineseName; |
| | | /** |
| | | * 车型名称 |
| | | */ |
| | | @TableField("englishName") |
| | | private String englishName; |
| | | /** |
| | | * 车型名称 |
| | | */ |
| | | @TableField("frenchName") |
| | | private String frenchName; |
| | | /** |
| | | * 车型照片 |
| | | */ |
| | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | |
| | | public String getChineseName() { |
| | | return chineseName; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | |
| | | public void setChineseName(String chineseName) { |
| | | this.chineseName = chineseName; |
| | | } |
| | | |
| | | |
| | | public String getEnglishName() { |
| | | return englishName; |
| | | } |
| | | |
| | | public void setEnglishName(String englishName) { |
| | | this.englishName = englishName; |
| | | } |
| | | |
| | | public String getFrenchName() { |
| | | return frenchName; |
| | | } |
| | | |
| | | public void setFrenchName(String frenchName) { |
| | | this.frenchName = frenchName; |
| | | } |
| | | |
| | | public String getImg() { |
| | | return img; |
| | | } |
| | |
| | | public void setPrice(String price) { |
| | | this.price = price; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ServerCarModel{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", name='" + name + '\'' + |
| | | ", chineseName='" + chineseName + '\'' + |
| | | ", englishName='" + englishName + '\'' + |
| | | ", frenchName='" + frenchName + '\'' + |
| | | ", img='" + img + '\'' + |
| | | ", price='" + price + '\'' + |
| | | ", state=" + state + |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<AdvertisementWarpper> queryAdvertisement(Double lat, Double lnt, Integer type) throws Exception; |
| | | List<AdvertisementWarpper> queryAdvertisement(Integer uid, Double lat, Double lnt, Integer type) throws Exception; |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | Company query1(String lon, String lat) throws Exception; |
| | | Company query1(Integer uid, String lon, String lat) throws Exception; |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception; |
| | | List<Driver> queryIdleDriver(Integer uid, Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<BaseWarpper> queryBusiness(Double lat, Double lnt, Integer language) throws Exception; |
| | | List<BaseWarpper> queryBusiness(Integer uid, Double lat, Double lnt, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | City openCity(Double lat, Double lnt, Integer language) throws Exception; |
| | | City openCity(Integer uid, Double lat, Double lnt, Integer language) throws Exception; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil<BaseWarpper> queryExpectedTime(Double slon, Double slat, Double elon, Double elat) throws Exception; |
| | | ResultUtil<BaseWarpper> queryExpectedTime(Integer uid, Double slon, Double slat, Double elon, Double elat) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Phone> queryPhones(Double lat, Double lnt) throws Exception; |
| | | List<Phone> queryPhones(Integer uid, Double lat, Double lnt) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | Map<String, Object> queryCustomerPhone(Double lat, Double lnt) throws Exception; |
| | | Map<String, Object> queryCustomerPhone(Integer uid, Double lat, Double lnt) throws Exception; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type, Integer language) throws Exception; |
| | | ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(Integer uid, String startLonLat, String endLonLat, Integer type, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | 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.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.AdvertisementWarpper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private AdvertisementMapper advertisementMapper; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<AdvertisementWarpper> queryAdvertisement(Double lat, Double lnt, Integer type) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | public List<AdvertisementWarpper> queryAdvertisement(Integer uid, Double lat, Double lnt, Integer type) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, tripId); |
| | | if(null == reverseGeocode){ |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | 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.RedisUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Company query1(String lon, String lat) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(lat), Double.valueOf(lon)); |
| | | public Company query1(Integer uid, String lon, String lat) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(lat), Double.valueOf(lon), tripId); |
| | | if(null == reverseGeocode){ |
| | | return null; |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Driver> queryIdleDriver(Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | public List<Driver> queryIdleDriver(Integer uid, Integer type, Integer serverCarModelId, Double lon, Double lat, Double distance, Integer companyId) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | 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(null != value){ |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(lat, lon, Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(lat, lon, Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0]), tripId); |
| | | if(null != distancematrix){ |
| | | if(distancematrix.getDistance() < (distance * 1000)){ |
| | | list.add(driver); |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | 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.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private OpenCityBusinessMapper openCityBusinessMapper; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<BaseWarpper> queryBusiness(Double lat, Double lnt, Integer language) throws Exception { |
| | | public List<BaseWarpper> queryBusiness(Integer uid, Double lat, Double lnt, Integer language) throws Exception { |
| | | if(null == language){ |
| | | language = 2; |
| | | } |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, tripId); |
| | | if(null == reverseGeocode){ |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | 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.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public City openCity(Double lat, Double lnt, Integer language) throws Exception { |
| | | public City openCity(Integer uid, Double lat, Double lnt, Integer language) throws Exception { |
| | | if(null == language){ |
| | | language = 2; |
| | | } |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, tripId); |
| | | if(null == reverseGeocode){ |
| | | return null; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ICarService carService; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil<BaseWarpper> queryExpectedTime(Double slon, Double slat, Double elon, Double elat) throws Exception { |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(slat, slon, elat, elon); |
| | | public ResultUtil<BaseWarpper> queryExpectedTime(Integer uid, Double slon, Double slat, Double elon, Double elat) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(slat, slon, elat, elon, tripId); |
| | | Long duration = distancematrix.getDuration() / 60; |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setMinute(duration.intValue()); |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | 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.RedisUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private PhoneMapper phoneMapper; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取所有系统电话 |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Phone> queryPhones(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | public List<Phone> queryPhones(Integer uid, Double lat, Double lnt) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, tripId); |
| | | if(null == reverseGeocode){ |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryCustomerPhone(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | public Map<String, Object> queryCustomerPhone(Integer uid, Double lat, Double lnt) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt, tripId); |
| | | if(null == reverseGeocode){ |
| | | return new HashMap<>(); |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | 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.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.ServerCarModelWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type, Integer language) throws Exception { |
| | | public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(Integer uid, String startLonLat, String endLonLat, Integer type, Integer language) throws Exception { |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | //查找与起点匹配的企业(经营范围) |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(startLonLat.split(",")[1]), Double.valueOf(startLonLat.split(",")[0])); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(startLonLat.split(",")[1]), Double.valueOf(startLonLat.split(",")[0]), tripId); |
| | | if(null == language){ |
| | | language = 2; |
| | | } |
| | |
| | | Double slat = Double.valueOf(startLonLat.split(",")[1]); |
| | | Double elnt = Double.valueOf(endLonLat.split(",")[0]); |
| | | Double elat = Double.valueOf(endLonLat.split(",")[1]); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(slat, slnt, elat, elnt); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(slat, slnt, elat, elnt, tripId); |
| | | if(null == distancematrix){ |
| | | return ResultUtil.error(language == 1 ? "获取预估距离出错" : language == 2 ? "Obtaining-estimated-distance error" : "Erreur d’obtention de la distance estimée", new ArrayList<>()); |
| | | }else if(distancematrix.getDistance() == 0){ |
| | |
| | | long duration = distancematrix.getDuration();//时间(秒) |
| | | long duration_ = Long.valueOf(duration).longValue(); |
| | | |
| | | List<ServerCarModelWarpper> price = this.getPrice(query.getId(), distance1_, duration_, 0, type); |
| | | List<ServerCarModelWarpper> price = this.getPrice(query.getId(), distance1_, duration_, 0, type, language); |
| | | if(price.size() == 0){ |
| | | return ResultUtil.error(language == 1 ? "未获取到可服务的车型" : language == 2 ? "Not obtaining available vehicle-type" : "Ne pas obtenir le type de véhicule disponible", new ArrayList<>()); |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public List<ServerCarModelWarpper> getPrice(Integer companyId, double distance, long duration, long wait, Integer type) throws Exception { |
| | | public List<ServerCarModelWarpper> getPrice(Integer companyId, double distance, long duration, long wait, Integer type, Integer language) throws Exception { |
| | | List<Map<String, Object>> list = serverCarModelMapper.queryServerCarModel(type); |
| | | List<ServerCarModelWarpper> data = new ArrayList<>(); |
| | | for(Map<String, Object> map : list){ |
| | | if(1 == language){ |
| | | map.put("name", map.get("chineseName")); |
| | | } |
| | | if(2 == language){ |
| | | map.put("name", map.get("englishName")); |
| | | } |
| | | if(3 == language){ |
| | | map.put("name", map.get("frenchName")); |
| | | } |
| | | Map<String, Object> query1 = systemPriceMapper.query(companyId, type, Integer.valueOf(map.get("id").toString())); |
| | | if(null == query1){//排除没有设置价格的车型 |
| | | continue; |
| | |
| | | import com.stylefeng.guns.modular.system.dao.UserCouponRecordMapper; |
| | | import com.stylefeng.guns.modular.system.model.UserCouponRecord; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private ISystemNoticeService systemNoticeService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | public ResultUtil handselCoupon(Integer id, Integer uid, Integer userId, Integer language) throws Exception { |
| | | UserCouponRecord userCouponRecord = userCouponRecordMapper.selectById(id); |
| | | language = userInfoService.queryLanguage(uid, language); |
| | | UserInfo userInfo1 = userInfoService.selectById(uid); |
| | | String nickName = userInfo1.getNickName(); |
| | | String phone = userInfo1.getPhone(); |
| | | if(userCouponRecord.getUserId().compareTo(uid) != 0){ |
| | | return ResultUtil.error(language == 1 ? "您不能赠送此优惠券" : language == 2 ? "You cannot gift the coupon." : "Vous ne pouvez pas offrir le coupon."); |
| | | } |
| | |
| | | } |
| | | userCouponRecord.setUserId(userId); |
| | | userCouponRecordMapper.updateById(userCouponRecord); |
| | | UserInfo userInfo = userInfoService.selectById(userId); |
| | | Integer language1 = userInfo.getLanguage(); |
| | | systemNoticeService.addSystemNotice(1, language1 == 1 ? nickName + "(" + phone + ")刚赠送您了一张GHS 5.00的优惠券,请查看账户。" : language1 == 2 |
| | | ? nickName + "(" + phone + ")just gifted a GHS 5.00 coupon to you, please check your account." |
| | | : nickName + "(" + phone + ")vient de vous offrir un coupon de GHS 5.00, veuillez vérifier votre compte.", userId, 1); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | |
| | | //用户所属企业 |
| | | if(null != lat && null != lng){ |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lat); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lat, null); |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] citys = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | |
| | | } |
| | | //用户所属企业 |
| | | if(null != lat && null != lng){ |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lng); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lng, null); |
| | | if(null != reverseGeocode){ |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] citys = new String[addressComponentsVos.length]; |
| | |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.maps.*; |
| | | import com.google.maps.model.*; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | |
| | | /** |
| | | * 谷歌地图工具类 |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static ReverseGeocodeVo getReverseGeocode(double lat, double lng) throws Exception{ |
| | | public static ReverseGeocodeVo getReverseGeocode(double lat, double lng, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | GeocodingApiRequest request = GeocodingApi.reverseGeocode(context, new LatLng(lat, lng)); |
| | | request.language("en"); |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | GeocodingResult[] results = request.await(); |
| | | ReverseGeocodeVo vo = null; |
| | | if(results.length > 0){ |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static DistancematrixVo getDistancematrix(String origin, String destination) throws Exception{ |
| | | public static DistancematrixVo getDistancematrix(String origin, String destination, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | DistanceMatrixApiRequest request = DistanceMatrixApi.getDistanceMatrix(context, new String[]{origin}, new String[]{destination}); |
| | | request.language("en"); |
| | | request.mode(TravelMode.DRIVING);//出行方式(驾车) |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | DistanceMatrix distanceMatrix = request.await(); |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.err.println(gson.toJson(distanceMatrix)); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static DistancematrixVo getDistancematrix(Double sLat, Double sLnt, Double eLat, Double eLnt) throws Exception{ |
| | | public static DistancematrixVo getDistancematrix(Double sLat, Double sLnt, Double eLat, Double eLnt, String tripId) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | |
| | | request.origins(new LatLng(sLat, sLnt)); |
| | | request.destinations(new LatLng(eLat, eLnt)); |
| | | request.mode(TravelMode.DRIVING);//出行方式(驾车) |
| | | if(ToolUtil.isNotEmpty(tripId)){ |
| | | request.header("X-Goog-Maps-Experience-ID", tripId);//行程id |
| | | } |
| | | DistanceMatrix distanceMatrix = request.await(); |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.out.println(gson.toJson(distanceMatrix)); |
| | |
| | | public synchronized ResultUtil<BaseWarpper> taxiOrder(OrderTaxi orderTaxi, Integer uid) throws Exception { |
| | | //定义用户所属公司 |
| | | UserInfo userInfo1 = userInfoService.selectById(uid); |
| | | Company query = companyCityService.query1(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat())); |
| | | Company query = companyCityService.query1(orderTaxi.getUserId(), String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat())); |
| | | if(null == query){ |
| | | return ResultUtil.error("出发点暂未开通"); |
| | | } |
| | |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query1(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | Company query = companyCityService.query1(orderTaxi.getUserId(), String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | PushOrder pushOrder = pushOrderService.querys(i, 2, query.getId()).get(0); |