xiatian 1 månad sedan
förälder
incheckning
f01e0f1628

+ 48 - 30
src/main/java/cn/com/qmth/am/bean/DataKey.java

@@ -3,34 +3,52 @@ package cn.com.qmth.am.bean;
 import java.util.Objects;
 
 public class DataKey {
-	private int index;
-	private String key;
-	public int getIndex() {
-		return index;
-	}
-	public void setIndex(int index) {
-		this.index = index;
-	}
-	public String getKey() {
-		return key;
-	}
-	public void setKey(String key) {
-		this.key = key;
-	}
-	@Override
-	public int hashCode() {
-		return Objects.hash(key);
-	}
-	@Override
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		DataKey other = (DataKey) obj;
-		return Objects.equals(key, other.key);
-	}
-	
+
+    private int index;
+
+    private String key;
+
+    private int end;
+
+    public int getIndex() {
+        return index;
+    }
+
+    public void setIndex(int index) {
+        this.index = index;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(key);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        DataKey other = (DataKey) obj;
+        return Objects.equals(key, other.key);
+    }
+
+    public int getEnd() {
+        return end;
+    }
+
+    public void setEnd(int end) {
+        this.end = end;
+    }
+
 }

+ 7 - 2
src/main/java/cn/com/qmth/am/controller/AdminController.java

@@ -259,9 +259,12 @@ public class AdminController {
             }
             sb.append("            " + k.getKey() + "\t" + c + "\t" + Calculator.percentage(c, total, 2)
                     + "          \r\n");
+            if (roundedValue == k.getEnd()) {
+
+                sb.append("       一致率(≤" + roundedValue + "分)\t" + st + "\t" + Calculator.percentage(st, total, 2)
+                        + "        \r\n");
+            }
         }
-        sb.append("       一致率(≤" + roundedValue + "分)\t" + st + "\t" + Calculator.percentage(st, total, 2)
-                + "        \r\n");
     }
 
     private void fillMarkingCount(List<StudentScoreEntity> scores, StringBuilder sb) {
@@ -340,6 +343,7 @@ public class AdminController {
             DataKey r = new DataKey();
             r.setKey("[0,0]");
             r.setIndex(-1);
+            r.setEnd(0);
             return r;
         }
         int i = 0;
@@ -348,6 +352,7 @@ public class AdminController {
                 DataKey r = new DataKey();
                 r.setKey("(" + i + "," + (i + 1) + "]");
                 r.setIndex(i);
+                r.setEnd((i + 1));
                 return r;
             }
             i++;

+ 2 - 2
src/main/java/cn/com/qmth/am/service/impl/StudentScoreServiceImpl.java

@@ -382,8 +382,8 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreDao, Studen
         // System.out.println(score+d.substring(start,d.length()));
         // }
         // String[] items = d.split("\\[\\[[0-9](.[0-9]+){0,1}分\\]\\]");
-        String code = "23635170";
-        String s = "https://file.markingcloud.com/" + getMarkingCloudPath(725, getSuffix(code), code, 2, "jpg");
+        String code = "24400488";
+        String s = "http://192.168.10.188:9000/" + getMarkingCloudPath(1, getSuffix(code), code, 2, "jpg");
         System.out.println(s);
     }