puzhibing
2023-03-18 7ae454c0b24545b6edf71401512e6d15f8845655
user/guns-admin/src/main/java/com/supersavedriving/user/modular/api/OrderController.java
@@ -204,14 +204,43 @@
    @ResponseBody
    @PostMapping("/api/order/queryOrderPrice")
//    @ServiceLog(name = "获取订单费用明细", url = "/api/order/queryOrderPrice")
    @ApiOperation(value = "获取订单费用明细", tags = {"用户端-首页"}, notes = "")
//    @ServiceLog(name = "获取待支付页面订单费用明细", url = "/api/order/queryOrderPrice")
    @ApiOperation(value = "获取待支付页面订单费用明细", tags = {"用户端-首页"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"),
            @ApiImplicitParam(value = "是否余额抵扣(0=否,1=是)", name = "payType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResponseWarpper<OrderPriceWarpper> queryOrderPrice(Long orderId, Integer payType){
    public ResponseWarpper<OrderPriceWarpper> queryOrderPrice(Long orderId){
        if(null == orderId){
            return ResponseWarpper.success(ResultUtil.paranErr("orderId"));
        }
        try {
            Integer uid = appUserService.getUserByRequest();
            if(null == uid){
                return ResponseWarpper.success(ResultUtil.tokenErr());
            }
            OrderPriceWarpper orderPriceWarpper = orderService.queryOrderPrice(uid, orderId);
            return ResponseWarpper.success(orderPriceWarpper);
        }catch (Exception e){
            e.printStackTrace();
            return new ResponseWarpper(500, e.getMessage());
        }
    }
    @ResponseBody
    @PostMapping("/api/order/calculationOfExpenses")
//    @ServiceLog(name = "重新计算待支付页面订单费用明细", url = "/api/order/calculationOfExpenses")
    @ApiOperation(value = "重新计算待支付页面订单费用明细", tags = {"用户端-首页"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"),
            @ApiImplicitParam(value = "优惠券id", name = "couponId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "是否使用余额抵扣(0=否,1=是)", name = "payType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "抵扣金额", name = "balance", required = true, dataType = "double"),
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResponseWarpper<OrderPriceWarpper> calculationOfExpenses(Long orderId, Integer couponId, Integer payType, Double balance){
        if(null == orderId){
            return ResponseWarpper.success(ResultUtil.paranErr("orderId"));
        }
@@ -223,7 +252,7 @@
            if(null == uid){
                return ResponseWarpper.success(ResultUtil.tokenErr());
            }
            OrderPriceWarpper orderPriceWarpper = orderService.queryOrderPrice(uid, orderId, payType);
            OrderPriceWarpper orderPriceWarpper = orderService.calculationOfExpenses(uid, orderId, couponId, payType, balance);
            return ResponseWarpper.success(orderPriceWarpper);
        }catch (Exception e){
            e.printStackTrace();