|
@@ -133,7 +133,7 @@ public class PaperDetailServiceImpl extends ServiceImpl<PaperDetailDao, PaperDet
|
|
|
throw new StatusException("小题号必须大于0");
|
|
|
}
|
|
|
String score = unit.getScore().toString();
|
|
|
- if (score.indexOf(".") < score.length() - 2) {
|
|
|
+ if (score.indexOf(".")>=0&&score.indexOf(".") < score.length() - 2) {
|
|
|
throw new StatusException("小题满分只能有一位小数");
|
|
|
}
|
|
|
String scoreStep = unit.getScoreStep().toString();
|
|
@@ -213,7 +213,7 @@ public class PaperDetailServiceImpl extends ServiceImpl<PaperDetailDao, PaperDet
|
|
|
throw new StatusException("小题号必须大于0");
|
|
|
}
|
|
|
String score = unit.getScore().toString();
|
|
|
- if (score.indexOf(".") < score.length() - 2) {
|
|
|
+ if (score.indexOf(".")>=0&&score.indexOf(".") < score.length() - 2) {
|
|
|
throw new StatusException("小题满分只能有一位小数");
|
|
|
}
|
|
|
String scoreStep = unit.getScoreStep().toString();
|