From eaa20cb58afc80e3612fd6e93d6f27e181a027e7 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期五, 07 四月 2023 17:38:29 +0800 Subject: [PATCH] 提交用户端开发版本 --- user/guns-admin/src/main/java/com/supersavedriving/user/modular/api/OrderController.java | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 163 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..53d9271 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 @@ -6,6 +6,7 @@ import com.supersavedriving.user.modular.system.model.AppUser; import com.supersavedriving.user.modular.system.model.Order; import com.supersavedriving.user.modular.system.service.IAppUserService; +import com.supersavedriving.user.modular.system.service.IBillService; import com.supersavedriving.user.modular.system.service.IOrderService; import com.supersavedriving.user.modular.system.util.PayMoneyUtil; import com.supersavedriving.user.modular.system.util.ResultUtil; @@ -44,6 +45,9 @@ @Autowired private PayMoneyUtil payMoneyUtil; + + @Autowired + private IBillService billService; @@ -181,6 +185,28 @@ @ResponseBody + @PostMapping("/base/order/queryShareOrderInfo") +// @ServiceLog(name = "获取订单详情", url = "/base/order/queryShareOrderInfo") + @ApiOperation(value = "获取订单详情", tags = {"用户端-分享"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), + }) + public ResponseWarpper<OrderInfoWarpper> queryOrderInfo1(Long orderId){ + if(null == orderId){ + return ResponseWarpper.success(ResultUtil.paranErr("orderId")); + } + try { + OrderInfoWarpper orderInfoWarpper = orderService.queryOrderInfo(null, orderId); + return ResponseWarpper.success(orderInfoWarpper); + }catch (Exception e){ + e.printStackTrace(); + return new ResponseWarpper(500, e.getMessage()); + } + } + + + + @ResponseBody @PostMapping("/api/order/editOrderEndAddress") // @ServiceLog(name = "修改终点", url = "/api/order/editOrderEndAddress") @ApiOperation(value = "修改终点", tags = {"用户端-首页"}, notes = "") @@ -204,14 +230,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 +278,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(); @@ -336,5 +391,108 @@ } } + @ResponseBody + @PostMapping("/api/order/queryMyOrder") +// @ServiceLog(name = "获取我的行程", url = "/api/order/queryMyOrder") + @ApiOperation(value = "获取我的行程", tags = {"用户端-个人中心"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), + @ApiImplicitParam(value = "页条数", name = "pageSize", required = true, dataType = "int"), + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResponseWarpper<List<OrderListWarpper>> queryMyOrder(Integer pageNum, Integer pageSize){ + if(null == pageNum){ + return ResponseWarpper.success(ResultUtil.paranErr("pageNum")); + } + if(null == pageSize){ + return ResponseWarpper.success(ResultUtil.paranErr("pageSize")); + } + try { + Integer uid = appUserService.getUserByRequest(); + if(null == uid){ + return ResponseWarpper.success(ResultUtil.tokenErr()); + } + List<OrderListWarpper> orderListWarppers = orderService.queryMyOrder(uid, pageNum, pageSize); + return ResponseWarpper.success(orderListWarppers); + }catch (Exception e){ + e.printStackTrace(); + return new ResponseWarpper(500, e.getMessage()); + } + } + + @ResponseBody + @PostMapping("/api/order/queryNotInvoiceOrder") +// @ServiceLog(name = "获取未开票订单列表", url = "/api/order/queryNotInvoiceOrder") + @ApiOperation(value = "获取未开票订单列表", tags = {"用户端-个人中心"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResponseWarpper<List<OrderListWarpper>> queryNotInvoiceOrder(NotInvoiceOrder notInvoiceOrder){ + try { + Integer uid = appUserService.getUserByRequest(); + if(null == uid){ + return ResponseWarpper.success(ResultUtil.tokenErr()); + } + List<OrderListWarpper> orderListWarppers = orderService.queryNotInvoiceOrder(uid, notInvoiceOrder); + return ResponseWarpper.success(orderListWarppers); + }catch (Exception e){ + e.printStackTrace(); + return new ResponseWarpper(500, e.getMessage()); + } + } + + + + @ResponseBody + @PostMapping("/api/order/invoicing") +// @ServiceLog(name = "开票操作", url = "/api/order/invoicing") + @ApiOperation(value = "开票操作", tags = {"用户端-个人中心"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResponseWarpper invoicing(Invoicing invoicing){ + try { + Integer uid = appUserService.getUserByRequest(); + if(null == uid){ + return ResponseWarpper.success(ResultUtil.tokenErr()); + } + ResultUtil invoicing1 = billService.invoicing(uid, invoicing); + return ResponseWarpper.success(invoicing1); + }catch (Exception e){ + e.printStackTrace(); + return new ResponseWarpper(500, e.getMessage()); + } + } + + + + @ResponseBody + @PostMapping("/api/order/queryBillList") +// @ServiceLog(name = "获取开票历史", url = "/api/order/queryBillList") + @ApiOperation(value = "获取开票历史", tags = {"用户端-个人中心"}, notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), + @ApiImplicitParam(value = "页条数", name = "pageSize", required = true, dataType = "int"), + @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") + }) + public ResponseWarpper<List<BillWarpper>> queryBillList(Integer pageNum, Integer pageSize){ + if(null == pageNum){ + return ResponseWarpper.success(ResultUtil.paranErr("pageNum")); + } + if(null == pageSize){ + return ResponseWarpper.success(ResultUtil.paranErr("pageSize")); + } + try { + Integer uid = appUserService.getUserByRequest(); + if(null == uid){ + return ResponseWarpper.success(ResultUtil.tokenErr()); + } + List<BillWarpper> billWarppers = billService.queryBillList(uid, pageNum, pageSize); + return ResponseWarpper.success(billWarppers); + }catch (Exception e){ + e.printStackTrace(); + return new ResponseWarpper(500, e.getMessage()); + } + } } -- Gitblit v1.7.1