| | |
| | | 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); |
| | | 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(fileLink); |
| | | privateCarService.updateById(orderPrivateCar); |
| | | break; |
| | | case 5: |
| | | OrderCrossCity orderCrossCity = crossCityService.selectById(orderId); |
| | | orderCrossCity.setRecordTime(new Date()); |
| | | orderCrossCity.setRouteRecord(fileLink); |
| | | crossCityService.updateById(orderCrossCity); |
| | | break; |
| | | case 7: |
| | | TOrderTransfer orderTransfer = orderTransferService.selectById(orderId); |
| | | orderTransfer.setRecordTime(new Date()); |
| | | orderTransfer.setRouteRecord(fileLink); |
| | | orderTransferService.updateById(orderTransfer); |
| | | break; |
| | | } |
| | | return ResultUtil.success(); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @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(); |
| | | } |
| | | return orderService.specail(orderId, uid, lon, lat,endAddress); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |