From a93e59e5c6c487a3ce93eee78b21654de9ca5aee Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 30 Oct 2024 17:30:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/RepairOrderInfoController.java | 18 ++++++++++++++++++ .../impl/DlRepairTicketsServiceImpl.java | 12 +++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java index 35e01ace..9e2cbbf4 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/controller/admin/RepairOrderInfoController.java @@ -19,6 +19,11 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.io.IOException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.SignatureException; + import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - 维修模块 订单") @@ -95,4 +100,17 @@ public class RepairOrderInfoController { public CommonResult census() { return success(repairOrderInfoService.census()); } + + /** + * PC支付按钮 + * + * @author 小李 + * @date 17:26 2024/10/30 + * @param id id + **/ + @GetMapping("/toPay") + @Operation(summary = "PC支付按钮") + public CommonResult toPay(@RequestParam("id")String id) throws IOException, NoSuchAlgorithmException, SignatureException, InvalidKeyException { + return success(repairOrderInfoService.payTransactions(id)); + } } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 7e45efd5..e3c48da2 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -697,6 +697,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl().eq(RepairOrderInfo::getGoodsId, tickets.getId())); if (ObjectUtil.isNotEmpty(orderInfo)) { // 付款情况 @@ -742,9 +743,18 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl stringObjectMap = repairOrderInfoService.payTransactions(orderInfo.getId()); + payUrl = (String) stringObjectMap.get("prepay_id"); + }catch (Exception e){ + e.printStackTrace(); + throw exception0(500, "系统异常"); + } // 生成收款二维码 int width = 100, height = 100; - byte[] texts = CreateQRCodeUtil.GenerateQRCode("hello world", width, height); + byte[] texts = CreateQRCodeUtil.GenerateQRCode(payUrl, width, height); if (ObjectUtil.isNotEmpty(texts)){ params.put("qrCode", new PictureRenderData(width, height, PictureType.PNG, texts)); }