package com.scpyun.platform.jilinsscgsdp.constant.task;

import com.scpyun.base.core.utils.Global;

public class Constant {
	
	public static final String SYS_ENV=Global.getConfig("server.enviro");
	
	public static String CHECK_SUCCESS_COLLECTION="successList";
	
	public static String CHECK_FAILURE_COLLECTION="failList";
	
	public static final String SAVE_SUCCESS = "SUCCESS";
	
	public static final String OPERATE_TYPE_SUCCESS = "1";
	
	public static final String OPERATE_TYPE_FAIL = "2";
    
//	public static final String COMMUNITY_CODE_CHECK_EXCEPTION = "数据异常:社区编码与省编码不一致";
	public static final String COMMUNITY_CODE_CHECK_EXCEPTION = "数据异常:社区编码异常";

	public static final String SAVE_EXCEPTION_PREFIX = "写入异常:";
	
	public enum TypeEnum{
		INSERT("insert"),
		UPDATE("update"),
		DELETE("delete");
		
		private String type;

		private TypeEnum(String type) {
			this.type = type;
		}

		public String getType() {
			return type;
		}

		public void setType(String type) {
			this.type = type;
		}
		
		public static boolean doInsertOrUpdate(String type) {
			if(!type.equals(DELETE.getType())) {
				return true;
			}else {
				return false;
			}
		}
		
		public static TypeEnum getType(String type) {
			for(TypeEnum typEnum:TypeEnum.values()) {
				if(typEnum.getType().equals(type)) {
					return typEnum;
				}
			}
			return null;
		}
	}	
}

