package com.tourguide.modules.order.dto;
|
|
import com.tourguide.modules.order.domain.RefundAmountCalculator;
|
import com.tourguide.modules.order.entity.TourOrder;
|
|
import java.math.BigDecimal;
|
import java.time.LocalDateTime;
|
|
/** 导游单笔订单业绩明细。 */
|
public class GuideEarningItemResponse {
|
private final Long id;
|
private final String orderNo;
|
private final String scenicName;
|
private final String serviceName;
|
private final String orderType;
|
private final BigDecimal orderAmount;
|
private final BigDecimal commissionRate;
|
private final BigDecimal earningAmount;
|
private final LocalDateTime completedAt;
|
|
public GuideEarningItemResponse(TourOrder order) {
|
this.id = order.getId();
|
this.orderNo = order.getOrderNo();
|
this.scenicName = order.getScenicName();
|
this.serviceName = order.getPackageName();
|
this.orderType = order.getOrderType();
|
this.orderAmount = order.getPaymentAmount() == null ? order.getAmount() : order.getPaymentAmount();
|
this.commissionRate = order.getCommissionRate();
|
this.earningAmount = RefundAmountCalculator.refundableAmount(order);
|
this.completedAt = order.getCompletedAt();
|
}
|
|
public Long getId() { return id; }
|
public String getOrderNo() { return orderNo; }
|
public String getScenicName() { return scenicName; }
|
public String getServiceName() { return serviceName; }
|
public String getOrderType() { return orderType; }
|
public BigDecimal getOrderAmount() { return orderAmount; }
|
public BigDecimal getCommissionRate() { return commissionRate; }
|
public BigDecimal getEarningAmount() { return earningAmount; }
|
public LocalDateTime getCompletedAt() { return completedAt; }
|
}
|