Permalink
Browse files

调整成绩输入API

  • Loading branch information...
1 parent 51e904e commit be9857c398d1311fc32f85ae9fd65214e6696fdd LICH committed Apr 23, 2012
@@ -73,7 +73,8 @@
<td><input type="text" name="zd2grade" value="${student.zd2grade}" class="input-mini" /></td>
<td><input type="text" name="zd3grade" value="${student.zd3grade}" class="input-mini" /></td>
<td><input type="text" name="zd4grade" value="${student.zd4grade}" class="input-mini" /></td>
- <td><input type="submit" class="btn btn-primary btn-mini" value="更新" /></td>
+ <td><input type="submit" class="btn btn-primary btn-mini" value="更新" />&nbsp;<a
+ href="${ctx}/teacher/pingyuInput/zhidao/${student.loginName}" class="btn btn-primary btn-mini">评语</a></td>
</tr>
</form>
</c:forEach>
@@ -106,7 +107,8 @@
<td>${pingyueStudentsThesises[st.index].name}</td>
<td>${student.py1grade}</td>
<td>${student.py2grade}</td>
- <td><a href="${ctx}/teacher/scoreInput/pingyue/del/${student.loginName}" class="btn btn-mini">删除</a></td>
+ <td><a href="${ctx}/teacher/scoreInput/pingyue/del/${student.loginName}" class="btn btn-mini">删除</a>&nbsp;<a
+ href="${ctx}/teacher/pingyuInput/pingyue/${student.loginName}" class="btn btn-primary btn-mini">评语</a></td>
</tr>
</c:forEach>
<form name="student" action="${ctx}/teacher/scoreInput/pingyue/add" method="post">
@@ -148,7 +150,8 @@
<td>${dabianStudentsThesises[st.index].name}</td>
<td>${student.db1grade}</td>
<td>${student.db2grade}</td>
- <td><a href="${ctx}/teacher/scoreInput/dabian/del/${student.loginName}" class="btn btn-mini">删除</a></td>
+ <td><a href="${ctx}/teacher/scoreInput/dabian/del/${student.loginName}" class="btn btn-mini">删除</a>&nbsp;<a
+ href="${ctx}/teacher/pingyuInput/dabian/${student.loginName}" class="btn btn-primary btn-mini">评语</a></td>
</tr>
</c:forEach>
<form name="student" action="${ctx}/teacher/scoreInput/dabian/add" method="post">
@@ -30,6 +30,13 @@
*/
public Thesis getStudentThesis(Student student);
+ /**
+ * 获取学生课题信息
+ * @param students 学生集合
+ * @return List<Thesis>
+ */
+ public List<Thesis> getStudentsThesises(Collection<Student> students);
+
/**
* 保存学生信息
* @param student 学生
@@ -129,4 +136,11 @@
* @return Student 学生,失败返回null
*/
public Student delScoreInputDabian(String studentLoginName);
+
+ /**
+ * 更新学生评语(全部)
+ * @param student 学生
+ * @return Student 学生,失败返回null
+ */
+ public Student updatePingyu(Student student);
}
@@ -1,17 +0,0 @@
-package im.lich.gdms.core.service.student;
-
-import im.lich.gdms.base.service.BaseService;
-import im.lich.gdms.core.model.student.Student;
-import im.lich.gdms.core.model.teacher.Thesis;
-
-import java.util.Collection;
-import java.util.List;
-
-public interface StudentThesisService extends BaseService {
- /**
- * 获取学生课题信息
- * @param students 学生集合
- * @return List<Thesis>
- */
- public List<Thesis> getStudentsThesises(Collection<Student> students);
-}
@@ -67,6 +67,19 @@ public Thesis getStudentThesis(Student student) {
return thesisDao.findOne(thesisId);
}
+ @Override
+ public List<Thesis> getStudentsThesises(Collection<Student> students) {
+ List<Thesis> thesises = Lists.newArrayList();
+ for (Student s : students) {
+ Long thesisId = s.getThesisId();
+ Thesis t = thesisDao.findOne(thesisId);
+ Assert.notNull(t);
+ Assert.hasText(t.getAssign());
+ thesises.add(t);
+ }
+ return thesises;
+ }
+
@Override
@Transactional(readOnly = false)
public Student saveStudentInfo(Student student) {
@@ -326,4 +339,33 @@ public Student delScoreInputDabian(String studentLoginName) {
dabianRecordDao.delete(dabianId);
return s;
}
+
+ @Override
+ @Transactional(readOnly = false)
+ public Student updatePingyu(Student student) {
+ Assert.notNull(student);
+ Assert.notNull(student.getLoginName());
+
+ //简化名称
+ Student s = student;
+
+ //获取内部学生
+ Student _s = studentDao.findByLoginName(s.getLoginName());
+ Assert.notNull(_s);
+
+ _s.setZdpingyu(s.getZdpingyu());
+
+ _s.setPypingyu(s.getPypingyu());
+
+ _s.setQuestion1(s.getQuestion1());
+ _s.setAnswer1(s.getAnswer1());
+ _s.setQuestion2(s.getQuestion2());
+ _s.setAnswer2(s.getAnswer2());
+ _s.setQuestion3(s.getQuestion3());
+ _s.setAnswer3(s.getAnswer3());
+ _s.setDbpingyu(s.getDbpingyu());
+
+ logger.debug("保存评语信息:{}", _s);
+ return studentDao.save(_s);
+ }
}
@@ -1,39 +0,0 @@
-package im.lich.gdms.core.service.student.impl;
-
-import im.lich.gdms.base.service.BaseServiceImpl;
-import im.lich.gdms.core.dao.teacher.ThesisDao;
-import im.lich.gdms.core.model.student.Student;
-import im.lich.gdms.core.model.teacher.Thesis;
-import im.lich.gdms.core.service.student.StudentThesisService;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.annotation.Resource;
-
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.Assert;
-
-import com.google.common.collect.Lists;
-
-@Service
-@Transactional(readOnly = true)
-public class StudentThesisServiceImpl extends BaseServiceImpl implements StudentThesisService {
-
- @Resource
- private ThesisDao thesisDao;
-
- @Override
- public List<Thesis> getStudentsThesises(Collection<Student> students) {
- List<Thesis> thesises = Lists.newArrayList();
- for (Student s : students) {
- Long thesisId = s.getThesisId();
- Thesis t = thesisDao.findOne(thesisId);
- Assert.notNull(t);
- Assert.hasText(t.getAssign());
- thesises.add(t);
- }
- return thesises;
- }
-}
@@ -4,7 +4,6 @@
import im.lich.gdms.core.model.student.Student;
import im.lich.gdms.core.model.teacher.Thesis;
import im.lich.gdms.core.service.student.StudentService;
-import im.lich.gdms.core.service.student.StudentThesisService;
import im.lich.gdms.core.service.teacher.DabianService;
import im.lich.gdms.core.service.teacher.PingyueService;
import im.lich.gdms.core.service.teacher.TeacherService;
@@ -31,9 +30,6 @@
@Resource
private StudentService studentService;
- @Resource
- private StudentThesisService studentThesisService;
-
@Resource
private PingyueService pingyueService;
@@ -51,7 +47,7 @@ public String showScoreInput(Model model) {
logger.debug("学生:{}", StringUtils.join(students, ','));
//获取学生课题
- List<Thesis> studentsThesises = studentThesisService.getStudentsThesises(students);
+ List<Thesis> studentsThesises = studentService.getStudentsThesises(students);
model.addAttribute("studentsThesises", studentsThesises);
//获取指导教师成绩输入状态
@@ -71,15 +67,15 @@ public String showScoreInput(Model model) {
List<Student> pingyueStudents = pingyueService.getStudents(loginName);
model.addAttribute("pingyueStudents", pingyueStudents);
//获取评阅教师输入成绩的学生的课题
- List<Thesis> pingyueStudentsThesises = studentThesisService.getStudentsThesises(pingyueStudents);
+ List<Thesis> pingyueStudentsThesises = studentService.getStudentsThesises(pingyueStudents);
model.addAttribute("pingyueStudentsThesises", pingyueStudentsThesises);
//答辩Tab
//获取答辩教师输入成绩的学生
List<Student> dabianStudents = dabianService.getStudents(loginName);
model.addAttribute("dabianStudents", dabianStudents);
//获取答辩教师输入成绩的学生的课题
- List<Thesis> dabianStudentsThesises = studentThesisService.getStudentsThesises(pingyueStudents);
+ List<Thesis> dabianStudentsThesises = studentService.getStudentsThesises(pingyueStudents);
model.addAttribute("dabianStudentsThesises", dabianStudentsThesises);
return "/teacher/scoreInput";
@@ -176,4 +172,12 @@ public String delScoreInputDabian(@PathVariable("studentLoginName") String stude
model.addAttribute("tabChoose", "dabian");
return "forward:/teacher/scoreInput";
}
+
+ //重定向回成绩输入
+ @RequestMapping(value = "/scoreInput/redirect/{tab}")
+ public String redirect(@PathVariable("tab") String tab, Model model) {
+ //激活评阅Tab
+ model.addAttribute("tabChoose", tab);
+ return "forward:/teacher/scoreInput";
+ }
}

0 comments on commit be9857c

Please sign in to comment.