Commit d1cd8422e60b6061d7bccbbcced2f4b18c9b6a47

Authored by =
2 parents 725e1c03 bf0c69bb

Merge branch 'develop' of http://120.78.57.84/Elvis/SunvoteEducation into develop

WebRoot/WEB-INF/jsp/sunvote/homework/homework_list.jsp
@@ -48,16 +48,20 @@ @@ -48,16 +48,20 @@
48 <table class="table table-striped"> 48 <table class="table table-striped">
49 <col style="width: 10%" /> 49 <col style="width: 10%" />
50 <col style="width: 20%" /> 50 <col style="width: 20%" />
51 - <col style="width: 20%" />  
52 - <col style="width: 20%" />  
53 - <col style="width: 20%" /> 51 + <col style="width: 15%" />
  52 + <col style="width: 15%" />
  53 + <col style="width: 10%" />
  54 + <col style="width: 10%" />
  55 + <col style="width: 10%" />
54 <col style="width: 10%" /> 56 <col style="width: 10%" />
55 <thead> 57 <thead>
56 <tr> 58 <tr>
57 <th><input type="checkbox" name='ids' id="ids" />序号</th> 59 <th><input type="checkbox" name='ids' id="ids" />序号</th>
58 - <th>测验标题</th>  
59 - <th>创建时间</th>  
60 - <th>建议考试时长</th> 60 + <th>练习标题</th>
  61 + <th>布置时间</th>
  62 + <th>完成时间</th>
  63 + <th>题目数</th>
  64 + <th>完成情况</th>
61 <th>总分</th> 65 <th>总分</th>
62 <th>操作</th> 66 <th>操作</th>
63 </tr> 67 </tr>
@@ -69,23 +73,27 @@ @@ -69,23 +73,27 @@
69 <table class="table table-striped"> 73 <table class="table table-striped">
70 <col style="width: 10%" /> 74 <col style="width: 10%" />
71 <col style="width: 20%" /> 75 <col style="width: 20%" />
72 - <col style="width: 20%" />  
73 - <col style="width: 20%" />  
74 - <col style="width: 20%" /> 76 + <col style="width: 15%" />
  77 + <col style="width: 15%" />
  78 + <col style="width: 10%" />
  79 + <col style="width: 10%" />
  80 + <col style="width: 10%" />
75 <col style="width: 10%" /> 81 <col style="width: 10%" />
76 <tbody> 82 <tbody>
77 <c:choose> 83 <c:choose>
78 <c:when test="${not empty varList}"> 84 <c:when test="${not empty varList}">
79 <c:forEach items="${varList}" var="var" varStatus="vs"> 85 <c:forEach items="${varList}" var="var" varStatus="vs">
80 <tr> 86 <tr>
81 - <td><input type="checkbox" name='ids' id="ids" value="${var.PAPER_ID}"/>${vs.index+1}</td>  
82 - <td ><a target="_blank" href="<%=basePath%>paper/iteminfo.do?paper_id=${var.PAPER_ID}">${var.TITLE}</a></td> 87 + <td><input type="checkbox" name='ids' id="ids" value="${var.HOMEWORK_ID}"/>${vs.index+1}</td>
  88 + <td ><a target="_blank" href="<%=basePath%>paper/iteminfo.do?paper_id=${var.HOMEWORK_ID}">${var.NAME}</a></td>
83 <td >${var.CREATE_DATE}</td> 89 <td >${var.CREATE_DATE}</td>
84 - <td >${var.EXAM_TIME}</td>  
85 - <td >${var.SCORE}</td> 90 + <td >${var.COMPLETE_DATE}</td>
  91 + <td >${var.QUESTIOM_COUNT}</td>
  92 + <td >${var.COMPLETE_COUNT == "0" ? "未完成":"已完成"}</td>
  93 + <td >${var.ALL_SCORE}</td>
86 <td> 94 <td>
87 - <a onclick="del('${var.PAPER_ID}');"><img src="static/images/remove.png" /></a>  
88 - <a onclick="del('${var.PAPER_ID}');"><img src="static/images/eidtor.png" /></a> 95 + <a onclick="del('${var.HOMEWORK_ID}');"><img src="static/images/remove.png" /></a>
  96 + <a onclick="del('${var.HOMEWORK_ID}');"><img src="static/images/eidtor.png" /></a>
89 </td> 97 </td>
90 </tr> 98 </tr>
91 99
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp
@@ -179,7 +179,7 @@ @@ -179,7 +179,7 @@
179 function homeWork(schoolId){ 179 function homeWork(schoolId){
180 //var path = "../school/goEdit2.do?ID=" + schoolId ; 180 //var path = "../school/goEdit2.do?ID=" + schoolId ;
181 181
182 - var path = '<%=basePath%>homework/list.do?ID=' + schoolId ; 182 + var path = '<%=basePath%>homework/list.do?teacher_id=${pd.TEACHER.ID}&ID=' + schoolId ;
183 183
184 $("#mainFrame").attr('src',path); 184 $("#mainFrame").attr('src',path);
185 window.top.loading.show(); 185 window.top.loading.show();
resources/mybatis1/sunvote/HomeworkMapper.xml
@@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
27 GET_SCORE, 27 GET_SCORE,
28 GET_SCORE_PERSENT, 28 GET_SCORE_PERSENT,
29 GET_MAX_SCORE, 29 GET_MAX_SCORE,
  30 + QUESTIOM_COUNT,
30 HOMEWORK_ID 31 HOMEWORK_ID
31 </sql> 32 </sql>
32 33
@@ -50,6 +51,7 @@ @@ -50,6 +51,7 @@
50 #{GET_SCORE}, 51 #{GET_SCORE},
51 #{GET_SCORE_PERSENT}, 52 #{GET_SCORE_PERSENT},
52 #{GET_MAX_SCORE}, 53 #{GET_MAX_SCORE},
  54 + #{QUESTIOM_COUNT},
53 #{HOMEWORK_ID} 55 #{HOMEWORK_ID}
54 </sql> 56 </sql>
55 57
@@ -113,6 +115,8 @@ @@ -113,6 +115,8 @@
113 GET_SCORE_PERSENT = #{GET_SCORE_PERSENT}, 115 GET_SCORE_PERSENT = #{GET_SCORE_PERSENT},
114 </if><if test="GET_MAX_SCORE != null and GET_MAX_SCORE != ''"> 116 </if><if test="GET_MAX_SCORE != null and GET_MAX_SCORE != ''">
115 GET_MAX_SCORE = #{GET_MAX_SCORE}, 117 GET_MAX_SCORE = #{GET_MAX_SCORE},
  118 + </if><if test="QUESTIOM_COUNT != null and QUESTIOM_COUNT != ''">
  119 + QUESTIOM_COUNT = #{QUESTIOM_COUNT},
116 </if> 120 </if>
117 HOMEWORK_ID = HOMEWORK_ID 121 HOMEWORK_ID = HOMEWORK_ID
118 where 122 where
@@ -136,15 +140,23 @@ @@ -136,15 +140,23 @@
136 from 140 from
137 <include refid="tableName"></include> 141 <include refid="tableName"></include>
138 where 1=1 142 where 1=1
139 - <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 -->  
140 - and  
141 - (  
142 - <!-- 根据需求自己加检索条件  
143 - 字段1 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')  
144 - or  
145 - 字段2 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%')  
146 - -->  
147 - ) 143 + <if test="pd.SUBJECT_ID != null and pd.SUBJECT_ID != ''"><!-- 关键词检索 -->
  144 + and SUBJECT_ID = #{pd.SUBJECT_ID}
  145 + </if>
  146 + <if test="pd.CLASS_ID != null and pd.CLASS_ID != ''"><!-- 关键词检索 -->
  147 + and CLASS_ID = #{pd.CLASS_ID}
  148 + </if>
  149 + <if test="pd.GRADE_ID != null and pd.GRADE_ID != ''"><!-- 关键词检索 -->
  150 + and GRADE_ID = #{pd.GRADE_ID}
  151 + </if>
  152 + <if test="pd.SCHOOL_ID != null and pd.SCHOOL_ID != ''"><!-- 关键词检索 -->
  153 + and SCHOOL_ID = #{pd.SCHOOL_ID}
  154 + </if>
  155 + <if test="pd.TEACHER_ID != null and pd.TEACHER_ID != ''"><!-- 关键词检索 -->
  156 + and TEACHER_ID = #{pd.TEACHER_ID}
  157 + </if>
  158 + <if test="pd.COMPLETE != null and pd.COMPLETE != ''"><!-- 关键词检索 -->
  159 + and COMPLETE_DATE &gt; #{pd.COMPLETE_DATE}
148 </if> 160 </if>
149 </select> 161 </select>
150 162
src/com/fh/controller/sunvote/homework/HomeworkController.java
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
19 import org.springframework.web.bind.annotation.ResponseBody; 19 import org.springframework.web.bind.annotation.ResponseBody;
20 import org.springframework.web.servlet.ModelAndView; 20 import org.springframework.web.servlet.ModelAndView;
21 21
  22 +import com.fh.controller.api.ResponseGson;
22 import com.fh.controller.base.BaseController; 23 import com.fh.controller.base.BaseController;
23 import com.fh.entity.Page; 24 import com.fh.entity.Page;
24 import com.fh.service.sunvote.homework.HomeworkManager; 25 import com.fh.service.sunvote.homework.HomeworkManager;
@@ -51,9 +52,6 @@ public class HomeworkController extends BaseController { @@ -51,9 +52,6 @@ public class HomeworkController extends BaseController {
51 @RequestMapping(value = "/save") 52 @RequestMapping(value = "/save")
52 public ModelAndView save() throws Exception { 53 public ModelAndView save() throws Exception {
53 logBefore(logger, Jurisdiction.getUsername() + "新增Homework"); 54 logBefore(logger, Jurisdiction.getUsername() + "新增Homework");
54 - if (!Jurisdiction.buttonJurisdiction(menuUrl, "add")) {  
55 - return null;  
56 - } // 校验权限  
57 ModelAndView mv = this.getModelAndView(); 55 ModelAndView mv = this.getModelAndView();
58 PageData pd = new PageData(); 56 PageData pd = new PageData();
59 pd = this.getPageData(); 57 pd = this.getPageData();
@@ -89,9 +87,6 @@ public class HomeworkController extends BaseController { @@ -89,9 +87,6 @@ public class HomeworkController extends BaseController {
89 @RequestMapping(value = "/edit") 87 @RequestMapping(value = "/edit")
90 public ModelAndView edit() throws Exception { 88 public ModelAndView edit() throws Exception {
91 logBefore(logger, Jurisdiction.getUsername() + "修改Homework"); 89 logBefore(logger, Jurisdiction.getUsername() + "修改Homework");
92 - if (!Jurisdiction.buttonJurisdiction(menuUrl, "edit")) {  
93 - return null;  
94 - } // 校验权限  
95 ModelAndView mv = this.getModelAndView(); 90 ModelAndView mv = this.getModelAndView();
96 PageData pd = new PageData(); 91 PageData pd = new PageData();
97 pd = this.getPageData(); 92 pd = this.getPageData();
@@ -110,8 +105,6 @@ public class HomeworkController extends BaseController { @@ -110,8 +105,6 @@ public class HomeworkController extends BaseController {
110 @RequestMapping(value = "/list") 105 @RequestMapping(value = "/list")
111 public ModelAndView list(Page page) throws Exception { 106 public ModelAndView list(Page page) throws Exception {
112 logBefore(logger, Jurisdiction.getUsername() + "列表Homework"); 107 logBefore(logger, Jurisdiction.getUsername() + "列表Homework");
113 - // if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;}  
114 - // //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)  
115 ModelAndView mv = this.getModelAndView(); 108 ModelAndView mv = this.getModelAndView();
116 PageData pd = new PageData(); 109 PageData pd = new PageData();
117 pd = this.getPageData(); 110 pd = this.getPageData();
@@ -285,4 +278,36 @@ public class HomeworkController extends BaseController { @@ -285,4 +278,36 @@ public class HomeworkController extends BaseController {
285 Gson gson = new Gson(); 278 Gson gson = new Gson();
286 return gson.toJson(pd); 279 return gson.toJson(pd);
287 } 280 }
  281 +
  282 + /**
  283 + * 列表
  284 + *
  285 + * @param page
  286 + * @throws Exception
  287 + */
  288 + @RequestMapping(value = "/listdata", produces = "application/json;charset=UTF-8")
  289 + @ResponseBody
  290 + public String listdata(Page page) throws Exception {
  291 + PageData pd = new PageData();
  292 + pd = this.getPageData();
  293 + String keywords = pd.getString("keywords"); // 关键词检索条件
  294 + if (null != keywords && !"".equals(keywords)) {
  295 + pd.put("keywords", keywords.trim());
  296 + }
  297 + page.setPd(pd);
  298 + List<PageData> varList = homeworkService.list(page); // 列出Homework列表
  299 + Gson gson = new Gson();
  300 + return gson.toJson(varList);
  301 + }
  302 +
  303 + @RequestMapping(value = "/savedata")
  304 + public String savedata() throws Exception {
  305 + PageData pd = new PageData();
  306 + pd = this.getPageData();
  307 + pd.put("HOMEWORK_ID", this.get32UUID()); // 主键
  308 + homeworkService.save(pd);
  309 + ResponseGson<String> responseGson = new ResponseGson<String>();
  310 + responseGson.setData(pd.getString("HOMEWORK_ID"));
  311 + return responseGson.toJson();
  312 + }
288 } 313 }