package com.hzya.frame.cbs8.dto.res;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;

/**
 * @Description data节点
 * @Author xiangerlin
 * @Date 2024/1/2 09:26
 **/
public class CbsResDataDTO {


    private List<JSONObject> list;//明细数据
    //------- 交易明细字段-----
    private int endRow;
    private Boolean hasNextPage;//是否有下一页
    private Boolean hasPreviousPage;//是否有前一页
    @JSONField(name = "isFirstPage")
    private Boolean hasFirstPage;
    @JSONField(name = "isLastPage")
    private Boolean hasLastPage;
    private int navigateFirstPage;
    private int navigateLastPage;
    private int navigatePages;
    private int nextPage;
    private int pageNum;
    private int pageSize;
    private int pages;
    private int prePage;
    private int size;
    private int startRow;
    private int total;
    //------- 交易明细字段-----

    //------经办支付返回参数------
    private String busNum;//申请单编号
    private String errorCode;//错误编码
    private String errorMsg;//错误信息
    private String freezeFlowNum;//内部户冻结流水号
    private String recordNum;//批量经办序号
    private String referenceNum;//业务参考号
    private Boolean successed;//是否成功
    //------经办支付返回参数------


    //------查询交易结果返回参数-------

    private String busType;//支付业务类型
    private String payAccount;//付款账号
    private String payAccountName;//付款户名
    private String payBankName;//付款开户行名称
    private String payBankType;//付款银行类型
    private String currency;//币种
    private String amount;//金额
    private String revAccount;//收款账户
    private String revAccountName;//收款账户名
    private String revBankName;//收款开户行
    private String revBankType;//收款银行类型
    private String payChannel;//支付渠道

    private String status;//支付申请单状态
    private String payStatus;//支付状态
    private String payDate;//支付时间
    private String planNumber;//计划流水号
    private String planItemCode;//资金预算编号
    private String planItemName;//预算名称
    private String erpExtend1;//客户备用字段1
    private String erpExtend2;//客户备用字段1
    private String erpExtend3;//客户备用字段1

    //------查询交易结果返回参数-------


    public List<JSONObject> getList() {
        return list;
    }

    public void setList(List<JSONObject> list) {
        this.list = list;
    }

    public int getEndRow() {
        return endRow;
    }

    public void setEndRow(int endRow) {
        this.endRow = endRow;
    }

    public Boolean getHasNextPage() {
        return hasNextPage;
    }

    public void setHasNextPage(Boolean hasNextPage) {
        this.hasNextPage = hasNextPage;
    }

    public Boolean getHasPreviousPage() {
        return hasPreviousPage;
    }

    public void setHasPreviousPage(Boolean hasPreviousPage) {
        this.hasPreviousPage = hasPreviousPage;
    }

    public Boolean getHasFirstPage() {
        return hasFirstPage;
    }

    public void setHasFirstPage(Boolean hasFirstPage) {
        this.hasFirstPage = hasFirstPage;
    }

    public Boolean getHasLastPage() {
        return hasLastPage;
    }

    public void setHasLastPage(Boolean hasLastPage) {
        this.hasLastPage = hasLastPage;
    }

    public int getNavigateFirstPage() {
        return navigateFirstPage;
    }

    public void setNavigateFirstPage(int navigateFirstPage) {
        this.navigateFirstPage = navigateFirstPage;
    }

    public int getNavigateLastPage() {
        return navigateLastPage;
    }

    public void setNavigateLastPage(int navigateLastPage) {
        this.navigateLastPage = navigateLastPage;
    }

    public int getNavigatePages() {
        return navigatePages;
    }

    public void setNavigatePages(int navigatePages) {
        this.navigatePages = navigatePages;
    }

    public int getNextPage() {
        return nextPage;
    }

    public void setNextPage(int nextPage) {
        this.nextPage = nextPage;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPages() {
        return pages;
    }

    public void setPages(int pages) {
        this.pages = pages;
    }

    public int getPrePage() {
        return prePage;
    }

    public void setPrePage(int prePage) {
        this.prePage = prePage;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getStartRow() {
        return startRow;
    }

    public void setStartRow(int startRow) {
        this.startRow = startRow;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public String getBusNum() {
        return busNum;
    }

    public void setBusNum(String busNum) {
        this.busNum = busNum;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public String getFreezeFlowNum() {
        return freezeFlowNum;
    }

    public void setFreezeFlowNum(String freezeFlowNum) {
        this.freezeFlowNum = freezeFlowNum;
    }

    public String getRecordNum() {
        return recordNum;
    }

    public void setRecordNum(String recordNum) {
        this.recordNum = recordNum;
    }

    public String getReferenceNum() {
        return referenceNum;
    }

    public void setReferenceNum(String referenceNum) {
        this.referenceNum = referenceNum;
    }

    public Boolean getSuccessed() {
        return successed;
    }

    public void setSuccessed(Boolean successed) {
        this.successed = successed;
    }

    public String getBusType() {
        return busType;
    }

    public void setBusType(String busType) {
        this.busType = busType;
    }

    public String getPayAccount() {
        return payAccount;
    }

    public void setPayAccount(String payAccount) {
        this.payAccount = payAccount;
    }

    public String getPayAccountName() {
        return payAccountName;
    }

    public void setPayAccountName(String payAccountName) {
        this.payAccountName = payAccountName;
    }

    public String getPayBankName() {
        return payBankName;
    }

    public void setPayBankName(String payBankName) {
        this.payBankName = payBankName;
    }

    public String getPayBankType() {
        return payBankType;
    }

    public void setPayBankType(String payBankType) {
        this.payBankType = payBankType;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getRevAccount() {
        return revAccount;
    }

    public void setRevAccount(String revAccount) {
        this.revAccount = revAccount;
    }

    public String getRevAccountName() {
        return revAccountName;
    }

    public void setRevAccountName(String revAccountName) {
        this.revAccountName = revAccountName;
    }

    public String getRevBankName() {
        return revBankName;
    }

    public void setRevBankName(String revBankName) {
        this.revBankName = revBankName;
    }

    public String getRevBankType() {
        return revBankType;
    }

    public void setRevBankType(String revBankType) {
        this.revBankType = revBankType;
    }

    public String getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(String payChannel) {
        this.payChannel = payChannel;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(String payStatus) {
        this.payStatus = payStatus;
    }

    public String getPayDate() {
        return payDate;
    }

    public void setPayDate(String payDate) {
        this.payDate = payDate;
    }

    public String getPlanNumber() {
        return planNumber;
    }

    public void setPlanNumber(String planNumber) {
        this.planNumber = planNumber;
    }

    public String getPlanItemCode() {
        return planItemCode;
    }

    public void setPlanItemCode(String planItemCode) {
        this.planItemCode = planItemCode;
    }

    public String getPlanItemName() {
        return planItemName;
    }

    public void setPlanItemName(String planItemName) {
        this.planItemName = planItemName;
    }

    public String getErpExtend1() {
        return erpExtend1;
    }

    public void setErpExtend1(String erpExtend1) {
        this.erpExtend1 = erpExtend1;
    }

    public String getErpExtend2() {
        return erpExtend2;
    }

    public void setErpExtend2(String erpExtend2) {
        this.erpExtend2 = erpExtend2;
    }

    public String getErpExtend3() {
        return erpExtend3;
    }

    public void setErpExtend3(String erpExtend3) {
        this.erpExtend3 = erpExtend3;
    }

    /**
     * 把json字符串转换成指定范型的list
     * @param json
     * @param list
     * @param clazz
     * @param <T>
     */
    private static <T> void adaptAndAddToList(String json, List<Object> list, Class<T> clazz) {
        JSONObject jsonObject = JSON.parseObject(json);

        if (jsonObject.containsKey("list")) {
            JSONArray listArray = jsonObject.getJSONArray("list");
            for (Object item : listArray) {
                JSONObject itemObject = (JSONObject) item;
                // 适配不同类型的节点
                list.add(JSON.toJavaObject(itemObject, clazz));
            }
        }
    }
}
