package cn.com.ty.lift.batch.applet.dao.model.request;

import cn.com.ty.lift.batch.applet.constants.DataStatisticsConstants;
import cn.com.ty.lift.batch.applet.util.DataStatisticsUtil;
import lombok.Data;

import java.time.LocalDate;

/**
 * @author huangyuan
 * @date 2020/2/4
 * @description
 */
@Data
public class ContractDataRequest extends CommonRequest{
    /**
     * 起始时间
     */
    private LocalDate startDate;

    /**
     * 起始时间字符串
     */
    private String startDateStr;

    /**
     * 结束时间
     */
    private LocalDate endDate;

    /**
     * 结束时间字符串
     */
    private String endDateStr;

    /**
     * 合同取值范围 top5 表示前5 all 表示全部
     */
    private String contractScope;

    public LocalDate getStartDate(){
        return DataStatisticsUtil.getLocalDateFromStr(startDateStr,
                DataStatisticsConstants.DATA_STATISTICS_TIME_FORMAT);
    }

    public LocalDate getEndDate(){
        return DataStatisticsUtil.getLocalDateFromStr(endDateStr,
                DataStatisticsConstants.DATA_STATISTICS_TIME_FORMAT);
    }

}
