From 8e680f301f31c91391579213661be4af04810e8c Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期五, 01 八月 2025 10:47:34 +0800 Subject: [PATCH] 特殊区域,价格修改 --- DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java | 78 +++++++++++++++++++++++++++++++++++--- 1 files changed, 71 insertions(+), 7 deletions(-) diff --git a/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java b/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java index 49e826a..22ef996 100644 --- a/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java +++ b/DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java @@ -9,7 +9,7 @@ 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.util.ChinaMobileUtil; +//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 com.stylefeng.guns.modular.system.util.SystemException; @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import io.swagger.models.auth.In; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.PostMapping; @@ -32,9 +33,11 @@ import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** * 订单相关控制器 @@ -55,9 +58,9 @@ @Autowired private PushUtil pushUtil; - @Autowired - private ChinaMobileUtil chinaMobileUtil; - +// @Autowired +// private ChinaMobileUtil chinaMobileUtil; +// @Autowired private IOrderLogisticsService orderLogisticsService; @@ -368,6 +371,40 @@ } } + /** + * 司机流程中创建猎鹰轨迹 + * @param orderId + * @param orderType + * @param request + * @return + */ + @ResponseBody + @PostMapping("/api/order/getTrackId") + @ApiOperation(value = "司机流程中创建猎鹰轨迹-接收轨迹id", 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 = "轨迹id", name = "trackId", required = true, dataType = "int"), + @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResultUtil getTrackId(Integer orderId, Integer orderType, Integer trackId, HttpServletRequest request){ + try { + Integer uid = driverService.getUserIdFormRedis(request); + if(null == uid){ + return ResultUtil.tokenErr(); + } + // 设置订单轨迹id + if(Objects.isNull(trackId)){ + return ResultUtil.error("创建轨迹失败!"); + } + orderService.getTrackId(orderId, orderType, trackId); + return ResultUtil.success(); + }catch (Exception e){ + e.printStackTrace(); + return ResultUtil.runErr(); + } + } + /** @@ -546,8 +583,8 @@ @PostMapping("/base/order/test") public String test(String phoneA, String phoneB){ try { - Map<String, String> map = chinaMobileUtil.midAxbBindSend(phoneA, phoneB, 28); - System.err.println(JSON.toJSONString(map)); +// Map<String, String> map = chinaMobileUtil.midAxbBindSend(phoneA, phoneB, 28); +// System.err.println(JSON.toJSONString(map)); }catch (Exception e){ e.printStackTrace(); return ""; @@ -559,7 +596,7 @@ @PostMapping("/base/order/test_") public String test(String bindId){ try { - Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(bindId,""); +// Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(bindId,""); }catch (Exception e){ e.printStackTrace(); return ""; @@ -714,4 +751,31 @@ return ResultUtil.runErr(); } } + + /** + * 司机改价 + * @param orderId + * @param orderType + * @return + */ + @ResponseBody + @PostMapping("/api/order/updatePrice") + @ApiOperation(value = "司机修改费用[0731]", tags = {"司机端-服务中"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), + @ApiImplicitParam(value = "订单类型(1=专车,2=快车,3=城际)", name = "orderType", required = true, dataType = "int"), + @ApiImplicitParam(value = "价格类型 1=原价格 2=预估价 3=修改价", name = "priceType", required = true, dataType = "int"), + @ApiImplicitParam(value = "改价金额", name = "updatePrice", required = true, dataType = "BigDecimal"), + @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResultUtil updatePrice(Integer orderId, Integer orderType, Integer priceType, BigDecimal updatePrice){ + try{ + orderService.updatePrice(orderId, orderType, priceType, updatePrice); + return ResultUtil.success(); + }catch (Exception e){ + e.printStackTrace(); + return ResultUtil.runErr(); + } + } + } -- Gitblit v1.7.1