package com.slodon.b2b2c.vo.system;

import com.slodon.b2b2c.core.util.TimeUtil;
import com.slodon.b2b2c.system.pojo.Bill;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 *
 * 结算导出VO对象
 * @author wuxy
 */
@Data
public class BillExportVO {

    @ApiModelProperty("结算单号")
    private String billSn;

    @ApiModelProperty("店铺名称")
    private String storeName;

    @ApiModelProperty("出账时间")
    private String createTime;

    @ApiModelProperty("结算开始时间")
    private String startTime;

    @ApiModelProperty("结算结束时间")
    private String endTime;

    @ApiModelProperty("订单金额(元)")
    private BigDecimal orderAmount;

    @ApiModelProperty("佣金(元)")
    private BigDecimal commission;

    @ApiModelProperty("退单金额(元)")
    private BigDecimal refundAmount;

    @ApiModelProperty("退还佣金(元)")
    private BigDecimal refundCommission;

    @ApiModelProperty("平台优惠券")
    private BigDecimal platformVoucherAmount;

    @ApiModelProperty("积分抵扣金额(元)")
    private BigDecimal integralCashAmount;

    @ApiModelProperty("定金赔偿金额(元)")
    private BigDecimal compensationAmount;

    @ApiModelProperty("推手佣金(元)")
    private BigDecimal attachCommission;

    @ApiModelProperty("应结金额(元)")
    private BigDecimal settleAmount;

    @ApiModelProperty("结算状态")
    private String stateValue;

    public BillExportVO(Bill bill) {
        billSn = bill.getBillSn();
        storeName = bill.getStoreName();
        createTime = TimeUtil.getDateTimeString(bill.getCreateTime());
        startTime = TimeUtil.getDateTimeString(bill.getStartTime());
        endTime = TimeUtil.getDateTimeString(bill.getEndTime());
        orderAmount = bill.getOrderAmount();
        commission = bill.getCommission();
        refundAmount = bill.getRefundAmount();
        refundCommission = bill.getRefundCommission();
        platformVoucherAmount = bill.getPlatformVoucherAmount();
        integralCashAmount = bill.getIntegralCashAmount();
        compensationAmount = bill.getCompensationAmount();
        attachCommission = bill.getAttachCommission();
        settleAmount = bill.getSettleAmount();
        stateValue = BillVO.dealStateValue(bill.getState());
    }
}
