根据订单id获取退款详情
This commit is contained in:
parent
8479eff9ea
commit
e70df6f7f7
@ -22,7 +22,7 @@ import java.time.LocalDateTime;
|
|||||||
public class EbikeOrderBaseInfoVo {
|
public class EbikeOrderBaseInfoVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单编号
|
* 订单id
|
||||||
*/
|
*/
|
||||||
private Long orderId;
|
private Long orderId;
|
||||||
|
|
||||||
|
|||||||
@ -34,12 +34,7 @@ public class EbikePaymentCostDetailVo implements Serializable {
|
|||||||
private String detailName;
|
private String detailName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数量
|
* 费用金额
|
||||||
*/
|
*/
|
||||||
private Integer quantity;
|
private BigDecimal detailAmount;
|
||||||
|
|
||||||
/**
|
|
||||||
* 单价(单位:元)
|
|
||||||
*/
|
|
||||||
private BigDecimal unitPrice;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,4 +97,64 @@ public class EbikeRefundApplyOrderBaseInfoVo {
|
|||||||
* 支付订单号
|
* 支付订单号
|
||||||
*/
|
*/
|
||||||
private String tradingNumber;
|
private String tradingNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private Long refundId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付订单号
|
||||||
|
*/
|
||||||
|
private String transactionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款单号
|
||||||
|
*/
|
||||||
|
private String refundOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信退款状态;0退款成功 1关闭 2退款中 3异常
|
||||||
|
*/
|
||||||
|
private Integer refundStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款金额
|
||||||
|
*/
|
||||||
|
private BigDecimal refund;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题类型:1-还车点误判 2-禁停区误判 3-服务区外误判 4-车辆故障 5-开启失败 6-无法换车 7-车辆没电
|
||||||
|
*/
|
||||||
|
private Integer problemType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款问题描述
|
||||||
|
*/
|
||||||
|
private String problemDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款方式;0原路返回,1余额,2线下退款
|
||||||
|
*/
|
||||||
|
private Integer refundMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态 1-已同意 2-申请中 3-已驳回
|
||||||
|
*/
|
||||||
|
private Integer processStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驳回原因/退款备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驳回/通过时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime processTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款单创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime refundCreateTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,13 +58,4 @@ public class EbikeRefundApplyOrderDetailInfoVo {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal discountAmount;
|
private BigDecimal discountAmount;
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠卷抵扣金额
|
|
||||||
*/
|
|
||||||
private BigDecimal couponAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 骑行卡抵扣金额
|
|
||||||
*/
|
|
||||||
private BigDecimal cyclingCardAmount;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,9 +17,9 @@ public class EbikeRefundApplyOrderInfoVo {
|
|||||||
private EbikeOrderBaseInfoVo orderInfo;
|
private EbikeOrderBaseInfoVo orderInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户信息
|
* 退款信息
|
||||||
*/
|
*/
|
||||||
private EbikeRefundApplyUserBaseInfoVo userInfo;
|
private EbikeRefundApplyRefundVo refundInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 费用信息
|
* 费用信息
|
||||||
|
|||||||
@ -0,0 +1,76 @@
|
|||||||
|
package com.cdzy.user.model.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款申请退款信息
|
||||||
|
*
|
||||||
|
* @author yanglei
|
||||||
|
* @since 2025-12-31 17:13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EbikeRefundApplyRefundVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private Long refundId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付订单号
|
||||||
|
*/
|
||||||
|
private String transactionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款单号
|
||||||
|
*/
|
||||||
|
private String refundOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信退款状态;0退款成功 1关闭 2退款中 3异常
|
||||||
|
*/
|
||||||
|
private Integer refundStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款金额
|
||||||
|
*/
|
||||||
|
private BigDecimal refund;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 问题类型:1-还车点误判 2-禁停区误判 3-服务区外误判 4-车辆故障 5-开启失败 6-无法换车 7-车辆没电
|
||||||
|
*/
|
||||||
|
private Integer problemType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款问题描述
|
||||||
|
*/
|
||||||
|
private String problemDescription;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款方式;0原路返回,1余额,2线下退款
|
||||||
|
*/
|
||||||
|
private Integer refundMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核状态 1-已同意 2-申请中 3-已驳回
|
||||||
|
*/
|
||||||
|
private Integer processStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驳回原因/退款备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驳回/通过时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime processTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
}
|
||||||
@ -1,24 +0,0 @@
|
|||||||
package com.cdzy.user.model.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退款申请用户基本信息
|
|
||||||
*
|
|
||||||
* @author yanglei
|
|
||||||
* @since 2025-10-17 14:41
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class EbikeRefundApplyUserBaseInfoVo {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户昵称
|
|
||||||
*/
|
|
||||||
private String userName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户手机号
|
|
||||||
*/
|
|
||||||
private String phone;
|
|
||||||
}
|
|
||||||
@ -1,12 +1,9 @@
|
|||||||
package com.cdzy.user.service;
|
package com.cdzy.user.service;
|
||||||
|
|
||||||
import com.cdzy.user.model.entity.EbikePayment;
|
import com.cdzy.user.model.entity.EbikePayment;
|
||||||
import com.cdzy.user.model.vo.EbikePaymentCostDetailVo;
|
|
||||||
import com.cdzy.user.model.vo.EbikeRefundApplyOrderBaseInfoVo;
|
import com.cdzy.user.model.vo.EbikeRefundApplyOrderBaseInfoVo;
|
||||||
import com.mybatisflex.core.service.IService;
|
import com.mybatisflex.core.service.IService;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户支付 服务层
|
* 用户支付 服务层
|
||||||
*
|
*
|
||||||
@ -31,12 +28,4 @@ public interface EbikePaymentService extends IService<EbikePayment> {
|
|||||||
* @return 订单详情
|
* @return 订单详情
|
||||||
*/
|
*/
|
||||||
EbikeRefundApplyOrderBaseInfoVo getOrderDetail(Long orderId);
|
EbikeRefundApplyOrderBaseInfoVo getOrderDetail(Long orderId);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据订单id查询订单详情
|
|
||||||
*
|
|
||||||
* @param orderId 订单id
|
|
||||||
* @return 订单详情
|
|
||||||
*/
|
|
||||||
List<EbikePaymentCostDetailVo> getOrderDetailsByOrderId(Long orderId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package com.cdzy.user.service.impl;
|
package com.cdzy.user.service.impl;
|
||||||
|
|
||||||
import com.cdzy.common.enums.GlobalConstants;
|
|
||||||
import com.cdzy.user.mapper.EbikeOrderDetailMapper;
|
import com.cdzy.user.mapper.EbikeOrderDetailMapper;
|
||||||
import com.cdzy.user.model.entity.EbikeOrderDetail;
|
import com.cdzy.user.model.entity.EbikeOrderDetail;
|
||||||
import com.cdzy.user.model.vo.EbikePaymentCostDetailVo;
|
import com.cdzy.user.model.vo.EbikePaymentCostDetailVo;
|
||||||
@ -35,8 +34,7 @@ public class EbikeOrderDetailServiceImpl extends ServiceImpl<EbikeOrderDetailMap
|
|||||||
payDetailVo.setDetailType(orderDetail.getDetailType());
|
payDetailVo.setDetailType(orderDetail.getDetailType());
|
||||||
payDetailVo.setDetailName(orderDetail.getDetailName());
|
payDetailVo.setDetailName(orderDetail.getDetailName());
|
||||||
payDetailVo.setDetailId(orderDetail.getDetailId());
|
payDetailVo.setDetailId(orderDetail.getDetailId());
|
||||||
payDetailVo.setQuantity(GlobalConstants.NUMBER_ONE);
|
payDetailVo.setDetailAmount(orderDetail.getDetailAmount());
|
||||||
payDetailVo.setUnitPrice(orderDetail.getDetailAmount());
|
|
||||||
return payDetailVo;
|
return payDetailVo;
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import java.util.List;
|
|||||||
import static com.cdzy.user.model.entity.table.EbikeOrderDetailTableDef.EBIKE_ORDER_DETAIL;
|
import static com.cdzy.user.model.entity.table.EbikeOrderDetailTableDef.EBIKE_ORDER_DETAIL;
|
||||||
import static com.cdzy.user.model.entity.table.EbikeOrderTableDef.EBIKE_ORDER;
|
import static com.cdzy.user.model.entity.table.EbikeOrderTableDef.EBIKE_ORDER;
|
||||||
import static com.cdzy.user.model.entity.table.EbikePaymentTableDef.EBIKE_PAYMENT;
|
import static com.cdzy.user.model.entity.table.EbikePaymentTableDef.EBIKE_PAYMENT;
|
||||||
|
import static com.cdzy.user.model.entity.table.EbikeRefundTableDef.EBIKE_REFUND;
|
||||||
import static com.cdzy.user.model.entity.table.EbikeUserTableDef.EBIKE_USER;
|
import static com.cdzy.user.model.entity.table.EbikeUserTableDef.EBIKE_USER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,11 +47,11 @@ public class EbikePaymentServiceImpl extends ServiceImpl<EbikePaymentMapper, Ebi
|
|||||||
public EbikeRefundApplyOrderBaseInfoVo getOrderDetail(Long orderId) {
|
public EbikeRefundApplyOrderBaseInfoVo getOrderDetail(Long orderId) {
|
||||||
QueryWrapper query = QueryWrapper.create()
|
QueryWrapper query = QueryWrapper.create()
|
||||||
.select(
|
.select(
|
||||||
EbikePaymentTableDef.EBIKE_PAYMENT.COST_PRICE.as("orderOriginalPrice"),
|
EBIKE_PAYMENT.COST_PRICE.as("orderOriginalPrice"),
|
||||||
EbikePaymentTableDef.EBIKE_PAYMENT.TOTAL.as("actualPaymentAmount"),
|
EBIKE_PAYMENT.TOTAL.as("actualPaymentAmount"),
|
||||||
EbikePaymentTableDef.EBIKE_PAYMENT.PAYMENT_TIME,
|
EBIKE_PAYMENT.PAYMENT_TIME,
|
||||||
EbikePaymentTableDef.EBIKE_PAYMENT.PAYMENT_METHOD,
|
EBIKE_PAYMENT.PAYMENT_METHOD,
|
||||||
EbikePaymentTableDef.EBIKE_PAYMENT.TRANSACTION_ID.as("tradingNumber")
|
EBIKE_PAYMENT.TRANSACTION_ID.as("tradingNumber")
|
||||||
)
|
)
|
||||||
.select(
|
.select(
|
||||||
EBIKE_ORDER.ORDER_ID,
|
EBIKE_ORDER.ORDER_ID,
|
||||||
@ -65,31 +66,27 @@ public class EbikePaymentServiceImpl extends ServiceImpl<EbikePaymentMapper, Ebi
|
|||||||
EBIKE_USER.NICKNAME.as("userName"),
|
EBIKE_USER.NICKNAME.as("userName"),
|
||||||
EBIKE_USER.MOBILE
|
EBIKE_USER.MOBILE
|
||||||
)
|
)
|
||||||
|
.select(
|
||||||
|
EBIKE_REFUND.REFUND_ID,
|
||||||
|
EBIKE_REFUND.TRANSACTION_ID,
|
||||||
|
EBIKE_REFUND.REFUND_ORDER_ID,
|
||||||
|
EBIKE_REFUND.REFUND_STATUS,
|
||||||
|
EBIKE_REFUND.REFUND,
|
||||||
|
EBIKE_REFUND.PROBLEM_TYPE,
|
||||||
|
EBIKE_REFUND.PROBLEM_DESCRIPTION,
|
||||||
|
EBIKE_REFUND.REFUND_METHOD,
|
||||||
|
EBIKE_REFUND.PROCESS_STATUS,
|
||||||
|
EBIKE_REFUND.REMARK,
|
||||||
|
EBIKE_REFUND.PROCESS_TIME,
|
||||||
|
EBIKE_REFUND.CREATE_TIME.as("refundCreateTime")
|
||||||
|
)
|
||||||
.innerJoin(EBIKE_ORDER)
|
.innerJoin(EBIKE_ORDER)
|
||||||
.on(EBIKE_ORDER.ORDER_ID.eq(EbikePaymentTableDef.EBIKE_PAYMENT.ORDER_ID))
|
.on(EBIKE_ORDER.ORDER_ID.eq(EbikePaymentTableDef.EBIKE_PAYMENT.ORDER_ID))
|
||||||
.leftJoin(EBIKE_USER)
|
.leftJoin(EBIKE_USER)
|
||||||
.on(EBIKE_USER.USER_ID.eq(EBIKE_ORDER.USER_ID))
|
.on(EBIKE_USER.USER_ID.eq(EBIKE_ORDER.USER_ID))
|
||||||
|
.leftJoin(EBIKE_REFUND)
|
||||||
|
.on(EBIKE_ORDER.ORDER_ID.eq(EBIKE_REFUND.ORDER_ID))
|
||||||
.where(EbikePaymentTableDef.EBIKE_PAYMENT.ORDER_ID.eq(orderId));
|
.where(EbikePaymentTableDef.EBIKE_PAYMENT.ORDER_ID.eq(orderId));
|
||||||
return getOneAs(query, EbikeRefundApplyOrderBaseInfoVo.class);
|
return getOneAs(query, EbikeRefundApplyOrderBaseInfoVo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<EbikePaymentCostDetailVo> getOrderDetailsByOrderId(Long orderId) {
|
|
||||||
QueryWrapper query = QueryWrapper.create()
|
|
||||||
.select(EBIKE_ORDER_DETAIL.ALL_COLUMNS)
|
|
||||||
.from(EBIKE_ORDER_DETAIL)
|
|
||||||
.where(EBIKE_ORDER_DETAIL.ORDER_ID.eq(orderId));
|
|
||||||
List<EbikeOrderDetail> orderDetails = listAs(query, EbikeOrderDetail.class);
|
|
||||||
|
|
||||||
return orderDetails.stream().map(orderDetail -> {
|
|
||||||
EbikePaymentCostDetailVo payDetailVo = new EbikePaymentCostDetailVo();
|
|
||||||
payDetailVo.setDetailType(orderDetail.getDetailType());
|
|
||||||
payDetailVo.setDetailName(orderDetail.getDetailName());
|
|
||||||
payDetailVo.setDetailId(orderDetail.getDetailId());
|
|
||||||
payDetailVo.setQuantity(GlobalConstants.NUMBER_ONE);
|
|
||||||
payDetailVo.setUnitPrice(orderDetail.getDetailAmount());
|
|
||||||
return payDetailVo;
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,6 +41,7 @@ import java.math.BigDecimal;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static com.cdzy.user.model.entity.table.EbikeOrderTableDef.EBIKE_ORDER;
|
import static com.cdzy.user.model.entity.table.EbikeOrderTableDef.EBIKE_ORDER;
|
||||||
@ -223,35 +224,30 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
|
|||||||
if (Objects.nonNull(details)) {
|
if (Objects.nonNull(details)) {
|
||||||
for (EbikePaymentCostDetailVo payDetailVo : details) {
|
for (EbikePaymentCostDetailVo payDetailVo : details) {
|
||||||
//1-时长费用 2-起步费用 3-运营区调度费用 4-停车区外调度费用 5-禁停区调度费用 6-头盔使用费用
|
//1-时长费用 2-起步费用 3-运营区调度费用 4-停车区外调度费用 5-禁停区调度费用 6-头盔使用费用
|
||||||
BigDecimal unitPrice = payDetailVo.getUnitPrice();
|
|
||||||
if (unitPrice == null) {
|
|
||||||
continue; // 或记录 warn 日志,避免 NPE
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (payDetailVo.getDetailType()) {
|
switch (payDetailVo.getDetailType()) {
|
||||||
case 1 -> {
|
case 1 -> {
|
||||||
BigDecimal current = detailVo.getDurationFee();
|
BigDecimal current = payDetailVo.getDetailAmount();
|
||||||
detailVo.setDurationFee((current != null ? current : BigDecimal.ZERO).add(unitPrice));
|
detailVo.setDurationFee((current != null ? current : BigDecimal.ZERO));
|
||||||
}
|
}
|
||||||
case 2 -> {
|
case 2 -> {
|
||||||
BigDecimal current = detailVo.getBaseFee();
|
BigDecimal current = payDetailVo.getDetailAmount();
|
||||||
detailVo.setBaseFee((current != null ? current : BigDecimal.ZERO).add(unitPrice));
|
detailVo.setBaseFee((current != null ? current : BigDecimal.ZERO));
|
||||||
}
|
}
|
||||||
case 3 -> {
|
case 3 -> {
|
||||||
BigDecimal current = detailVo.getOutOfServiceAreaFee();
|
BigDecimal current = payDetailVo.getDetailAmount();
|
||||||
detailVo.setOutOfServiceAreaFee((current != null ? current : BigDecimal.ZERO).add(unitPrice));
|
detailVo.setOutOfServiceAreaFee((current != null ? current : BigDecimal.ZERO));
|
||||||
}
|
}
|
||||||
case 4 -> {
|
case 4 -> {
|
||||||
BigDecimal current = detailVo.getOutOfParkingAreaFee();
|
BigDecimal current = payDetailVo.getDetailAmount();
|
||||||
detailVo.setOutOfParkingAreaFee((current != null ? current : BigDecimal.ZERO).add(unitPrice));
|
detailVo.setOutOfParkingAreaFee((current != null ? current : BigDecimal.ZERO));
|
||||||
}
|
}
|
||||||
case 5 -> {
|
case 5 -> {
|
||||||
BigDecimal current = detailVo.getNoParkingZoneFee();
|
BigDecimal current = payDetailVo.getDetailAmount();
|
||||||
detailVo.setNoParkingZoneFee((current != null ? current : BigDecimal.ZERO).add(unitPrice));
|
detailVo.setNoParkingZoneFee((current != null ? current : BigDecimal.ZERO));
|
||||||
}
|
}
|
||||||
case 6 -> {
|
case 6 -> {
|
||||||
BigDecimal current = detailVo.getHelmetManagementFee();
|
BigDecimal current = payDetailVo.getDetailAmount();
|
||||||
detailVo.setHelmetManagementFee((current != null ? current : BigDecimal.ZERO).add(unitPrice));
|
detailVo.setHelmetManagementFee((current != null ? current : BigDecimal.ZERO));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -273,9 +269,9 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
|
|||||||
EbikeOrderBaseInfoVo orderInfo = buildOrderInfo(orderDetail);
|
EbikeOrderBaseInfoVo orderInfo = buildOrderInfo(orderDetail);
|
||||||
refundOrderInfo.setOrderInfo(orderInfo);
|
refundOrderInfo.setOrderInfo(orderInfo);
|
||||||
|
|
||||||
// 用户信息
|
// 退款单信息
|
||||||
EbikeRefundApplyUserBaseInfoVo userInfo = buildUserInfo(orderDetail);
|
EbikeRefundApplyRefundVo refundInfo = buildRefundInfo(orderDetail);
|
||||||
refundOrderInfo.setUserInfo(userInfo);
|
refundOrderInfo.setRefundInfo(refundInfo);
|
||||||
|
|
||||||
// 费用信息
|
// 费用信息
|
||||||
EbikeRefundApplyOrderDetailInfoVo orderDetailInfo = buildOrderDetailInfo(orderDetail);
|
EbikeRefundApplyOrderDetailInfoVo orderDetailInfo = buildOrderDetailInfo(orderDetail);
|
||||||
@ -288,6 +284,23 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
|
|||||||
return refundOrderInfo;
|
return refundOrderInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private EbikeRefundApplyRefundVo buildRefundInfo(EbikeRefundApplyOrderBaseInfoVo orderDetail) {
|
||||||
|
EbikeRefundApplyRefundVo refundApplyRefundVo = new EbikeRefundApplyRefundVo();
|
||||||
|
refundApplyRefundVo.setRefundId(orderDetail.getRefundId());
|
||||||
|
refundApplyRefundVo.setTransactionId(orderDetail.getTransactionId());
|
||||||
|
refundApplyRefundVo.setRefundOrderId(orderDetail.getRefundOrderId());
|
||||||
|
refundApplyRefundVo.setRefundStatus(orderDetail.getRefundStatus());
|
||||||
|
refundApplyRefundVo.setRefund(orderDetail.getRefund());
|
||||||
|
refundApplyRefundVo.setProblemType(orderDetail.getProblemType());
|
||||||
|
refundApplyRefundVo.setProblemDescription(orderDetail.getProblemDescription());
|
||||||
|
refundApplyRefundVo.setRefundMethod(orderDetail.getRefundMethod());
|
||||||
|
refundApplyRefundVo.setProcessStatus(orderDetail.getProcessStatus());
|
||||||
|
refundApplyRefundVo.setRemark(orderDetail.getRemark());
|
||||||
|
refundApplyRefundVo.setProcessTime(orderDetail.getProcessTime());
|
||||||
|
refundApplyRefundVo.setCreateTime(orderDetail.getRefundCreateTime());
|
||||||
|
return refundApplyRefundVo;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<EbikeTransactionRecordVo> queryRefundTradeRecordById(EbikeTreadRecordDto reqTradeRecordDto) {
|
public Page<EbikeTransactionRecordVo> queryRefundTradeRecordById(EbikeTreadRecordDto reqTradeRecordDto) {
|
||||||
QueryWrapper query = QueryWrapper.create()
|
QueryWrapper query = QueryWrapper.create()
|
||||||
@ -443,16 +456,6 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
|
|||||||
return orderInfo;
|
return orderInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 构建用户信息
|
|
||||||
*/
|
|
||||||
private EbikeRefundApplyUserBaseInfoVo buildUserInfo(EbikeRefundApplyOrderBaseInfoVo orderDetail) {
|
|
||||||
EbikeRefundApplyUserBaseInfoVo userInfo = new EbikeRefundApplyUserBaseInfoVo();
|
|
||||||
userInfo.setUserName(orderDetail.getUserName());
|
|
||||||
userInfo.setPhone(orderDetail.getMobile());
|
|
||||||
return userInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建费用信息
|
* 构建费用信息
|
||||||
*/
|
*/
|
||||||
@ -477,18 +480,23 @@ public class EbikeRefundServiceImpl extends ServiceImpl<EbikeRefundMapper, Ebike
|
|||||||
* 设置订单费用详情
|
* 设置订单费用详情
|
||||||
*/
|
*/
|
||||||
private void setOrderFeeDetails(EbikeRefundApplyOrderDetailInfoVo detailInfo, Long orderId) {
|
private void setOrderFeeDetails(EbikeRefundApplyOrderDetailInfoVo detailInfo, Long orderId) {
|
||||||
List<EbikePaymentCostDetailVo> details = ebikePaymentService.getOrderDetailsByOrderId(orderId);
|
List<EbikePaymentCostDetailVo> details = orderDetailService.getOrderDetailsByOrderId(orderId);
|
||||||
if (details != null && !details.isEmpty()) {
|
if (details != null && !details.isEmpty()) {
|
||||||
for (EbikePaymentCostDetailVo detailVo : details) {
|
for (EbikePaymentCostDetailVo detailVo : details) {
|
||||||
BigDecimal unitPrice = detailVo.getUnitPrice();
|
|
||||||
//1-时长费用 2-起步费用 3-运营区调度费用 4-停车区外调度费用 5-禁停区调度费用 6-头盔使用费用
|
//1-时长费用 2-起步费用 3-运营区调度费用 4-停车区外调度费用 5-禁停区调度费用 6-头盔使用费用
|
||||||
switch (detailVo.getDetailType()) {
|
switch (detailVo.getDetailType()) {
|
||||||
case 1 -> detailInfo.setDurationFee(detailInfo.getDurationFee().add(unitPrice));
|
case 1 -> detailInfo.setDurationFee(
|
||||||
case 2 -> detailInfo.setBaseFee(detailInfo.getBaseFee().add(unitPrice));
|
Optional.ofNullable(detailVo.getDetailAmount()).orElse(BigDecimal.ZERO));
|
||||||
case 3 -> detailInfo.setOutOfServiceAreaFee(detailInfo.getOutOfServiceAreaFee().add(unitPrice));
|
case 2 -> detailInfo.setBaseFee(
|
||||||
case 4 -> detailInfo.setOutOfParkingAreaFee(detailInfo.getOutOfParkingAreaFee().add(unitPrice));
|
Optional.ofNullable(detailVo.getDetailAmount()).orElse(BigDecimal.ZERO));
|
||||||
case 5 -> detailInfo.setNoParkingZoneFee(detailInfo.getNoParkingZoneFee().add(unitPrice));
|
case 3 -> detailInfo.setOutOfServiceAreaFee(
|
||||||
case 6 -> detailInfo.setHelmetManagementFee(detailInfo.getHelmetManagementFee().add(unitPrice));
|
Optional.ofNullable(detailVo.getDetailAmount()).orElse(BigDecimal.ZERO));
|
||||||
|
case 4 -> detailInfo.setOutOfParkingAreaFee(
|
||||||
|
Optional.ofNullable(detailVo.getDetailAmount()).orElse(BigDecimal.ZERO));
|
||||||
|
case 5 -> detailInfo.setNoParkingZoneFee(
|
||||||
|
Optional.ofNullable(detailVo.getDetailAmount()).orElse(BigDecimal.ZERO));
|
||||||
|
case 6 -> detailInfo.setHelmetManagementFee(
|
||||||
|
Optional.ofNullable(detailVo.getDetailAmount()).orElse(BigDecimal.ZERO));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user