package thyyxxk.webserver.entity.medicalinsurance.setlinfo;

import lombok.Data;
import thyyxxk.webserver.utils.DateUtil;

import java.util.Date;

@Data
public class TimesList {
    private String setlId;
    private Integer times;
    private Integer ledgerSn;
    private Date endtime;
    private String label;
    private String hisOrdNum;

    public String getLabel() {
        if (null != ledgerSn && ledgerSn > 0) {
            return setlId + "_" + times + "_" + ledgerSn + "_" + DateUtil.formatDatetime(endtime, "yyyyMMddHHmmss");
        }
        if (null != hisOrdNum && !hisOrdNum.isEmpty()) {
            String temp = hisOrdNum.replaceAll("_", "^");
            return setlId + "_" + times + "_" + temp;
        }
        return setlId + "_" + times + "_" + DateUtil.formatDatetime(endtime, "yyyyMMddHHmmss");
    }
}
