package com.jsowell.common.core.domain.ykc;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 交易记录数据对象
 *
 * @author JS-ZZA
 * @date 2022/11/16 15:01
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class TransactionRecordsData {
    // private String orderCode;

    // 交易流水号
    private String transactionCode;

    // 桩编码
    private String pileSn;

    // 枪号
    private String connectorCode;

    // 开始时间  CP56Time2a 格式
    private String startTime;

    // 结束时间
    private String endTime;

    // 尖单价   精确到小数点后五位（尖电费+尖服务费，见费率帧）
    private String sharpPrice;

    // 尖电量   精确到小数点后四位
    private String sharpUsedElectricity;

    // 计损尖电量
    private String sharpPlanLossElectricity;

    // 尖金额
    private String sharpAmount;

    // 峰单价   精确到小数点后五位（峰电费+峰服务费）
    private String peakPrice;

    // 峰电量
    private String peakUsedElectricity;

    // 计损峰电量
    private String peakPlanLossElectricity;

    // 峰金额
    private String peakAmount;

    // 平单价   精确到小数点后五位（平电费+平服务费）
    private String flatPrice;

    // 平电量
    private String flatUsedElectricity;

    // 计损平电量
    private String flatPlanLossElectricity;

    // 平金额
    private String flatAmount;

    // 谷单价   精确到小数点后五位（谷电费+谷 服务费）
    private String valleyPrice;

    // 谷电量
    private String valleyUsedElectricity;

    // 计损谷电量
    private String valleyPlanLossElectricity;

    // 谷金额
    private String valleyAmount;

    // 电表总起值
    private String ammeterTotalStart;

    // 电表总止值
    private String ammeterTotalEnd;

    // 总电量
    private String totalElectricity;

    // 计损总电量
    private String planLossTotalElectricity;

    // 消费金额   精确到小数点后四位，包含电费、 服务费
    private String consumptionAmount;

    // VIN 码   VIN 码，此处 VIN 码和充电时 VIN 码不同， 正序直接上传， 无需补 0 和反序
    private String vinCode;

    /** order_anomaly_record
     * 交易标识
     * 0x01： app 启动
     * 0x02：卡启动
     * 0x04：离线卡启动
     * 0x05: vin 码启动充电
     */
    private String transactionIdentifier;

    // 交易时间  CP56Time2a 格式
    private String transactionTime;

    // 停止原因
    private String stopReasonMsg;

    // 物理卡号  不足 8 位补 0
    private String logicCard;

    private Date createTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
                .append("transactionCode", transactionCode)
                .append("pileSn", pileSn)
                .append("connectorCode", connectorCode)
                .append("startTime", startTime)
                .append("endTime", endTime)
                .append("sharpPrice", sharpPrice)
                .append("sharpUsedElectricity", sharpUsedElectricity)
                .append("sharpPlanLossElectricity", sharpPlanLossElectricity)
                .append("sharpAmount", sharpAmount)
                .append("peakPrice", peakPrice)
                .append("peakUsedElectricity", peakUsedElectricity)
                .append("peakPlanLossElectricity", peakPlanLossElectricity)
                .append("peakAmount", peakAmount)
                .append("flatPrice", flatPrice)
                .append("flatUsedElectricity", flatUsedElectricity)
                .append("flatPlanLossElectricity", flatPlanLossElectricity)
                .append("flatAmount", flatAmount)
                .append("valleyPrice", valleyPrice)
                .append("valleyUsedElectricity", valleyUsedElectricity)
                .append("valleyPlanLossElectricity", valleyPlanLossElectricity)
                .append("valleyAmount", valleyAmount)
                .append("ammeterTotalStart", ammeterTotalStart)
                .append("ammeterTotalEnd", ammeterTotalEnd)
                .append("totalElectricity", totalElectricity)
                .append("planLossTotalElectricity", planLossTotalElectricity)
                .append("consumptionAmount", consumptionAmount)
                .append("vinCode", vinCode)
                .append("transactionIdentifier", transactionIdentifier)
                .append("transactionTime", transactionTime)
                .append("stopReasonMsg", stopReasonMsg)
                .append("logicCard", logicCard)
                .append("createTime", createTime)
                .toString();
    }
}
