package com.jpsoft.shinestar.modules.base.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 描述:base_holiday_info的实体类
 */
@Data
@ApiModel(value = "base_holiday_info的实体类")
public class HolidayInfo {
	/**
	 * 主键
	 */
	@ApiModelProperty(value = "主键")
	private String id;
	/**
	 * 节假日名称
	 */
	@ApiModelProperty(value = "节假日名称")
	private String holidayName;
	/**
	 * 节假日开始日期
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@ApiModelProperty(value = "节假日开始日期")
	private Date beginDate;
	/**
	 * 节假日结束日期
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@ApiModelProperty(value = "节假日结束日期")
	private Date endDate;
	/**
	 * 创建人
	 */
	@ApiModelProperty(value = "创建人")
	private String createBy;
	/**
	 * 创建时间
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
	@ApiModelProperty(value = "创建时间")
	private Date createTime;
	/**
	 * 更新人
	 */
	@ApiModelProperty(value = "更新人")
	private String updateBy;
	/**
	 * 更新时间
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
	@ApiModelProperty(value = "更新时间")
	private Date updateTime;
	/**
	 * 是否删除
	 */
	@ApiModelProperty(value = "是否删除")
	private Boolean delFlag;

	@ApiModelProperty(value = "是否需要上班")
	private Boolean working;

	@ApiModelProperty(value = "参考上班日")
	private int refWeekday;

	@ApiModelProperty(value = "单位编号")
	private String companyId;

	@ApiModelProperty(value = "单位名称")
	private String companyName;

	public String getRefWeekdayN(){
		String text = "";

		if(refWeekday == 0){
			text = "无";
		}else if(refWeekday == 1){
			text = "周一";
		}
		else if(refWeekday == 2){
			text = "周二";
		}
		else if(refWeekday == 3){
			text = "周三";
		}
		else if(refWeekday == 4){
			text = "周四";
		}
		else if(refWeekday == 5){
			text = "周五";
		}
		else if(refWeekday == 6){
			text = "周六";
		}
		else if(refWeekday == 7){
			text = "周日";
		}else{
			text = "无";
		}
		return text;
	}
}