| | |
| | | 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.City; |
| | | 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.*; |
| | |
| | | |
| | | @Value("${share.url}") |
| | | private String shareUrl; |
| | | |
| | | @Autowired |
| | | private TEmailService emailService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | boolean b = driverService.checkCaptcha(email, phone, code); |
| | | return b ? ResultUtil.success() : ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); |
| | | return b ? ResultUtil.success() : ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid CAPTCHA" : "CAPTCHA non valide"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | phoneOperator = "GH-AIRTEL-B2C"; |
| | | break; |
| | | } |
| | | return driverService.registeredDriver(phoneOperator, phone, code, password, uid, type, userType, language); |
| | | return driverService.registeredDriver1(phoneOperator, phone, code, password, uid, type, userType, language); |
| | | }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(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机注册后完善车辆信息 |
| | |
| | | @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") |
| | | @ApiImplicitParam(value = "车辆id", name = "carId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "其他品牌", name = "otherBrand", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "其他型号", name = "otherModel", required = false, dataType = "string") |
| | | }) |
| | | 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){ |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid, Integer carId, String peopleAndCarsPhone, Integer language |
| | | ,String otherBrand,String otherModel){ |
| | | try { |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicenseNumber, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto, commercialInsuranceTime, uid,carId, peopleAndCarsPhone, language); |
| | | return carService.addCar(modelId, color, licensePlate, |
| | | time, drivingLicenseNumber, drivingLicensePhoto, |
| | | drivingLicenseEndTime, carPhoto, insurancePhoto, commercialInsuranceTime, uid,carId, peopleAndCarsPhone, language,otherBrand,otherModel); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取忘记密码页面的电话 |
| | | * @return |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 司机上下班操作 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/work2") |
| | | @ApiOperation(value = "司机上下班操作,同时设置接单类型【1.0】", tags = {"司机端-车载端"}, notes = "") |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryHomeNum") |
| | | @ApiOperation(value = "获取首页统计数据", tags = {"司机端-车载端"}, notes = "") |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 上班时选择的业务类型 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 存储订单服务中的司机位置 |
| | | * @param orderPosition |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @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); |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改手机号码 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改密码 |
| | | * @param password |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取设置接单的业务类型列表 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 设置接单规则 |
| | | * @param type |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取当前车辆及空闲车辆 |
| | | * @param request |
| | |
| | | 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(); |
| | |
| | | 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(); |
| | |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/getSum") |
| | | @ApiOperation(value = "获取收入明细总额", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil getSum(HttpServletRequest request) throws Exception { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Income> objectId = incomeService.selectList(new EntityWrapper<Income>().eq("objectId", uid)); |
| | | double sum = 0; |
| | | for (Income income : objectId) { |
| | | Double money = income.getMoney(); |
| | | sum = sum+money; |
| | | } |
| | | return ResultUtil.success(sum); |
| | | } |
| | | |
| | | |
| | |
| | | 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){ |
| | | 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 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 = "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(); |