| | |
| | | package com.doumee.core.utils; |
| | | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.net.URLDecoder; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | public class Constants { |
| | | |
| | |
| | | public static final String HK_APPSECRET ="HK_APPSECRET" ; |
| | | public static final String HK_HTTPS ="HK_HTTPS" ; |
| | | public static final String HK_PUSH_URL = "HK_PUSH_URL"; |
| | | public static final String HK_ROOTORG_CODE ="HK_ROOTORG_CODE" ; |
| | | |
| | | //被拜访人信息校验方式(0手机号单独校验 1手机号和姓名组合校验) |
| | | public static final String BEVISITED_USER_VALID = "BEVISITED_USER_VALID"; |
| | | public static final String SELECT_DOORS_VISIT_REQUIRED = "SELECT_DOORS_VISIT_REQUIRED"; |
| | | public static final String SELECT_DOORS_LW_REQUIRED = "SELECT_DOORS_LW_REQUIRED"; |
| | | public static final String PROBLEM_LW_REQUIRED = "PROBLEM_LW_REQUIRED"; |
| | | public static final String PROBLEM_VISIT_REQUIRED = "PROBLEM_VISIT_REQUIRED"; |
| | | public static final String MDJ_LW_REQUIRED = "MDJ_LW_REQUIRED"; |
| | | public static final String MDJ_VISIT_REQUIRED = "MDJ_VISIT_REQUIRED"; |
| | | public static final String EDS_PWD ="!@#$%^&QWERTY" ; |
| | | |
| | | |
| | | public static Date getBirthdyByCardNo(String idCard){ |
| | | if(idCard ==null || idCard.length()<14){ |
| | | return null; |
| | | } |
| | | Date birthday = null; // 解析为日期对象 |
| | | String birthdayString = idCard.substring(6, 14); // 截取身份证号的前六位数字作为出生日期 |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); |
| | | try { |
| | | birthday = dateFormat.parse(birthdayString); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return birthday; |
| | | } |
| | | public static String getTuominStr(String s){ |
| | | if(StringUtils.isEmpty(s)){ |
| | | return ""; |
| | | } |
| | | int l = s.length(); |
| | | if(l <= 2){ |
| | | return s.substring(0,1)+"****"; |
| | | } |
| | | if(l <= 5){ |
| | | return s.substring(0,2)+"***"; |
| | | } |
| | | if(l <= 10){ |
| | | return s.substring(0,3)+"***"+s.substring(l-3,l); |
| | | } |
| | | if(l <= 11){ |
| | | return s.substring(0,3)+"****"+s.substring(l-4,l); |
| | | } |
| | | if(l <= 15){ |
| | | return s.substring(0,3)+"****"+s.substring(l-4,l); |
| | | } |
| | | return s.substring(0,5)+"*******"+s.substring(l-6,l); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * mq tag |
| | |
| | | String activity_looknum = "looknum"; |
| | | String activity_signup = "signup"; |
| | | } |
| | | public interface DeviceRoleType{ |
| | | int lw = 0;//劳务访客 |
| | | int fk = 1;//普通访客 |
| | | int nb = 2;//内部访客 |
| | | } |
| | | public interface DOOR_ROLE_TYPE{ |
| | | int lw = 0; |
| | | int fk = 1; |
| | |
| | | public static final String SUCCESS_STR = "SUCCESS" ; |
| | | |
| | | //开门时间有效期(分钟) |
| | | public static final String QR_OPENBOOK_VALIDTIME="QR_OPENBOOK_VALIDTIME"; |
| | | public static final String QR_OPENROOM_VALIDTIME="QR_OPENROOM_VALIDTIME"; |
| | | public static final String ADVANCE_IN="ADVANCE_IN"; |
| | | public static final String ACCESS_ID="ACCESS_ID"; |
| | | public static final String BUCKETNAME = "BUCKETNAME"; |
| | | public static final String OSS = "OSS"; |
| | |
| | | public static final String ENDPOINT = "ENDPOINT"; |
| | | public static final String RESOURCE_PATH = "RESOURCE_PATH"; |
| | | //发送会议开始 定时提前多少分钟发送 |
| | | public static final String NOTICE_TIME = "NOTICE_TIME"; |
| | | |
| | | public static final String INITIAL_PASSWORD = "INITIAL_PASSWORD"; |
| | | public static final String ACCESS_TOKEN = "ACCESS_TOKEN"; |
| | | |
| | | public static final String INITIAL_ROLE = "INITIAL_ROLE"; |
| | | |
| | | public static final String PLAT_ADDR="PLAT_ADDR"; |
| | | public static final String ADDR_PHONE="ADDR_PHONE"; |
| | | public static final String ADDR_NAME="ADDR_NAME"; |
| | | public static final String ADDR_INFO="ADDR_INFO"; |
| | | |
| | | public static final String SYSTEM ="SYSTEM"; |
| | | public static final String DEFAULT_PASSWORD = "DEFAULT_PASSWORD" ; |
| | | public static final String CREATION_ROLE = "CREATION_ROLE"; |
| | | public static final String ORG_ROLE = "ORG_ROLE"; |
| | | |
| | | public static final String USER_AGREEMENT = "USER_AGREEMENT"; |
| | | |
| | | public static final String ABOUT_USER = "ABOUT_USER"; |
| | | |
| | | public static final String RECHARGE_MONEY = "RECHARGE_MONEY"; |
| | | |
| | | public static final String PLATFORM_ADDRESS = "PLATFORM_ADDRESS"; |
| | | |
| | | public static final String PROJECT_HEAD_IMG = "PROJECT_HEAD_IMG"; |
| | | |
| | | public static final String COFFEE_BEAN_TASK ="COFFEE_BEAN_TASK"; |
| | | |
| | | public static final String SIGN_BOARD="SIGN_BOARD";//每日签到 |
| | | public static final String SHARE_INFO="SHARE_INFO";//分享资讯 |
| | | public static final String SHARE_INVITE_BILL="SHARE_INVITE_BILL";//分享邀请海报 |
| | | public static final String INVITE_USER_LOGIN="INVITE_USER_LOGIN";///邀请新用户注册 |
| | | public static final String POST_COMMENTS="POST_COMMENTS";//发布评论 |
| | | public static final String COFFEE_MAP_CONSUME="COFFEE_MAP_CONSUME";//咖啡地图消费 |
| | | |
| | | // 服务项目 |
| | | public static final String PROJECTS = "PROJECTS"; |
| | | //用户头像 |
| | | public static final String SYSUSER = "SYSUSER"; |
| | | |
| | | public static final String ROOT_PATH="ROOT_PATH";//本地文件上传地址配置 |
| | | public static final String FILE_DIR="FILE_DIR";//本地文件访问地址配置 |
| | | |
| | | |
| | | public static final String WX_PLATFORM = "WX_PLATFORM"; |
| | | public static final String WX_PLATFORM_ACCESS_TOKEN = "WX_PLATFORM_ACCESS_TOKEN"; |
| | | public static final String WX_PLATFORM_APPID = "WX_PLATFORM_APPID"; |
| | | public static final String WX_PLATFORM_SECRET = "WX_PLATFORM_SECRET"; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | public static final String ACTIVITY_SIGN_KEY = "actcode_"; |
| | | public static final String AFTERSALE_KEY = "salecode_"; |
| | | } |
| | | /** |
| | | * 企业数据来源 0平台注册 1后台导入 |
| | | */ |
| | | public interface ORIGIN{ |
| | | public static final int platformRegister = 0; |
| | | public static final int backstageImport = 1; |
| | | } |
| | | |
| | | |
| | | public static BigDecimal formatBigdecimal(BigDecimal d) { |
| | | if (d == null) { |
| | |
| | | int objTypeBook_in = 1;//参会人员开门 |
| | | int objTypeBook_out = 2;//访客开门 |
| | | } |
| | | public interface memberType{ |
| | | int visitor = 0;//普通访客 |
| | | int lw_visitor = 1;//劳务访客 |
| | | int internal = 2;//内部人员 |
| | | } |
| | | public static void main(String[] args) { |
| | | String t = URLDecoder.decode("https://lsqw.gtja.com/qwcos/v-index.html#/loginforProperty?corpId=ww4b7aefafeb430e4b&corpId=ww4b7aefafeb430e4b&agentId=1000005&agentId=1000005&fromRoute=&userCode=013561&userCode=&userId=zz&userId=&encryptUserCode=&custQwId=wmIUuSDgAAR8MhtVY8w90EyKltvoK5fA&custCode=&openId=op1wZwD1dKuBQywmWWS5957zUOJI&name=%E8%B9%84%E8%B9%84&headUrl=http%3A%2F%2Fwx.qlogo.cn%2Fmmhead%2FQ3auHgzwzM4QlibSOAvYcvRMdsoyF3Ua7duLOYSJfB3dsGsYxIYonBw%2F0&dbHeadUrl=https%3A%2F%2Ftgf.gtja.com%2Ff%2F%2Fqwoms%2F2022512%2Fqwoms_1652332606613_8.jpg"); |
| | | System.out.println(t); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用户类型 |
| | | */ |
| | |
| | | |
| | | // 0订单通知 1系统消息 2互动消息 3优惠券提醒 4官方客服 5活动推荐 6我的关注 |
| | | |
| | | NOTICE_ORDER(0,"0订单通知","0订单通知"), |
| | | NOTICE_SYSTEM(1,"1系统消息","1系统消息"), |
| | | NOTICE_INTERACTION(2,"互动消息","互动消息"), |
| | | NOTICE_MEMBER_COUPON(3,"优惠券提醒","优惠券提醒"), |
| | | NOTICE_ACTIVITY(5,"活动推荐","活动推荐"), |
| | | NOTICE_MEMBER_FOLLOW(6,"我的关注","我的关注") |
| | | ; |
| | | |
| | | private Integer key; |
| | | |
| | | private String type; |
| | | |
| | | private String content; |
| | | |
| | | NoticeType(Integer key, String type, String content) { |
| | | this.key = key; |
| | | this.type = type; |
| | | this.content = content; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 积分类型 |
| | | */ |
| | | public enum IntegralObjType { |
| | | REGISTER(0, "平台注册", "平台注册",0), |
| | | SIGNIN(1, "签到", "签到",0), |
| | | SHARE(2, "分享邀请", "分享邀请",0), |
| | | INVITENEWUSER(3, "邀请新用户", "邀请新用户",0), |
| | | EXCHANGEGOODS(4, "兑换商品", "兑换商品",1), |
| | | EXCHANGECOUPON(5, "兑换优惠券", "兑换优惠券",1), |
| | | SHARE_INFO(6,"分享资讯","分享资讯",0), |
| | | POST_COMMENTS(7,"发布评论","发布评论",0), |
| | | COFFEE_MAP_CONSUME(8,"咖啡地图消费","咖啡地图消费",0), |
| | | SHOP_ORDER(9,"余额抵扣商品","余额抵扣商品",1), |
| | | AFTERSALE_BACK(10,"售后退款","售后退款",1), |
| | | EXCHANGE_CARD(11,"卡充值","卡充值",0), |
| | | SYSTEM_RECHARGE(12,"平台充值","平台充值",0), |
| | | SYSTEM_DEDUCT(13,"平台扣款","平台扣款",0), |
| | | SHOP_ORDER_CANCEL(14,"余额抵扣商品退还","余额抵扣商品退还",0) |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | | private int key; |
| | | private String noteinfo;// 描述 |
| | | private Integer addTitle; // 0 = 新增;1 = 不新增 |
| | | |
| | | // 构造方法 |
| | | IntegralObjType(int key, String name, String noteinfo ,Integer addTitle) { |
| | | this.name = name; |
| | | this.key = key; |
| | | this.noteinfo = noteinfo; |
| | | this.addTitle = addTitle; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getName(int index) { |
| | | for (IntegralObjType c : IntegralObjType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getInfo(int index) { |
| | | for (IntegralObjType c : IntegralObjType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.noteinfo; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // get set 方法 |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getNoteinfo() { |
| | | return noteinfo; |
| | | } |
| | | |
| | | |
| | | public int getAddTitle() { |
| | | return this.addTitle; |
| | | } |
| | | |
| | | public void setAddTitle(Integer addTitle) { |
| | | this.addTitle = addTitle; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 标签类型 |
| | | */ |
| | | public enum LabelsType { |
| | | GOODSTYPE(0, "商品分类", "商品分类"), |
| | | GOODSBRAND(1, "商品品牌", "商品品牌"), |
| | | BUSNESSLABEL(2, "商家标签", "商家标签"), |
| | | EXPRESSDELIVERY(3, "快递", "快递"), |
| | | RETURNOPTIONS(4, "退货选项", "退货选项"), |
| | | EXCHANGEOPTIONS(5, "换货选项", "换货选项"), |
| | | REFUNDOPTIONS(6, "退款选项", "退款选项"), |
| | | CANCELORDEROPTIONS(7, "取消订单选项", "取消订单选项"), |
| | | COFFERBEANTYPE(8, "咖啡百科分类", "咖啡百科分类"), |
| | | INFOTYPE(9, "咨询分类", "咨询分类"), |
| | | ACTIVITYMATCHTYPE(10, "活动赛事分类", "活动赛事分类"), |
| | | DARENTANDIANTYPE(11, "达人探店分类", "达人探店分类"), |
| | | HOMEZHUANQU(12, "首页专区", "首页专区"), |
| | | |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | | private int key; |
| | | private String noteinfo;// 描述 |
| | | |
| | | // 构造方法 |
| | | LabelsType(int key, String name, String noteinfo) { |
| | | this.name = name; |
| | | this.key = key; |
| | | this.noteinfo = noteinfo; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getName(int index) { |
| | | for (LabelsType c : LabelsType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getInfo(int index) { |
| | | for (LabelsType c : LabelsType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.noteinfo; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // get set 方法 |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getNoteinfo() { |
| | | return noteinfo; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 活动类型 |
| | | */ |
| | | public enum ActivityType { |
| | | |
| | | SHOPACTIVITY(0, "商家活动", "商家活动"), |
| | | PLATACTIVITY(1, "平台活动", "平台活动"), |
| | | TANDIAN(2, "探店", "探店"), |
| | | CONSULT(3, "资讯", "资讯"), |
| | | |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | | private int key; |
| | | private String noteinfo;// 描述 |
| | | |
| | | // 构造方法 |
| | | ActivityType(int key, String name, String noteinfo) { |
| | | this.name = name; |
| | | this.key = key; |
| | | this.noteinfo = noteinfo; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getName(int index) { |
| | | for (ActivityType c : ActivityType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getInfo(int index) { |
| | | for (ActivityType c : ActivityType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.noteinfo; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // get set 方法 |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getNoteinfo() { |
| | | return noteinfo; |
| | | } |
| | | |
| | | } |
| | | } |