puzhibing
2023-07-09 d9c4252c54adc1684de9b56ad810465945e442a8
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -179,10 +179,10 @@
     */
    @ResponseBody
    @PostMapping("/api/order/queryPushOrder")
    @ApiOperation(value = "获取抢单界面的订单详情", tags = {"司机端-首页"}, notes = "")
    @ApiOperation(value = "获取抢单界面的订单详情【1.0】", 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=专车,4=小件物流-同城)", 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.....")
@@ -212,16 +212,16 @@
    @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=专车,4=小件物流-同城)", 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){
    public ResultUtil grabOrder(Integer orderId, Integer orderType, Integer language, HttpServletRequest request){
        try {
            Integer uid = driverService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderService.grabOrder(orderId, orderType, uid);
            return orderService.grabOrder(orderId, orderType, uid, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -239,14 +239,14 @@
    @ApiOperation(value = "获取服务中页面订单详情", tags = {"司机端-服务中"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,4=小件物流-同城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<OrderInfoWarpper> queryOrderInfo(Integer orderId, Integer orderType){
        try {
            Map<String, Object> map = orderService.queryOrderInfo(orderId, orderType);
            OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map);
            File file = new File(filePath + orderId + "_1.txt");
            File file = new File(filePath + orderId + "_" + orderType + ".txt");
            if(file.exists()){
                //读取文件(字符流)
                BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"));
@@ -280,7 +280,7 @@
    @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=专车,4=小件物流-同城)", 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){
@@ -317,13 +317,13 @@
            @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil reassign(Reassign reassign, HttpServletRequest request){
    public ResultUtil reassign(Reassign reassign, Integer language, HttpServletRequest request){
        try {
            Integer uid = driverService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return reassignService.saveData(reassign, uid, null);
            return reassignService.saveData(reassign, uid, null, language);
        }catch (SystemException s){
            return ResultUtil.error(s.getMsg());
        } catch (Exception e){
@@ -348,20 +348,20 @@
    @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=专车,4=小件物流-同城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "流程操作状态(3=开始出发预约点,4=到达预约点,5=开始服务,6=服务结束)", name = "state", required = true, dataType = "int"),
            @ApiImplicitParam(value = "手机号后四位", name = "phone", required = false, dataType = "String"),
            @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 process(Integer orderId, Integer orderType, Integer state, Double lon, Double lat,String phone, HttpServletRequest request){
    public ResultUtil process(Integer orderId, Integer orderType, Integer state, Double lon, Double lat,String phone, Integer language, HttpServletRequest request){
        try {
            Integer uid = driverService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderService.process(orderId, orderType, state, uid, lon, lat,phone);
            return orderService.process(orderId, orderType, state, uid, lon, lat, phone, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -529,9 +529,9 @@
            @ApiImplicitParam(value = "改派原因", name = "reason", required = true, dataType = "string"),
            @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"),
    })
    public String reassign_(Reassign reassign, Integer uid){
    public String reassign_(Reassign reassign, Integer uid, Integer language){
        try {
            ResultUtil resultUtil = reassignService.saveData(reassign, uid, 3);
            ResultUtil resultUtil = reassignService.saveData(reassign, uid, 3, language);
            return JSON.toJSONString(resultUtil);
        }catch (SystemException s){
            return JSON.toJSONString(ResultUtil.error(s.getMsg()));
@@ -635,9 +635,9 @@
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil completeOrder(Integer orderId, Integer orderType){
    public ResultUtil completeOrder(Integer orderId, Integer orderType, Integer language){
        try {
            return orderService.completeOrder(orderId, orderType);
            return orderService.completeOrder(orderId, orderType, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -672,9 +672,9 @@
            @ApiImplicitParam(value = "取件码", name = "pickUpCode", required = true, dataType = "string"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil fillInPickUpCode(Integer orderId, String pickUpCode){
    public ResultUtil fillInPickUpCode(Integer orderId, String pickUpCode, Integer language){
        try {
            return orderLogisticsService.fillInPickUpCode(orderId, pickUpCode);
            return orderLogisticsService.fillInPickUpCode(orderId, pickUpCode, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -689,9 +689,9 @@
            @ApiImplicitParam(value = "差价金额", name = "difference", required = true, dataType = "double"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil makeUpTheDifference(Integer orderId, Double difference){
    public ResultUtil makeUpTheDifference(Integer orderId, Double difference, Integer language){
        try {
            return orderLogisticsService.makeUpTheDifference(orderId, difference);
            return orderLogisticsService.makeUpTheDifference(orderId, difference, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -705,13 +705,38 @@
            @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 sendVerificationCode(Integer orderId){
    public ResultUtil sendVerificationCode(Integer orderId, Integer language){
        try {
            orderLogisticsService.sendVerificationCode(orderId);
            orderLogisticsService.sendVerificationCode(orderId, language);
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @PostMapping("/api/order/payOrder")
    @ApiOperation(value = "司机订单代付(现金收款)", tags = {"司机端-服务中"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "支付方式(1=线上,2=余额)", name = "payType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil payOrder(Integer orderId, Integer orderType, Integer payType, Integer language, HttpServletRequest request){
        try {
            Integer uid = driverService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderService.payOrder(uid, orderId, orderType, payType, language);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
}