From b3e0d0ea6c1e311566bab861b79cc9b9c6d25287 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期五, 15 三月 2024 09:49:03 +0800 Subject: [PATCH] 修改bug --- cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentServiceImpl.java | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentServiceImpl.java b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentServiceImpl.java index 02622b7..1b304a6 100644 --- a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentServiceImpl.java +++ b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentServiceImpl.java @@ -59,7 +59,7 @@ * @return */ @Override - public ResultUtil cancelMyWorldCup(String id) { + public ResultUtil cancelMyWorldCup(Long id) { WorldCupPaymentParticipant worldCupPaymentParticipant = worldCupPaymentParticipantService.getById(id); WorldCupPayment worldCupPayment = this.getById(worldCupPaymentParticipant.getWorldCupPaymentId()); WorldCup worldCup = worldCupService.getById(worldCupPayment.getWorldCupId()); @@ -79,6 +79,7 @@ } List<WorldCupPaymentParticipant> list1 = worldCupPaymentParticipantService.list(new QueryWrapper<WorldCupPaymentParticipant>() .eq("worldCupPaymentId", worldCupPayment.getId()).eq("alreadyEntered", 0)); + //总排款金额(排除已经参加比赛的数据) BigDecimal multiply = worldCupPayment.getUnitPrice().multiply(new BigDecimal(list1.size())); //微信支付 if(worldCupPayment.getPayType() == 1){ @@ -88,6 +89,9 @@ System.err.println("-------------微信退款失败---------"); System.err.println(map.get("return_msg")); return ResultUtil.error("微信退款失败"); + }else{ + worldCupPayment.setRefundAmount(multiply); + this.updateById(worldCupPayment); } } //支付宝支付 @@ -104,6 +108,7 @@ worldCupPayment.setRefundTime(new Date()); worldCupPayment.setRefundOrderNo(trade_no); worldCupPayment.setPayStatus(3); + worldCupPayment.setRefundAmount(multiply); this.updateById(worldCupPayment); } } @@ -117,6 +122,7 @@ worldCupPayment.setRefundTime(new Date()); worldCupPayment.setRefundOrderNo(""); worldCupPayment.setPayStatus(3); + worldCupPayment.setRefundAmount(multiply); this.updateById(worldCupPayment); } //课时支付 @@ -130,6 +136,7 @@ worldCupPayment.setRefundTime(new Date()); worldCupPayment.setRefundOrderNo(""); worldCupPayment.setPayStatus(3); + worldCupPayment.setRefundAmount(multiply); this.updateById(worldCupPayment); } return ResultUtil.success(); -- Gitblit v1.7.1