Commit b3c44d84782afae591e1fad36c973600a59e9f0d
1 parent
0786f023
课后练bug修复
Showing
8 changed files
with
66 additions
and
11 deletions
WebRoot/WEB-INF/jsp/sunvote/coursemanagement/coursemanagement_edit2.jsp
@@ -57,17 +57,17 @@ | @@ -57,17 +57,17 @@ | ||
57 | </td> | 57 | </td> |
58 | </tr> | 58 | </tr> |
59 | 59 | ||
60 | - <tr> | 60 | + <%-- <tr> |
61 | <td style="width:75px;text-align: right;padding-top: 13px;">科目:</td> | 61 | <td style="width:75px;text-align: right;padding-top: 13px;">科目:</td> |
62 | <td> | 62 | <td> |
63 | - <%-- <input type="number" name="SUBJECT_ID" id="SUBJECT_ID" value="${pd.SUBJECT_ID}" maxlength="32" placeholder="这里输入科目" title="科目" style="width:98%;"/></td> --%> | 63 | + <input type="number" name="SUBJECT_ID" id="SUBJECT_ID" value="${pd.SUBJECT_ID}" maxlength="32" placeholder="这里输入科目" title="科目" style="width:98%;"/></td> |
64 | <select class="chosen-select form-control" name="SUBJECT_ID" id="SUBJECT_ID" data-placeholder="这里输入班级类型"> | 64 | <select class="chosen-select form-control" name="SUBJECT_ID" id="SUBJECT_ID" data-placeholder="这里输入班级类型"> |
65 | <c:forEach var="item" items="${subjects}"> | 65 | <c:forEach var="item" items="${subjects}"> |
66 | <option value="${item.ID}" <c:if test="${pd.SUBJECT_ID==item.ID}">selected="true"</c:if>>${item.CNAME}</option> | 66 | <option value="${item.ID}" <c:if test="${pd.SUBJECT_ID==item.ID}">selected="true"</c:if>>${item.CNAME}</option> |
67 | </c:forEach> | 67 | </c:forEach> |
68 | </select> | 68 | </select> |
69 | </td> | 69 | </td> |
70 | - </tr> | 70 | + </tr> --%> |
71 | <tr> | 71 | <tr> |
72 | <td style="width:75px;text-align: right;padding-top: 13px;">学期:</td> | 72 | <td style="width:75px;text-align: right;padding-top: 13px;">学期:</td> |
73 | <td> | 73 | <td> |
WebRoot/WEB-INF/jsp/sunvote/homework/homework_report.jsp
@@ -282,7 +282,7 @@ | @@ -282,7 +282,7 @@ | ||
282 | } | 282 | } |
283 | 283 | ||
284 | function homeReport(classId){ | 284 | function homeReport(classId){ |
285 | - var path = '<%=basePath%>homework/report.do?CLASS_ID='+classId; | 285 | + var path = '<%=basePath%>homework/report.do?School_id=${pd.SCHOOL_ID}&CLASS_ID='+classId; |
286 | console.log(path); | 286 | console.log(path); |
287 | parent.$("#mainFrame").attr('src',path); | 287 | parent.$("#mainFrame").attr('src',path); |
288 | window.top.loading.show(); | 288 | window.top.loading.show(); |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp
@@ -197,7 +197,7 @@ | @@ -197,7 +197,7 @@ | ||
197 | function homeWorkList(schoolId){ | 197 | function homeWorkList(schoolId){ |
198 | //var path = "../school/goEdit2.do?ID=" + schoolId ; | 198 | //var path = "../school/goEdit2.do?ID=" + schoolId ; |
199 | 199 | ||
200 | - var path = '<%=basePath%>homework/list.do?teacher_id=${pd.TEACHER.ID}&ID=' + schoolId ; | 200 | + var path = '<%=basePath%>homework/list.do?teacher_id=${pd.TEACHER.ID}' ; |
201 | 201 | ||
202 | $("#mainFrame").attr('src',path); | 202 | $("#mainFrame").attr('src',path); |
203 | window.top.loading.show(); | 203 | window.top.loading.show(); |
resources/mybatis1/sunvote/CourseManagementMapper.xml
@@ -101,6 +101,20 @@ | @@ -101,6 +101,20 @@ | ||
101 | ID = #{ID} | 101 | ID = #{ID} |
102 | </select> | 102 | </select> |
103 | 103 | ||
104 | + <select id="findByCourse" parameterType="pd" resultType="pd"> | ||
105 | + select | ||
106 | + <include refid="Field"></include> | ||
107 | + from | ||
108 | + <include refid="tableName"></include> | ||
109 | + where | ||
110 | + 1 =1 | ||
111 | + and TEACHER_ID = #{TEACHER_ID} | ||
112 | + and CLASS_ID= #{TEACHER_ID} | ||
113 | + and SUBJECT_ID= #{TEACHER_ID} | ||
114 | + | ||
115 | + limit 0,1 | ||
116 | + </select> | ||
117 | + | ||
104 | <!-- 列表 --> | 118 | <!-- 列表 --> |
105 | <select id="datalistPage" parameterType="page" resultType="pd"> | 119 | <select id="datalistPage" parameterType="page" resultType="pd"> |
106 | select | 120 | select |
@@ -161,7 +175,14 @@ | @@ -161,7 +175,14 @@ | ||
161 | sv_coursemanagement | 175 | sv_coursemanagement |
162 | LEFT JOIN sv_sclass ON sv_coursemanagement.CLASS_ID = sv_sclass.ID | 176 | LEFT JOIN sv_sclass ON sv_coursemanagement.CLASS_ID = sv_sclass.ID |
163 | WHERE | 177 | WHERE |
164 | - sv_coursemanagement.TEACHER_ID = #{TEACHER_ID} | 178 | + 1 = 1 |
179 | + <if test="TEACHER_ID != null and TEACHER_ID != ''"> | ||
180 | + and sv_coursemanagement.TEACHER_ID = #{TEACHER_ID} | ||
181 | + </if> | ||
182 | + <if test="SCHOOL_ID != null and SCHOOL_ID != ''"> | ||
183 | + and sv_coursemanagement.SCHOOL_ID = #{SCHOOL_ID} | ||
184 | + </if> | ||
185 | + group by sv_sclass.CLASS_CODE | ||
165 | order by sv_sclass.CLASS_CODE | 186 | order by sv_sclass.CLASS_CODE |
166 | 187 | ||
167 | </select> | 188 | </select> |
src/com/fh/controller/sunvote/coursemanagement/CourseManagementController.java
@@ -90,7 +90,15 @@ public class CourseManagementController extends BaseController { | @@ -90,7 +90,15 @@ public class CourseManagementController extends BaseController { | ||
90 | PageData pd = new PageData(); | 90 | PageData pd = new PageData(); |
91 | pd = this.getPageData(); | 91 | pd = this.getPageData(); |
92 | pd.put("ID", this.get32UUID()); | 92 | pd.put("ID", this.get32UUID()); |
93 | - coursemanagementService.save(pd); | 93 | + PageData tpd = new PageData(); |
94 | + tpd.put("ID", pd.get("TEACHER_ID")); | ||
95 | + tpd = teacherService.findById(tpd); | ||
96 | + pd.put("SUBJECT_ID", tpd.get("SUBJECT_IDS")); | ||
97 | + if(coursemanagementService.findByCourse(pd) == null){ | ||
98 | + coursemanagementService.save(pd); | ||
99 | + }else{ | ||
100 | + //TODO | ||
101 | + } | ||
94 | mv.addObject("msg","success"); | 102 | mv.addObject("msg","success"); |
95 | mv.setViewName("save_result2"); | 103 | mv.setViewName("save_result2"); |
96 | return mv; | 104 | return mv; |
src/com/fh/controller/sunvote/homework/HomeworkController.java
@@ -31,6 +31,8 @@ import com.fh.service.sunvote.homework.HomeworkManager; | @@ -31,6 +31,8 @@ import com.fh.service.sunvote.homework.HomeworkManager; | ||
31 | import com.fh.service.sunvote.homework.HomeworkReportManager; | 31 | import com.fh.service.sunvote.homework.HomeworkReportManager; |
32 | import com.fh.service.sunvote.homeworkproblem.HomeworkProblemManager; | 32 | import com.fh.service.sunvote.homeworkproblem.HomeworkProblemManager; |
33 | import com.fh.service.sunvote.student.StudentManager; | 33 | import com.fh.service.sunvote.student.StudentManager; |
34 | +import com.fh.service.sunvote.teacher.TeacherManager; | ||
35 | +import com.fh.service.sunvote.teacher.impl.TeacherService; | ||
34 | import com.fh.util.AppUtil; | 36 | import com.fh.util.AppUtil; |
35 | import com.fh.util.Jurisdiction; | 37 | import com.fh.util.Jurisdiction; |
36 | import com.fh.util.ObjectExcelView; | 38 | import com.fh.util.ObjectExcelView; |
@@ -61,6 +63,9 @@ public class HomeworkController extends BaseController { | @@ -61,6 +63,9 @@ public class HomeworkController extends BaseController { | ||
61 | 63 | ||
62 | @Resource(name="studentService") | 64 | @Resource(name="studentService") |
63 | private StudentManager studentService; | 65 | private StudentManager studentService; |
66 | + | ||
67 | + @Resource(name = "teacherService") | ||
68 | + private TeacherManager teacherService; | ||
64 | 69 | ||
65 | /** | 70 | /** |
66 | * 保存 | 71 | * 保存 |
@@ -125,10 +130,10 @@ public class HomeworkController extends BaseController { | @@ -125,10 +130,10 @@ public class HomeworkController extends BaseController { | ||
125 | logBefore(logger, Jurisdiction.getUsername() + "列表Homework"); | 130 | logBefore(logger, Jurisdiction.getUsername() + "列表Homework"); |
126 | ModelAndView mv = this.getModelAndView(); | 131 | ModelAndView mv = this.getModelAndView(); |
127 | PageData pd = new PageData(); | 132 | PageData pd = new PageData(); |
128 | - if(pd.get("TEACHER_ID") == null){ | 133 | + pd = this.getPageData(); |
134 | + if(pd.get("SCHOOL_ID") == null){ | ||
129 | pd.put("TEACHER_ID", getTeacherID()); | 135 | pd.put("TEACHER_ID", getTeacherID()); |
130 | } | 136 | } |
131 | - pd = this.getPageData(); | ||
132 | String keywords = pd.getString("keywords"); // 关键词检索条件 | 137 | String keywords = pd.getString("keywords"); // 关键词检索条件 |
133 | if (null != keywords && !"".equals(keywords)) { | 138 | if (null != keywords && !"".equals(keywords)) { |
134 | pd.put("keywords", keywords.trim()); | 139 | pd.put("keywords", keywords.trim()); |
@@ -275,7 +280,9 @@ public class HomeworkController extends BaseController { | @@ -275,7 +280,9 @@ public class HomeworkController extends BaseController { | ||
275 | ModelAndView mv = this.getModelAndView(); | 280 | ModelAndView mv = this.getModelAndView(); |
276 | PageData pd = new PageData(); | 281 | PageData pd = new PageData(); |
277 | pd = this.getPageData(); | 282 | pd = this.getPageData(); |
278 | - pd.put("TEACHER_ID", getTeacherID()); | 283 | + if(pd.get("SCHOOL_ID") == null || "".equals(pd.get("SCHOOL_ID").toString().trim())){ |
284 | + pd.put("TEACHER_ID", getTeacherID()); | ||
285 | + } | ||
279 | 286 | ||
280 | 287 | ||
281 | if(pd.get("CURRENT_WEEK") == null && pd.get("START_DATE") == null && pd.get("END_DATE") == null){ | 288 | if(pd.get("CURRENT_WEEK") == null && pd.get("START_DATE") == null && pd.get("END_DATE") == null){ |
@@ -707,6 +714,9 @@ public class HomeworkController extends BaseController { | @@ -707,6 +714,9 @@ public class HomeworkController extends BaseController { | ||
707 | 714 | ||
708 | Homework homework = Homework.parse(data); | 715 | Homework homework = Homework.parse(data); |
709 | 716 | ||
717 | + pd.put("ID", getTeacherID()); | ||
718 | + PageData tmpd = teacherService.findById(pd); | ||
719 | + | ||
710 | PageData hpd = new PageData(); | 720 | PageData hpd = new PageData(); |
711 | if (homework != null) { | 721 | if (homework != null) { |
712 | hpd.put("CODE", get32UUID()); | 722 | hpd.put("CODE", get32UUID()); |
@@ -726,6 +736,7 @@ public class HomeworkController extends BaseController { | @@ -726,6 +736,7 @@ public class HomeworkController extends BaseController { | ||
726 | hpd.put("MODIFY_DATE", format.format(new Date())); | 736 | hpd.put("MODIFY_DATE", format.format(new Date())); |
727 | hpd.put("COMPLETE_COUNT", 0); | 737 | hpd.put("COMPLETE_COUNT", 0); |
728 | hpd.put("TEACHER_ID", homework.getTEACHER_ID()); | 738 | hpd.put("TEACHER_ID", homework.getTEACHER_ID()); |
739 | + hpd.put("SCHOOL_ID", tmpd.get("SCHOOL_ID")); | ||
729 | hpd.put("COMPLETE_DESC", ""); | 740 | hpd.put("COMPLETE_DESC", ""); |
730 | 741 | ||
731 | if (homework.getCLASSLIST() != null | 742 | if (homework.getCLASSLIST() != null |
@@ -774,7 +785,8 @@ public class HomeworkController extends BaseController { | @@ -774,7 +785,8 @@ public class HomeworkController extends BaseController { | ||
774 | ResponseGson<String> responseGson = new ResponseGson<String>(); | 785 | ResponseGson<String> responseGson = new ResponseGson<String>(); |
775 | 786 | ||
776 | Homework homework = Homework.parse(data); | 787 | Homework homework = Homework.parse(data); |
777 | - | 788 | + pd.put("ID", getTeacherID()); |
789 | + PageData tmpd = teacherService.findById(pd); | ||
778 | PageData hpd = new PageData(); | 790 | PageData hpd = new PageData(); |
779 | if (homework != null) { | 791 | if (homework != null) { |
780 | if (homework.getHOMEWORK_ID() != null | 792 | if (homework.getHOMEWORK_ID() != null |
@@ -792,6 +804,7 @@ public class HomeworkController extends BaseController { | @@ -792,6 +804,7 @@ public class HomeworkController extends BaseController { | ||
792 | hpd.put("COMPLETE_COUNT", 0); | 804 | hpd.put("COMPLETE_COUNT", 0); |
793 | hpd.put("TEACHER_ID", homework.getTEACHER_ID()); | 805 | hpd.put("TEACHER_ID", homework.getTEACHER_ID()); |
794 | hpd.put("COMPLETE_DESC", ""); | 806 | hpd.put("COMPLETE_DESC", ""); |
807 | + hpd.put("SCHOOL_ID", tmpd.get("SCHOOL_ID")); | ||
795 | if(homeworkService.findByCode(hpd).size() > 1){ | 808 | if(homeworkService.findByCode(hpd).size() > 1){ |
796 | hpd.put("CODE", get32UUID()); | 809 | hpd.put("CODE", get32UUID()); |
797 | for (HomeClass homeclass : homework.getCLASSLIST()) { | 810 | for (HomeClass homeclass : homework.getCLASSLIST()) { |
src/com/fh/service/sunvote/coursemanagement/CourseManagementManager.java
@@ -48,6 +48,11 @@ public interface CourseManagementManager{ | @@ -48,6 +48,11 @@ public interface CourseManagementManager{ | ||
48 | * @throws Exception | 48 | * @throws Exception |
49 | */ | 49 | */ |
50 | public PageData findById(PageData pd)throws Exception; | 50 | public PageData findById(PageData pd)throws Exception; |
51 | + /**通过id获取数据 | ||
52 | + * @param pd | ||
53 | + * @throws Exception | ||
54 | + */ | ||
55 | + public PageData findByCourse(PageData pd)throws Exception; | ||
51 | 56 | ||
52 | /**批量删除 | 57 | /**批量删除 |
53 | * @param ArrayDATA_IDS | 58 | * @param ArrayDATA_IDS |
src/com/fh/service/sunvote/coursemanagement/impl/CourseManagementService.java
@@ -85,6 +85,14 @@ public class CourseManagementService implements CourseManagementManager{ | @@ -85,6 +85,14 @@ public class CourseManagementService implements CourseManagementManager{ | ||
85 | return (PageData)dao.findForObject("CourseManagementMapper.findById", pd); | 85 | return (PageData)dao.findForObject("CourseManagementMapper.findById", pd); |
86 | } | 86 | } |
87 | 87 | ||
88 | + /**通过id获取数据 | ||
89 | + * @param pd | ||
90 | + * @throws Exception | ||
91 | + */ | ||
92 | + public PageData findByCourse(PageData pd)throws Exception{ | ||
93 | + return (PageData)dao.findForObject("CourseManagementMapper.findByCourse", pd); | ||
94 | + } | ||
95 | + | ||
88 | /**批量删除 | 96 | /**批量删除 |
89 | * @param ArrayDATA_IDS | 97 | * @param ArrayDATA_IDS |
90 | * @throws Exception | 98 | * @throws Exception |