Sfoglia il codice sorgente

Merge remote-tracking branch 'remotes/origin/dev_1.0.0' into release_1.0.0

xiatian 2 anni fa
parent
commit
94c547b59d

+ 2 - 2
src/main/java/cn/com/qmth/mps/service/impl/PaperDetailServiceImpl.java

@@ -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();

+ 1 - 1
src/main/java/cn/com/qmth/mps/service/impl/PaperServiceImpl.java

@@ -417,7 +417,7 @@ public class PaperServiceImpl extends ServiceImpl<PaperDao, PaperEntity> impleme
 						if (n <= 0) {
 							msg.append("  小题满分不能小于0");
 						} else {
-							if (score.indexOf(".") < score.length() - 2) {
+							if (score.indexOf(".")>=0&&score.indexOf(".") < score.length() - 2) {
 								msg.append("小题满分只能有一位小数");
 							} else {
 								imp.setScore(n);