| | |
| | | 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 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 LABOR_CONFIG = "LABOR_CONFIG"; |
| | | |
| | | |
| | | public static Date getBirthdyByCardNo(String idCard){ |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 对象驼峰属性转下划线 |
| | | * @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; |
| | | } |
| | | |
| | | |
| | | } |