diff --git a/src/com/fh/bean/StudentPaper.java b/src/com/fh/bean/StudentPaper.java index fcfc970..7807249 100644 --- a/src/com/fh/bean/StudentPaper.java +++ b/src/com/fh/bean/StudentPaper.java @@ -130,12 +130,18 @@ public class StudentPaper { private String createDate; + private String startDate; + private String endDate; private String schoolId; private String paperId; + private String name; + + private String subject_id ; + private List students; @@ -174,6 +180,14 @@ public class StudentPaper { + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + public String getPaperId() { return paperId; } @@ -189,6 +203,22 @@ public class StudentPaper { } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSubject_id() { + return subject_id; + } + + public void setSubject_id(String subject_id) { + this.subject_id = subject_id; + } + public String toJson(){ Gson gson = new Gson(); return gson.toJson(this); diff --git a/src/com/fh/controller/api/V1.java b/src/com/fh/controller/api/V1.java index 1c92729..b963d4a 100644 --- a/src/com/fh/controller/api/V1.java +++ b/src/com/fh/controller/api/V1.java @@ -1786,18 +1786,48 @@ public class V1 extends BaseController { .date2Str(new Date()) : studentPaper .getCreateDate()); testPd.put("TEST_TYPE", "1"); - testPd.put("START_DATE", ""); + testPd.put("START_DATE",studentPaper.getStartDate()); testPd.put("END_DATE", studentPaper.getEndDate()); - testPd.put("NAME", ""); testPd.put("TESTPAPER_ID", studentPaper.getPaperId()); testPd.put("OTHER_SCORE", ""); testPd.put("HIGHT_SCORE", ""); testPd.put("LOW_SCORE", ""); testPd.put("AVG_SCORE", ""); testPd.put("TOTAL_SCORE", ""); - testPd.put("SUBJECT_ID", ""); + testPd.put("SUBJECT_ID", studentPaper.getSubject_id()); testPd.put("REMARK", ""); + testPd.put("NAME", studentPaper.getName()); testpaperService.save(testPd); + }else{ + boolean find = false; + for(PageData pda: oldList){ + if(pda != null && studentPaper.getPaperId().equals(pda.get("TESTPAPER_ID"))){ + find = true; + break; + } + } + if(!find){ + testPd.put("TEACHER_ID", ""); + testPd.put("SCLASS_ID", ""); + testPd.put( + "CREATE_DATE", + studentPaper.getCreateDate() == null ? Tools + .date2Str(new Date()) : studentPaper + .getCreateDate()); + testPd.put("TEST_TYPE", "1"); + testPd.put("START_DATE",studentPaper.getStartDate()); + testPd.put("END_DATE", studentPaper.getEndDate()); + testPd.put("TESTPAPER_ID", studentPaper.getPaperId()); + testPd.put("OTHER_SCORE", ""); + testPd.put("HIGHT_SCORE", ""); + testPd.put("LOW_SCORE", ""); + testPd.put("AVG_SCORE", ""); + testPd.put("TOTAL_SCORE", ""); + testPd.put("SUBJECT_ID", studentPaper.getSubject_id()); + testPd.put("REMARK", ""); + testPd.put("NAME", studentPaper.getName()); + testpaperService.save(testPd); + } } List list = studentPaper diff --git a/src/com/fh/controller/sunvote/paper/PaperController.java b/src/com/fh/controller/sunvote/paper/PaperController.java index 0a98fee..5a12e7e 100644 --- a/src/com/fh/controller/sunvote/paper/PaperController.java +++ b/src/com/fh/controller/sunvote/paper/PaperController.java @@ -843,7 +843,15 @@ public class PaperController extends BaseController { Float o2GetScore = Float.valueOf(o2.getString("TEST_NUM")) == 0 ? 0 : Float.valueOf(o2.getString("STUDENT_TOTAL")) / Float.valueOf(o2.getString("TEST_NUM")); - return o2GetScore.compareTo(o1GetScore); + int result = o2GetScore.compareTo(o1GetScore); + if(result == 0){ + if(Float.valueOf(o1.getString("TEST_NUM")) -Float.valueOf(o2.getString("TEST_NUM")) == 0 ){ + return o1.get("STUDENT_NUMBER").toString().compareTo(o2.get("STUDENT_NUMBER").toString()); + } + return Float.valueOf(o1.getString("TEST_NUM")) -Float.valueOf(o2.getString("TEST_NUM")) > 0 ? -1 : 1; + + } + return result; } });