Constants.java 7.5 KB
package cn.runsa.crmapp.base;

import java.util.Date;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;

/**
 * 系统常量
 * 
 * @author Stephen
 *
 */
public class Constants {
	/**
	 * rest webservice 提供的页面地址
	 */
	public static final String CONSTANTS_SERVER_WEB_URL = "SERVER_URL";
	/**
	 * rest webservice 提供页面的超时时间
	 */
	public static final int CONSTANTS_API_PAGE_REGISTER_TIMEOUT = 30*60;
	/**
	 * rest webservice 提供页面的业务:会员入会
	 */
	public static final String CONSTANTS_API_PAGE_SCOPE_REGISTER = "REGISTER";
	
	public static final String CONSTANTS_CLASS_IMPL_PROFILE = "class.impl.profile";
	
	public static final String CONSTANTS_CLASS_IMPL_SYSTEM = "system";
	
	public static final String CONSTANTS_SERVER_CONFIG_PATH = "server_config";
	
	
	/**
	 * 系统默认字符集
	 */
	public static final String CONSTANTS_DEFAULT_CHARSET = "UTF-8";
	
	public static final String CONSTANTS_DEFAULT_SQL_DELIMITER = "#@#!#";
	
	
	/**
	 * 内容服务的类型:url
	 */
	public static final Byte CONSTANTS_CONTENT_URL = 0;

	
	/**
	 * 东八区:中国
	 */
	public static final int CONSTANTS_CHINA_OFFSET_UTC = 8;
	/**
	 * 一天的秒
	 */
	public static final int CONSTANTS_MILLS_OF_DAYS = 24 * 60 * 60 * 1000;

	
	/**
	 * 操作失败(响应到前端)
	 */
	public static final String RES_EXEC_FAILURE = "cn.runsa.failure";

	
	/**
	 * 阳历
	 */
	public static final int CALENDAR_GREGORIAN = 0;
	/**
	 * 阴历
	 */
	public static final int CALENDAR_LUNAR = 1;
	
	
	/**
	 * 未婚
	 */
	public static final int MARRIAGE_NO = 0;
	/**
	 * 已婚
	 */
	public static final int MARRIAGE_YES = 1;
	/**
	 * 婚姻保密
	 */
	public static final int MARRIAGE_UNKNOWN = 2;
	
	
	/**
	 * 女
	 */
	public static final int SEX_FEMALE = 0;
	/**
	 * 男
	 */
	public static final int SEX_MALE = 1;
	/**
	 * 性别保密
	 */
	public static final int SEX_UNKNOWN = 2;
	
	
	/**
	 * 永久
	 */
	public static Date DATE_FOR_EVER = new DateTime(2099, 12, 31, 23, 59, 59,DateTimeZone.forOffsetHours(CONSTANTS_CHINA_OFFSET_UTC)).toDate();
	
	
	/**
	 * 业务处理需要分页的默认值
	 */
	public static final int CONSTANTS_BUSINESS_DEFAULT_PAGE_SIZE = 100;
	
	
	/**
	 * 顾客未验证
	 */
	public static final byte CONSTANTS_CUSTOMER_VERIFY_NOT = 0;
	

	/**
	 * 非会员
	 */
	public static final Byte CONSTANTS_CUSTOMER_NOT_MEMBER = (byte)0;
	/**
	 * 会员
	 */
	public static final Byte CONSTANTS_CUSTOMER_MEMBER = (byte)1;
	
	
	/**
	 * 顾客来源渠道:线下
	 */
	public static final String CONSTANTS_CUSTOMER_CHANNEL_OFFLINE = "OFFLINE";
	/**
	 * 顾客来源渠道:微信
	 */
	public static final String CONSTANTS_CUSTOMER_CHANNEL_WEIXIN = "WEIXIN";

	
	/**
	 * 顾客来源:门店
	 */
	public static final String CONSTANTS_CUSTOMER_SOURCE_SITE = "SIT";
	/**
	 * 顾客来源:推荐顾客
	 */
	public static final String CONSTANTS_CUSTOMER_SOURCE_CUSTOMER = "CST";
	/**
	 * 顾客来源:推荐雇员
	 */
	public static final String CONSTANTS_CUSTOMER_SOURCE_EMPLOYEE = "EMP";
	/**
	 * 顾客来源:优惠券
	 */
	public static final String CONSTANTS_CUSTOMER_SOURCE_COUPON = "CPN";
	/**
	 * 顾客来源:搜索公众号
	 */
	public static final String CONSTANTS_CUSTOMER_SOURCE_WEIXINGZH = "GZH";
	/**
	 * 顾客来源:物流单
	 */
	public static final String CONSTANTS_CUSTOMER_SOURCE_EXPRESS = "EXP";
	/**
	 * 顾客来源:商品
	 */
	public static final String CONSTANTS_CUSTOMER_SOURCE_GOODS = "GDS";
	/**
	 * 顾客来源:活动
	 */
	public static final String CONSTANTS_CUSTOMER_SOURCE_ACTIVITY = "ACT";
	/**
	 * 顾客来源:订单
	 */
	public static final String CONSTANTS_CUSTOMER_SOURCE_ORDER= "ODR";
	/**
	 * 顾客来源:APP
	 */
	public static final String CONSTANTS_CUSTOMER_SOURCE_APP = "APP";

	
	/**
	 * 优惠券来源:内部券
	 */
	public static final int CONSTANTS_COUPONS_COME_FROM_INNER = 0;
	/**
	 * 优惠券来源:外部券
	 */
	public static final int CONSTANTS_COUPONS_COME_FROM_OUTER = 1;
	
	
	/**
	 * 优惠券类型:折扣券
	 */
	public static final int CONSTANTS_COUPONS_TYPE_DISCOUNT = 0;
	/**
	 * 优惠券类型:金额券
	 */
	public static final int CONSTANTS_COUPONS_TYPE_MONEY = 1;
	/**
	 * 优惠券类型:礼品券
	 */
	public static final int CONSTANTS_COUPONS_TYPE_GIFT = 2;
	/**
	 * 优惠券类型:定价券
	 */
	public static final int CONSTANTS_COUPONS_TYPE_PRICE = 3;
	/**
	 * 优惠券类型:包邮券
	 */
	public static final int CONSTANTS_COUPONS_TYPE_FREESHIPPING = 4;
	
	
	/**
	 * 优惠券的生成方式:自动
	 */
	public static final int CONSTANTS_COUPONS_GENERATE_AUTO = 0;
	/**
	 * 优惠券的生成方式:导入
	 */
	public static final int CONSTANTS_COUPONS_GENERATE_IMPORT = 1;
	/**
	 * 优惠券的生成方式:接口接入
	 */
	public static final int CONSTANTS_COUPONS_GENERATE_INTERFACE = 2;

	
	/**
	 * 手机
	 */
	public static final String CONSTANTS_CHANNEL_PHONE = "phone";
	/**
	 * 邮箱
	 */
	public static final String CONSTANTS_CHANNEL_EMAIL = "email";

	
	/**
	 * 联盟级
	 */
	public static final String CONSTANTS_CUSTOMER_RANK_DEFAULT = "LMJ";
	
	
	/**
	 * 等级改变:升级
	 */
	public static final boolean CONSTANTS_RANK_CHANGE_UPGRADE = true;
	/**
	 * 等级改变:降级
	 */
	public static final boolean CONSTANTS_RANK_CHANGE_DEGRADE = false;
	
	
	/**
	 * 订单回执业务:积分
	 */
	public static final String CONSTANTS_ORDER_SERVICE_POINTS = "POINTS";
	/**
	 * 订单回执业务:优惠券
	 */
	public static final String CONSTANTS_ORDER_SERVICE_COUPONS = "COUPON";
	
	
	
	public static final Byte CONSTANTS_ORDER_POINTS_INCREASE = 1;
	
	public static final Byte CONSTANTS_ORDER_POINTS_DECREASE = 2;
	
	
	/**
	 * API账户:公众号
	 */
	public static final String CONSTANTS_API_TYPE_WXGZH = "GZH";
	/**
	 * API账户:POS
	 */
	public static final String CONSTANTS_API_TYPE_POS = "POS";
	/**
	 * API账户:电商
	 */
	public static final String CONSTANTS_API_TYPE_E_COMMERCE = "EC";
	/**
	 * API账户:导购
	 */
	public static final String CONSTANTS_API_TYPE_SALES_ASSISTANT = "SALES";
	
	
	/**
	 * 缓存前缀:token
	 */
	public static final String CONSTANTS_PREFIX_TOKEN  = "TOKEN";
	/**
	 * 缓存前缀:顾客信息
	 */
	public static final String CONSTANTS_PREFIX_CUSTOMER_INFO = "CST_INF";
	/**
	 * 缓存前缀:顾客手机号
	 */
	public static final String CONSTANTS_PREFIX_CUSTOMER_ID_PHONE = "CST_TEL";
	/**
	 * 缓存前缀:顾客微信
	 */
	public static final String CONSTANTS_PREFIX_CUSTOMER_ID_WXGZH = "CST_GZH";
	/**
	 * 缓存前缀:顾客账套信息
	 */
	public static final String CONSTANTS_PREFIX_CUSTOMER_CRM_ACCOUNTS_ALL = "CST_ACTA";
	/**
	 * 缓存前缀:顾客部分账套信息
	 */
	public static final String CONSTANTS_PREFIX_CUSTOMER_CRM_ACCOUNTS_PART = "CST_ACTP";
	
	
	
	public static final String CONSTANTS_TEMPLATE_SCOPE_POINTS_EXPIRY = "POINTS_EXPIRY";
	
	public static final String CONSTANTS_POINTS_CHANGE_TYPE_ADJUST_MANUAL ="ADJ_MAN";
	
	public static final String CONSTANTS_POINTS_CHANGE_TYPE_EXPIRY ="EXPIRY";
	
	
	/**
	 * 新建时字段
	 */
	public static final String CONSTANTS_FIELD_MODE_NEW = "NEW";
	/**
	 * 更新时字段
	 */
	public static final String CONSTANTS_FIELD_MODE_MODIFY = "MOD";
	/**
	 * 审批通过
	 */
	public static final Byte CONSTANTS_APPROVAL_STAT_PASS = 2;
	
	public static final String CONSTANTS_EVENT_ENV_KEY_NAME_POINTS_CALCULATE = "CRM_CALCULATE";
	
	/**
	 * QiNiu
	 */
	public static final String QN_ACCESS_KEY = "QN_ACCESS_KEY";
	public static final String QN_SECRET_KEY = "QN_SECRET_KEY";
	public static final String QN_BUCKET = "QN_BUCKET";
}