From bba222e730ebdbf7409b7f02ee40409923035ef3 Mon Sep 17 00:00:00 2001 From: dzl <863620989@qq.com> Date: Wed, 21 May 2025 16:16:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=80=E6=AC=BE=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E7=94=A8=E6=88=B7=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EbikeWxPaymentController.java | 29 ++-- .../payment/model/dto/OrderFaultReport.java | 47 +++++++ .../cdzy/payment/model/dto/OrderRecord.java | 132 ++++++++++++++++++ .../payment/model/dto/TransactionRecord.java | 37 +++++ .../model/dto/UserBasicInformation.java | 87 ++++++++++++ .../cdzy/payment/service/WxPayService.java | 14 +- .../service/impl/WxPayServiceImpl.java | 6 + 7 files changed, 341 insertions(+), 11 deletions(-) create mode 100644 ebike-payment/src/main/java/com/cdzy/payment/model/dto/OrderFaultReport.java create mode 100644 ebike-payment/src/main/java/com/cdzy/payment/model/dto/OrderRecord.java create mode 100644 ebike-payment/src/main/java/com/cdzy/payment/model/dto/TransactionRecord.java create mode 100644 ebike-payment/src/main/java/com/cdzy/payment/model/dto/UserBasicInformation.java diff --git a/ebike-payment/src/main/java/com/cdzy/payment/controller/EbikeWxPaymentController.java b/ebike-payment/src/main/java/com/cdzy/payment/controller/EbikeWxPaymentController.java index 53982635..bf5dec39 100644 --- a/ebike-payment/src/main/java/com/cdzy/payment/controller/EbikeWxPaymentController.java +++ b/ebike-payment/src/main/java/com/cdzy/payment/controller/EbikeWxPaymentController.java @@ -42,7 +42,7 @@ public class EbikeWxPaymentController { @GetMapping("/prepay") public JsonResult prepay(@RequestParam(name = "orderId") String orderId) { JSONObject r = wxPayService.prepay(orderId); - return r.containsKey("error")?JsonResult.failed("下单失败: "+ r.getString("error")):JsonResult.success(r); + return r.containsKey("error") ? JsonResult.failed("下单失败: " + r.getString("error")) : JsonResult.success(r); } /** @@ -54,7 +54,7 @@ public class EbikeWxPaymentController { @GetMapping("/queryOrder/{orderId}") public JsonResult queryOrderByOrderId(@PathVariable(name = "orderId") String orderId) { Transaction r = wxPayService.queryOrderByOrderId(orderId); - return r == null?JsonResult.failed(String.format("骑行订单号{%s}查询支付订单失败", orderId)):JsonResult.success(r); + return r == null ? JsonResult.failed(String.format("骑行订单号{%s}查询支付订单失败", orderId)) : JsonResult.success(r); } /** @@ -70,6 +70,7 @@ public class EbikeWxPaymentController { } // 拆分为两个接口,一个是退款申请(生成退款记录),一个是提交退款(调用微信退款接口) + /** * 退款申请 * @@ -79,7 +80,7 @@ public class EbikeWxPaymentController { @PostMapping("/refundApply") public JsonResult refundApply(@RequestBody EbikeRefundDto refundDto) { String r = wxPayService.refundApply(refundDto.getOrderId(), refundDto.getReason()); - return r == null?JsonResult.failed("退款申请失败"):JsonResult.success((Object) r); + return r == null ? JsonResult.failed("退款申请失败") : JsonResult.success((Object) r); } /** @@ -99,7 +100,7 @@ public class EbikeWxPaymentController { userId = String.valueOf(staffFeign.getStaffId()); } HandleNotifyResult r = wxPayService.refund(refundDto, userId); - return r.isSuccess()?JsonResult.success(true):JsonResult.failed(r.getMessage()); + return r.isSuccess() ? JsonResult.success(true) : JsonResult.failed(r.getMessage()); } /** @@ -119,7 +120,7 @@ public class EbikeWxPaymentController { userId = String.valueOf(staffFeign.getStaffId()); } boolean r = wxPayService.refundReview(processDto, userId); - return r?JsonResult.success(true):JsonResult.failed("审核失败"); + return r ? JsonResult.success(true) : JsonResult.failed("审核失败"); } /** @@ -131,7 +132,7 @@ public class EbikeWxPaymentController { @GetMapping("/queryRefund/{refundId}") public JsonResult refundQuery(@PathVariable(name = "refundId") String refundId) { Refund r = wxPayService.queryRefundByOutNo(refundId); - return r == null?JsonResult.failed(String.format("退款单号{%s}查询退款失败", refundId)):JsonResult.success(r); + return r == null ? JsonResult.failed(String.format("退款单号{%s}查询退款失败", refundId)) : JsonResult.success(r); } /** @@ -155,7 +156,7 @@ public class EbikeWxPaymentController { @GetMapping("/refundOrderDetail/{refundId}") public JsonResult refundOrderDetail(@PathVariable(name = "refundId") String refundId) { ResOrderInfoDto r = wxPayService.queryRefundOrderById(refundId); - return r == null?JsonResult.failed(String.format("退款单号{%s}查询订单详情失败", refundId)):JsonResult.success(r); + return r == null ? JsonResult.failed(String.format("退款单号{%s}查询订单详情失败", refundId)) : JsonResult.success(r); } /** @@ -167,6 +168,18 @@ public class EbikeWxPaymentController { @GetMapping("/refundApplyOrderDetail/{orderId}") public JsonResult refundApplyOrderDetail(@PathVariable(name = "orderId") String orderId) { ResRefundOrderInfo r = wxPayService.queryRefundApplyOrderById(orderId); - return r == null?JsonResult.failed(String.format("订单号{%s}查询订单详情失败", orderId)):JsonResult.success(r); + return r == null ? JsonResult.failed(String.format("订单号{%s}查询订单详情失败", orderId)) : JsonResult.success(r); + } + + /** + * 退款申请 + * + * @param refundId 退款id + * @return + */ + @PostMapping("/refundApplyUserDetail/{refundId}") + public JsonResult refundApplyUserDetail(@PathVariable(name = "refundId") String refundId) { + UserBasicInformation r = wxPayService.queryRefundUserInfoById(refundId); + return r == null ? JsonResult.failed(String.format("退款单号{%s}查询订单详情失败", refundId)) : JsonResult.success(r); } } diff --git a/ebike-payment/src/main/java/com/cdzy/payment/model/dto/OrderFaultReport.java b/ebike-payment/src/main/java/com/cdzy/payment/model/dto/OrderFaultReport.java new file mode 100644 index 00000000..2bab7d7f --- /dev/null +++ b/ebike-payment/src/main/java/com/cdzy/payment/model/dto/OrderFaultReport.java @@ -0,0 +1,47 @@ +package com.cdzy.payment.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @author:Ding + * @ClassName:OrderFaultReport + * @Package:com.cdzy.payment.model.dto.OrderFaultReport + * @Description:订单故障上报记录 + * @CreateDate:2025年05月21日 + * @Version:V1.0 + **/ +@Data +public class OrderFaultReport { + + /** + * 反馈用户 + */ + private String userName; + + /** + * 坐标 + */ + private String coordinate; + + /** + * 故障类型 + */ + private String faultType; + + /** + * 图片 + */ + private String image; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private LocalDateTime createTime; +} diff --git a/ebike-payment/src/main/java/com/cdzy/payment/model/dto/OrderRecord.java b/ebike-payment/src/main/java/com/cdzy/payment/model/dto/OrderRecord.java new file mode 100644 index 00000000..c1a553a1 --- /dev/null +++ b/ebike-payment/src/main/java/com/cdzy/payment/model/dto/OrderRecord.java @@ -0,0 +1,132 @@ +package com.cdzy.payment.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @author:Ding + * @ClassName:OrderRecord + * @Package:com.cdzy.payment.model.dto.OrderRecord + * @Description:订单记录 + * @CreateDate:2025年05月21日 + * @Version:V1.0 + **/ +@Data +public class OrderRecord { + + /** + * 订单编号 + */ + private String orderId; + + /** + * 运营区域 + */ + private String operate; + + /** + * 车辆编号 + */ + private String bikeCode; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 骑行时长 + */ + private String cyclingDuration; + + /** + * 实付金额 + */ + private Double actualAmount = 0.0; + + /** + * 订单金额 + */ + private Double totalAmount = 0.0; + + /** + * 骑行卡抵扣金额 + */ + private Double cyclingCardAmount = 0.0; + + /** + * 优惠卷抵扣金额 + */ + private Double couponAmount = 0.0; + + /** + * 优惠金额 + */ + private Double discountAmount = 0.0; + + /** + * 起步费用 + */ + private Double startupCost = 0.0; + + /** + * 时长费 + */ + private Double durationCost = 0.0; + + /** + * 车辆状态 + */ + private String bikeState; + + /** + * 还车类型 + */ + private String returnCarType; + + /** + * 锁车时间 + */ + private LocalDateTime lockCarTime; + + /** + * 结束时间 + */ + private LocalDateTime endTime; + + /** + * 支付方式 + */ + private String payMethod; + + /** + * 支付状态 + */ + private String payState; + + /** + * 支付时间 + */ + private LocalDateTime payTime; + + /** + * 交易流水号 + */ + private String tradeSerialNumber; + + /** + * 订单来源 + */ + private String orderSource; + + /** + * 是否上报故障 + */ + private String hasFaultReport; + + /** + * 订单备注 + */ + private String orderRemark; +} diff --git a/ebike-payment/src/main/java/com/cdzy/payment/model/dto/TransactionRecord.java b/ebike-payment/src/main/java/com/cdzy/payment/model/dto/TransactionRecord.java new file mode 100644 index 00000000..cfa830c9 --- /dev/null +++ b/ebike-payment/src/main/java/com/cdzy/payment/model/dto/TransactionRecord.java @@ -0,0 +1,37 @@ +package com.cdzy.payment.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @author:Ding + * @ClassName:TransactionRecord + * @Package:com.cdzy.payment.model.dto.TransactionRecord + * @Description:交易记录 + * @CreateDate:2025年05月21日 + * @Version:V1.0 + **/ +@Data +public class TransactionRecord { + + /** + * 交易类型 + */ + private String transactionType; + + /** + * 金额 + */ + private Double amount; + + /** + * 交易内容 + */ + private String transactionContent; + + /** + * 创建时间 + */ + private LocalDateTime createTime; +} diff --git a/ebike-payment/src/main/java/com/cdzy/payment/model/dto/UserBasicInformation.java b/ebike-payment/src/main/java/com/cdzy/payment/model/dto/UserBasicInformation.java new file mode 100644 index 00000000..2b064f96 --- /dev/null +++ b/ebike-payment/src/main/java/com/cdzy/payment/model/dto/UserBasicInformation.java @@ -0,0 +1,87 @@ +package com.cdzy.payment.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @author:Ding + * @ClassName:UserBasicInformation + * @Package:com.cdzy.orders.model.dto.res.UserBasicInformation + * @Description:退款申请用户详情基本信息 + * @CreateDate:2025年05月20日 + * @Version:V1.0 + **/ +@Data +public class UserBasicInformation { + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户手机号 + */ + private String phone; + + /** + * 实名状态 + */ + private String realNameState; + + /** + * 用户真实姓名 + */ + private String userName; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 注册区域 + */ + private String registrationArea; + + /** + * 注册来源 + */ + private String registrationSource; + + /** + * 注册时间 + */ + private LocalDateTime registrationTime; + + /** + * 最近登录时间 + */ + private LocalDateTime lastLoginTime; + + /** + * 最近登录ip + */ + private String lastLoginIp; + + /** + * 最近登录终端 + */ + private String lastLoginTerminal; + + /** + * 历史消费金额 + */ + private Double totalConsumption; + + /** + * 历史骑行次数 + */ + private Integer totalCyclingNumber; + + /** + * 历史骑行时长 + */ + private String totalCyclingDuration; +} diff --git a/ebike-payment/src/main/java/com/cdzy/payment/service/WxPayService.java b/ebike-payment/src/main/java/com/cdzy/payment/service/WxPayService.java index 88de36ae..b0e4318e 100644 --- a/ebike-payment/src/main/java/com/cdzy/payment/service/WxPayService.java +++ b/ebike-payment/src/main/java/com/cdzy/payment/service/WxPayService.java @@ -72,7 +72,7 @@ public interface WxPayService { * 退款申请 * * @param outTradeNo 商户(骑行)订单号 - * @param reason 退款原因 + * @param reason 退款原因 * @return 退款信息id */ String refundApply(String outTradeNo, String reason); @@ -81,8 +81,8 @@ public interface WxPayService { * 审核退款申请 * * @param processDto 退款审核信息 - * @operator 操作人id * @return 退款信息id + * @operator 操作人id */ Boolean refundReview(ReqRefundProcessDto processDto, String operator); @@ -90,7 +90,7 @@ public interface WxPayService { * 调用微信退款接口 * * @param refundDto 退款请求 - * @param operator 操作人id + * @param operator 操作人id * @return 退款信息id */ HandleNotifyResult refund(ReqRefundDto refundDto, String operator); @@ -143,4 +143,12 @@ public interface WxPayService { * @return 退款申请详情 */ ResRefundOrderInfo queryRefundApplyOrderById(String orderId); + + /** + * 获取退款申请用户详情 + * + * @param refundId 退款id + * @return + */ + UserBasicInformation queryRefundUserInfoById(String refundId); } diff --git a/ebike-payment/src/main/java/com/cdzy/payment/service/impl/WxPayServiceImpl.java b/ebike-payment/src/main/java/com/cdzy/payment/service/impl/WxPayServiceImpl.java index 110a8073..c846ba9c 100644 --- a/ebike-payment/src/main/java/com/cdzy/payment/service/impl/WxPayServiceImpl.java +++ b/ebike-payment/src/main/java/com/cdzy/payment/service/impl/WxPayServiceImpl.java @@ -598,6 +598,12 @@ public class WxPayServiceImpl implements WxPayService { return null; } + @Override + public UserBasicInformation queryRefundUserInfoById(String refundId) { + + return null; + } + /** * 打印日志 *