| | |
| | | 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.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.CompanyVo; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ALiSendSms; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static org.bouncycastle.cms.RecipientId.password; |
| | | |
| | | /** |
| | | * 司机控制器 |
| | |
| | | private ICarService carService; |
| | | |
| | | @Autowired |
| | | private ALiSendSms aLiSendSms; |
| | | private RegionMapper regionMapper; |
| | | |
| | | @Autowired |
| | | private IOrderTaxiService orderTaxiService; |
| | |
| | | |
| | | @Autowired |
| | | private GunsProperties gunsProperties; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | |
| | | @Autowired |
| | | private ICompanyCityService companyCityService; |
| | | |
| | | /** |
| | | * 获取短信验证码 |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryMyCar") |
| | | @ApiOperation(value = "获取当前车辆及空闲车辆", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "获取当前车辆及空闲车辆 新增useState 1使用中 2空闲", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | |
| | | |
| | | |
| | | /** |
| | | * 获取省市区3级联动 |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("/base/driver/getRegion") |
| | | @ApiOperation(value = "获取省市区3级联动", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | }) |
| | | public ResultUtil<List<Region>> getRegion(){ |
| | | try { |
| | | List<Region> regions = regionMapper.selectList(null); |
| | | List<Region> regionList = regions.stream().filter(e -> e.getParentId() == 0).collect(Collectors.toList()); |
| | | for (Region region : regionList) { |
| | | region.setTire(1); |
| | | List<Region> regionList1 = regions.stream().filter(e -> e.getParentId().equals(region.getId())).collect(Collectors.toList()); |
| | | for (Region region1 : regionList1) { |
| | | region1.setTire(2); |
| | | List<Region> regionList2 = regions.stream().filter(e -> e.getParentId().equals(region1.getId())).collect(Collectors.toList()); |
| | | region1.setChildren(regionList2); |
| | | } |
| | | region.setChildren(regionList1); |
| | | } |
| | | return ResultUtil.success(regionList); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/base/driver/getCompany") |
| | | @ApiOperation(value = "通过区code获取服务商", tags = {"司机端-注册"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "区code", name = "areaCode", required = true, dataType = "String"), |
| | | |
| | | }) |
| | | public ResultUtil<List<CompanyVo>> getCompany(String areaCode){ |
| | | try { |
| | | |
| | | ArrayList<CompanyVo> companyVos = new ArrayList<>(); |
| | | List<CompanyCity> companyCities = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("areaCode", areaCode).eq("state", 1)); |
| | | if(companyCities.isEmpty()){ |
| | | return ResultUtil.success(companyVos); |
| | | } |
| | | List<Company> companies = companyService.selectList(new EntityWrapper<Company>().eq("type", 2).ne("flag", 3).in("id", companyCities.stream().map(CompanyCity::getCompanyId).collect(Collectors.toList()))); |
| | | for (Company company : companies) { |
| | | CompanyVo companyVo = new CompanyVo(company.getId(), company.getName()); |
| | | companyVos.add(companyVo); |
| | | } |
| | | return ResultUtil.success(companyVos); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置提现密码 |
| | | * @param withdrawPassword |
| | | * @param request |