package jnpf.model.cultivate.dto.teaching;

import com.alibaba.excel.util.StringUtils;
import jnpf.base.Pagination;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class EmployeePageListDto extends Pagination {
    /**
     * 门店id集合
     */
    private List<String> storeIdList;

    /**
     * 关键字
     */
    private String keyword;

    /**
     * 开始日期(yyyy-MM-dd)
     */
    @NotBlank(message = "开始日期不能为空")
    private String startDate;

    /**
     * 结束日期(yyyy-MM-dd)
     */
    @NotBlank(message = "结束日期不能为空")
    private String endDate;
    public void dateTimeFormat() {
        if(StringUtils.isNotBlank(this.getStartDate())){
            this.startDate = this.getStartDate() + " 00:00:00";
        }
        if(StringUtils.isNotBlank(this.getEndDate())){
            this.endDate = this.getEndDate() + " 23:59:59";
        }
    }
}