| | |
| | | <artifactId>spring-test</artifactId> |
| | | <version>5.1.3.RELEASE</version> |
| | | </dependency> |
| | | <!--邮件发送依赖--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-mail</artifactId> |
| | | </dependency> |
| | | <!--谷歌地图依赖--> |
| | | <dependency> |
| | | <groupId>com.google.maps</groupId> |
| | | <artifactId>google-maps-services</artifactId> |
| | | <version>2.0.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.slf4j</groupId> |
| | | <artifactId>slf4j-simple</artifactId> |
| | | <version>1.7.25</version> |
| | | </dependency> |
| | | <!-- 计算两坐标间的直线距离 --> |
| | | <dependency> |
| | | <groupId>org.gavaghan</groupId> |
| | | <artifactId>geodesy</artifactId> |
| | | <version>1.1.3</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/car/addCar") |
| | | @ApiOperation(value = "添加车辆", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "添加车辆【1.0】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "车辆型号id", name = "modelId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "车辆id", name = "id", required = true, dataType = "int"), |
| | |
| | | @ApiImplicitParam(value = "车牌号", name = "licensePlate", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "年审日期(需要格式化)", name = "time", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "行驶证照片", name = "drivingLicensePhoto", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "行驶证到期时间(yyyy-MM-dd)", name = "drivingLicenseEndTime", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "车辆照片", name = "carPhoto", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "保险照片", name = "insurancePhoto", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "保险到期时间(yyyy-MM-dd)", name = "commercialInsuranceTime", required = false, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = false, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, |
| | | String carPhoto, String insurancePhoto, HttpServletRequest request,Integer id){ |
| | | String drivingLicenseEndTime, String carPhoto, String insurancePhoto, String commercialInsuranceTime, HttpServletRequest request,Integer id){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicensePhoto, carPhoto, insurancePhoto, uid,id); |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto, commercialInsuranceTime, uid,id); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/queryEmailCaptcha") |
| | | @ApiOperation(value = "发送验证码【1.0】", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "邮箱地址", name = "email", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil queryEmailCaptcha(String email){ |
| | | if(ToolUtil.isNotEmpty(email)){ |
| | | try { |
| | | return driverService.queryEmailCaptcha(email); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | }else{ |
| | | return ResultUtil.paranErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 验证短信验证码 |
| | | * @param phone |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/checkCaptcha") |
| | | @ApiOperation(value = "验证短信验证码", tags = {"司机端-注册"}, notes = "") |
| | | @ApiOperation(value = "验证验证码", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String") |
| | | @ApiImplicitParam(value = "邮箱", name = "email", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "验证码", name = "code", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil checkCaptcha(String phone, String code){ |
| | | public ResultUtil checkCaptcha(String email, String code){ |
| | | try { |
| | | boolean b = driverService.checkCaptcha(phone, code); |
| | | if(b){ |
| | | Driver driver = driverService.queryByPhone(phone); |
| | | smsrecordService.saveData(null == driver ? 5 : 8, phone, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"); |
| | | } |
| | | boolean b = driverService.checkCaptcha(email, code); |
| | | // if(b){ |
| | | // Driver driver = driverService.queryByPhone(email); |
| | | // smsrecordService.saveData(null == driver ? 5 : 8, email, code, "验证码【" + code + "】已发到您的邮箱,验证码将在5分钟后失效!"); |
| | | // } |
| | | return b ? ResultUtil.success() : ResultUtil.error("验证码无效"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/updateDriver") |
| | | @ApiOperation(value = "司机注册后完善个人信息", tags = {"司机端-注册"}, notes = "") |
| | | @ApiOperation(value = "司机注册后完善个人信息【1.0】", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "司机id", name = "uid", required = true, dataType = "int") |
| | | }) |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/addDriverCar") |
| | | @ApiOperation(value = "司机注册后完善车辆信息", tags = {"司机端-注册"}, notes = "") |
| | | @ApiOperation(value = "司机注册后完善车辆信息【1.0】", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "车辆型号id", name = "modelId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "车辆颜色", name = "color", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "车牌号", name = "licensePlate", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "年审日期(需要格式化)", name = "time", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "行驶证照片", name = "drivingLicensePhoto", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "行驶证到期时间(yyyy-MM-dd)", name = "drivingLicenseEndTime", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "车辆照片", name = "carPhoto", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "保险照片", name = "insurancePhoto", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "保险到期时间(yyyy-MM-dd)", name = "commercialInsuranceTime", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "司机id", name = "uid", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "车辆id", name = "carId", required = false, dataType = "int") |
| | | }) |
| | | public ResultUtil addDriverCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, |
| | | String carPhoto, String insurancePhoto, Integer uid, Integer carId){ |
| | | public ResultUtil addDriverCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid, Integer carId){ |
| | | try { |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicensePhoto, carPhoto, insurancePhoto, uid,carId); |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto, commercialInsuranceTime, uid,carId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiOperation(value = "忘记密码操作", tags = {"司机端-登录"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "新密码", name = "password", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil resetPassword(String phone, String code, String password){ |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/queryPhone") |
| | | @ApiOperation(value = "获取忘记密码页面的电话", tags = {"司机端-登录"}, notes = "") |
| | | @ApiOperation(value = "获取忘记密码页面的电话【1.0】", tags = {"司机端-登录"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "当前定位城市行政编号(510100)", name = "code", required = true, dataType = "String") |
| | | @ApiImplicitParam(value = "当前定位纬度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "当前定位经度", name = "lnt", required = true, dataType = "double") |
| | | }) |
| | | public ResultUtil queryPhone(String code){ |
| | | public ResultUtil queryPhone(Double lat, Double lnt){ |
| | | try { |
| | | Map<String, Object> map = driverService.queryPhone(code); |
| | | Map<String, Object> map = driverService.queryPhone(lat, lnt); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/work") |
| | | @ApiOperation(value = "司机上下班操作", tags = {"司机端-首页"}, notes = "") |
| | | @ApiOperation(value = "司机上下班操作【1.0】", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车,4=小件物流-同城)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil work(String type, HttpServletRequest request){ |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/work2") |
| | | @ApiOperation(value = "司机上下班操作,同时设置接单类型", tags = {"司机端-车载端"}, notes = "") |
| | | @ApiOperation(value = "司机上下班操作,同时设置接单类型【1.0】", tags = {"司机端-车载端"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车,4=小件物流-同城)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil work2(String type, HttpServletRequest request){ |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryInfo") |
| | | @ApiOperation(value = "获取个人中心详情", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "获取个人中心详情【1.0】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/editLanguage") |
| | | @ApiOperation(value = "修改系统语言【1.0】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil editLanguage(Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | driverService.editLanguage(language, uid); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改密码 |
| | | * @param password |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryPushOrder") |
| | | @ApiOperation(value = "获取抢单界面的订单详情", tags = {"司机端-首页"}, notes = "") |
| | | @ApiOperation(value = "获取抢单界面的订单详情【1.0】", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,4=小件物流-同城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "当前定位经度", name = "lon", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "当前定位纬度", name = "lat", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | @ApiOperation(value = "司机抢单操作", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,4=小件物流-同城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil grabOrder(Integer orderId, Integer orderType, HttpServletRequest request){ |
| | |
| | | @ApiOperation(value = "获取服务中页面订单详情", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,4=小件物流-同城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OrderInfoWarpper> queryOrderInfo(Integer orderId, Integer orderType){ |
| | | try { |
| | | Map<String, Object> map = orderService.queryOrderInfo(orderId, orderType); |
| | | OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map); |
| | | File file = new File(filePath + orderId + "_1.txt"); |
| | | File file = new File(filePath + orderId + "_" + orderType + ".txt"); |
| | | if(file.exists()){ |
| | | //读取文件(字符流) |
| | | BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8")); |
| | |
| | | @ApiOperation(value = "获取改派支付金额", tags = {"司机端-服务中"}, notes = "返回金额为0不需要调用支付") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id(跨城多个订单使用逗号分隔)", name = "orderId", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,4=小件物流-同城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<BaseWarpper> queryReassignMoney(String orderId, Integer orderType){ |
| | |
| | | @ApiOperation(value = "司机走流程操作", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,4=小件物流-同城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "流程操作状态(3=开始出发预约点,4=到达预约点,5=开始服务,6=服务结束)", name = "state", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "手机号后四位", name = "phone", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "当前经度", name = "lon", required = true, dataType = "double"), |
| | |
| | | if(null != orderPosition1){ |
| | | String now = lon + "," + lat; |
| | | String old = orderPosition1.getLon() + "," + orderPosition1.getLat(); |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(now, old, 0);//直线距离 |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(now, old);//直线距离 |
| | | if(null != distance){ |
| | | String distance1 = distance.get("distance"); |
| | | if(Double.valueOf(distance1) > 50){//大于50米表示在移动 |
| | | Double distance1 = distance.get("WGS84"); |
| | | if(distance1 > 50){//大于50米表示在移动 |
| | | orderCrossCity.setMileage(new BigDecimal(orderCrossCity.getMileage()).add(new BigDecimal(distance1)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | this.updateById(orderCrossCity); |
| | | b = true; |
| | |
| | | orderLogistics.setSnatchOrderTime(new Date()); |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderLogistics.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderLogistics.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode.get("districtCode")); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderLogistics.getRecipientPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1))); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderLogistics.setTelX(map.get("telX")); |
| | | orderLogistics.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | // Region region = regionMapper.query(geocode.get("districtCode")); |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderLogistics.getRecipientPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1))); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderLogistics.setTelX(map.get("telX")); |
| | | // orderLogistics.setBindId(map.get("bindId")); |
| | | // } |
| | | |
| | | this.updateById(orderLogistics); |
| | | |
| | |
| | | orderPrivateCar.setSnatchOrderTime(new Date()); |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderPrivateCar.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderPrivateCar.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | /*Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode.get("districtCode"));*/ |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), null); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | | } |
| | | System.out.println(map); |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), null); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | // System.out.println(map); |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | //如果是预约单,则不修改司机为服务中 |
| | |
| | | this.updateById(orderPrivateCar); |
| | | return true;//第一条数据不作处理,直接存储 |
| | | } |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(now, old, 0);//直线距离 |
| | | |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(now, old); |
| | | if(null != distance){ |
| | | String distance1 = distance.get("distance"); |
| | | if(Double.valueOf(distance1) > 50 && orderPrivateCar.getState()==5/* && orderPosition.getInsertTime().getTime()>=orderPrivateCar.getBoardingTime().getTime()*/){//大于50米表示在移动 |
| | | Double distance1 = distance.get("WGS84"); |
| | | if(distance1 > 50 && orderPrivateCar.getState()==5/* && orderPosition.getInsertTime().getTime()>=orderPrivateCar.getBoardingTime().getTime()*/){//大于50米表示在移动 |
| | | orderPrivateCar.setMileage(new BigDecimal(orderPrivateCar.getMileage()).add(new BigDecimal(distance1)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | this.updateById(orderPrivateCar); |
| | | return true; |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.City; |
| | | |
| | | public interface CityMapper extends BaseMapper<City> { |
| | | } |
| | |
| | | */ |
| | | List<Company> query(@Param("province") String province, @Param("city") String city, |
| | | @Param("code") String code); |
| | | |
| | | |
| | | |
| | | List<Company> queryList(@Param("city") String[] city, @Param("type") Integer type); |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.CityMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.City"> |
| | | <id column="id" property="id"/> |
| | | <result column="chineseName" property="chineseName"/> |
| | | <result column="englishName" property="englishName"/> |
| | | <result column="frenchName" property="frenchName"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | </if> |
| | | ) |
| | | </select> |
| | | |
| | | |
| | | <select id="queryList" resultType="Company"> |
| | | select |
| | | id as id, |
| | | isSpe as isSpe, |
| | | isTaxi as isTaxi, |
| | | isCross as isCross, |
| | | isCrossLogistics as isCrossLogistics, |
| | | isSameLogistics as isSameLogistics, |
| | | isCharter as isCharter, |
| | | isSpeFixedOrProportional as isSpeFixedOrProportional, |
| | | isTaxiFixedOrProportional as isTaxiFixedOrProportional, |
| | | isCrossLogisticsFixedOrProportional as isCrossLogisticsFixedOrProportional, |
| | | isSameLogisticsFixedOrProportional as isSameLogisticsFixedOrProportional, |
| | | speMoney as speMoney, |
| | | taxiMoney as taxiMoney, |
| | | crossLogisticsMoney as crossLogisticsMoney, |
| | | sameLogisticsMoney as sameLogisticsMoney, |
| | | isNeedFerry as isNeedFerry, |
| | | name as name, |
| | | type as type, |
| | | superiorId as superiorId, |
| | | principalName as principalName, |
| | | principalPhone as principalPhone, |
| | | adminName as adminName, |
| | | adminPhone as adminPhone, |
| | | urgentPhoen as urgentPhoen, |
| | | setupTime as setupTime, |
| | | identifier as identifier, |
| | | addressCode as addressCode, |
| | | businessScope as businessScope, |
| | | contactAddress as contactAddress, |
| | | documentAddress as documentAddress, |
| | | economicType as economicType, |
| | | regCapital as regCapital, |
| | | legalName as legalName, |
| | | legalId as legalId, |
| | | legalPhone as legalPhone, |
| | | legalPhotoUrl as legalPhotoUrl, |
| | | licensingAgency as licensingAgency, |
| | | licenseTime as licenseTime, |
| | | licenseStartTime as licenseStartTime, |
| | | licenseEndTime as licenseEndTime, |
| | | licenseNumber as licenseNumber, |
| | | carNum as carNum, |
| | | driverNum as driverNum, |
| | | mac as mac, |
| | | state as state, |
| | | flag as flag, |
| | | upload as upload, |
| | | insertTime as insertTime |
| | | from t_company where flag != 3 and state = 0 and id in ( |
| | | select companyId from t_company_city where state = 1 |
| | | <if test="null != city"> |
| | | and cityId in (select id from t_city where englishName in |
| | | <foreach collection="city" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | ) |
| | | <if test="null != type"> |
| | | and type = #{type} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="driverContactAddress_" property="driverContactAddress_" /> |
| | | <result column="driverAge" property="driverAge" /> |
| | | <result column="driveCard" property="driveCard" /> |
| | | <result column="driveCardImgUrl" property="driveCardImgUrl" /> |
| | | <result column="driveCardImgUrl1" property="driveCardImgUrl1" /> |
| | | <result column="driveCardImgUrl2" property="driveCardImgUrl2" /> |
| | | <result column="email" property="email"/> |
| | | <result column="driverType" property="driverType" /> |
| | | <result column="getDriverLicenseDate" property="getDriverLicenseDate" /> |
| | | <result column="driverLicenseOn" property="driverLicenseOn" /> |
| | |
| | | <result column="laveBusinessMoney" property="laveBusinessMoney" /> |
| | | <result column="placeOfPractice" property="placeOfPractice"/> |
| | | <result column="appletsOpenId" property="appletsOpenId"/> |
| | | <result column="language" property="language"/> |
| | | |
| | | <result column="flag" property="flag"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | |
| | | a.sex as sex, |
| | | a.`name` as `name`, |
| | | a.phone as phone, |
| | | a.email, |
| | | a.qrCode, |
| | | a.language, |
| | | a.laveActivityMoney as balance, |
| | | a.laveActivityMoney as laveActivityMoney, |
| | | a.activityMoney as activityMoney, |
| | |
| | | @TableField("drivingLicensePhoto") |
| | | private String drivingLicensePhoto; |
| | | /** |
| | | * 行驶证到期时间 |
| | | */ |
| | | @TableField("drivingLicenseEndTime") |
| | | private Date drivingLicenseEndTime; |
| | | /** |
| | | * 年检到期时间 |
| | | */ |
| | | @TableField("annualInspectionTime") |
| | |
| | | this.addObjectId = addObjectId; |
| | | } |
| | | |
| | | public Date getDrivingLicenseEndTime() { |
| | | return drivingLicenseEndTime; |
| | | } |
| | | |
| | | public void setDrivingLicenseEndTime(Date drivingLicenseEndTime) { |
| | | this.drivingLicenseEndTime = drivingLicenseEndTime; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Car{" + |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | /** |
| | | * 城市 |
| | | */ |
| | | @TableName("t_city") |
| | | public class City { |
| | | //主键 |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | //中文名称 |
| | | @TableField("chineseName") |
| | | private String chineseName; |
| | | //英文名称 |
| | | @TableField("englishName") |
| | | private String englishName; |
| | | //法文名称 |
| | | @TableField("frenchName") |
| | | private String frenchName; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getChineseName() { |
| | | return chineseName; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "City{" + |
| | | "id=" + id + |
| | | ", chineseName='" + chineseName + '\'' + |
| | | ", englishName='" + englishName + '\'' + |
| | | ", frenchName='" + frenchName + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | @TableField("driveCard") |
| | | private String driveCard; |
| | | /** |
| | | * 驾驶证照片 |
| | | * 驾驶证照片正面 |
| | | */ |
| | | @TableField("driveCardImgUrl") |
| | | private String driveCardImgUrl; |
| | | @TableField("driveCardImgUrl1") |
| | | private String driveCardImgUrl1; |
| | | /** |
| | | * 驾驶证照片背面 |
| | | */ |
| | | @TableField("driveCardImgUrl2") |
| | | private String driveCardImgUrl2; |
| | | /** |
| | | * 邮箱 |
| | | */ |
| | | @TableField("email") |
| | | private String email; |
| | | /** |
| | | * 准驾车型 |
| | | */ |
| | |
| | | */ |
| | | @TableField("carId") |
| | | private Integer carId; |
| | | /** |
| | | * 语言(1=简体中文,2=英语,3=法语) |
| | | */ |
| | | @TableField("language") |
| | | private Integer language; |
| | | /** |
| | | * 审核状态(1=待审核,2=正常,3=冻结,4=拒绝) |
| | | */ |
| | |
| | | this.driveCard = driveCard; |
| | | } |
| | | |
| | | public String getDriveCardImgUrl() { |
| | | return driveCardImgUrl; |
| | | public String getDriveCardImgUrl1() { |
| | | return driveCardImgUrl1; |
| | | } |
| | | |
| | | public void setDriveCardImgUrl(String driveCardImgUrl) { |
| | | this.driveCardImgUrl = driveCardImgUrl; |
| | | public void setDriveCardImgUrl1(String driveCardImgUrl1) { |
| | | this.driveCardImgUrl1 = driveCardImgUrl1; |
| | | } |
| | | |
| | | public String getDriveCardImgUrl2() { |
| | | return driveCardImgUrl2; |
| | | } |
| | | |
| | | public void setDriveCardImgUrl2(String driveCardImgUrl2) { |
| | | this.driveCardImgUrl2 = driveCardImgUrl2; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getDriverType() { |
| | |
| | | this.withdrawPassword = withdrawPassword; |
| | | } |
| | | |
| | | public Integer getLanguage() { |
| | | return language; |
| | | } |
| | | |
| | | public void setLanguage(Integer language) { |
| | | this.language = language; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Driver{" + |
| | |
| | | ", driverContactAddress_='" + driverContactAddress_ + '\'' + |
| | | ", driverAge=" + driverAge + |
| | | ", driveCard='" + driveCard + '\'' + |
| | | ", driveCardImgUrl='" + driveCardImgUrl + '\'' + |
| | | ", driveCardImgUrl1='" + driveCardImgUrl1 + '\'' + |
| | | ", driveCardImgUrl2='" + driveCardImgUrl2 + '\'' + |
| | | ", driverType='" + driverType + '\'' + |
| | | ", getDriverLicenseDate=" + getDriverLicenseDate + |
| | | ", driverLicenseOn=" + driverLicenseOn + |
| | |
| | | ", qrCode='" + qrCode + '\'' + |
| | | ", uid=" + uid + |
| | | ", uType=" + uType + |
| | | ", frozenMoney=" + frozenMoney + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, |
| | | String carPhoto, String insurancePhoto, Integer uid,Integer id) throws Exception; |
| | | ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid,Integer id) throws Exception; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.City; |
| | | |
| | | public interface ICityService extends IService<City> { |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | Company query(String code) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 根据城市名称获取匹配的企业 |
| | | * @param city |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | Company query(String[] city) throws Exception; |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 获取邮件验证码 |
| | | * @param email |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil queryEmailCaptcha(String email) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 验证短信验证码 |
| | | * @param phone |
| | | * @param code |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | Map<String, Object> queryPhone(String code) throws Exception; |
| | | Map<String, Object> queryPhone(Double lat, Double lnt) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | /** |
| | | * 修改语言设置 |
| | | * @param language |
| | | * @param uid |
| | | * @throws Exception |
| | | */ |
| | | void editLanguage(Integer language, Integer uid) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 电话号码查询司机 |
| | | * @param phone |
| | | * @return |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.CarBrandMapper; |
| | | import com.stylefeng.guns.modular.system.dao.CarMapper; |
| | | import com.stylefeng.guns.modular.system.dao.CarModelMapper; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, |
| | | String carPhoto, String insurancePhoto, Integer uid,Integer id) throws Exception { |
| | | public ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid,Integer id) throws Exception { |
| | | |
| | | Car query = carMapper.query(licensePlate); |
| | | if(id==null){ |
| | |
| | | } |
| | | } |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Car car = new Car(); |
| | | car.setDriverId(uid); |
| | | car = carMapper.selectOne(car); |
| | |
| | | car.setCarLicensePlate(licensePlate); |
| | | car.setAnnualInspectionTime(time); |
| | | car.setDrivingLicensePhoto(drivingLicensePhoto); |
| | | if(ToolUtil.isNotEmpty(drivingLicenseEndTime)){ |
| | | car.setDrivingLicenseEndTime(sdf.parse(drivingLicenseEndTime)); |
| | | } |
| | | car.setCarPhoto(carPhoto); |
| | | car.setInsurancePhoto(insurancePhoto); |
| | | |
| | | if(ToolUtil.isNotEmpty(commercialInsuranceTime)){ |
| | | car.setCommercialInsuranceTime(sdf.parse(commercialInsuranceTime)); |
| | | } |
| | | Driver driver = driverService.selectById(uid); |
| | | car.setCompanyId(driver.getCompanyId()); |
| | | car.setFranchiseeId(driver.getFranchiseeId()); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.CityMapper; |
| | | import com.stylefeng.guns.modular.system.model.City; |
| | | import com.stylefeng.guns.modular.system.service.ICityService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class CityServiceImpl extends ServiceImpl<CityMapper, City> implements ICityService { |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Company query(String[] city) throws Exception { |
| | | List<Company> query = companyMapper.queryList(city, 3); |
| | | if(query.size() == 0){ |
| | | query = companyMapper.queryList(city, 2); |
| | | } |
| | | if(query.size() == 0){ |
| | | query = companyMapper.queryList(city, 1); |
| | | } |
| | | if(query.size() > 0){ |
| | | return query.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | 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.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | |
| | | private PushUtil pushUtil; |
| | | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ResultUtil queryEmailCaptcha(String email) throws Exception { |
| | | Random random = new Random(); |
| | | StringBuffer sb = new StringBuffer(); |
| | | for(int i = 0; i < 4; i++){ |
| | | sb.append((int) (random.nextDouble() * 10)); |
| | | } |
| | | String authCode = sb.toString(); |
| | | String sms = "您发送的验证码为【" + authCode + "】,验证码将在5分钟后失效!"; |
| | | |
| | | //发送验证码短信 |
| | | redisUtil.setStrValue(email, authCode, 5 * 60);//设置五分钟过期 |
| | | EmailUtil.getMimeMessage(email, "验证码", sms); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 校验短信验证码 |
| | |
| | | driver.setSex(registeredWarpper.getSex()); |
| | | driver.setIdCard(registeredWarpper.getIdCard()); |
| | | |
| | | String code = registeredWarpper.getPlaceOfEmployment(); |
| | | Company query = companyCityService.query(code); |
| | | City city1 = cityService.selectById(registeredWarpper.getPlaceOfPracticeId()); |
| | | String[] city = new String[]{city1.getEnglishName()}; |
| | | Company query = companyCityService.query(city); |
| | | if(null == query){ |
| | | return ResultUtil.error("选择从业地暂未开通业务"); |
| | | } |
| | |
| | | driver.setHeadImgUrl(registeredWarpper.getHeadImgUrl()); |
| | | driver.setIdCardImgUrl1(registeredWarpper.getIdCardImgUrl1()); |
| | | driver.setIdCardImgUrl2(registeredWarpper.getIdCardImgUrl2()); |
| | | driver.setPlaceOfEmployment(registeredWarpper.getPlaceOfEmployment()); |
| | | driver.setPlaceOfEmployment(city1.getEnglishName()); |
| | | driver.setDriverAddress(registeredWarpper.getDriverContactAddress()); |
| | | driver.setDriverContactAddress(registeredWarpper.getDriverContactAddress()); |
| | | driver.setDriverContactAddress_(registeredWarpper.getDriverContactAddress_()); |
| | | driver.setPlaceOfPractice(registeredWarpper.getPlaceOfPractice()); |
| | | driver.setPlaceOfPractice(city1.getEnglishName()); |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(registeredWarpper.getGetDriverLicenseDate()); |
| | | Calendar now = Calendar.getInstance(); |
| | | now.setTime(new Date()); |
| | | driver.setDriverAge(now.get(Calendar.YEAR) - calendar.get(Calendar.YEAR)); |
| | | driver.setDriveCardImgUrl(registeredWarpper.getDriveCardImgUrl()); |
| | | driver.setGetDriverLicenseDate(registeredWarpper.getGetDriverLicenseDate()); |
| | | driver.setTaxiAptitudeCard(registeredWarpper.getTaxiAptitudeCard()); |
| | | driver.setNetworkCarlssueImg(registeredWarpper.getNetworkCarlssueImg()); |
| | | driver.setDriveCardImgUrl1(registeredWarpper.getDriveCardImgUrl1()); |
| | | driver.setDriveCardImgUrl2(registeredWarpper.getDriveCardImgUrl2()); |
| | | driver.setEmail(registeredWarpper.getEmail()); |
| | | |
| | | this.updateById(driver); |
| | | //服务模式 |
| | |
| | | |
| | | /** |
| | | * 根据定位的城市行政编号获取分公司的客服电话 |
| | | * @param code |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryPhone(String code) throws Exception { |
| | | Company query = companyCityService.query(code); |
| | | public Map<String, Object> queryPhone(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | if(null == reverseGeocode){ |
| | | System.err.println("获取地址异常"); |
| | | return null; |
| | | } |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] city = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | | city[i] = addressComponentsVos[i].getLongName(); |
| | | } |
| | | Company query = companyCityService.query(city); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(null == query){ |
| | | map.put("phone", ""); |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void editLanguage(Integer language, Integer uid) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | driver.setLanguage(language); |
| | | this.updateById(driver); |
| | | } |
| | | |
| | | /** |
| | | * 电话号码查询司机 |
| | | * @param phone |
| | |
| | | import com.stylefeng.guns.modular.system.service.IOrderService; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderListWarpper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Map<String, Object>> datas = new ArrayList<>(); |
| | | //出租车 |
| | | List<Map<String, Object>> list = orderTaxiService.queryOrderList(state, uid); |
| | | datas.addAll(list); |
| | | // List<Map<String, Object>> list = orderTaxiService.queryOrderList(state, uid); |
| | | // datas.addAll(list); |
| | | //专车 |
| | | List<Map<String, Object>> list1 = orderPrivateCarService.queryOrderList(state, uid); |
| | | datas.addAll(list1); |
| | | //跨城 |
| | | List<Map<String, Object>> list2 = orderCrossCityService.queryOrderList(state, uid); |
| | | datas.addAll(list2); |
| | | // List<Map<String, Object>> list2 = orderCrossCityService.queryOrderList(state, uid); |
| | | // datas.addAll(list2); |
| | | //小件物流 |
| | | List<Map<String, Object>> list3 = orderLogisticsService.queryOrderList(uid); |
| | | datas.addAll(list3); |
| | |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Map<String, Object>> datas = new ArrayList<>(); |
| | | //出租车 |
| | | List<Map<String, Object>> list = orderTaxiService.queryMyAllOrder(state, uid); |
| | | datas.addAll(list); |
| | | // List<Map<String, Object>> list = orderTaxiService.queryMyAllOrder(state, uid); |
| | | // datas.addAll(list); |
| | | //专车 |
| | | List<Map<String, Object>> list1 = orderPrivateCarService.queryMyAllOrder(state, uid); |
| | | datas.addAll(list1); |
| | | //跨城 |
| | | List<Map<String, Object>> list2 = orderCrossCityService.queryMyAllOrder(state, uid); |
| | | datas.addAll(list2); |
| | | // List<Map<String, Object>> list2 = orderCrossCityService.queryMyAllOrder(state, uid); |
| | | // datas.addAll(list2); |
| | | //小件物流 |
| | | List<Map<String, Object>> list3 = orderLogisticsService.queryMyAllOrder(state, uid); |
| | | datas.addAll(list3); |
| | |
| | | switch (orderType){ |
| | | case 1://专车 |
| | | map = orderPrivateCarService.queryPushOrder(orderId); |
| | | String order = String.valueOf(map.get("startLon")) + "," + String.valueOf(map.get("startLat")); |
| | | String distance = gdMapElectricFenceUtil.getDistance(lon + "," + lat, order, 1).get("distance"); |
| | | map.put("startDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon)); |
| | | map.put("startDistance", null != distancematrix ? distancematrix.getDistance() / 1000 : 0); |
| | | |
| | | //总距离 |
| | | String end = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); |
| | | distance = gdMapElectricFenceUtil.getDistance(end, order, 1).get("distance"); |
| | | map.put("totalDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(map.get("endLat").toString()), Double.valueOf(map.get("endLon").toString())); |
| | | map.put("totalDistance", null != distancematrix ? distancematrix.getDistance() / 1000 : 0); |
| | | |
| | | Integer orderSource = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | if(orderSource == 1 || orderSource == 2 || orderSource == 3){ |
| | |
| | | } |
| | | break; |
| | | case 2://出租 |
| | | map = orderTaxiService.queryPushOrder(orderId); |
| | | String order1 = String.valueOf(map.get("startLon")) + "," + String.valueOf(map.get("startLat")); |
| | | String distance1 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, order1, 1).get("distance"); |
| | | map.put("startDistance", ToolUtil.isNotEmpty(distance1) ? Double.valueOf(distance1) / 1000 : 0); |
| | | |
| | | //总距离 |
| | | String end1 = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); |
| | | distance = gdMapElectricFenceUtil.getDistance(end1, order1, 1).get("distance"); |
| | | map.put("totalDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | |
| | | Integer orderSource1 = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | if(orderSource1 == 1 || orderSource1 == 2 || orderSource1 == 3){ |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "乘客下单"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 2 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "预约"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 2 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | | } |
| | | } |
| | | if(orderSource1 == 5){ |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "调度下单"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 2 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "预约"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 2 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | | } |
| | | } |
| | | // map = orderTaxiService.queryPushOrder(orderId); |
| | | // String order1 = String.valueOf(map.get("startLon")) + "," + String.valueOf(map.get("startLat")); |
| | | // String distance1 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, order1, 1).get("distance"); |
| | | // map.put("startDistance", ToolUtil.isNotEmpty(distance1) ? Double.valueOf(distance1) / 1000 : 0); |
| | | // |
| | | // //总距离 |
| | | // String end1 = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); |
| | | // distance = gdMapElectricFenceUtil.getDistance(end1, order1, 1).get("distance"); |
| | | // map.put("totalDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | // |
| | | // Integer orderSource1 = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | // if(orderSource1 == 1 || orderSource1 == 2 || orderSource1 == 3){ |
| | | // if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | // map.put("type", "乘客下单"); |
| | | // } |
| | | // if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | // map.put("type", "改派"); |
| | | // } |
| | | // if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 2 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | // map.put("type", "预约"); |
| | | // } |
| | | // if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 2 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | // map.put("type", "改派"); |
| | | // } |
| | | // } |
| | | // if(orderSource1 == 5){ |
| | | // if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | // map.put("type", "调度下单"); |
| | | // } |
| | | // if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | // map.put("type", "改派"); |
| | | // } |
| | | // if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 2 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | // map.put("type", "预约"); |
| | | // } |
| | | // if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 2 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | // map.put("type", "改派"); |
| | | // } |
| | | // } |
| | | break; |
| | | case 3://城际 |
| | | map = orderCrossCityService.queryPushOrder(orderId); |
| | | String order2 = String.valueOf(map.get("startLon")) + "," + String.valueOf(map.get("startLat")); |
| | | String distance2 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, order2, 1).get("distance"); |
| | | map.put("startDistance", ToolUtil.isNotEmpty(distance2) ? Double.valueOf(distance2) / 1000 : 0); |
| | | |
| | | //总距离 |
| | | String end2 = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); |
| | | distance = gdMapElectricFenceUtil.getDistance(end2, order2, 1).get("distance"); |
| | | map.put("totalDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | |
| | | Integer orderSource2 = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | if(orderSource2 == 1 || orderSource2 == 2 || orderSource2 == 3){ |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "乘客下单"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | | } |
| | | } |
| | | if(orderSource2 == 5){ |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "调度下单"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | | } |
| | | } |
| | | // map = orderCrossCityService.queryPushOrder(orderId); |
| | | // String order2 = String.valueOf(map.get("startLon")) + "," + String.valueOf(map.get("startLat")); |
| | | // String distance2 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, order2, 1).get("distance"); |
| | | // map.put("startDistance", ToolUtil.isNotEmpty(distance2) ? Double.valueOf(distance2) / 1000 : 0); |
| | | // |
| | | // //总距离 |
| | | // String end2 = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); |
| | | // distance = gdMapElectricFenceUtil.getDistance(end2, order2, 1).get("distance"); |
| | | // map.put("totalDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | // |
| | | // Integer orderSource2 = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | // if(orderSource2 == 1 || orderSource2 == 2 || orderSource2 == 3){ |
| | | // if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | // map.put("type", "乘客下单"); |
| | | // } |
| | | // if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | // map.put("type", "改派"); |
| | | // } |
| | | // } |
| | | // if(orderSource2 == 5){ |
| | | // if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | // map.put("type", "调度下单"); |
| | | // } |
| | | // if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | // map.put("type", "改派"); |
| | | // } |
| | | // } |
| | | break; |
| | | case 4://同城小件物流 |
| | | map = orderLogisticsService.queryPushOrder(orderId); |
| | | String order3 = String.valueOf(map.get("startLon")) + "," + String.valueOf(map.get("startLat")); |
| | | String distance3 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, order3, 1).get("distance"); |
| | | map.put("startDistance", ToolUtil.isNotEmpty(distance3) ? Double.valueOf(distance3) / 1000 : 0); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon)); |
| | | map.put("startDistance", null != distancematrix1 ? distancematrix1.getDistance() / 1000 : 0); |
| | | |
| | | //总距离 |
| | | String end3 = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); |
| | | distance = gdMapElectricFenceUtil.getDistance(end3, order3, 1).get("distance"); |
| | | map.put("totalDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(map.get("endLat").toString()), Double.valueOf(map.get("endLon").toString())); |
| | | map.put("totalDistance", null != distancematrix1 ? distancematrix1.getDistance() / 1000 : 0); |
| | | |
| | | Integer orderSource3 = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | if(orderSource3 == 1 || orderSource3 == 2 || orderSource3 == 3){ |
| | |
| | | } |
| | | break; |
| | | case 5://跨城小件物流 |
| | | map = orderLogisticsService.queryPushOrder(orderId); |
| | | String order4 = String.valueOf(map.get("startLon")) + "," + String.valueOf(map.get("startLat")); |
| | | String distance4 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, order4, 1).get("distance"); |
| | | map.put("startDistance", ToolUtil.isNotEmpty(distance4) ? Double.valueOf(distance4) / 1000 : 0); |
| | | |
| | | //总距离 |
| | | String end4 = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); |
| | | distance = gdMapElectricFenceUtil.getDistance(end4, order4, 1).get("distance"); |
| | | map.put("totalDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | |
| | | Integer orderSource4 = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | if(orderSource4 == 1 || orderSource4 == 2 || orderSource4 == 3){ |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "乘客下单"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | | } |
| | | } |
| | | if(orderSource4 == 5){ |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "调度下单"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | | } |
| | | } |
| | | // map = orderLogisticsService.queryPushOrder(orderId); |
| | | // String order4 = String.valueOf(map.get("startLon")) + "," + String.valueOf(map.get("startLat")); |
| | | // String distance4 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, order4, 1).get("distance"); |
| | | // map.put("startDistance", ToolUtil.isNotEmpty(distance4) ? Double.valueOf(distance4) / 1000 : 0); |
| | | // |
| | | // //总距离 |
| | | // String end4 = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); |
| | | // distance = gdMapElectricFenceUtil.getDistance(end4, order4, 1).get("distance"); |
| | | // map.put("totalDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | // |
| | | // Integer orderSource4 = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | // if(orderSource4 == 1 || orderSource4 == 2 || orderSource4 == 3){ |
| | | // if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | // map.put("type", "乘客下单"); |
| | | // } |
| | | // if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | // map.put("type", "改派"); |
| | | // } |
| | | // } |
| | | // if(orderSource4 == 5){ |
| | | // if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | // map.put("type", "调度下单"); |
| | | // } |
| | | // if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | // map.put("type", "改派"); |
| | | // } |
| | | // } |
| | | break; |
| | | case 6: |
| | | break; |
| | |
| | | case 1://专车 |
| | | return orderPrivateCarService.grabOrder(orderId, uid); |
| | | case 2://出租 |
| | | return orderTaxiService.grabOrder(orderId, uid); |
| | | // return orderTaxiService.grabOrder(orderId, uid); |
| | | case 3://城际 |
| | | return ResultUtil.success();//不作任何操作,跨城默认选择的司机 |
| | | case 4://同城小件 |
| | | return orderLogisticsService.grabOrder(orderId, uid); |
| | | case 5://跨城小件 |
| | | return orderLogisticsService.grabOrder(orderId, uid); |
| | | // return orderLogisticsService.grabOrder(orderId, uid); |
| | | case 6: |
| | | break; |
| | | } |
| | |
| | | map = orderPrivateCarService.queryOrderInfo(orderId); |
| | | break; |
| | | case 2://出租 |
| | | map = orderTaxiService.queryOrderInfo(orderId); |
| | | // map = orderTaxiService.queryOrderInfo(orderId); |
| | | break; |
| | | case 3://城际 |
| | | map = orderCrossCityService.queryOrderCrossCityInfo(orderId); |
| | | // map = orderCrossCityService.queryOrderCrossCityInfo(orderId); |
| | | break; |
| | | case 4://同城小件 |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | case 5://跨城小件 |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | // map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | case 6: |
| | | break; |
| | |
| | | case 1://专车 |
| | | return orderPrivateCarService.process(orderId, state, lon, lat, address,phone); |
| | | case 2://出租 |
| | | return orderTaxiService.process(orderId, state, lon, lat, address); |
| | | // return orderTaxiService.process(orderId, state, lon, lat, address); |
| | | case 3://城际 |
| | | return orderCrossCityService.process(orderId, state, lon, lat, address); |
| | | // return orderCrossCityService.process(orderId, state, lon, lat, address); |
| | | case 4://同城小件 |
| | | return orderLogisticsService.process(orderId, state, lon, lat, address); |
| | | case 5://跨城小件 |
| | | return orderLogisticsService.process(orderId, state, lon, lat, address); |
| | | // return orderLogisticsService.process(orderId, state, lon, lat, address); |
| | | case 6: |
| | | break; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import javax.mail.*; |
| | | import javax.mail.internet.InternetAddress; |
| | | import javax.mail.internet.MimeBodyPart; |
| | | import javax.mail.internet.MimeMessage; |
| | | import javax.mail.internet.MimeMultipart; |
| | | import java.util.Date; |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * 邮件工具类 |
| | | */ |
| | | public class EmailUtil { |
| | | |
| | | /* |
| | | * gmail邮箱SSL方式 |
| | | */ |
| | | private static void gmailssl(Properties props) { |
| | | final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; |
| | | props.put("mail.debug", "true"); |
| | | props.put("mail.smtp.host", "smtp.gmail.com"); |
| | | props.put("mail.smtp.ssl.enable", "true"); |
| | | props.put("mail.smtp.socketFactory.class", SSL_FACTORY); |
| | | props.put("mail.smtp.port", "465"); |
| | | props.put("mail.smtp.socketFactory.port", "465"); |
| | | props.put("mail.smtp.auth", "true"); |
| | | } |
| | | |
| | | |
| | | //gmail邮箱的TLS方式 |
| | | private static void gmailtls(Properties props) { |
| | | props.put("mail.smtp.auth", "true"); |
| | | props.put("mail.smtp.starttls.enable", "true"); |
| | | props.put("mail.smtp.host", "smtp.gmail.com"); |
| | | props.put("mail.smtp.port", "587"); |
| | | } |
| | | |
| | | /** |
| | | * 创建邮件内容 需科学上网 |
| | | * |
| | | * @param sentToEmail 接收人邮箱 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static boolean getMimeMessage(String sentToEmail, String subject, String content) throws Exception { |
| | | //1.创建一封邮件的实例对象 |
| | | Properties props = new Properties(); |
| | | //选择ssl方式 |
| | | gmailssl(props); |
| | | |
| | | final String username = "southwindservice@gmail.com";// gmail 邮箱 |
| | | final String password = "irkgrsuzxgmwrxzy";// Google应用专用密码 |
| | | // 当做多商户的时候需要使用getInstance, 如果只是一个邮箱发送的话就用getDefaultInstance |
| | | // Session.getDefaultInstance 会将username,password保存在session会话中 |
| | | // Session.getInstance 不进行保存 |
| | | Session session = Session.getInstance(props, |
| | | new Authenticator() { |
| | | protected PasswordAuthentication getPasswordAuthentication() { |
| | | return new PasswordAuthentication(username, password); |
| | | } |
| | | }); |
| | | MimeMessage msg = new MimeMessage(session); |
| | | //2.设置发件人地址 |
| | | msg.setFrom(new InternetAddress(sentToEmail)); |
| | | /** |
| | | * 3.设置收件人地址(可以增加多个收件人、抄送、密送),即下面这一行代码书写多行 |
| | | * MimeMessage.RecipientType.TO:发送 |
| | | * MimeMessage.RecipientType.CC:抄送 |
| | | * MimeMessage.RecipientType.BCC:密送 |
| | | */ |
| | | msg.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress(sentToEmail)); |
| | | //4.设置邮件主题 |
| | | msg.setSubject(subject, "UTF-8"); |
| | | // 6. 创建文本"节点" |
| | | MimeBodyPart text = new MimeBodyPart(); |
| | | // 这里添加图片的方式是将整个图片包含到邮件内容中, 实际上也可以以 http 链接的形式添加网络图片 |
| | | text.setContent(content, "text/html;charset=UTF-8"); |
| | | // 7. (文本+图片)设置 文本 和 图片"节点"的关系(将 文本 和 图片"节点"合成一个混合"节点") |
| | | MimeMultipart mm_text_image = new MimeMultipart(); |
| | | mm_text_image.addBodyPart(text); |
| | | mm_text_image.setSubType("related"); // 关联关系 |
| | | // 11. 设置整个邮件的关系(将最终的混合"节点"作为邮件的内容添加到邮件对象) |
| | | msg.setContent(mm_text_image); |
| | | //设置邮件的发送时间,默认立即发送 |
| | | msg.setSentDate(new Date()); |
| | | |
| | | Transport.send(msg); |
| | | return true; |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | boolean mimeMessage = getMimeMessage("393733352@qq.com", "测试内容", "这是一段测试内容"); |
| | | System.out.println(mimeMessage); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import org.gavaghan.geodesy.Ellipsoid; |
| | | import org.gavaghan.geodesy.GeodeticCalculator; |
| | | import org.gavaghan.geodesy.GeodeticCurve; |
| | | import org.gavaghan.geodesy.GlobalCoordinates; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 计算两个金纬度坐标之间的直线距离 |
| | | */ |
| | | public class GeodesyUtil { |
| | | |
| | | |
| | | /** |
| | | * 获取直线距离 |
| | | * @param fromLonLat |
| | | * @param toLonLat |
| | | * @return |
| | | */ |
| | | public static Map<String, Double> getDistance(String fromLonLat, String toLonLat){ |
| | | Map<String, Double> map = null; |
| | | if(ToolUtil.isNotEmpty(fromLonLat) && ToolUtil.isNotEmpty(toLonLat)){ |
| | | map = new HashMap<>(); |
| | | String[] from = fromLonLat.split(","); |
| | | String[] to = toLonLat.split(","); |
| | | GlobalCoordinates source = new GlobalCoordinates(Double.valueOf(from[1]), Double.valueOf(from[0])); |
| | | GlobalCoordinates target = new GlobalCoordinates(Double.valueOf(to[1]), Double.valueOf(to[0])); |
| | | double Sphere = getDistanceMeter(source, target, Ellipsoid.Sphere); |
| | | double WGS84 = getDistanceMeter(source, target, Ellipsoid.WGS84); |
| | | double GRS80 = getDistanceMeter(source, target, Ellipsoid.GRS80); |
| | | double GRS67 = getDistanceMeter(source, target, Ellipsoid.GRS67); |
| | | double ANS = getDistanceMeter(source, target, Ellipsoid.ANS); |
| | | double WGS72 = getDistanceMeter(source, target, Ellipsoid.WGS72); |
| | | double Clarke1858 = getDistanceMeter(source, target, Ellipsoid.Clarke1858); |
| | | double Clarke1880 = getDistanceMeter(source, target, Ellipsoid.Clarke1880); |
| | | // logger.info("Sphere坐标系计算结果:"+Sphere + "米"); |
| | | // logger.info("WGS84坐标系计算结果:"+WGS84 + "米"); |
| | | // logger.info("GRS80坐标系计算结果:"+GRS80 + "米"); |
| | | // logger.info("GRS67坐标系计算结果:"+GRS67 + "米"); |
| | | // logger.info("ANS坐标系计算结果:"+ANS + "米"); |
| | | // logger.info("WGS72坐标系计算结果:"+WGS72 + "米"); |
| | | // logger.info("Clarke1858坐标系计算结果:"+Clarke1858 + "米"); |
| | | // logger.info("Clarke1880坐标系计算结果:"+Clarke1880 + "米"); |
| | | map.put("Sphere", Sphere); |
| | | map.put("WGS84", WGS84); |
| | | map.put("GRS80", GRS80); |
| | | map.put("GRS67", GRS67); |
| | | map.put("ANS", ANS); |
| | | map.put("WGS72", WGS72); |
| | | map.put("Clarke1858", Clarke1858); |
| | | map.put("Clarke1880", Clarke1880); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | private static double getDistanceMeter(GlobalCoordinates gpsFrom, GlobalCoordinates gpsTo, Ellipsoid ellipsoid){ |
| | | //创建GeodeticCalculator,调用计算方法,传入坐标系、经纬度用于计算距离 |
| | | GeodeticCurve geoCurve = new GeodeticCalculator().calculateGeodeticCurve(ellipsoid, gpsFrom, gpsTo); |
| | | return geoCurve.getEllipsoidalDistance(); |
| | | } |
| | | |
| | | |
| | | |
| | | public static void main(String[] ages){ |
| | | GeodesyUtil geodesyUtil = new GeodesyUtil(); |
| | | geodesyUtil.getDistance("115.481028,39.989643", "114.465302,40.004717"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.GoogleMap; |
| | | |
| | | public class AddressComponentsVo { |
| | | /** |
| | | * 长名称 |
| | | */ |
| | | private String longName; |
| | | /** |
| | | * 短名称 |
| | | */ |
| | | private String shortName; |
| | | |
| | | public String getLongName() { |
| | | return longName; |
| | | } |
| | | |
| | | public void setLongName(String longName) { |
| | | this.longName = longName; |
| | | } |
| | | |
| | | public String getShortName() { |
| | | return shortName; |
| | | } |
| | | |
| | | public void setShortName(String shortName) { |
| | | this.shortName = shortName; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.GoogleMap; |
| | | |
| | | public class DistancematrixVo { |
| | | /** |
| | | * 预估时间(秒) |
| | | */ |
| | | private Long duration; |
| | | |
| | | /** |
| | | * 预估里程(米) |
| | | */ |
| | | private Long distance; |
| | | |
| | | public Long getDuration() { |
| | | return duration; |
| | | } |
| | | |
| | | public void setDuration(Long duration) { |
| | | this.duration = duration; |
| | | } |
| | | |
| | | public Long getDistance() { |
| | | return distance; |
| | | } |
| | | |
| | | public void setDistance(Long distance) { |
| | | this.distance = distance; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.GoogleMap; |
| | | |
| | | public class FindPlaceFromTextVo { |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 详细地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private Double lat; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private Double lng; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public Double getLat() { |
| | | return lat; |
| | | } |
| | | |
| | | public void setLat(Double lat) { |
| | | this.lat = lat; |
| | | } |
| | | |
| | | public Double getLng() { |
| | | return lng; |
| | | } |
| | | |
| | | public void setLng(Double lng) { |
| | | this.lng = lng; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.GoogleMap; |
| | | |
| | | public class GeocodeVo { |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private double lat; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private double lng; |
| | | |
| | | public double getLat() { |
| | | return lat; |
| | | } |
| | | |
| | | public void setLat(double lat) { |
| | | this.lat = lat; |
| | | } |
| | | |
| | | public double getLng() { |
| | | return lng; |
| | | } |
| | | |
| | | public void setLng(double lng) { |
| | | this.lng = lng; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.GoogleMap; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.maps.*; |
| | | import com.google.maps.model.*; |
| | | |
| | | /** |
| | | * 谷歌地图工具类 |
| | | */ |
| | | public class GoogleMapUtil { |
| | | |
| | | private final static String key = "AIzaSyA_FEliOkbkL1IAHQsnBpbpo9MlIp729H0"; |
| | | |
| | | |
| | | /** |
| | | * 地理编码(地址获取位置坐标) |
| | | * @param address 地址信息 |
| | | * @throws Exception |
| | | */ |
| | | public static GeocodeVo getGeocode(String address) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | GeocodingResult[] results = GeocodingApi.geocode(context, address).await(); |
| | | GeocodeVo vo = null; |
| | | if(results.length > 0){ |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.out.println(gson.toJson(results[0].addressComponents)); |
| | | |
| | | Geometry geometry = results[0].geometry; |
| | | LatLng location = geometry.location; |
| | | vo = new GeocodeVo(); |
| | | vo.setLat(location.lat); |
| | | vo.setLng(location.lng); |
| | | } |
| | | context.shutdown(); |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 逆地理编码获取地址信息 |
| | | * @param lat 纬度 |
| | | * @param lng 经度 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static ReverseGeocodeVo getReverseGeocode(double lat, double lng) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | GeocodingApiRequest request = GeocodingApi.reverseGeocode(context, new LatLng(lat, lng)); |
| | | GeocodingResult[] results = request.await(); |
| | | ReverseGeocodeVo vo = null; |
| | | if(results.length > 0){ |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.out.println(gson.toJson(results[0].addressComponents)); |
| | | |
| | | |
| | | vo = new ReverseGeocodeVo(); |
| | | AddressComponent[] addressComponents = results[0].addressComponents; |
| | | AddressComponentsVo[] addressComponentsVos = new AddressComponentsVo[addressComponents.length]; |
| | | for (int i = 0; i < addressComponents.length; i++) { |
| | | addressComponentsVos[i].setLongName(addressComponents[i].longName); |
| | | addressComponentsVos[i].setShortName(addressComponents[i].shortName); |
| | | } |
| | | String address = results[0].formattedAddress; |
| | | vo.setAddressComponentsVos(addressComponentsVos); |
| | | vo.setAddress(address); |
| | | } |
| | | context.shutdown(); |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 搜索地图获取地图结果 |
| | | * @param input |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static FindPlaceFromTextVo findplacefromtext(String input) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | FindPlaceFromTextRequest request = new FindPlaceFromTextRequest(context); |
| | | request.input(input); |
| | | request.inputType(FindPlaceFromTextRequest.InputType.TEXT_QUERY); |
| | | FindPlaceFromText findPlaceFromText = request.await(); |
| | | PlacesSearchResult[] candidates = findPlaceFromText.candidates; |
| | | FindPlaceFromTextVo vo = null; |
| | | if(candidates.length > 0){ |
| | | vo = new FindPlaceFromTextVo(); |
| | | String formattedAddress = candidates[0].formattedAddress; |
| | | String name = candidates[0].name; |
| | | Geometry geometry = candidates[0].geometry; |
| | | LatLng location = geometry.location; |
| | | double lat = location.lat; |
| | | double lng = location.lng; |
| | | |
| | | vo.setName(name); |
| | | vo.setAddress(formattedAddress); |
| | | vo.setLat(lat); |
| | | vo.setLng(lng); |
| | | } |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取两个地点之间的预估里程和预估时间 |
| | | * @param origin 起点 |
| | | * @param destination 终点 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static DistancematrixVo getDistancematrix(String origin, String destination) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | DistanceMatrixApiRequest request = DistanceMatrixApi.getDistanceMatrix(context, new String[]{origin}, new String[]{destination}); |
| | | request.mode(TravelMode.DRIVING);//出行方式(驾车) |
| | | DistanceMatrix distanceMatrix = request.await(); |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.out.println(gson.toJson(distanceMatrix)); |
| | | context.shutdown(); |
| | | |
| | | DistanceMatrixElement elements = distanceMatrix.rows[0].elements[0]; |
| | | DistancematrixVo vo = new DistancematrixVo(); |
| | | vo.setDistance(elements.distance.inMeters); |
| | | vo.setDuration(elements.duration.inSeconds); |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取两点之间的距离 |
| | | * @param sLat |
| | | * @param sLnt |
| | | * @param eLat |
| | | * @param eLnt |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static DistancematrixVo getDistancematrix(Double sLat, Double sLnt, Double eLat, Double eLnt) throws Exception{ |
| | | ReverseGeocodeVo reverseGeocode = getReverseGeocode(sLat, sLnt); |
| | | ReverseGeocodeVo reverseGeocode1 = getReverseGeocode(eLat, eLnt); |
| | | if(null != reverseGeocode && null != reverseGeocode1){ |
| | | String origin = reverseGeocode.getAddress(); |
| | | String destination = reverseGeocode1.getAddress(); |
| | | return getDistancematrix(origin, destination); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取两地点之间的线路规划 |
| | | * @param origin 起点 要计算方向的位置ID、地址或文本纬度/经度值。目标参数的选项与原点参数的相同。 |
| | | * @param destination 终点 要计算方向的位置ID、地址或文本纬度/经度值。目标参数的选项与原点参数的相同。 |
| | | * |
| | | */ |
| | | public static void getDirections(String origin, String destination) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | DirectionsApiRequest directions = DirectionsApi.getDirections(context, origin, destination); |
| | | directions.mode(TravelMode.DRIVING);//出行方式(驾车) |
| | | DirectionsResult result = directions.await(); |
| | | |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.out.println(gson.toJson(result)); |
| | | context.shutdown(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static void main(String[] ages){ |
| | | try { |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.GoogleMap; |
| | | |
| | | public class ReverseGeocodeVo { |
| | | /** |
| | | * 完整地址名称 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 分段地址名称数组 |
| | | */ |
| | | private AddressComponentsVo[] addressComponentsVos; |
| | | |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public AddressComponentsVo[] getAddressComponentsVos() { |
| | | return addressComponentsVos; |
| | | } |
| | | |
| | | public void setAddressComponentsVos(AddressComponentsVo[] addressComponentsVos) { |
| | | this.addressComponentsVos = addressComponentsVos; |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | return; |
| | | } |
| | | if((state == 2 || state == 3 || state == 4) || (oldState != null && (oldState == 2 || oldState == 3 || oldState == 4))){//前往预约地 |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(value, startLonLat, 1); |
| | | String d = "0"; |
| | | String t = "0"; |
| | | if(null == distance){ |
| | | System.err.println("查询距离出错了"); |
| | | return; |
| | | if(ToolUtil.isNotEmpty(value) && ToolUtil.isNotEmpty(startLonLat)){ |
| | | String[] split = value.split(","); |
| | | String[] split1 = startLonLat.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), Double.valueOf(split1[1]), Double.valueOf(split1[0])); |
| | | if(null == distancematrix){ |
| | | System.err.println("地图获取距离出错"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | d = distancematrix.getDistance().toString();//距离m |
| | | t = distancematrix.getDuration().toString();//时间s |
| | | } |
| | | } |
| | | d = new BigDecimal(d).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(t).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | map.put("reservationMileage", d);//当前位置距离预约点的剩余里程 |
| | | map.put("reservationTime", t);//当前位置距离预约点的剩余分钟 |
| | | map.put("servedMileage", "0");//距离起点已经服务的里程 |
| | |
| | | map.put("servedMileage", String.valueOf((null == servedMileage ? 0 : servedMileage) / 1000));//距离起点已经服务的里程 |
| | | Integer servedTime = Long.valueOf((new Date().getTime() - startServiceTime) / 60000).intValue(); |
| | | map.put("servedTime", servedTime + "");//距离起点已经服务的时间 |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(value, endLonLat, 1); |
| | | |
| | | String d = "0"; |
| | | String t = "0"; |
| | | if(null == distance){ |
| | | System.err.println("查询距离出错了"); |
| | | if(ToolUtil.isNotEmpty(value) && ToolUtil.isNotEmpty(endLonLat)){ |
| | | String[] split = value.split(","); |
| | | String[] split1 = endLonLat.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), Double.valueOf(split1[1]), Double.valueOf(split1[0])); |
| | | if(null == distancematrix){ |
| | | System.err.println("地图获取距离出错"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | d = distancematrix.getDistance().toString();//距离m |
| | | t = distancematrix.getDuration().toString();//时间s |
| | | } |
| | | } |
| | | |
| | | d = new BigDecimal(d).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(t).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | map.put("laveMileage", d);//距离终点剩余未服务的里程数 |
| | | map.put("laveTime", t);//距离终端剩余未服务的预计时间 |
| | | } |
| | | File file = new File(filePath + orderId + "_1.txt"); |
| | | File file = new File(filePath + orderId + "_" + orderType + ".txt"); |
| | | if(file.exists()){ |
| | | //读取文件(字符流) |
| | | BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8")); |
| | |
| | | private String name; |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | @ApiModelProperty("邮箱") |
| | | private String email; |
| | | @ApiModelProperty("性别") |
| | | private Integer sex; |
| | | @ApiModelProperty("车牌") |
| | |
| | | private String driveCardImgUrl; |
| | | @ApiModelProperty("网约车资格证照片") |
| | | private String networkCarlssueImg; |
| | | @ApiModelProperty("语言(1=简体中文,2=英语,3=法语)") |
| | | private Integer language; |
| | | |
| | | @ApiModelProperty("审核状态(1=待审核,2=正常,3=冻结,4=拒绝)") |
| | | private Integer authState; |
| | |
| | | this.laveBusinessMoney = laveBusinessMoney; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public Integer getLanguage() { |
| | | return language; |
| | | } |
| | | |
| | | public void setLanguage(Integer language) { |
| | | this.language = language; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "DriverInfoWarpper{" + |
| | |
| | | driverInfoWarpper.setQrCodeIsOpen(null != map.get("qrCodeIsOpen") ? Boolean.valueOf(map.get("qrCodeIsOpen").toString()) : false); |
| | | driverInfoWarpper.setName(null != map.get("name") ? String.valueOf(map.get("name")) : ""); |
| | | driverInfoWarpper.setPhone(null != map.get("phone") ? String.valueOf(map.get("phone")) : ""); |
| | | driverInfoWarpper.setEmail(null != map.get("email") ? String.valueOf(map.get("email")) : ""); |
| | | driverInfoWarpper.setSex(null != map.get("sex") ? Integer.valueOf(String.valueOf(map.get("sex"))) : 0); |
| | | driverInfoWarpper.setLicensePlate(null != map.get("licensePlate") ? String.valueOf(map.get("licensePlate")) : ""); |
| | | driverInfoWarpper.setBrand(null != map.get("brand") ? String.valueOf(map.get("brand")) : ""); |
| | |
| | | driverInfoWarpper.setPlaceOfEmployment(null != map.get("placeOfEmployment") ? String.valueOf(map.get("placeOfEmployment")) : ""); |
| | | driverInfoWarpper.setLaveActivityMoney(null != map.get("laveActivityMoney") ? Double.valueOf(String.valueOf(map.get("laveActivityMoney"))) : 0); |
| | | driverInfoWarpper.setLaveBusinessMoney(null != map.get("laveBusinessMoney") ? Double.valueOf(String.valueOf(map.get("laveBusinessMoney"))) : 0); |
| | | driverInfoWarpper.setLanguage(null != map.get("language") ? Integer.valueOf(String.valueOf(map.get("language"))) : 2); |
| | | } |
| | | return driverInfoWarpper; |
| | | } |
| | |
| | | private Date getDriverLicenseDate; |
| | | @ApiModelProperty("服务模式(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)多个以逗号分隔") |
| | | private String type; |
| | | @ApiModelProperty("从业地行政代码(510100)") |
| | | private String placeOfEmployment; |
| | | @ApiModelProperty("从业地地址(带分隔符)") |
| | | private String placeOfPractice; |
| | | @ApiModelProperty("邮件") |
| | | private String email; |
| | | @ApiModelProperty("从业地城市id") |
| | | private Integer placeOfPracticeId; |
| | | @ApiModelProperty("头像") |
| | | private String headImgUrl; |
| | | @ApiModelProperty("驾驶证照片") |
| | | private String driveCardImgUrl; |
| | | @ApiModelProperty("网约车资格证照片") |
| | | private String networkCarlssueImg; |
| | | @ApiModelProperty("出租车资格证号") |
| | | private String taxiAptitudeCard; |
| | | @ApiModelProperty("驾驶证照片正面") |
| | | private String driveCardImgUrl1; |
| | | @ApiModelProperty("驾驶证照片背面") |
| | | private String driveCardImgUrl2; |
| | | |
| | | |
| | | public String getPhone() { |
| | |
| | | this.driverContactAddress = driverContactAddress; |
| | | } |
| | | |
| | | public String getDriverContactAddress_() { |
| | | return driverContactAddress_; |
| | | } |
| | | |
| | | public void setDriverContactAddress_(String driverContactAddress_) { |
| | | this.driverContactAddress_ = driverContactAddress_; |
| | | } |
| | | |
| | | public String getIdCard() { |
| | | return idCard; |
| | | } |
| | |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getPlaceOfEmployment() { |
| | | return placeOfEmployment; |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setPlaceOfEmployment(String placeOfEmployment) { |
| | | this.placeOfEmployment = placeOfEmployment; |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public Integer getPlaceOfPracticeId() { |
| | | return placeOfPracticeId; |
| | | } |
| | | |
| | | public void setPlaceOfPracticeId(Integer placeOfPracticeId) { |
| | | this.placeOfPracticeId = placeOfPracticeId; |
| | | } |
| | | |
| | | public String getHeadImgUrl() { |
| | |
| | | this.headImgUrl = headImgUrl; |
| | | } |
| | | |
| | | public String getDriveCardImgUrl() { |
| | | return driveCardImgUrl; |
| | | public String getDriveCardImgUrl1() { |
| | | return driveCardImgUrl1; |
| | | } |
| | | |
| | | public void setDriveCardImgUrl(String driveCardImgUrl) { |
| | | this.driveCardImgUrl = driveCardImgUrl; |
| | | public void setDriveCardImgUrl1(String driveCardImgUrl1) { |
| | | this.driveCardImgUrl1 = driveCardImgUrl1; |
| | | } |
| | | |
| | | public String getNetworkCarlssueImg() { |
| | | return networkCarlssueImg; |
| | | public String getDriveCardImgUrl2() { |
| | | return driveCardImgUrl2; |
| | | } |
| | | |
| | | public void setNetworkCarlssueImg(String networkCarlssueImg) { |
| | | this.networkCarlssueImg = networkCarlssueImg; |
| | | } |
| | | |
| | | public String getTaxiAptitudeCard() { |
| | | return taxiAptitudeCard; |
| | | } |
| | | |
| | | public void setTaxiAptitudeCard(String taxiAptitudeCard) { |
| | | this.taxiAptitudeCard = taxiAptitudeCard; |
| | | } |
| | | |
| | | public String getDriverContactAddress_() { |
| | | return driverContactAddress_; |
| | | } |
| | | |
| | | public void setDriverContactAddress_(String driverContactAddress_) { |
| | | this.driverContactAddress_ = driverContactAddress_; |
| | | } |
| | | |
| | | public String getPlaceOfPractice() { |
| | | return placeOfPractice; |
| | | } |
| | | |
| | | public void setPlaceOfPractice(String placeOfPractice) { |
| | | this.placeOfPractice = placeOfPractice; |
| | | public void setDriveCardImgUrl2(String driveCardImgUrl2) { |
| | | this.driveCardImgUrl2 = driveCardImgUrl2; |
| | | } |
| | | |
| | | @Override |
| | |
| | | ", name='" + name + '\'' + |
| | | ", sex=" + sex + |
| | | ", driverContactAddress='" + driverContactAddress + '\'' + |
| | | ", driverContactAddress_='" + driverContactAddress_ + '\'' + |
| | | ", idCard='" + idCard + '\'' + |
| | | ", idCardImgUrl1='" + idCardImgUrl1 + '\'' + |
| | | ", idCardImgUrl2='" + idCardImgUrl2 + '\'' + |
| | | ", getDriverLicenseDate=" + getDriverLicenseDate + |
| | | ", type=" + type + |
| | | ", placeOfEmployment='" + placeOfEmployment + '\'' + |
| | | ", type='" + type + '\'' + |
| | | ", email='" + email + '\'' + |
| | | ", placeOfPracticeId=" + placeOfPracticeId + |
| | | ", headImgUrl='" + headImgUrl + '\'' + |
| | | ", driveCardImgUrl='" + driveCardImgUrl + '\'' + |
| | | ", networkCarlssueImg='" + networkCarlssueImg + '\'' + |
| | | ", taxiAptitudeCard='" + taxiAptitudeCard + '\'' + |
| | | ", driveCardImgUrl1='" + driveCardImgUrl1 + '\'' + |
| | | ", driveCardImgUrl2='" + driveCardImgUrl2 + '\'' + |
| | | '}'; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |