| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | 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.Reassign; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderService; |
| | | import com.stylefeng.guns.modular.system.service.IReassignService; |
| | | import com.stylefeng.guns.modular.system.model.TOrderTape; |
| | | import com.stylefeng.guns.modular.system.model.TOrderTransfer; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ChinaMobileUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | @Autowired |
| | | private ITOrderTapeService orderTapeService; |
| | | @Autowired |
| | | private IOrderPrivateCarService privateCarService; |
| | | @Autowired |
| | | private IOrderCrossCityService crossCityService; |
| | | @Autowired |
| | | private ITOrderTransferService orderTransferService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/tape") |
| | | @ApiOperation(value = "订单提交录音", tags = {"司机端-录音"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "文件链接 逗号拼接", name = "fileLink", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "文件名称", name = "fileName", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "文件格式", name = "fileFormat", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "文件大小(mb)", name = "fileSize", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "订单类型1=专车 5=小件物流-跨城 ,7=接送机", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryOrderList(String fileLink,String fileName,String fileFormat,String fileSize,Integer orderType,Integer orderId, HttpServletRequest request) { |
| | | // 创建一个Date对象,假设现在是当前日期 |
| | | Date currentDate = new Date(); |
| | | // 创建一个Calendar实例,并设置其时间为基础Date对象 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(currentDate); |
| | | // 增加31天 |
| | | calendar.add(Calendar.DAY_OF_MONTH, 31); |
| | | // 获取增加后的Date对象 |
| | | Date newDate = calendar.getTime(); |
| | | |
| | | TOrderTape tape = new TOrderTape(); |
| | | tape.setFileLink(fileLink); |
| | | tape.setFileName(fileName); |
| | | tape.setFileFormat(fileFormat); |
| | | tape.setFileSize(Double.parseDouble(fileSize)); |
| | | tape.setOrderType(orderType); |
| | | tape.setInsertTime(new Date()); |
| | | tape.setAfterTime(newDate); |
| | | tape.setOrderId(orderId); |
| | | String[] split = fileLink.split(","); |
| | | for (String s : split) { |
| | | orderTapeService.insert(tape); |
| | | } |
| | | switch (orderType){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = privateCarService.selectById(orderId); |
| | | orderPrivateCar.setRecordTime(new Date()); |
| | | orderPrivateCar.setRouteRecord(orderPrivateCar.getRouteRecord()==null? fileLink: orderPrivateCar.getRouteRecord()+","+fileLink); |
| | | privateCarService.updateById(orderPrivateCar); |
| | | break; |
| | | case 3: |
| | | OrderCrossCity orderCrossCity = crossCityService.selectById(orderId); |
| | | orderCrossCity.setRecordTime(new Date()); |
| | | orderCrossCity.setRouteRecord(orderCrossCity.getRouteRecord()==null? fileLink: orderCrossCity.getRouteRecord()+","+fileLink); |
| | | crossCityService.updateById(orderCrossCity); |
| | | break; |
| | | case 7: |
| | | TOrderTransfer orderTransfer = orderTransferService.selectById(orderId); |
| | | orderTransfer.setRecordTime(new Date()); |
| | | orderTransfer.setRouteRecord(orderTransfer.getRouteRecord()==null? fileLink: orderTransfer.getRouteRecord()+","+fileLink); |
| | | orderTransferService.updateById(orderTransfer); |
| | | break; |
| | | } |
| | | return ResultUtil.success(); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | @ApiOperation(value = "获取抢单界面的订单详情", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城7=接送机)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "当前定位经度", name = "lon", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "当前定位纬度", name = "lat", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | @ApiOperation(value = "司机抢单操作", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城 7接送机)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil grabOrder(Integer orderId, Integer orderType, HttpServletRequest request){ |
| | |
| | | @ApiOperation(value = "获取改派支付金额", tags = {"司机端-服务中"}, notes = "返回金额为0不需要调用支付") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id(跨城多个订单使用逗号分隔)", name = "orderId", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城 7=接送机)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<BaseWarpper> queryReassignMoney(String orderId, Integer orderType){ |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/specail") |
| | | @ApiOperation(value = "修改结束地点", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "当前经度", name = "lon", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "当前纬度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil specail(Integer orderId, Double lon, Double lat,String endAddress, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | endAddress = endAddress.replaceAll("& #40;", "\\("); |
| | | endAddress = endAddress.replaceAll("& #41;", "\\)"); |
| | | return orderService.specail(orderId, uid, lon, lat,endAddress); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @ApiOperation(value = "提交改派申请", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车,7=接送机)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "改派支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "改派原因", name = "reason", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"), |