| | |
| | | package com.doumee.core.utils; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.PropertyNamingStrategy; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLDecoder; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | 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 final String ROOT_PATH = ""; |
| | | public static final String FILE_DIR = ""; |
| | | // 访客来访配置 |
| | | public static final String VISIT_CONFIG = "VISIT_CONFIG"; |
| | | public static final String MEMBER_IMG = "MEMBER_IMG"; |
| | | // 劳务来访配置 |
| | | public static final String LABOR_CONFIG = "LABOR_CONFIG"; |
| | | public static final String VISIT_EVENT_IMG = "VISIT_EVENT_IMG"; |
| | | public static final String CAR_EVENT_IMG = "CAR_EVENT_IMG"; |
| | | public static final String DEVICE_EVENT_IMG = "DEVICE_EVENT_IMG"; |
| | | public static final String FTP ="FTP" ; |
| | | public static final String FTP_HOST ="FTP_HOST" ; |
| | | public static final String FTP_PORT ="FTP_PORT" ; |
| | | 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 boolean DEALING_HK_IMG = false; |
| | | public static boolean DEALING_HK_ORG = false; |
| | | public static boolean DEALING_HK_USER = false; |
| | | public static boolean DEALING_HK_VISIT = false; |
| | | public static boolean DEALING_HK_EMPOWER = 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"; |
| | | |
| | | // FTP文件服务器资源访问地址 |
| | | |
| | | public static Date getBirthdyByCardNo(String idCard){ |
| | | if(idCard ==null || idCard.length()<14){ |
| | |
| | | |
| | | |
| | | |
| | | |
| | | 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 interface RedisKeys { |
| | | public static final String ERP_TOKEN ="ERP_TOKEN"; |
| | | public static final long EXPIRE_TIME = 7200; |
| | | |
| | | public static final String GOODSORDER_KEY = "ordercode_"; |
| | | public static final String ACTIVITY_SIGN_KEY = "actcode_"; |
| | | public static final String AFTERSALE_KEY = "salecode_"; |
| | |
| | | |
| | | /** 用户启用禁用枚举值*/ |
| | | ENABLE(0,"正常"), |
| | | DISABLE(1,"禁用"); |
| | | DISABLE(1,"禁用"), |
| | | FREEZE(2,"拉黑/冻结"); |
| | | |
| | | private Integer value; |
| | | private String des; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 对象驼峰属性转下划线 |
| | | * @param object |
| | | * @return |
| | | * @throws JsonProcessingException |
| | | */ |
| | | public static String toUnderlineJSONString(Object object) throws JsonProcessingException { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); |
| | | mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); |
| | | String reqJson = mapper.writeValueAsString(object); |
| | | return reqJson; |
| | | } |
| | | |
| | | |
| | | public static <T> T toSnakeObject(String json, Class<T> clazz) throws IOException { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE); |
| | | T reqJson = mapper.readValue(json, clazz); |
| | | return reqJson; |
| | | } |
| | | |
| | | |
| | | } |