From 84e9c0bba0403095e4c3118c3d34189c23b4f1b3 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 13 Feb 2023 23:59:03 +0800 Subject: [PATCH] =?UTF-8?q?pay=EF=BC=9A=E5=89=8D=E7=AB=AF=E6=94=B6?= =?UTF-8?q?=E9=93=B6=E5=8F=B0=E7=9A=84=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/order/PayOrderController.java | 19 ++++++-- yudao-ui-admin/src/api/pay/order.js | 8 ++++ yudao-ui-admin/src/router/index.js | 7 ++- yudao-ui-admin/src/utils/constants.js | 2 +- yudao-ui-admin/src/views/pay/demo/index.vue | 19 ++++---- yudao-ui-admin/src/views/pay/order/index.vue | 6 +-- yudao-ui-admin/src/views/pay/order/submit.vue | 46 +++++++++++++------ 7 files changed, 72 insertions(+), 35 deletions(-) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/PayOrderController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/PayOrderController.java index 1be5e379e..26d0abd18 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/PayOrderController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/PayOrderController.java @@ -46,7 +46,7 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E public class PayOrderController { @Resource - private PayOrderService orderService; + private PayOrderService payOrderService; @Resource private PayOrderExtensionService orderExtensionService; @Resource @@ -58,8 +58,17 @@ public class PayOrderController { @Operation(summary = "获得支付订单") @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('pay:order:query')") - public CommonResult getOrder(@RequestParam("id") Long id) { - PayOrderDO order = orderService.getOrder(id); + public CommonResult getOrder(@RequestParam("id") Long id) { + return success(PayOrderConvert.INSTANCE.convert(payOrderService.getOrder(id))); + } + + // TODO 芋艿:看看怎么优化下; + @GetMapping("/get-detail") + @Operation(summary = "获得支付订单详情") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('pay:order:query')") + public CommonResult getOrderDetail(@RequestParam("id") Long id) { + PayOrderDO order = payOrderService.getOrder(id); if (ObjectUtil.isNull(order)) { return success(new PayOrderDetailsRespVO()); } @@ -86,7 +95,7 @@ public class PayOrderController { @Operation(summary = "获得支付订单分页") @PreAuthorize("@ss.hasPermission('pay:order:query')") public CommonResult> getOrderPage(@Valid PayOrderPageReqVO pageVO) { - PageResult pageResult = orderService.getOrderPage(pageVO); + PageResult pageResult = payOrderService.getOrderPage(pageVO); if (CollectionUtil.isEmpty(pageResult.getList())) { return success(new PageResult<>(pageResult.getTotal())); } @@ -120,7 +129,7 @@ public class PayOrderController { public void exportOrderExcel(@Valid PayOrderExportReqVO exportReqVO, HttpServletResponse response) throws IOException { - List list = orderService.getOrderList(exportReqVO); + List list = payOrderService.getOrderList(exportReqVO); if (CollectionUtil.isEmpty(list)) { ExcelUtils.write(response, "支付订单.xls", "数据", PayOrderExcelVO.class, new ArrayList<>()); diff --git a/yudao-ui-admin/src/api/pay/order.js b/yudao-ui-admin/src/api/pay/order.js index bff95bca7..5e1c0bc0f 100755 --- a/yudao-ui-admin/src/api/pay/order.js +++ b/yudao-ui-admin/src/api/pay/order.js @@ -34,6 +34,14 @@ export function getOrder(id) { }) } +// 获得支付订单的明细 +export function getOrderDetail(id) { + return request({ + url: '/pay/order/get-detail?id=' + id, + method: 'get' + }) +} + // 获得支付订单分页 export function getOrderPage(query) { return request({ diff --git a/yudao-ui-admin/src/router/index.js b/yudao-ui-admin/src/router/index.js index 14c41bb98..d38e6c42d 100644 --- a/yudao-ui-admin/src/router/index.js +++ b/yudao-ui-admin/src/router/index.js @@ -228,9 +228,12 @@ export const constantRoutes = [ hidden: true, children: [{ path: 'order/submit', - name: '收银台', + name: 'PayOrderSubmit', hidden: true, - meta: { title: '收银台' }, + meta: { + title: '收银台', + noCache: true + }, component: (resolve) => require(['@/views/pay/order/submit'], resolve) }] } diff --git a/yudao-ui-admin/src/utils/constants.js b/yudao-ui-admin/src/utils/constants.js index 33f43ac0b..e8147510f 100644 --- a/yudao-ui-admin/src/utils/constants.js +++ b/yudao-ui-admin/src/utils/constants.js @@ -172,7 +172,7 @@ export const PayOrderStatusEnum = { }, CLOSED: { status: 20, - name: '未支付' + name: '支付关闭' } } diff --git a/yudao-ui-admin/src/views/pay/demo/index.vue b/yudao-ui-admin/src/views/pay/demo/index.vue index e84816e67..e2a41f603 100644 --- a/yudao-ui-admin/src/views/pay/demo/index.vue +++ b/yudao-ui-admin/src/views/pay/demo/index.vue @@ -47,7 +47,7 @@ @@ -187,15 +187,14 @@ export default { }); }); }, - /** 删除按钮操作 */ - handleDelete(row) { - const id = row.id; - this.$modal.confirm('是否确认删除示例订单编号为"' + id + '"的数据项?').then(function() { - return deleteDemoOrder(id); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + /** 支付按钮操作 */ + handlePay(row) { + this.$router.push({ + name: 'PayOrderSubmit', + query:{ + id: row.payOrderId + } + }) } } }; diff --git a/yudao-ui-admin/src/views/pay/order/index.vue b/yudao-ui-admin/src/views/pay/order/index.vue index 54a4b255c..ecf70bb7a 100755 --- a/yudao-ui-admin/src/views/pay/order/index.vue +++ b/yudao-ui-admin/src/views/pay/order/index.vue @@ -215,7 +215,7 @@