|
@@ -109,7 +109,7 @@ public class PaperDetailServiceImpl extends ServiceImpl<PaperDetailDao, PaperDet
|
|
throw new StatusException("试卷满分必须大于0");
|
|
throw new StatusException("试卷满分必须大于0");
|
|
}
|
|
}
|
|
String total = domain.getTotalScore().toString();
|
|
String total = domain.getTotalScore().toString();
|
|
- if (total.indexOf(".") < total.length() - 2) {
|
|
|
|
|
|
+ if (total.indexOf(".")>=0&&total.indexOf(".") < total.length() - 2) {
|
|
throw new StatusException("试卷满分只能有一位小数");
|
|
throw new StatusException("试卷满分只能有一位小数");
|
|
}
|
|
}
|
|
if (CollectionUtils.isEmpty(domain.getStructInfo())) {
|
|
if (CollectionUtils.isEmpty(domain.getStructInfo())) {
|
|
@@ -137,7 +137,7 @@ public class PaperDetailServiceImpl extends ServiceImpl<PaperDetailDao, PaperDet
|
|
throw new StatusException("小题满分只能有一位小数");
|
|
throw new StatusException("小题满分只能有一位小数");
|
|
}
|
|
}
|
|
String scoreStep = unit.getScoreStep().toString();
|
|
String scoreStep = unit.getScoreStep().toString();
|
|
- if (scoreStep.indexOf(".") < scoreStep.length() - 2) {
|
|
|
|
|
|
+ if (scoreStep.indexOf(".")>=0&&scoreStep.indexOf(".") < scoreStep.length() - 2) {
|
|
throw new StatusException("给分间隔只能有一位小数");
|
|
throw new StatusException("给分间隔只能有一位小数");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -192,7 +192,7 @@ public class PaperDetailServiceImpl extends ServiceImpl<PaperDetailDao, PaperDet
|
|
throw new StatusException("试卷满分必须大于0");
|
|
throw new StatusException("试卷满分必须大于0");
|
|
}
|
|
}
|
|
String total = domain.getTotalScore().toString();
|
|
String total = domain.getTotalScore().toString();
|
|
- if (total.indexOf(".") < total.length() - 2) {
|
|
|
|
|
|
+ if (total.indexOf(".")>=0&&total.indexOf(".") < total.length() - 2) {
|
|
throw new StatusException("试卷满分只能有一位小数");
|
|
throw new StatusException("试卷满分只能有一位小数");
|
|
}
|
|
}
|
|
if (CollectionUtils.isEmpty(domain.getStructInfo())) {
|
|
if (CollectionUtils.isEmpty(domain.getStructInfo())) {
|
|
@@ -217,7 +217,7 @@ public class PaperDetailServiceImpl extends ServiceImpl<PaperDetailDao, PaperDet
|
|
throw new StatusException("小题满分只能有一位小数");
|
|
throw new StatusException("小题满分只能有一位小数");
|
|
}
|
|
}
|
|
String scoreStep = unit.getScoreStep().toString();
|
|
String scoreStep = unit.getScoreStep().toString();
|
|
- if (scoreStep.indexOf(".") < scoreStep.length() - 2) {
|
|
|
|
|
|
+ if (scoreStep.indexOf(".")>=0&&scoreStep.indexOf(".") < scoreStep.length() - 2) {
|
|
throw new StatusException("给分间隔只能有一位小数");
|
|
throw new StatusException("给分间隔只能有一位小数");
|
|
}
|
|
}
|
|
}
|
|
}
|