package com.prolog.cs.biz.outbound.model.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;


@ApiModel("打印服务")
public class PrintVO {

    public PrintVO() {
        data = new ArrayList<>(1);
    }

    @ApiModelProperty(value = "打印方案，对应打印机相关设置")
    private String printSolution;

    @ApiModelProperty(value = "打印模板地址")
    private String url;

    @ApiModelProperty(value = "是否预览")
    private Boolean preview;

    @ApiModelProperty(value = "打印份数")
    private Integer count;

    @ApiModelProperty(value = "打印参数")
    private List<PrintParameter> data;

    public <H> void addParameter(H header) {
        PrintParameter printParameter = new PrintParameter();
        printParameter.setHead(header);
        data.add(printParameter);
    }

    public String getPrintSolution() {
        return printSolution;
    }

    public void setPrintSolution(String printSolution) {
        this.printSolution = printSolution;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Boolean getPreview() {
        return preview;
    }

    public void setPreview(Boolean preview) {
        this.preview = preview;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public List<PrintParameter> getData() {
        return data;
    }

    public void setData(List<PrintParameter> data) {
        this.data = data;
    }

    @ApiModel("打印参数")
    public static class PrintParameter<H, T> implements Serializable {
        @ApiModelProperty(value = "报表头参数")
        private H head;

        @ApiModelProperty(value = "报表行参数")
        private List<T> table;


        public H getHead() {
            return head;
        }

        public void setHead(H head) {
            this.head = head;
        }

        public void setTable(List<T> table) {
            this.table = table;
        }

        public List<T> getTable() {
            return table;
        }
    }

}
