| | |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.worker.entity.Evaluate; |
| | | import com.ruoyi.worker.entity.MasterWorker; |
| | |
| | | * |
| | | * @param orderId 订单id |
| | | */ |
| | | @ApiOperation(value = "订单路线导航", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/orderNavigation") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "师傅所在经度", name = "longitude", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "师傅所在纬度", name = "latitude", dataType = "String", required = true) |
| | | }) |
| | | public R<Object> orderNavigation(@RequestParam Integer orderId, @RequestParam String longitude, |
| | | @RequestParam String latitude) { |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId).eq(Order::getServerId, loginWorker.getUserid()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("请确认当前订单所派单师傅是否是您!"); |
| | | } |
| | | // 用户下单经纬度 |
| | | Double userLongitude = order.getLongitude(); |
| | | Double userLatitude = order.getLatitude(); |
| | | String userPosition = userLongitude + "," + userLatitude; |
| | | // 师傅当前位置 经纬度 |
| | | String workerPosition = longitude + "," + latitude; |
| | | return R.ok(orderService.orderNavigation(userPosition, workerPosition)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-已到达预约地点 |
| | | * |
| | | * @param orderId 订单id |
| | | */ |
| | | @ApiOperation(value = "已到达预约地点", tags = {"师傅端-订单列表"}) |
| | | @GetMapping(value = "/reachPosition") |
| | | @ApiImplicitParams({ |