package com.sckw.payment.repose.vo;


import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sckw.excel.annotation.ExcelContext;
import com.sckw.payment.repose.KwpBizWalletPrepayPageResponse;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Author: donglang
 * Time: 2025-11-03
 * Des: 钱包明细列表返回
 * Version: 1.0
 */

@Data
@ExcelContext(fileName = "冻账明细表", sheetName = "冻账明细信息")
public class KwpBizWalletPrepayExcelVO {

    /**
     * 钱包名称
     */
    @ExcelProperty(value = "钱包名称")
    private String walletName;

    /**
     * 供应企业
     */
    @ExcelProperty(value = "供应企业")
    private String supEntName;


    /**
     * 动帐类型  0-预付、1-扣款、2-冻结、3-解冻、4-消费',
     */
    @ExcelProperty(value = "动帐类型")
    private String type;


    /**
     * 变动金额（单位：元，保留2位小数）
     */
    @ExcelProperty(value = "变动金额（元）")
    private BigDecimal changeAmount;

    /**
     * 可用金额
     */
    @ExcelProperty(value = "可用金额（元）")
    private BigDecimal amount;

    /**
     * 冻结金额
     */
    @ExcelProperty(value = "冻结金额（元）")
    private BigDecimal prepayAmount;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private static KwpBizWalletPrepayExcelVO getInstance() {
        return new KwpBizWalletPrepayExcelVO();
    }


    public static KwpBizWalletPrepayExcelVO toPageResp(KwpBizWalletPrepayPageResponse response) {
        if (response == null) {
            return new KwpBizWalletPrepayExcelVO();
        }
        KwpBizWalletPrepayExcelVO excelVO = KwpBizWalletPrepayExcelVO.getInstance();
        excelVO.setAmount(response.getAmount());
        excelVO.setPrepayAmount(response.getPrepayAmount());
        excelVO.setWalletName(response.getWalletName());
        excelVO.setSupEntName(response.getSupEntName());
        excelVO.setChangeAmount(response.getAmount());
        excelVO.setRemark(response.getRemark());
        excelVO.setCreateTime(response.getCreateTime());

        return excelVO;
    }





}
