当前位置: 首页 > news >正文

建设一个网站的文案需要网站推广一站式服务

建设一个网站的文案需要,网站推广一站式服务,个人网页背景图片,徐州企业网站设计加载当前订单 需求 无论是司机端,还是乘客端,遇到页面切换,重新登录小程序等,只要回到首页面,查看当前是否有正在执行订单,如果有跳转到当前订单执行页面 之前这个接口已经开发,为了测试&…

加载当前订单

需求

  • 无论是司机端,还是乘客端,遇到页面切换,重新登录小程序等,只要回到首页面,查看当前是否有正在执行订单,如果有跳转到当前订单执行页面

  • 之前这个接口已经开发,为了测试,临时跳过去,默认没有当前订单的

乘客端查找当前订单

@Operation(summary = "乘客端查找当前订单")
@GetMapping("/searchCustomerCurrentOrder/{customerId}")
public Result<CurrentOrderInfoVo> searchCustomerCurrentOrder(@PathVariable Long customerId) {return Result.ok(orderInfoService.searchCustomerCurrentOrder(customerId));
}//乘客端查找当前订单
@Override
public CurrentOrderInfoVo searchCustomerCurrentOrder(Long customerId) {//封装条件//乘客idLambdaQueryWrapper<OrderInfo> wrapper = new LambdaQueryWrapper<>();wrapper.eq(OrderInfo::getCustomerId,customerId);//各种状态// 这些状态都表明该订单在执行中,所以要所有状态都查询Integer[] statusArray = {OrderStatus.ACCEPTED.getStatus(),OrderStatus.DRIVER_ARRIVED.getStatus(),OrderStatus.UPDATE_CART_INFO.getStatus(),OrderStatus.START_SERVICE.getStatus(),OrderStatus.END_SERVICE.getStatus(),OrderStatus.UNPAID.getStatus()};wrapper.in(OrderInfo::getStatus,statusArray);//获取最新一条记录wrapper.orderByDesc(OrderInfo::getId);wrapper.last(" limit 1");//调用方法OrderInfo orderInfo = orderInfoMapper.selectOne(wrapper);//封装到CurrentOrderInfoVoCurrentOrderInfoVo currentOrderInfoVo = new CurrentOrderInfoVo();if(orderInfo != null) {currentOrderInfoVo.setOrderId(orderInfo.getId());currentOrderInfoVo.setStatus(orderInfo.getStatus());currentOrderInfoVo.setIsHasCurrentOrder(true);} else {currentOrderInfoVo.setIsHasCurrentOrder(false);}return currentOrderInfoVo;
}/*** 乘客端查找当前订单* @param customerId* @return*/
@GetMapping("/order/info/searchCustomerCurrentOrder/{customerId}")
Result<CurrentOrderInfoVo> searchCustomerCurrentOrder(@PathVariable("customerId") Long customerId);@Operation(summary = "乘客端查找当前订单")
@GuiguLogin
@GetMapping("/searchCustomerCurrentOrder")
public Result<CurrentOrderInfoVo> searchCustomerCurrentOrder() {Long customerId = AuthContextHolder.getUserId();return Result.ok(orderService.searchCustomerCurrentOrder(customerId));
}//乘客查找当前订单
@Override
public CurrentOrderInfoVo searchCustomerCurrentOrder(Long customerId) {return orderInfoFeignClient.searchCustomerCurrentOrder(customerId).getData();
}

司机端查找当前订单

@Operation(summary = "司机端查找当前订单")
@GetMapping("/searchDriverCurrentOrder/{driverId}")
public Result<CurrentOrderInfoVo> searchDriverCurrentOrder(@PathVariable Long driverId) {return Result.ok(orderInfoService.searchDriverCurrentOrder(driverId));
}//司机端查找当前订单
@Override
public CurrentOrderInfoVo searchDriverCurrentOrder(Long driverId) {//封装条件LambdaQueryWrapper<OrderInfo> wrapper = new LambdaQueryWrapper<>();wrapper.eq(OrderInfo::getDriverId,driverId);Integer[] statusArray = {OrderStatus.ACCEPTED.getStatus(),OrderStatus.DRIVER_ARRIVED.getStatus(),OrderStatus.UPDATE_CART_INFO.getStatus(),OrderStatus.START_SERVICE.getStatus(),OrderStatus.END_SERVICE.getStatus()};wrapper.in(OrderInfo::getStatus,statusArray);wrapper.orderByDesc(OrderInfo::getId);wrapper.last(" limit 1");OrderInfo orderInfo = orderInfoMapper.selectOne(wrapper);//封装到voCurrentOrderInfoVo currentOrderInfoVo = new CurrentOrderInfoVo();if(null != orderInfo) {currentOrderInfoVo.setStatus(orderInfo.getStatus());currentOrderInfoVo.setOrderId(orderInfo.getId());currentOrderInfoVo.setIsHasCurrentOrder(true);} else {currentOrderInfoVo.setIsHasCurrentOrder(false);}return currentOrderInfoVo;
}/*** 司机端查找当前订单* @param driverId* @return*/
@GetMapping("/order/info/searchDriverCurrentOrder/{driverId}")
Result<CurrentOrderInfoVo> searchDriverCurrentOrder(@PathVariable("driverId") Long driverId);@Operation(summary = "司机端查找当前订单")
@GuiguLogin
@GetMapping("/searchDriverCurrentOrder")
public Result<CurrentOrderInfoVo> searchDriverCurrentOrder() {Long driverId = AuthContextHolder.getUserId();return Result.ok(orderService.searchDriverCurrentOrder(driverId));
}@Override
public CurrentOrderInfoVo searchDriverCurrentOrder(Long driverId) {return orderInfoFeignClient.searchDriverCurrentOrder(driverId).getData();
}

获取订单信息

进入首页,在有执行中订单的情况下,我们需要获取订单信息,才能知道页面跳转到那里去,因此现在把这个接口给实现了。

  • 订单的各个状态,获取的订单信息不一样,当前我们只是获取订单基本信息,后续完善
@Operation(summary = "根据订单id获取订单信息")
@GetMapping("/getOrderInfo/{orderId}")
public Result<OrderInfo> getOrderInfo(@PathVariable Long orderId) {return Result.ok(orderInfoService.getById(orderId));
}/*** 远程调用* 根据订单id获取订单信息* @param orderId* @return*/
@GetMapping("/order/info/getOrderInfo/{orderId}")
Result<OrderInfo> getOrderInfo(@PathVariable("orderId") Long orderId);// 乘客端web接口
@Operation(summary = "获取订单信息")
@GuiguLogin
@GetMapping("/getOrderInfo/{orderId}")
public Result<OrderInfoVo> getOrderInfo(@PathVariable Long orderId) {Long customerId = AuthContextHolder.getUserId();return Result.ok(orderService.getOrderInfo(orderId, customerId));
}@Override
public OrderInfoVo getOrderInfo(Long orderId, Long customerId) {OrderInfo orderInfo = orderInfoFeignClient.getOrderInfo(orderId).getData();//判断if(orderInfo.getCustomerId() != customerId) {throw new GuiguException(ResultCodeEnum.ILLEGAL_REQUEST);}OrderInfoVo orderInfoVo = new OrderInfoVo();orderInfoVo.setOrderId(orderId);BeanUtils.copyProperties(orderInfo,orderInfoVo);return orderInfoVo;
}// 司机端web接口
@Operation(summary = "获取订单账单详细信息")
@GuiguLogin
@GetMapping("/getOrderInfo/{orderId}")
public Result<OrderInfoVo> getOrderInfo(@PathVariable Long orderId) {Long driverId = AuthContextHolder.getUserId();return Result.ok(orderService.getOrderInfo(orderId, driverId));
}@Override
public OrderInfoVo getOrderInfo(Long orderId, Long driverId) {OrderInfo orderInfo = orderInfoFeignClient.getOrderInfo(orderId).getData();if(orderInfo.getDriverId() != driverId) {throw new GuiguException(ResultCodeEnum.ILLEGAL_REQUEST);}OrderInfoVo orderInfoVo = new OrderInfoVo();orderInfoVo.setOrderId(orderId);BeanUtils.copyProperties(orderInfo,orderInfoVo);return orderInfoVo;
}

司乘同显

在这里插入图片描述

  • 司机抢单成功后要赶往上车点,我们要计算司机赶往上车点的最佳线路,司机端与乘客端都要显示司机乘同显,这样乘客就能实时看见司机的动向。

司机端司乘同显

  • 司机所在地址司乘同显开始位置,代驾地址就是司乘同显终点
  • 计算司机司乘同显最佳路线
@Operation(summary = "计算最佳驾驶线路")
@GuiguLogin
@PostMapping("/calculateDrivingLine")
public Result<DrivingLineVo> calculateDrivingLine(@RequestBody CalculateDrivingLineForm calculateDrivingLineForm) {return Result.ok(orderService.calculateDrivingLine(calculateDrivingLineForm));
}//计算最佳驾驶线路
@Override
public DrivingLineVo calculateDrivingLine(CalculateDrivingLineForm calculateDrivingLineForm) {return mapFeignClient.calculateDrivingLine(calculateDrivingLineForm).getData();
}

更新位置到Redis里面

  • 司机要赶往代驾地址,实时更新司机当前最新位置(经纬度)到Redis里面
  • 乘客看到司机的动向,司机端更新,乘客端获取
@Operation(summary = "司机赶往代驾起始点:更新订单地址到缓存")
@PostMapping("/updateOrderLocationToCache")
public Result<Boolean> updateOrderLocationToCache(@RequestBody UpdateOrderLocationForm updateOrderLocationForm) {return Result.ok(locationService.updateOrderLocationToCache(updateOrderLocationForm));
}//司机赶往代驾起始点:更新订单地址到缓存
@Override
public Boolean updateOrderLocationToCache(UpdateOrderLocationForm updateOrderLocationForm) {OrderLocationVo orderLocationVo = new OrderLocationVo();orderLocationVo.setLongitude(updateOrderLocationForm.getLongitude());orderLocationVo.setLatitude(updateOrderLocationForm.getLatitude());String key = RedisConstant.UPDATE_ORDER_LOCATION + updateOrderLocationForm.getOrderId();redisTemplate.opsForValue().set(key,orderLocationVo);return true;
}/*** 司机赶往代驾起始点:更新订单地址到缓存* @param updateOrderLocationForm* @return*/
@PostMapping("/map/location/updateOrderLocationToCache")
Result<Boolean> updateOrderLocationToCache(@RequestBody UpdateOrderLocationForm updateOrderLocationForm);@Operation(summary = "司机赶往代驾起始点:更新订单位置到Redis缓存")
@GuiguLogin
@PostMapping("/updateOrderLocationToCache")
public Result updateOrderLocationToCache(@RequestBody UpdateOrderLocationForm updateOrderLocationForm) {return Result.ok(locationService.updateOrderLocationToCache(updateOrderLocationForm));
}@Override
public Boolean updateOrderLocationToCache(UpdateOrderLocationForm updateOrderLocationForm) {return locationFeignClient.updateOrderLocationToCache(updateOrderLocationForm).getData();
}

获取司机基本信息

  • 乘客进入司乘同显页面,需要加载司机基本信息,司机姓名,头像等信息
@Operation(summary = "获取司机基本信息")
@GetMapping("/getDriverInfo/{driverId}")
public Result<DriverInfoVo> getDriverInfoOrder(@PathVariable Long driverId) {return Result.ok(driverInfoService.getDriverInfoOrder(driverId));
}//获取司机基本信息
@Override
public DriverInfoVo getDriverInfoOrder(Long driverId) {//司机id获取基本信息DriverInfo driverInfo = driverInfoMapper.selectById(driverId);//封装DriverInfoVoDriverInfoVo driverInfoVo = new DriverInfoVo();BeanUtils.copyProperties(driverInfo,driverInfoVo);//计算驾龄//获取当前年int currentYear = new DateTime().getYear();//获取驾驶证初次领证日期//driver_license_issue_dateint firstYear = new DateTime(driverInfo.getDriverLicenseIssueDate()).getYear();int driverLicenseAge = currentYear - firstYear;driverInfoVo.setDriverLicenseAge(driverLicenseAge);return driverInfoVo;
}/*** 获取司机基本信息* @param driverId* @return*/
@GetMapping("/driver/info/getDriverInfo/{driverId}")
Result<DriverInfoVo> getDriverInfo(@PathVariable("driverId") Long driverId);@Operation(summary = "根据订单id获取司机基本信息")
@GuiguLogin
@GetMapping("/getDriverInfo/{orderId}")
public Result<DriverInfoVo> getDriverInfo(@PathVariable Long orderId) {Long customerId = AuthContextHolder.getUserId();return Result.ok(orderService.getDriverInfo(orderId, customerId));
}@Override
public DriverInfoVo getDriverInfo(Long orderId, Long customerId) {//根据订单id获取订单信息OrderInfo orderInfo = orderInfoFeignClient.getOrderInfo(orderId).getData();if(orderInfo.getCustomerId() != customerId) {throw new GuiguException(ResultCodeEnum.DATA_ERROR);}return driverInfoFeignClient.getDriverInfo(orderInfo.getDriverId()).getData();
}

乘客端获取司机经纬度位置

@Operation(summary = "司机赶往代驾起始点:获取订单经纬度位置")
@GetMapping("/getCacheOrderLocation/{orderId}")
public Result<OrderLocationVo> getCacheOrderLocation(@PathVariable Long orderId) {return Result.ok(locationService.getCacheOrderLocation(orderId));
}@Override
public OrderLocationVo getCacheOrderLocation(Long orderId) {String key = RedisConstant.UPDATE_ORDER_LOCATION + orderId;OrderLocationVo orderLocationVo = (OrderLocationVo)redisTemplate.opsForValue().get(key);return orderLocationVo;
}/*** 司机赶往代驾起始点:获取订单经纬度位置* @param orderId* @return*/
@GetMapping("/map/location/getCacheOrderLocation/{orderId}")
Result<OrderLocationVo> getCacheOrderLocation(@PathVariable("orderId") Long orderId);@Operation(summary = "司机赶往代驾起始点:获取订单经纬度位置")
@GetMapping("/getCacheOrderLocation/{orderId}")
public Result<OrderLocationVo> getCacheOrderLocation(@PathVariable Long orderId) {return Result.ok(locationService.getCacheOrderLocation(orderId));
}@Override
public OrderLocationVo getCacheOrderLocation(Long orderId) {return locationFeignClient.getCacheOrderLocation(orderId).getData();
}@Operation(summary = "计算最佳驾驶线路")
@GuiguLogin
@PostMapping("/calculateDrivingLine")
public Result<DrivingLineVo> calculateDrivingLine(@RequestBody CalculateDrivingLineForm calculateDrivingLineForm) {return Result.ok(orderService.calculateDrivingLine(calculateDrivingLineForm));
}@Override
public DrivingLineVo calculateDrivingLine(CalculateDrivingLineForm calculateDrivingLineForm) {return mapFeignClient.calculateDrivingLine(calculateDrivingLineForm).getData();
}

司机到达起始点

在这里插入图片描述

  • 司机到达代驾起始点之后,更新当前代驾订单数据
  • 更新订单状态:司机到达
  • 更新订单到达时间
@Operation(summary = "司机到达起始点")
@GetMapping("/driverArriveStartLocation/{orderId}/{driverId}")
public Result<Boolean> driverArriveStartLocation(@PathVariable Long orderId, @PathVariable Long driverId) {return Result.ok(orderInfoService.driverArriveStartLocation(orderId, driverId));
}//司机到达起始点
@Override
public Boolean driverArriveStartLocation(Long orderId, Long driverId) {// 更新订单状态和到达时间,条件:orderId + driverIdLambdaQueryWrapper<OrderInfo> wrapper = new LambdaQueryWrapper<>();wrapper.eq(OrderInfo::getId,orderId);wrapper.eq(OrderInfo::getDriverId,driverId);OrderInfo orderInfo = new OrderInfo();orderInfo.setStatus(OrderStatus.DRIVER_ARRIVED.getStatus());orderInfo.setArriveTime(new Date());int rows = orderInfoMapper.update(orderInfo, wrapper);if(rows == 1) {return true;} else {throw new GuiguException(ResultCodeEnum.UPDATE_ERROR);}
}/*** 司机到达起始点* @param orderId* @param driverId* @return*/
@GetMapping("/order/info/driverArriveStartLocation/{orderId}/{driverId}")
Result<Boolean> driverArriveStartLocation(@PathVariable("orderId") Long orderId, @PathVariable("driverId") Long driverId);@Operation(summary = "司机到达代驾起始地点")
@GuiguLogin
@GetMapping("/driverArriveStartLocation/{orderId}")
public Result<Boolean> driverArriveStartLocation(@PathVariable Long orderId) {Long driverId = AuthContextHolder.getUserId();return Result.ok(orderService.driverArriveStartLocation(orderId, driverId));
}//司机到达代驾起始地点
@Override
public Boolean driverArriveStartLocation(Long orderId, Long driverId) {return orderInfoFeignClient.driverArriveStartLocation(orderId,driverId).getData();
}

司机更新代驾车辆信息

司机到达代驾起始点,联系了乘客,见到了代驾车辆,要拍照与录入车辆信息

在这里插入图片描述

@Operation(summary = "更新代驾车辆信息")
@PostMapping("/updateOrderCart")
public Result<Boolean> updateOrderCart(@RequestBody UpdateOrderCartForm updateOrderCartForm) {return Result.ok(orderInfoService.updateOrderCart(updateOrderCartForm));
}Boolean updateOrderCart(UpdateOrderCartForm updateOrderCartForm);@Transactional(rollbackFor = Exception.class)
@Override
public Boolean updateOrderCart(UpdateOrderCartForm updateOrderCartForm) {LambdaQueryWrapper<OrderInfo> queryWrapper = new LambdaQueryWrapper<>();queryWrapper.eq(OrderInfo::getId, updateOrderCartForm.getOrderId());queryWrapper.eq(OrderInfo::getDriverId, updateOrderCartForm.getDriverId());OrderInfo updateOrderInfo = new OrderInfo();BeanUtils.copyProperties(updateOrderCartForm, updateOrderInfo);updateOrderInfo.setStatus(OrderStatus.UPDATE_CART_INFO.getStatus());//只能更新自己的订单int row = orderInfoMapper.update(updateOrderInfo, queryWrapper);if(row == 1) {//记录日志this.log(updateOrderCartForm.getOrderId(), OrderStatus.UPDATE_CART_INFO.getStatus());} else {throw new GuiguException(ResultCodeEnum.UPDATE_ERROR);}return true;
}/*** 更新代驾车辆信息* @param updateOrderCartForm* @return*/
@PostMapping("/order/info//updateOrderCart")
Result<Boolean> updateOrderCart(@RequestBody UpdateOrderCartForm updateOrderCartForm);@Operation(summary = "更新代驾车辆信息")
@GuiguLogin
@PostMapping("/updateOrderCart")
public Result<Boolean> updateOrderCart(@RequestBody UpdateOrderCartForm updateOrderCartForm) {Long driverId = AuthContextHolder.getUserId();updateOrderCartForm.setDriverId(driverId);return Result.ok(orderService.updateOrderCart(updateOrderCartForm));
}@Override
public Boolean updateOrderCart(UpdateOrderCartForm updateOrderCartForm) {return orderInfoFeignClient.updateOrderCart(updateOrderCartForm).getData();
}

公司只有一个总的理想,员工不能要求公司去实现你的理想,你必须适应这个总的理想,参加主力部队作战,发挥你的作用。我们的主航道不会变化,你们与大学合作的面宽一点,到2012实验室的时候窄一点,到产品研发更是窄窄的,要有长期性的清晰指标。

https://baijiahao.baidu.com/s?id=1760664270073856317&wfr=spider&for=pc
擦亮花火、共创未来——任正非在“难题揭榜”花火奖座谈会上的讲话
任正非

http://www.yayakq.cn/news/259843/

相关文章:

  • 找外国男人做老公网站南通网站公司
  • cdr做好排班怎么做网站工程公司绩效考核
  • 没有网站做淘宝客济南莱芜都市网
  • 做棋牌推广网站违反不网站建设项目组织结构图
  • 网站建设前的规划苏州城乡建设网站查询系统
  • 万能视频解析接口网站怎么做系统网站怎么做的
  • 网站建设 今网科技深圳百度地图
  • 大良营销网站建设讯息短视频网站开发教程
  • 动漫网站源码企业内网搭建要多少钱
  • 石家庄网站搭建公司保险哪家好
  • 云南 网站建设网站什么是互联网营销
  • 如何编辑做网站多个招聘网站格式不一致如何做招聘记录
  • wordpress更换域名301wordpress seo
  • 校园风险管理网站建设方案wordpress全站静太化
  • 企业网站项目的流程wordpress多站点好吗
  • 应用商店网站模板wordpress 关键词优化
  • php原生态开发公司网站企业营销管理
  • 物流网站建设报价有没有做培养基的网站
  • 雏鸟短视频app软件下载网站seo顾问服务四川
  • 郑州网站设计制作简历在线制作网站免费
  • 全椒县建设局网站做一网站困难吗
  • 湖北网站建设平台做小程序的流程
  • 电源网站模版wordpress 粘贴板图片
  • 河南网站建设平台施工企业的施工现场消防安全责任人应是
  • 推荐好的设计网站wordpress部署文件夹
  • 创建公司网站难吗域名跳转网站
  • 东莞网站建设_东莞网页设计wordpress pdf
  • 怎么做网盘搜索引擎网站h5源码分享网
  • 建设银行网站打不井wordpress编辑网页
  • 青岛外贸网站建设费用黑龙江建设网官网入口