| | |
| | | import com.ltkj.LtkjApplication; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.common.utils.StringUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.DictHosp; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.io.BufferedReader; |
| | | import java.io.InputStreamReader; |
| | | import java.math.BigDecimal; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.sql.Connection; |
| | |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.Properties; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * @Author: 西安路泰科技有限公司/赵佳豪 |
| | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // System.out.println(DateUtil.date()); |
| | | // System.out.println(DateUtil.offsetMonth(DateUtil.date(),-1)); |
| | | |
| | | String s ="612129197611110029"; |
| | | |
| | | String ss ="13335337160"; |
| | | |
| | | boolean idCard = MatchUtils.isIdCard(s); |
| | | System.out.println(idCard); |
| | | |
| | | |
| | | System.out.println(MatchUtils.isMobileNO(ss)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 将科学计数法文本转换成字符文本 |
| | | * @param number |
| | | * @return |
| | | */ |
| | | public static String translateToPlainStr(String number) { |
| | | |
| | | return getString(number); |
| | | } |
| | | |
| | | private static String getString(String number) { |
| | | if (null == number || number.trim().length() == 0) { |
| | | return number; |
| | | } |
| | | String regEx="^([\\+|-]?\\d+(.{0}|.\\d+))[Ee]{1}([\\+|-]?\\d+)$"; |
| | | // 编译正则表达式 |
| | | Pattern pattern = Pattern.compile(regEx); |
| | | // 忽略大小写的写法 |
| | | // Pattern pat = Pattern.compile(regEx, Pattern.CASE_INSENSITIVE); |
| | | Matcher matcher = pattern.matcher(number); |
| | | // 字符串是否与正则表达式相匹配 |
| | | boolean rs = matcher.matches(); |
| | | // 判断是否为字符串的科学计数法 |
| | | if(rs){ |
| | | // 科学计数法转数字 |
| | | BigDecimal originValue = new BigDecimal(number); |
| | | System.out.println("手机号为 ==> " + originValue.toPlainString()); |
| | | // 数字转字符串 |
| | | return originValue.toPlainString(); |
| | | } |
| | | return number; |
| | | } |
| | | |
| | | |
| | | public static void forwardUrl(String targetUrl, String forwardUrl) throws Exception { |
| | | public static void forwardUrl(String targetUrl, String forwardUrl) throws Exception { |
| | | // 创建URL对象 |
| | | URL url = new URL(forwardUrl); |
| | | |