|
|
@ -95,6 +95,7 @@ import java.io.InputStream; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.regex.Matcher; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@ -569,9 +570,7 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(excelInfo.getBePrincipal())) { |
|
|
|
String bePrincipal = excelInfo.getBePrincipal(); |
|
|
|
Pattern pattern = Pattern.compile("^\\d+(.\\d{1,2})?$"); |
|
|
|
boolean matches = pattern.matcher(bePrincipal).matches(); |
|
|
|
if (!matches) { |
|
|
|
if (!isNum(bePrincipal)) { |
|
|
|
checkWord.add("逾期本金必须为数字"); |
|
|
|
break; |
|
|
|
} |
|
|
@ -582,9 +581,7 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(excelInfo.getBeDefInter())) { |
|
|
|
String beDefInter = excelInfo.getBeDefInter(); |
|
|
|
Pattern pattern = Pattern.compile("^\\d+(.\\d{1,2})?$"); |
|
|
|
boolean matches = pattern.matcher(beDefInter).matches(); |
|
|
|
if (!matches) { |
|
|
|
if (!isNum(beDefInter)) { |
|
|
|
checkWord.add("逾期罚息必须为数字"); |
|
|
|
break; |
|
|
|
} |
|
|
@ -648,6 +645,42 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
return obj; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isNum(String s) { |
|
|
|
if (StringUtils.isNotBlank(s)) { |
|
|
|
if (s.contains(".")) { |
|
|
|
return isNumeric(s); |
|
|
|
} else { |
|
|
|
return isNumericFirst(s); |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isNumeric(String s) { |
|
|
|
String substring = s.substring(0, s.lastIndexOf(".")); |
|
|
|
String substringLast = s.substring(s.lastIndexOf(".") + 1, s.length()); |
|
|
|
if (substring != null && !"".equals(substring.trim()) || substringLast != null && !"".equals(substringLast.trim())) { |
|
|
|
boolean matches = substring.matches("^[0-9]*$"); |
|
|
|
boolean b = substringLast.matches("^[0-9]*$"); |
|
|
|
if (matches && b) { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
} else |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isNumericFirst(String str) { |
|
|
|
Pattern pattern = Pattern.compile("[0-9]*"); |
|
|
|
System.out.println(str); |
|
|
|
Matcher isNum = pattern.matcher(str); |
|
|
|
if (!isNum.matches()) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean submit(SubmitLoanBePadsincereDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
LoanBePadsincereApply loanBePadsincereApply = fetchBySid(dto.getSid()); |
|
|
|