| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | 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.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.Income; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ALiSendSms; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.EmailUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | |
| | | @Autowired |
| | | private IDriverOnlineService driverOnlineService; |
| | | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Value("${share.url}") |
| | | private String shareUrl; |
| | | |
| | | @Autowired |
| | | private TEmailService emailService; |
| | | |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "场景类型(1=身份验证,2=登录确认,3=用户注册,4=修改密码)", name = "type", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil queryCaptcha(String phone, Integer type){ |
| | | public ResultUtil queryCaptcha(String phone, Integer type, Integer language){ |
| | | if(ToolUtil.isNotEmpty(phone)){ |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | try { |
| | | return driverService.queryCaptcha(phone, type); |
| | | return driverService.queryCaptcha(phone, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "邮箱地址", name = "email", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil queryEmailCaptcha(String email){ |
| | | public ResultUtil queryEmailCaptcha(String email, Integer language){ |
| | | if(ToolUtil.isNotEmpty(email)){ |
| | | try { |
| | | return driverService.queryEmailCaptcha(email); |
| | | return driverService.queryEmailCaptcha(email, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiOperation(value = "验证验证码", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "邮箱", name = "email", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "验证码", name = "code", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil checkCaptcha(String email, String code){ |
| | | public ResultUtil checkCaptcha(String email, String phone, String code, Integer language){ |
| | | try { |
| | | 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("验证码无效"); |
| | | if(ToolUtil.isNotEmpty(phone)){ |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | } |
| | | boolean b = driverService.checkCaptcha(email, phone, code); |
| | | return b ? ResultUtil.success() : ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid CAPTCHA" : "CAPTCHA non valide"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/registeredDriver") |
| | | @ApiOperation(value = "司机提交注册申请", tags = {"分享专用"}, notes = "") |
| | | @ApiOperation(value = "司机提交注册申请【1.1】", tags = {"分享专用"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号码运营商", name = "phoneOperator", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "密码", name = "password", required = true, dataType = "String"), |
| | |
| | | @ApiImplicitParam(value = "用户类型(1=用户,2=司机)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "注册类型(1=司机注册,2=用户注册)", name = "userType", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil registeredDriver(String phone, String code, String password, Integer uid, Integer type, Integer userType){ |
| | | public ResultUtil registeredDriver(String phoneOperator, String phone, String code, String password, Integer uid, Integer type, Integer userType, Integer language){ |
| | | try { |
| | | return driverService.registeredDriver(phone, code, password, uid, type, userType); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | switch (phoneOperator){ |
| | | case "MTN": |
| | | phoneOperator = "GH-MTN-B2C"; |
| | | break; |
| | | case "TIGO": |
| | | phoneOperator = "GH-TIGO-B2C"; |
| | | break; |
| | | case "VODAFONE": |
| | | phoneOperator = "GH-VODAFONE-B2C"; |
| | | break; |
| | | case "AIRTEL": |
| | | phoneOperator = "GH-AIRTEL-B2C"; |
| | | break; |
| | | } |
| | | return driverService.registeredDriver1(phoneOperator, phone, code, password, uid, type, userType, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/registeredDriver_") |
| | | @ApiOperation(value = "司机提交注册申请", tags = {"司机端-注册"}, notes = "") |
| | | @ApiOperation(value = "司机提交注册申请【1.1】", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号码运营商", name = "phoneOperator", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "密码", name = "password", required = true, dataType = "String"), |
| | |
| | | @ApiImplicitParam(value = "用户类型(1=用户,2=司机)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "注册类型(1=司机注册,2=用户注册)", name = "userType", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<LoginWarpper> registeredDriver_(String phone, String code, String password, Integer uid, Integer type, Integer userType){ |
| | | public ResultUtil<LoginWarpper> registeredDriver_(String phoneOperator, String phone, String code, String password, Integer uid, Integer type, Integer userType, Integer language){ |
| | | try { |
| | | return driverService.registeredDriver(phone, code, password, uid, type, userType); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | switch (phoneOperator){ |
| | | case "MTN": |
| | | phoneOperator = "GH-MTN-B2C"; |
| | | break; |
| | | case "TIGO": |
| | | phoneOperator = "GH-TIGO-B2C"; |
| | | break; |
| | | case "VODAFONE": |
| | | phoneOperator = "GH-VODAFONE-B2C"; |
| | | break; |
| | | case "AIRTEL": |
| | | phoneOperator = "GH-AIRTEL-B2C"; |
| | | break; |
| | | } |
| | | return driverService.registeredDriver(phoneOperator, phone, code, password, uid, type, userType, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/queryNeedCertificate") |
| | | @ApiOperation(value = "注册完善个人信息根据选择的从业地判断是否需要网约车资格证", tags = {"司机端-注册"}, notes = "0=城市未开通,1=是,2=否") |
| | | @PostMapping("/base/driver/queryAllCity") |
| | | @ApiOperation(value = "获取所有城市", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "城市行政编号", name = "code", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil queryNeedCertificate(String code){ |
| | | public ResultUtil<List<City>> queryAllCity(){ |
| | | try { |
| | | Integer integer = driverService.queryNeedCertificate(code); |
| | | return ResultUtil.success(integer == null ? 0 : integer); |
| | | List<City> cities = cityService.selectList(null); |
| | | return ResultUtil.success(cities); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/updateDriver") |
| | | @ApiOperation(value = "司机注册后完善个人信息【1.0】", tags = {"司机端-注册"}, notes = "") |
| | | @ApiOperation(value = "司机注册后完善个人信息【1.1】", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "司机id", name = "uid", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil updateDriver(RegisteredWarpper registeredWarpper, Integer uid){ |
| | | public ResultUtil updateDriver(RegisteredWarpper registeredWarpper, Integer uid, Integer language){ |
| | | try { |
| | | return driverService.updateDriver(registeredWarpper, uid); |
| | | return driverService.updateDriver(registeredWarpper, uid, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/editEmail") |
| | | @ApiOperation(value = "个人中心修改邮箱【1.0】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "邮箱", name = "email", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil editEmail(String email, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Driver driver = driverService.selectById(uid); |
| | | driver.setEmail(email); |
| | | driverService.updateById(driver); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/getEmailList") |
| | | @ApiOperation(value = "获取邮箱信息", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<EmailWarpper>> getEmailList(Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<TEmail> tEmails = emailService.selectList(new EntityWrapper<TEmail>().eq("userId", uid).eq("type", 2).orderBy("createTime", false)); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | List<EmailWarpper> list = new ArrayList<>(); |
| | | for (TEmail tEmail : tEmails) { |
| | | EmailWarpper warpper = new EmailWarpper(); |
| | | BeanUtils.copyProperties(tEmail, warpper); |
| | | warpper.setCreateTime(DateUtil.conversionFormat(language, sdf.format(tEmail.getCreateTime()))); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(tEmail.getCreateTime())-1; |
| | | warpper.setWeek(EmailUtil.getWeek(language,i)); |
| | | list.add(warpper); |
| | | } |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机注册后完善车辆信息 |
| | | * @param |
| | |
| | | @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 = "drivingLicenseNumber", required = true, 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 = "人车合一照片", name = "peopleAndCarsPhone", 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 drivingLicenseEndTime, |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid, Integer carId){ |
| | | public ResultUtil addDriverCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicenseNumber, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid, Integer carId, String peopleAndCarsPhone, Integer language){ |
| | | try { |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto, commercialInsuranceTime, uid,carId); |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicenseNumber, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto, commercialInsuranceTime, uid,carId, peopleAndCarsPhone, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @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){ |
| | | public ResultUtil resetPassword(String phone, String code, String password, Integer language){ |
| | | try { |
| | | return driverService.resetPassword(phone, code, password); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return driverService.resetPassword(phone, code, password, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取忘记密码页面的电话 |
| | |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "密码", name = "password", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil<LoginWarpper> driverLogin(String phone, String password){ |
| | | public ResultUtil<LoginWarpper> driverLogin(String phone, String password, Integer language){ |
| | | try { |
| | | return driverService.driverLogin(phone, password); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return driverService.driverLogin(phone, password, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<HomeWarpper> queryHomeData(HttpServletRequest request){ |
| | | public ResultUtil<HomeWarpper> queryHomeData(Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Map<String, Object> map = driverService.queryHomeData(uid); |
| | | Map<String, Object> map = driverService.queryHomeData(uid, language); |
| | | return ResultUtil.success(HomeWarpper.getHomeWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机上下班操作 |
| | |
| | | @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){ |
| | | public ResultUtil work(String type, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.work(uid, type); |
| | | return driverService.work(uid, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/work2") |
| | | @ApiOperation(value = "司机上下班操作,同时设置接单类型【1.0】", tags = {"司机端-车载端"}, notes = "") |
| | |
| | | @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){ |
| | | public ResultUtil work2(String type, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.work2(uid, type); |
| | | return driverService.work2(uid, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryHomeNum") |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryHomeNum(HttpServletRequest request){ |
| | | public ResultUtil queryHomeNum(Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Map<String, Object> map = driverService.queryHomeNum(uid); |
| | | Map<String, Object> map = driverService.queryHomeNum(uid, language); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 上班时选择的业务类型 |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<BaseWarpper>> queryMyBusiness(HttpServletRequest request){ |
| | | public ResultUtil<List<BaseWarpper>> queryMyBusiness(Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | // TODO: 2020/7/21 修改为个人中心中设置的接单业务类型。 |
| | | List<BaseWarpper> list = driverService.queryMyBusiness(uid); |
| | | List<BaseWarpper> list = driverService.queryMyBusiness(uid, language); |
| | | |
| | | List<Integer> integers = driverOrdersService.queryOrders(uid); |
| | | List<BaseWarpper> data = new ArrayList<>(); |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 存储订单服务中的司机位置 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/queryInfo_") |
| | | @ApiOperation(value = "根据用户id获取数据", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "司机id", name = "uid", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<DriverInfoWarpper> queryInfo_(Integer uid){ |
| | | public ResultUtil<DriverInfoWarpper> queryInfo_(Integer language, Integer uid){ |
| | | try { |
| | | Map<String, Object> map = driverService.queryInfo(uid); |
| | | Map<String, Object> map = driverService.queryInfo(language, uid); |
| | | return ResultUtil.success(DriverInfoWarpper.getDriverInfoWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取个人中心详情 |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<DriverInfoWarpper> queryInfo(HttpServletRequest request){ |
| | | public ResultUtil<DriverInfoWarpper> queryInfo(Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Map<String, Object> map = driverService.queryInfo(uid); |
| | | Map<String, Object> map = driverService.queryInfo(language, uid); |
| | | map.put("qrCodeIsOpen",driverService.getAppOpenInfo(1)==1); |
| | | DriverInfoWarpper driverInfoWarpper = DriverInfoWarpper.getDriverInfoWarpper(map); |
| | | Double money = driverService.getThisWeekMoney(uid); |
| | | driverInfoWarpper.setLaveBusinessMoney(driverInfoWarpper.getLaveBusinessMoney()-(money==null?0d:money)); |
| | | driverInfoWarpper.setLaveBusinessNextWeekMoney(money==null?0d:money); |
| | | // Double money = driverService.getThisWeekMoney(uid); |
| | | // driverInfoWarpper.setLaveBusinessMoney(driverInfoWarpper.getLaveBusinessMoney()-(money==null?0d:money)); |
| | | driverInfoWarpper.setLaveBusinessNextWeekMoney(0D); |
| | | return ResultUtil.success(driverInfoWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改手机号码 |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/updatePhone") |
| | | @ApiOperation(value = "修改手机号码", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "修改手机号码【1.1】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号码运营商", name = "phoneOperator", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "新电话号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updatePhone(String phone, String code, HttpServletRequest request){ |
| | | public ResultUtil updatePhone(String phoneOperator, String phone, String code, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.updatePhone(phone, code, uid); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | switch (phoneOperator){ |
| | | case "MTN": |
| | | phoneOperator = "GH-MTN-B2C"; |
| | | break; |
| | | case "TIGO": |
| | | phoneOperator = "GH-TIGO-B2C"; |
| | | break; |
| | | case "VODAFONE": |
| | | phoneOperator = "GH-VODAFONE-B2C"; |
| | | break; |
| | | case "AIRTEL": |
| | | phoneOperator = "GH-AIRTEL-B2C"; |
| | | break; |
| | | } |
| | | return driverService.updatePhone(phoneOperator, phone, code, uid, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改密码 |
| | | * @param password |
| | |
| | | @ApiImplicitParam(value = "新密码", name = "password", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updatePassword(String password, HttpServletRequest request){ |
| | | public ResultUtil updatePassword(String password, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | driverService.updatePassword(password, uid); |
| | | driverService.updatePassword(password, uid, language); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取设置接单的业务类型列表 |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<OrdersWarpper>> querySetOrders(HttpServletRequest request){ |
| | | public ResultUtil<List<OrdersWarpper>> querySetOrders(Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<BaseWarpper> list = driverService.queryMyBusiness(uid); |
| | | List<BaseWarpper> list = driverService.queryMyBusiness(uid, language); |
| | | List<Integer> integers = driverOrdersService.queryOrders(uid); |
| | | List<OrdersWarpper> data = new ArrayList<>(); |
| | | for(BaseWarpper b : list){ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 设置接单规则 |
| | | * @param type |
| | |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updateOrders(Integer type, HttpServletRequest request){ |
| | | public ResultUtil updateOrders(Integer type, Integer language, HttpServletRequest request){ |
| | | try{ |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverOrdersService.updateOrders(uid, type); |
| | | return driverOrdersService.updateOrders(uid, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取当前车辆及空闲车辆 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 更换车辆 |
| | | * @param carId |
| | |
| | | @ApiImplicitParam(value = "车辆id", name = "carId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil replaceCar(Integer carId, HttpServletRequest request){ |
| | | public ResultUtil replaceCar(Integer carId, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.replaceCar(carId, uid); |
| | | return driverService.replaceCar(carId, uid, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<BaseWarpper>> queryPenalties(Integer pageNum, Integer size, HttpServletRequest request){ |
| | | public ResultUtil<List<BaseWarpper>> queryPenalties(Integer language, Integer pageNum, Integer size, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Map<String, Object>> list = driverService.queryPenalties(pageNum, size, uid); |
| | | List<Map<String, Object>> list = driverService.queryPenalties(language, pageNum, size, uid); |
| | | List<BaseWarpper> data = new ArrayList<>(); |
| | | for(Map<String, Object> map : list){ |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<BaseWarpper>> queryActivityIncome(Integer pageNum, Integer size, HttpServletRequest request){ |
| | | public ResultUtil<List<BaseWarpper>> queryActivityIncome(Integer pageNum, Integer size, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Map<String, Object>> list = driverService.queryActivityIncome(uid, pageNum, size); |
| | | List<Map<String, Object>> list = driverService.queryActivityIncome(language, uid, pageNum, size); |
| | | List<BaseWarpper> data = new ArrayList<>(); |
| | | for(Map<String, Object> map : list){ |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setDay(String.valueOf(null != map.get("time") ? map.get("time") : "")); |
| | | baseWarpper.setAmount(Double.valueOf(String.valueOf(null != map.get("money") ? map.get("money") : 0))); |
| | | baseWarpper.setName("活动奖励"); |
| | | baseWarpper.setName(language == 1 ? "活动奖励" : language == 2 ? "Activity reward" : "Récompenses pour événements"); |
| | | data.add(baseWarpper); |
| | | } |
| | | return ResultUtil.success(data); |
| | |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<BaseWarpper>> queryTotalRevenue(Integer pageNum, Integer size, HttpServletRequest request){ |
| | | public ResultUtil<List<BaseWarpper>> queryTotalRevenue(Integer pageNum, Integer size, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Map<String, Object>> list = driverService.queryTotalRevenue(uid, pageNum, size); |
| | | List<Map<String, Object>> list = driverService.queryTotalRevenue(language, uid, pageNum, size); |
| | | List<BaseWarpper> data = new ArrayList<>(); |
| | | for(Map<String, Object> map : list){ |
| | | String type = map.get("type").toString(); |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setDay(String.valueOf(null != map.get("time") ? map.get("time") : "")); |
| | | baseWarpper.setAmount(Double.valueOf(String.valueOf(null != map.get("money") ? map.get("money") : 0))); |
| | | switch (Integer.valueOf(String.valueOf(null != map.get("orderType") ? map.get("orderType") : 0))){ |
| | | case 1: |
| | | baseWarpper.setName("快车"); |
| | | break; |
| | | case 2: |
| | | baseWarpper.setName("出租车"); |
| | | break; |
| | | case 3: |
| | | baseWarpper.setName("城际出行"); |
| | | break; |
| | | case 4: |
| | | baseWarpper.setName("同城小件物流"); |
| | | break; |
| | | case 5: |
| | | baseWarpper.setName("跨城小件物流"); |
| | | break; |
| | | } |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | switch (Integer.valueOf(map.get("orderType").toString())){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes = incomeService.queryData(1, null, 2, orderPrivateCar.getId(), 1); |
| | | map1.put("travelMoney", orderPrivateCar != null ? orderPrivateCar.getOrderMoney() : 0);//行程费 |
| | | map1.put("parkMoney", orderPrivateCar != null ? orderPrivateCar.getParkMoney() : 0);//停车费 |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", orderPrivateCar != null ? orderPrivateCar.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes.size() > 0 ? incomes.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes1 = incomeService.queryData(1, null, 2, orderTaxi.getId(), 2); |
| | | map1.put("travelMoney", orderTaxi != null ? orderTaxi.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", orderTaxi != null ? orderTaxi.getParkMoney() : 0);//停车费 |
| | | map1.put("tipMoney", orderTaxi != null ? orderTaxi.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", orderTaxi != null ? orderTaxi.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes1.size() > 0 ? incomes1.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 3: |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes2 = incomeService.queryData(1, null, 2, orderCrossCity.getId(), 3); |
| | | map1.put("travelMoney", orderCrossCity != null ? orderCrossCity.getOrderMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes2.size() > 0 ? incomes2.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes3 = incomeService.queryData(1, null, 2, orderLogistics.getId(), 4); |
| | | map1.put("travelMoney", orderLogistics != null ? orderLogistics.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", orderLogistics != null ? orderLogistics.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes3.size() > 0 ? incomes3.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 5: |
| | | OrderLogistics orderLogistics1 = orderLogisticsService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes4 = incomeService.queryData(1, null, 2, orderLogistics1.getId(), 5); |
| | | map1.put("travelMoney", orderLogistics1 != null ? orderLogistics1.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", orderLogistics1 != null ? orderLogistics1.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes4.size() > 0 ? incomes4.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | if("2".equals(type)){ |
| | | switch (Integer.valueOf(String.valueOf(null != map.get("orderType") ? map.get("orderType") : 0))){ |
| | | case 1: |
| | | baseWarpper.setName(language == 1 ? "打车" : language == 2 ? "Ride" : "Course"); |
| | | break; |
| | | case 2: |
| | | baseWarpper.setName(language == 1 ? "出租车" : language == 2 ? "taxi" : "taxi"); |
| | | break; |
| | | case 3: |
| | | baseWarpper.setName(language == 1 ? "城际出行" : language == 2 ? "Intercity travel" : "Mobilité entre villes"); |
| | | break; |
| | | case 4: |
| | | baseWarpper.setName(language == 1 ? "包裹" : language == 2 ? "Delivery" : "Livraison"); |
| | | break; |
| | | case 5: |
| | | baseWarpper.setName(language == 1 ? "跨城小件物流" : language == 2 ? "Cross-city small parts logistics" : "Logistique des petites pièces à travers la ville"); |
| | | break; |
| | | } |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | switch (Integer.valueOf(map.get("orderType").toString())){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes = incomeService.queryData(1, null, 2, orderPrivateCar.getId(), 1); |
| | | map1.put("travelMoney", orderPrivateCar != null ? orderPrivateCar.getOrderMoney() : 0);//行程费 |
| | | map1.put("parkMoney", orderPrivateCar != null ? orderPrivateCar.getParkMoney() : 0);//停车费 |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", orderPrivateCar != null ? orderPrivateCar.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes.size() > 0 ? incomes.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes1 = incomeService.queryData(1, null, 2, orderTaxi.getId(), 2); |
| | | map1.put("travelMoney", orderTaxi != null ? orderTaxi.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", orderTaxi != null ? orderTaxi.getParkMoney() : 0);//停车费 |
| | | map1.put("tipMoney", orderTaxi != null ? orderTaxi.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", orderTaxi != null ? orderTaxi.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes1.size() > 0 ? incomes1.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 3: |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes2 = incomeService.queryData(1, null, 2, orderCrossCity.getId(), 3); |
| | | map1.put("travelMoney", orderCrossCity != null ? orderCrossCity.getOrderMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes2.size() > 0 ? incomes2.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes3 = incomeService.queryData(1, null, 2, orderLogistics.getId(), 4); |
| | | map1.put("travelMoney", orderLogistics != null ? orderLogistics.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", orderLogistics != null ? orderLogistics.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes3.size() > 0 ? incomes3.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 5: |
| | | OrderLogistics orderLogistics1 = orderLogisticsService.selectById(map.get("incomeId").toString()); |
| | | List<Income> incomes4 = incomeService.queryData(1, null, 2, orderLogistics1.getId(), 5); |
| | | map1.put("travelMoney", orderLogistics1 != null ? orderLogistics1.getTravelMoney() : 0);//行程费 |
| | | map1.put("parkMoney", 0);//停车费 |
| | | map1.put("tipMoney", orderLogistics1 != null ? orderLogistics1.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes4.size() > 0 ? incomes4.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | } |
| | | baseWarpper.setData(map1); |
| | | } |
| | | |
| | | baseWarpper.setData(map1); |
| | | if("3".equals(type)){ |
| | | baseWarpper.setName(language == 1 ? "取消订单费用" : language == 2 ? "Cancellation fee" : "Frais d'annulation"); |
| | | baseWarpper.setData(new Object()); |
| | | } |
| | | data.add(baseWarpper); |
| | | } |
| | | return ResultUtil.success(data); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<ActivityWarpper>> queryMyActivity(HttpServletRequest request){ |
| | | public ResultUtil<List<ActivityWarpper>> queryMyActivity(Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(driverService.queryMyActivity(uid, new Date())); |
| | | return ResultUtil.success(driverService.queryMyActivity(uid, new Date(), language)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryHistoryActivity(Integer pageNum, Integer size, HttpServletRequest request){ |
| | | public ResultUtil queryHistoryActivity(Integer language, Integer pageNum, Integer size, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Map<String, Object>> list = driverService.queryHistory(uid, pageNum, size); |
| | | List<Map<String, Object>> list = driverService.queryHistory(language, uid, pageNum, size); |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "查询的给定日期", name = "time", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryHistoryActivityInfo(String time, HttpServletRequest request){ |
| | | public ResultUtil queryHistoryActivityInfo(String time, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); |
| | | List<ActivityWarpper> activityWarppers = driverService.queryMyActivity(uid, sdf.parse(time)); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<ActivityWarpper> activityWarppers = driverService.queryMyActivity(uid, sdf.parse(time), language); |
| | | return ResultUtil.success(activityWarppers); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "工号", name = "jobNum", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil loginByJobNumber(String jobNum){ |
| | | public ResultUtil loginByJobNumber(String jobNum, Integer language){ |
| | | try { |
| | | return driverService.loginByJobNumber(jobNum); |
| | | return driverService.loginByJobNumber(jobNum, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "身份证号码", name = "identification", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil loginByIdentification(String identification){ |
| | | public ResultUtil loginByIdentification(String identification, Integer language){ |
| | | try { |
| | | return driverService.loginByIdentification(identification); |
| | | return driverService.loginByIdentification(identification, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "出租车资格证号", name = "taxiAptitudeCard", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil loginByTaxiAptitudeCard(String taxiAptitudeCard){ |
| | | public ResultUtil loginByTaxiAptitudeCard(String taxiAptitudeCard, Integer language){ |
| | | try { |
| | | return driverService.loginByTaxiAptitudeCard(taxiAptitudeCard); |
| | | return driverService.loginByTaxiAptitudeCard(taxiAptitudeCard, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "登录密码", name = "password", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil verificationPassword(String password, HttpServletRequest request){ |
| | | public ResultUtil verificationPassword(String password, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.verificationPassword(password, driverId); |
| | | return driverService.verificationPassword(password, driverId, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "提现密码", name = "withdrawPassword", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil setWithdrawPassword(String withdrawPassword, HttpServletRequest request){ |
| | | public ResultUtil setWithdrawPassword(String withdrawPassword, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.setWithdrawPassword(withdrawPassword, driverId); |
| | | return driverService.setWithdrawPassword(withdrawPassword, driverId, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "提现密码", name = "withdrawPassword", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil verificationWithdrawPassword(String withdrawPassword, HttpServletRequest request){ |
| | | public ResultUtil verificationWithdrawPassword(String withdrawPassword, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return driverService.verificationWithdrawPassword(withdrawPassword, driverId); |
| | | return driverService.verificationWithdrawPassword(withdrawPassword, driverId, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil getInviteList(Integer type,Integer pageNum, Integer size, HttpServletRequest request){ |
| | | public ResultUtil getInviteList(Integer language, Integer type,Integer pageNum, Integer size, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Map<String,Object>> list = driverService.queryMyInviteList(type,uid, pageNum, size); |
| | | List<Map<String,Object>> list = driverService.queryMyInviteList(language, type,uid, pageNum, size); |
| | | return ResultUtil.success(DriverInviteInfoWarpper.getDriverInviteInfoWarpper(list)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/queryShareLink") |
| | | @ApiOperation(value = "获取分享链接及分案", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "链接上的type", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "链接上的uid", name = "driverId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "语言", name = "language", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<Map<String, Object>> queryShareLink(Integer type, Integer driverId, Integer language){ |
| | | try { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("link", shareUrl + "?type=" + type + "&uid=" + driverId + "&language=" + (null == language ? 2 : language)); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/updateName") |
| | | @ApiOperation(value = "修改姓名【1.1】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "姓", name = "lastName", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "名", name = "firstName", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updateName(String lastName, String firstName, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Driver driver = driverService.selectById(uid); |
| | | driver.setLastName(lastName); |
| | | driver.setFirstName(firstName); |
| | | driverService.updateById(driver); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |