From 2ce20c4dd9df60435afe5e6820103a37cf7f684a Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期五, 12 七月 2024 18:26:15 +0800 Subject: [PATCH] 提交 --- server/service/src/main/java/com/doumee/core/utils/Constants.java | 184 +++++++++++++++++++++++++++++++++++---------- 1 files changed, 141 insertions(+), 43 deletions(-) diff --git a/server/service/src/main/java/com/doumee/core/utils/Constants.java b/server/service/src/main/java/com/doumee/core/utils/Constants.java index a1b0928..0a989e0 100644 --- a/server/service/src/main/java/com/doumee/core/utils/Constants.java +++ b/server/service/src/main/java/com/doumee/core/utils/Constants.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import java.io.IOException; @@ -15,6 +16,10 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.Date; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Random; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -32,6 +37,7 @@ public static final String HK_PUSH_URL = "HK_PUSH_URL"; public static final String HK_ROOTORG_CODE ="HK_ROOTORG_CODE" ; public static final String HK_ROOTORG_NAME ="HK_ROOTORG_NAME" ; + public static final String REDIS_TOKEN_KEY = "token_"; //琚嫓璁夸汉淇℃伅鏍¢獙鏂瑰紡锛�0鎵嬫満鍙峰崟鐙牎楠� 1鎵嬫満鍙峰拰濮撳悕缁勫悎鏍¢獙锛� public static final String BEVISITED_USER_VALID = "BEVISITED_USER_VALID"; @@ -73,11 +79,6 @@ public static final String FTP_USERNAME ="FTP_USERNAME" ; public static final String FTP_PWD ="FTP_PWD" ; public static final String FTP_RESOURCE_PATH ="FTP_RESOURCE_PATH" ; - public static final String ERP_ORGLIST_URL ="ERP_ORGLIST_URL" ; - public static final String ERP_USERLIST_URL ="ERP_USERLIST_URL" ; - public static final String ERP_APPROVE_URL ="ERP_APPROVE_URL" ; - public static final String ERP_USERSTATUS_RL ="ERP_USERSTATUS_RL" ; - public static final String ERP ="ERP" ; public static final Integer THREE =3 ; public static final Integer FOUR =4 ; public static final String ORG_USER_ORIGIN = "ORG_USER_ORIGIN"; @@ -87,34 +88,80 @@ public static final String ZBOM = "ZBOM" ; public static final String ZBOM_IAM_APPKEY = "ZBOM_IAM_APPKEY"; public static final String ZBOM_IAM_APPID = "ZBOM_IAM_APPID"; - public static boolean DEALING_HK_SYNCPRIVILEGE= false; - public static boolean DEALING_HK_SYNCDEVICE = false; - public static boolean DEALING_HK_SYNCDEVICE_STATUS = false; - public static boolean DEALING_HK_SYNCPARK = false; - public static boolean DEALING_HK_IMG = false; - public static boolean DEALING_HK_ORG = false; - public static boolean DEALING_HK_USER = false; - public static boolean DEALING_HK_DEL_USER = false; - public static boolean DEALING_HK_VISIT = false; - public static boolean DEALING_HK_VISIT_EXPIRE = false; - public static boolean DEALING_FROM_HK_VISIT = false; - public static boolean DEALING_HK_EMPOWER = false; - public static boolean DEALING_HK_EMPOWER_DETAIL = false; - public static boolean DEALING_HK_EMPOWER_RESULT = false; - public static boolean DEALING_HK_PARKBOOK = false; - // ERP鎺ュ彛閰嶇疆 - public static final String ERP_CONFIG = "ERP_CONFIG"; - // ERP ACCESS_KEY - public static final String ERP_ACCESS_KEY = "ERP_ACCESS_KEY"; - // ERP ACCESS_SECRET - public static final String ERP_ACCESS_SECRET = "ERP_ACCESS_SECRET"; - // 鍐呴儴浜哄憳鍐荤粨閰嶇疆鏃堕棿 - public static final String TIMEOUT_FREEZE = "TIMEOUT_FREEZE"; + public static Integer parseIntByStr(String idtOrgStatus) { + try { + return Integer.parseInt(idtOrgStatus); + }catch (Exception e){ + return null; + } + } - // 瓒呮椂棰勮閰嶇疆 - public static final String TIMEOUT_WARNING = "TIMEOUT_WARNING"; - // FTP鏂囦欢鏈嶅姟鍣ㄨ祫婧愯闂湴鍧� + /** + * 闄勪欢瀵硅薄绫诲瀷 0news澶氬浘 1news瑙嗛 + */ + public enum MultiFile{ + NEWS_FILE(0, "鎺ㄥ箍璧勮闄勪欢", "NEWS") + + ; + // 鎴愬憳鍙橀噺 + private String name; + private int key; + private String info;// 鎻忚堪 + + // 鏋勯�犳柟娉� + MultiFile(int key, String name, String info) { + this.name = name; + this.key = key; + this.info = info; + } + + // 鏅�氭柟娉� + public static String getName(int index) { + for (MultiFile c : MultiFile.values()) { + if (c.getKey() == index) { + return c.name; + } + } + return null; + } + + // 鏅�氭柟娉� + public static String getInfo(int index) { + for (MultiFile c : MultiFile.values()) { + if (c.getKey() == index) { + return c.info; + } + } + return null; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } + + // 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 static Date getBirthdyByCardNo(String idCard){ if(idCard ==null || idCard.length()<14){ @@ -257,9 +304,12 @@ public static final String ACCESS_KEY = "ACCESS_KEY"; public static final String ENDPOINT = "ENDPOINT"; public static final String RESOURCE_PATH = "RESOURCE_PATH"; + public static final String USERS_FILE = "USERS_FILE"; + public static final String NEWS_FILE = "NEWS_FILE"; //鍙戦�佷細璁紑濮� 瀹氭椂鎻愬墠澶氬皯鍒嗛挓鍙戦�� public static final String SYSTEM ="SYSTEM"; + public static final String MEMBER ="MEMBER"; public static final String COFFEE_BEAN_TASK ="COFFEE_BEAN_TASK"; @@ -270,31 +320,62 @@ public static final String WX_PLATFORM = "WX_PLATFORM"; + public static final String ZBOM_ZHONGTAI_API_URL = "ZBOM_ZHONGTAI_API_URL"; 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 WX_PLATFORM_AUDIT_VISIT = "WX_PLATFORM_AUDIT_VISIT"; + public static final String ZBOM_CRM_API_URL = "ZBOM_CRM_API_URL"; + public static final String ZBOM_CRM_API_KEY = "ZBOM_CRM_API_KEY"; + public static final String ZBOM_SMS_API_KEY = "ZBOM_SMS_API_KEY"; + public static final String ZBOM_IAM_API_URL = "ZBOM_IAM_API_URL"; + public static final String ZBOM_SMS_API_URL = "ZBOM_SMS_API_URL"; public static final String WX_PLATFORM_PREFIX = "WX_PLATFORM_PREFIX"; + public static final String WX_MINI_CONFIG = "WX_MINI_CONFIG"; + public static final String WX_APPID_CUSTOMER = "WX_APPID_CUSTOMER"; + public static final String WX_SECRET_CUSTOMER = "WX_SECRET_CUSTOMER"; + public static final String WX_APPID_PERSONNEL = "WX_APPID_PERSONNEL"; + public static final String WX_SECRET_PERSONNEL = "WX_SECRET_PERSONNEL"; + public interface CrmSources{ + + + String SOURCE_DKXD = "DKXD";// 浠e涓嬪崟(DKXD) + String SOURCE_LYSJ = "LYSJ";// 闆跺厓璁捐(LYSJ) + String SOURCE_ZBSJSQ = "ZBSJSQ";// 蹇楅偊璁捐鐢宠(ZBSJSQ) + String SOURCE_ZBDXFX = "ZBDXFX";// 蹇楅偊鐭俊鍒嗕韩(ZBDXFX) + String SOURCE_ZBLLJL = "ZBLLJL";// 蹇楅偊娴忚璁板綍鍒嗕韩(ZBLLJL) + String SOURCE_ZBWDSC = "ZBWDSC";// 蹇楅偊鎴戠殑鏀惰棌鍒嗕韩(ZBWDSC) + String SOURCE_ZBLYSJ = "ZBLYSJ";// 蹇楅偊闆跺厓璁捐(ZBLYSJ) + String SOURCE_ZBLDX = "ZBLDX";// 蹇楅偊鑰佸甫鏂�(ZBLDX) + String SOURCE_ZBFGCS = "ZBFGCS";// 蹇楅偊椋庢牸娴嬭瘯(ZBFGCS) + String SOURCE_ZBJX = "DSLX22";// 蹇楅偊瀹堕��(ZBJX) + } public interface RedisKeys { - public static final String IMPORTING_MEMBER ="IMPORTING_MEMBER"; - public static final String IMPORTING_SHOP ="IMPORTING_SHOP"; - public static final String IAM_APPID ="IAM_APPID"; - public static final String IAM_APPKEY ="IAM_APPKEY"; - public static final String SHOP_TREE ="SHOP_TREE"; - public static final String ERP_TOKEN ="ERP_TOKEN"; - public static final long EXPIRE_TIME = 7200; + String IMPORTING_MEMBER ="IMPORTING_MEMBER"; + String IMPORTING_SHOP ="IMPORTING_SHOP"; + String IMPORTING_USERS ="IMPORTING_USERS"; + String IAM_APPID ="IAM_APPID"; + String ZBOM_CRM_API_KEY ="ZBOM_CRM_API_KEY"; + String ZBOM_CRM_API_URL ="ZBOM_CRM_API_URL"; + String ZBOM_SMS_API_KEY ="ZBOM_SMS_API_KEY"; + String ZBOM_ZHONGTAI_API_URL ="ZBOM_ZHONGTAI_API_URL"; + String ZBOM_SMS_API_URL ="ZBOM_SMS_API_URL"; + String IAM_APPKEY ="IAM_APPKEY"; + String SHOP_TREE ="SHOP_TREE"; + String ERP_TOKEN ="ERP_TOKEN"; + long EXPIRE_TIME = 7200; - public static final String INTERNAL_TOKEN ="INTERNAL_TOKEN"; + String INTERNAL_TOKEN ="INTERNAL_TOKEN"; - public static final String GOODSORDER_KEY = "ordercode_"; - public static final String ACTIVITY_SIGN_KEY = "actcode_"; - public static final String AFTERSALE_KEY = "salecode_"; + String GOODSORDER_KEY = "ordercode_"; + String ACTIVITY_SIGN_KEY = "actcode_"; + String AFTERSALE_KEY = "salecode_"; } @@ -327,6 +408,12 @@ } + public static boolean equalsLong(Long a, Long b) { + if (a == null || b==null) { + return false; + } + return a.equals(b); + } public static boolean equalsInteger(Integer a, Integer b) { if (formatIntegerNum(a) == formatIntegerNum(b)) { return true; @@ -461,7 +548,7 @@ list.add(m); } System.out.println(JSONObject.toJSONString(list)); - + } @@ -534,4 +621,15 @@ return reqJson; } + public static String getRandom6Num( ) { + Random random = new Random(); + StringBuilder sb = new StringBuilder(); + + for (int i = 0; i < 6; i++) { + int digit = random.nextInt(10); + sb.append(digit); + } + + return sb.toString(); + } } -- Gitblit v1.9.3