package cn.hnthyy.thmz.vo;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * 所用票号视图类
 */
@Data
public class ReceiptBillVo implements Comparable<ReceiptBillVo> {
    private String payMark;
    private String cancelMark;
    private String receiptBill;
    private String serialNo;


    @Override
    public int compareTo(ReceiptBillVo receiptBillVo) {
        //重写Comparable接口的compareTo方法，
        Integer ownBill = 0;
        Integer otherBill = 0;
        if (StringUtils.isNotBlank(this.receiptBill)) {
            ownBill = Integer.valueOf(this.receiptBill);
        }
        if (receiptBillVo != null && StringUtils.isNotBlank(receiptBillVo.getReceiptBill())) {
            otherBill = Integer.valueOf(receiptBillVo.getReceiptBill());
        }
        return ownBill - otherBill;// 根据发票号升序排列，降序修改相减顺序即可
    }
}
