From a0536b4aac5867173d6b0280cddbf87cb52de78b Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 16 十月 2025 18:22:30 +0800 Subject: [PATCH] Merge branch 'dev' of http://120.76.84.145:10101/gitblit/r/java/ZhaoYangChuXing --- DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java | 62 +++++++++++++++++++++++++++++-- 1 files changed, 58 insertions(+), 4 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 1196f03..c3dd4bb 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 @@ -3,6 +3,8 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.stylefeng.guns.core.shiro.ShiroKit; +import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; import com.stylefeng.guns.modular.system.model.OrderPosition; import com.stylefeng.guns.modular.system.model.Reassign; @@ -11,6 +13,7 @@ import com.stylefeng.guns.modular.system.service.IReassignService; //import com.stylefeng.guns.modular.system.util.ChinaMobileUtil; import com.stylefeng.guns.modular.system.util.PushUtil; +import com.stylefeng.guns.modular.system.util.RedisUtil; import com.stylefeng.guns.modular.system.util.ResultUtil; import com.stylefeng.guns.modular.system.util.SystemException; import com.stylefeng.guns.modular.system.warpper.BaseWarpper; @@ -20,6 +23,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,6 +36,7 @@ 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; @@ -64,10 +69,8 @@ @Value("${filePath}") private String filePath; - - - - + @Autowired + private RedisUtil redisUtil; /** @@ -749,4 +752,55 @@ 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(); + } + } + + + @ResponseBody + @PostMapping("/api/order/getDriverNewOrder") + @ApiOperation(value = "获取司机最新的指派单数据", tags = {"司机端-服务中"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResultUtil getDriverNewOrder(HttpServletRequest request){ + try { + Integer uid = driverService.getUserIdFormRedis(request); + if(null == uid){ + return ResultUtil.tokenErr(); + } + String value = redisUtil.getValue("DRIVER_ORDER" + uid); + return ResultUtil.success(value); + }catch (Exception e){ + e.printStackTrace(); + return ResultUtil.runErr(); + } + } + + + + } -- Gitblit v1.7.1