package com.persagy.calendar.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @version 
 * @description 
 * @company persagy
 * @author zhangqiankun
 * @since 2020年9月1日:	下午1:59:38
 */
public class WorkCalendarConstant {
	
	/**
	 * 日期正则表达式，格式：yyyyMMddHHmmss
	 */
	public static final String DATE_REG_YYYYMMDDHHMMSS = "[\\d]{4}[0-1][0-9][0-3][0-9][0-2][0-9][0-6][0-9][0-6][0-9]";
	
	/** 
	 * 日期正则表达式，格式：yyyyMMdd
	 */
	public static final String DATE_REG_YYYYMMDD = "(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})(((0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))0229)";
	
	/** 
	 * 日期正则表达式，格式：hhmmss
	 */
	public static final String DATE_REG_HHMMSS = "[0-2][0-9][0-6][0-9][0-6][0-9]";
	
	
	// dOfW为按周设置,例如： 1 2 3 1 (Monday), 7 (Sunday)
	public static final String WORK_CALENDAR_D_OF_W = "dOfW";
	
	// dOfM为按每月的几号设置,例如：1 12 15-20
	public static final String WORK_CALENDAR_D_OF_M = "dOfM";
	
	// mAndD为按一年中的几月几号设置,例如： 0221 0830 0925-1028
	public static final String WORK_CALENDAR_M_AND_D = "mAndD";
	
	// 工作历ID前缀
	public static final String WORK_CALENDAR_ID_PREFIX = "WC";

	// 工作历规则ID前缀
	public static final String WORK_CALENDAR_RULE_ID_PREFIX = "WR";
	
	// 工作历标签ID前缀
	public static final String WORK_CALENDAR_LABEL_ID_PREFIX = "WL";
	
	// 作息时间表ID前缀
	public static final String WORK_CALENDAR_DATE_ID_PREFIX = "WD";
	
	public static final String WORK_CALENDAR_DEL_FLAG_NOR = "0";		// 正常
	
	public static final String WORK_CALENDAR_DEL_FLAG_DEL = "1";		// 删除	
	
	public static final String WORK_CALENDAR_RULE_FLAG_NEW = "0";		// 时间引擎解析规则
	
	public static final String WORK_CALENDAR_RULE_FLAG_OLD = "1";		// 时间引擎不解析规则，老版进来的
	
	public static final String CUSTOM_CALENDAR_DATE_NO = "0";		// 非自定义
	
	public static final String CUSTOM_CALENDAR_DATE_YES = "1";		// 自定义
	
	public static final String CUSTOM_CALENDAR_DICT_TYPE = "custom-type";	// 自定义类型
	
	/**
	 * day of week
	 */
	public static final Map<Integer, String> DAY_OF_WEEK = new HashMap<Integer, String>(8);
	
	/**
	 * 所有的类型
	 */
	public static final Map<String, String> DICT_TYPE = new HashMap<String, String>(2);
	
	/**
	 * 类型和code的映射
	 */
	public static final Map<String, Map<String, String>> DICT_TYPE_CODE = new HashMap<String, Map<String, String>>(2);
	
	/**
	 * 开闭店类型
	 */
	public static final Map<String, String> SHOP_TYPE_CODE = new HashMap<String, String>(4);
	
	static {
		SHOP_TYPE_CODE.put("2", "开店时间");
		SHOP_TYPE_CODE.put("3", "商业闭店时间");
		SHOP_TYPE_CODE.put("4", "娱乐闭店时间");
		DICT_TYPE_CODE.put("shop", SHOP_TYPE_CODE);
		
		DICT_TYPE.put("shop", "开闭店类型");
		
		
		DAY_OF_WEEK.put(1, "日");
		DAY_OF_WEEK.put(2, "一");
		DAY_OF_WEEK.put(3, "二");
		DAY_OF_WEEK.put(4, "三");
		DAY_OF_WEEK.put(5, "四");
		DAY_OF_WEEK.put(6, "五");
		DAY_OF_WEEK.put(7, "六");
	}
	
}
