zhibing.pu
2024-04-12 a075cdd2f76fae321ecf95dce363141ade30f0f1
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -81,9 +81,6 @@
    @Autowired
    private IOrderCrossCityService orderCrossCityService;
    /*@Autowired
    private ICBCPayUtil icbcPayUtil;*/
    @Autowired
    private IOrderLogisticsService orderLogisticsService;
@@ -461,14 +458,14 @@
                map.put("driverPhone", map.get("telX"));
            }
            OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map);
            String driverName = orderInfoWarpper.getDriverName();
            if(language == 2){
                driverName = "Master " + driverName.replace("师傅", "");
            }
            if(language == 3){
                driverName = "Maître " + driverName.replace("师傅", "");
            }
            orderInfoWarpper.setDriverName(driverName);
//            String driverName = orderInfoWarpper.getDriverName();
//            if(language == 2){
//                driverName = "Master " + driverName.replace("师傅", "");
//            }
//            if(language == 3){
//                driverName = "Maître " + driverName.replace("师傅", "");
//            }
//            orderInfoWarpper.setDriverName(driverName);
            File file = new File(filePath + orderId + "_1.txt");
            if(file.exists()){
@@ -529,14 +526,14 @@
                map.put("driverPhone", map.get("telX"));
            }
            OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map);
            String driverName = orderInfoWarpper.getDriverName();
            if(language == 2){
                driverName = "Master " + driverName.replace("师傅", "");
            }
            if(language == 3){
                driverName = "Maître " + driverName.replace("师傅", "");
            }
            orderInfoWarpper.setDriverName(driverName);
//            String driverName = orderInfoWarpper.getDriverName();
//            if(language == 2){
//                driverName = "Master " + driverName.replace("师傅", "");
//            }
//            if(language == 3){
//                driverName = "Maître " + driverName.replace("师傅", "");
//            }
//            orderInfoWarpper.setDriverName(driverName);
            return ResultUtil.success(orderInfoWarpper);
        }catch (Exception e){
            e.printStackTrace();
@@ -558,7 +555,7 @@
    @ApiOperation(value = "获取订单取消支付页面详情", 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=城际,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> queryCancelPage(Integer orderId, Integer orderType, Integer language){
@@ -580,16 +577,13 @@
                    ResultUtil<BaseWarpper> r = orderCrossCityService.queryCancleAmount(orderId);
                    map.put("cancelPayMoney", r.getData().getAmount());
                    break;
                case 4://同城小件物流
                    map = orderLogisticsService.queryOrderInfo(language, orderId);
                    ResultUtil<BaseWarpper> r1 = orderLogisticsService.queryCancleAmount(orderId, language);
                    map.put("cancelPayMoney", r1.getData().getAmount());
                    break;
            }
            OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map);
            String driverName = orderInfoWarpper.getDriverName();
            if(language == 2){
                driverName = "Master " + driverName.replace("师傅", "");
            }
            if(language == 3){
                driverName = "Maître " + driverName.replace("师傅", "");
            }
            orderInfoWarpper.setDriverName(driverName);
            return ResultUtil.success(orderInfoWarpper);
        }catch (Exception e){
            e.printStackTrace();
@@ -836,7 +830,7 @@
    @ApiOperation(value = "获取取消订单需要支付的费用金额", tags = {"用户端-出租车", "用户端-专车"}, notes = "返回金额为0则不需要支付")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城, 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> queryCancleAmount(Integer id, Integer orderType, Integer language){
@@ -848,6 +842,8 @@
                    return orderTaxiService.queryCancleAmount(id);
                case 3:
                    return orderCrossCityService.queryCancleAmount(id);
                case 4:
                    return orderLogisticsService.queryCancleAmount(id, language);
            }
            return ResultUtil.success();
        }catch (Exception e){
@@ -869,16 +865,19 @@
     */
    @ResponseBody
    @PostMapping("/api/taxi/addCancle")
    @ApiOperation(value = "添加取消记录", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
    @ApiOperation(value = "添加取消记录【2.0】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "取消原因", name = "reason", required = true, dataType = "string"),
            @ApiImplicitParam(value = "当前经度", name = "lon", required = true, dataType = "Double"),
            @ApiImplicitParam(value = "当前纬度", name = "lat", required = true, dataType = "Double"),
            @ApiImplicitParam(value = "详细地址", name = "address", required = true, dataType = "string"),
            @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"),
            @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil addCancle(Integer id, Integer orderType, String reason, String remark, Integer language, HttpServletRequest request){
    public ResultUtil addCancle(Integer id, Integer orderType, String reason, String remark, Double lon, Double lat, String address, Integer language, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
@@ -886,13 +885,13 @@
            }
            switch (orderType){
                case 1:
                    return orderPrivateCarService.addCancle(id, reason, remark, uid, language);
                    return orderPrivateCarService.addCancle(id, reason, remark, uid, lon, lat, address, language);
//                case 2:
//                    return orderTaxiService.addCancle(id, reason, remark, uid);
//                case 3:
//                    return orderCrossCityService.addCancle(id, reason, remark, uid);
                case 4:
                    return orderLogisticsService.addCancle(id, reason, remark, uid, language);
                    return orderLogisticsService.addCancle(id, reason, remark, uid, lon, lat, address, language);
//                case 5:
//                    return orderLogisticsService.addCancle(id, reason, remark, uid);
//                case 6:
@@ -956,10 +955,10 @@
     */
    @ResponseBody
    @PostMapping("/api/taxi/cancleOrderTaxi")
    @ApiOperation(value = "取消操作支付【1.1】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "")
    @ApiOperation(value = "取消操作支付【1.1】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件物流)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额)", name = "payType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = false, dataType = "int"),
            @ApiImplicitParam(value = "取消单id(取消操作返回)", name = "cancleId", required = false, dataType = "int"),
@@ -979,6 +978,8 @@
//                    return orderTaxiService.cancleOrderTaxi(id, payType, cancleId, type);
//                case 3:
//                    return orderCrossCityService.cancleOrderCrossCity(id, payType, cancleId, type);
                case 4:
                    return orderLogisticsService.cancleOrderPrivateCar(id, payType, bankCardId, cancleId, type, language);
            }
            return ResultUtil.success();
        }catch (Exception e){
@@ -1321,6 +1322,9 @@
//                        case 3:
//                            orderCrossCityService.payCancelOrderCrossCity(id, order_id, 1);
//                            break;
                        case 4:
                            orderLogisticsService.payCancelOrderPrivateCar(id, order_id, language);
                            break;
                    }
                    callbackResponse.setCheckout_request_id(order_id);
                    callbackResponse.setMerchant_transaction_id(out_trade_no);
@@ -1595,4 +1599,30 @@
        payoutCallbackResponse.setResults(results);
        return payoutCallbackResponse;
    }
    @ResponseBody
    @PostMapping("/api/taxi/updateEndAddress")
    @ApiOperation(value = "修改目的地【2.0】", tags = {"用户端-专车", "用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "终点经度", name = "endLon", required = true, dataType = "String"),
            @ApiImplicitParam(value = "终点纬度", name = "endLat", required = true, dataType = "String"),
            @ApiImplicitParam(value = "终点地址", name = "endAddress", required = true, dataType = "String"),
            @ApiImplicitParam(value = "语言", name = "language", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil updateEndAddress(Integer orderId, Integer orderType, String endLon, String endLat, String endAddress){
        switch (orderType){
            case 1:
                orderPrivateCarService.updateEndAddress(orderId, endLon, endLat, endAddress);
                break;
            case 4:
                orderLogisticsService.updateEndAddress(orderId, endLon, endLat, endAddress);
                break;
        }
        return ResultUtil.success();
    }
}