From 1edcf19be5f339219210894c45a77d9d507b2586 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 22 三月 2023 18:19:38 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- user/guns-admin/src/main/java/com/supersavedriving/user/modular/api/OrderController.java | 39 ++++++++++++++++++++++++++++++++++----- 1 files changed, 34 insertions(+), 5 deletions(-) diff --git a/user/guns-admin/src/main/java/com/supersavedriving/user/modular/api/OrderController.java b/user/guns-admin/src/main/java/com/supersavedriving/user/modular/api/OrderController.java index 4b3da9d..dd2ffa0 100644 --- a/user/guns-admin/src/main/java/com/supersavedriving/user/modular/api/OrderController.java +++ b/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(); -- Gitblit v1.7.1