diff --git a/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/domain/ReservationRefund.java b/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/domain/ReservationRefund.java index 9684a7f..fffaa76 100644 --- a/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/domain/ReservationRefund.java +++ b/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/domain/ReservationRefund.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serial; +import java.math.BigDecimal; /** * 预约退款对象 m_reservation_refund @@ -42,6 +43,15 @@ public class ReservationRefund extends BaseEntity { */ private String refundDesc; + /** + * 订单价格 + */ + private BigDecimal orderPrice; + + /** + * 实付价格 + */ + private BigDecimal actualPrice; /** * 退款状态 diff --git a/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/domain/vo/ReservationRefundVo.java b/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/domain/vo/ReservationRefundVo.java index 935ba98..8f0c556 100644 --- a/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/domain/vo/ReservationRefundVo.java +++ b/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/domain/vo/ReservationRefundVo.java @@ -11,6 +11,8 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; /** @@ -46,7 +48,7 @@ public class ReservationRefundVo implements Serializable { @ExcelProperty(value = "申请人") private Long userId; - @Translation(type = TransConstant.USER_ID_TO_NICKNAME) + @Translation(type = TransConstant.USER_ID_TO_NAME) @AutoMapping(target = "userId") private Long userPhone; @@ -56,11 +58,22 @@ public class ReservationRefundVo implements Serializable { @ExcelProperty(value = "退款原因") private String refundDesc; + /** + * 订单价格 + */ + private BigDecimal orderPrice; + + /** + * 实付价格 + */ + private BigDecimal actualPrice; + /** * 退款状态 */ @ExcelProperty(value = "退款状态") private Integer status; + private Date createTime; } diff --git a/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/service/impl/ReservationRefundServiceImpl.java b/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/service/impl/ReservationRefundServiceImpl.java index 83a2dd8..165ab67 100644 --- a/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/service/impl/ReservationRefundServiceImpl.java +++ b/ruoyi-modules/rouyi-scale/src/main/java/org/dromara/scale/service/impl/ReservationRefundServiceImpl.java @@ -100,8 +100,10 @@ public class ReservationRefundServiceImpl implements IReservationRefundService { public Boolean insertByBo(ReservationRefundBo bo) { Long userId = LoginHelper.getUserId(); ReservationRefund add = MapstructUtils.convert(bo, ReservationRefund.class); + ReservationOrder order = validEntityBeforeSave(add); add.setUserId(userId); - validEntityBeforeSave(add); + add.setOrderPrice(order.getOrderPrice()); + add.setActualPrice(order.getActualPrice()); add.setStatus(0); boolean flag = baseMapper.insert(add) > 0; if (flag) { @@ -176,7 +178,7 @@ public class ReservationRefundServiceImpl implements IReservationRefundService { /** * 保存前的数据校验 */ - private void validEntityBeforeSave(ReservationRefund entity) { + private ReservationOrder validEntityBeforeSave(ReservationRefund entity) { Long orderId = entity.getOrderId(); Long userId = entity.getUserId(); ReservationOrder order = orderMapper.selectById(orderId); @@ -196,6 +198,7 @@ public class ReservationRefundServiceImpl implements IReservationRefundService { if (exists) { throw new ServiceException("此订单已提交退款申请,请勿重复提交"); } + return order; } }