优化商品的excel导入
This commit is contained in:
@@ -8,6 +8,7 @@ import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author jishenghua qq752718920 2018-10-7 15:26:27
|
||||
@@ -316,6 +317,24 @@ public class StringUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断对象是否为数字(含小数)
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static boolean isPositiveBigDecimal(String str){
|
||||
Pattern pattern = Pattern.compile("[0-9]*");
|
||||
if(str.indexOf(".")>0){//判断是否有小数点
|
||||
if(str.indexOf(".")==str.lastIndexOf(".") && str.split("\\.").length==2){ //判断是否只有一个小数点
|
||||
return pattern.matcher(str.replace(".","")).matches();
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
return pattern.matcher(str).matches();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* sql注入过滤,保障sql的安全执行
|
||||
* @param originStr
|
||||
|
||||
Reference in New Issue
Block a user