|
@@ -3991,8 +3991,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
String stringCellValue = row.getCell(6).getStringCellValue();
|
|
|
double time=0;
|
|
|
if(!StringUtils.isEmpty(stringCellValue)){
|
|
|
- Pattern pattern= Pattern.compile("[0-9]*");
|
|
|
- if(!pattern.matcher(stringCellValue).matches()){
|
|
|
+ Pattern isWholeNumber= Pattern.compile("[0-9]*");
|
|
|
+ Pattern isDecimal= Pattern.compile("[-+]{0,1}\\d+\\.\\d*|[-+]{0,1}\\d*\\.\\d+");
|
|
|
+ if(!isWholeNumber.matcher(stringCellValue).matches()&&!isDecimal.matcher(stringCellValue).matches()){
|
|
|
msg.setError("工作时长只能为数字");
|
|
|
return msg;
|
|
|
}
|