Browse Source

一系列优化

shenhao 3 years ago
parent
commit
506bba0d5e
22 changed files with 845 additions and 120 deletions
  1. 54 4
      src/main/java/com/ssj/dao/sys/imlibuser/dao/impl/TbClassQueryDaoImpl.java
  2. 4 0
      src/main/java/com/ssj/dao/weixin/library/dao/ILibJoinDao.java
  3. 5 5
      src/main/java/com/ssj/dao/weixin/library/dao/ILibVipDao.java
  4. 35 3
      src/main/java/com/ssj/school/book/dao/impl/SchoolBookQueryDaoImpl.java
  5. 4 1
      src/main/java/com/ssj/service/sys/fx/service/impl/MerchantMealServiceImpl.java
  6. 17 0
      src/main/java/com/ssj/service/sys/imlibuser/service/impl/TbClassStudentTempServiceImpl.java
  7. 2 0
      src/main/java/com/ssj/service/weixin/library/service/ILibVipService.java
  8. 7 0
      src/main/java/com/ssj/service/weixin/library/service/impl/LibJoinServiceImpl.java
  9. 5 0
      src/main/java/com/ssj/service/weixin/library/service/impl/LibVipServiceImpl.java
  10. 3 1
      src/main/java/com/ssj/service/weixin/sales/service/impl/LibVipServiceServiceImpl.java
  11. 249 42
      src/main/java/com/ssj/sys/controller/ImLibUserController.java
  12. 82 1
      src/main/java/com/ssj/sys/controller/SysProblemController.java
  13. 1 1
      src/main/resources/templates/sys/fx/merchantAdd.html
  14. 15 2
      src/main/resources/templates/sys/fx/merchantAllList.html
  15. 100 23
      src/main/resources/templates/sys/imlibuser/headmasterList.html
  16. 7 1
      src/main/resources/templates/sys/imlibuser/schoolList.html
  17. 57 7
      src/main/resources/templates/sys/imlibuser/studentList.html
  18. 82 16
      src/main/resources/templates/sys/imlibuser/teacherList.html
  19. 1 0
      src/main/resources/templates/sys/problem/cnArealist.html
  20. 58 10
      src/main/resources/templates/sys/school/bookList.html
  21. 55 3
      src/main/resources/templates/sys/school/schoolBookList.html
  22. 2 0
      src/main/resources/templates/sys/termtrainQuestion/termtrainQuestionList.html

+ 54 - 4
src/main/java/com/ssj/dao/sys/imlibuser/dao/impl/TbClassQueryDaoImpl.java

@@ -30,6 +30,7 @@ public class TbClassQueryDaoImpl implements TbClassQueryDao {
 		selSql.append(" ,( SELECT COUNT(DISTINCT(a.user_id)) from tb_lib_manager a  where a.state=1  AND a.type in (4) AND a.lib_id=t.id  ) as principal_num    ");
 		selSql.append(" ,( SELECT COUNT(DISTINCT(a.user_id)) from tb_lib_manager a  where a.state=1  AND a.type in (19) AND a.lib_id=t.id  ) as leader_num    ");
 		selSql.append(" ,( SELECT COUNT(a.teacher_id) from tb_class_teacher a  where a.status=1 and a.type=2 AND a.lib_id=t.id  ) as headmaster_num    ");
+		selSql.append(" ,( SELECT COUNT(DISTINCT(a.user_id)) from tb_lib_manager a  where a.state=1  AND a.type in (2,10,15) AND a.lib_id=t.id  ) as school_teacher_num    ");
 		selSql.append(" ,IFNULL(( SELECT SUM(m.port_num) from fx_merchant m WHERE m.lib_id=t.id GROUP BY m.lib_id),0) as port_num ");
 		selSql.append(" from tb_lib_join t    ");
 		selSql.append(" where 1=1    ");
@@ -45,13 +46,30 @@ public class TbClassQueryDaoImpl implements TbClassQueryDao {
 	public Page<Map<String, Object>> findStudentByPage(Map<String, Object> searchParam, Pageable pageable) {
 		StringBuffer selSql = new StringBuffer();
 		List<Object> queryParams = new ArrayList<Object>();
-		selSql.append("  SELECT v.* from  tb_lib_vip v     ");
-		selSql.append("   where v.stat=1  AND v.lib_id=?   ");   
+		selSql.append("  SELECT v.* ,c.class_name from  tb_lib_vip v     ");
+		selSql.append("  left join   tb_class_student cs   on v.lib_id = cs.lib_id and v.id = cs.vip_id and cs.status = 1  ");
+		selSql.append("  left join   tb_class c   on cs.class_id = c.id  ");
+		selSql.append("   where v.stat=1  AND v.lib_id=?   ");
 		queryParams.add(searchParam.get("libId"));
 		if(!"".equals(searchParam.get("name"))){
 			  selSql.append(" AND v.child_name LIKE  CONCAT('%',?,'%')   ");
 	          queryParams.add(searchParam.get("name"));
 	    }
+		if(!"".equals(searchParam.get("selectIds"))){
+			  selSql.append(" AND v.id in ( ");
+			  String id = searchParam.get("selectIds").toString();
+			  String[] ids = id.split(",");
+			  int length = ids.length;
+			  for(int i=0;i<length;i++){
+				  selSql.append("'");
+				  selSql.append(ids[i]);
+				  selSql.append("'");
+				  if(i<length-1){
+					  selSql.append(",");
+				  }
+			  }
+			   selSql.append(")");
+	    }
 		selSql.append(" ORDER BY v.create_time DESC  ");
 		return dao.findPage(selSql.toString(),queryParams.toArray(), pageable);
 	}
@@ -112,7 +130,7 @@ public class TbClassQueryDaoImpl implements TbClassQueryDao {
 		StringBuffer selSql = new StringBuffer();
 		List<Object> queryParams = new ArrayList<Object>();
 		selSql.append("  SELECT * from tb_lib_manager t  ");
-		selSql.append("  where t.state=1 AND t.lib_id=?    ");
+		selSql.append("  where t.state=1 AND t.lib_id=?  and t.state = 1   ");
 		queryParams.add(searchParam.get("libId"));
 		
 		if("1".equals(searchParam.get("type"))){
@@ -131,6 +149,21 @@ public class TbClassQueryDaoImpl implements TbClassQueryDao {
 			  selSql.append(" AND t.name LIKE  CONCAT('%',?,'%')   ");
 	          queryParams.add(searchParam.get("name"));
 	    }
+		if(!"".equals(searchParam.get("selectIds"))){
+			selSql.append(" AND t.id in ( ");
+			String id = searchParam.get("selectIds").toString();
+			String[] ids = id.split(",");
+			int length = ids.length;
+			for(int i=0;i<length;i++){
+				selSql.append("'");
+				selSql.append(ids[i]);
+				selSql.append("'");
+				if(i<length-1){
+					selSql.append(",");
+				}
+			}
+			selSql.append(")");
+		}
 		selSql.append(" GROUP BY t.user_id ORDER BY t.create_time DESC  ");
 		return dao.findPage(selSql.toString(),queryParams.toArray(), pageable);
 	}
@@ -141,7 +174,9 @@ public class TbClassQueryDaoImpl implements TbClassQueryDao {
 	public Page<Map<String, Object>> findHeadmasterByPage(Map<String, Object> searchParam, Pageable pageable) {
 		StringBuffer selSql = new StringBuffer();
 		List<Object> queryParams = new ArrayList<Object>();
-		selSql.append("  SELECT u.*,c.grade,c.class_name,c.id as cid from tb_class_teacher t LEFT JOIN tb_user u ON t.teacher_id=u.id LEFT JOIN tb_class c ON t.class_id=c.id   ");
+		selSql.append("  SELECT u.*,c.grade,c.class_name,c.id as cid ");
+		selSql.append("  ,(select m.course_name from tb_lib_manager m where  t.teacher_id = m.user_id and m.state=1 and m.type in (2,10,15) group by m.user_id) as course_name ");
+		selSql.append("from tb_class_teacher t LEFT JOIN tb_user u ON t.teacher_id=u.id LEFT JOIN tb_class c ON t.class_id=c.id   ");
 		selSql.append("  where t.status=1 AND t.lib_id=?  ");
 		queryParams.add(searchParam.get("libId"));
 		if(!"".equals(searchParam.get("type"))){
@@ -152,6 +187,21 @@ public class TbClassQueryDaoImpl implements TbClassQueryDao {
 			 selSql.append(" AND u.user_name LIKE  CONCAT('%',?,'%')   ");
 	         queryParams.add(searchParam.get("name"));
 	    }
+		if(!"".equals(searchParam.get("selectIds"))){
+			selSql.append(" AND u.id in ( ");
+			String id = searchParam.get("selectIds").toString();
+			String[] ids = id.split(",");
+			int length = ids.length;
+			for(int i=0;i<length;i++){
+				selSql.append("'");
+				selSql.append(ids[i]);
+				selSql.append("'");
+				if(i<length-1){
+					selSql.append(",");
+				}
+			}
+			selSql.append(")");
+		}
 		selSql.append(" ORDER BY t.create_time DESC  ");
 		return dao.findPage(selSql.toString(),queryParams.toArray(), pageable);
 	}

+ 4 - 0
src/main/java/com/ssj/dao/weixin/library/dao/ILibJoinDao.java

@@ -94,4 +94,8 @@ public interface ILibJoinDao extends JpaRepository<TbLibJoin, String> {
     @Query(nativeQuery = true, value = " delete from   tb_lib_manager_audit   where lib_manager_id = ?1 ")
     @Modifying
     void libAuditDelete(String id);
+
+    @Query(nativeQuery = true, value = " update tb_class_teacher set status = 0 where teacher_id= ?1 and status = 1 ")
+    @Modifying
+    void updateClassTeacherData(String userId);
 }

+ 5 - 5
src/main/java/com/ssj/dao/weixin/library/dao/ILibVipDao.java

@@ -143,9 +143,9 @@ public interface ILibVipDao extends JpaRepository<LibVip, String> {
 	 @Query(nativeQuery = true, value = "update tb_lib_vip set lib_id = null where lib_id = ?1 and not exists (select 1 from tb_lib_vip_service a join tb_lib_order_details b on a.order_details_id = b.id where a.stat=1 and a.species='S003' and a.vip_id = tb_lib_vip.id)")
 	 @Modifying
 	 public void updateLibId(String libId);
-	 
-	 
-		        
-	
-	
+
+
+	@Query(nativeQuery = true, value = "update tb_class_student set status = 2 where lib_id = ?1 ")
+	@Modifying
+    void closeClassByLibId(String libId);
 }

+ 35 - 3
src/main/java/com/ssj/school/book/dao/impl/SchoolBookQueryDaoImpl.java

@@ -33,11 +33,35 @@ public class SchoolBookQueryDaoImpl implements ISchoolBookQueryDao {
         sql.append("select t.id,t.school_name,t11.book_name,t11.book_subject,t11.version_name,t11.book_grade,IF(t11.semester=1,'上学期','下学期') as semester,t11.book_year  ");
         sql.append(" from sys_school_book_detail t ");
         sql.append(" left join q_workbook t11 on t.book_id = t11.id ");
-        sql.append(" where t11.status = 1 ");
+        sql.append(" where 1=1 ");
         if(Objects.nonNull(params.get("name")) && StringUtils.isNotBlank(MapUtils.getString(params,"name"))){
-            sql.append(" and t.school_name like concat('%',?,'%')");
+            sql.append(" and t11.book_name like concat('%',?,'%')");
             queryParams.add(params.get("name"));
         }
+        if(Objects.nonNull(params.get("id")) && StringUtils.isNotBlank(MapUtils.getString(params,"id"))){
+            sql.append(" and t.school_id =?");
+            queryParams.add(params.get("id"));
+        }
+        if(Objects.nonNull(params.get("grade")) && StringUtils.isNotBlank(MapUtils.getString(params,"grade"))){
+            sql.append(" and t11.book_grade =?");
+            queryParams.add(params.get("grade"));
+        }
+        if(Objects.nonNull(params.get("subject")) && StringUtils.isNotBlank(MapUtils.getString(params,"subject"))){
+            sql.append(" and t11.book_subject =? ");
+            queryParams.add(params.get("subject"));
+        }
+        if(Objects.nonNull(params.get("version")) && StringUtils.isNotBlank(MapUtils.getString(params,"version"))){
+            sql.append(" and t11.version_code =? ");
+            queryParams.add(params.get("version"));
+        }
+        if(Objects.nonNull(params.get("year")) && StringUtils.isNotBlank(MapUtils.getString(params,"year"))){
+            sql.append(" and t11.book_year =? ");
+            queryParams.add(params.get("year"));
+        }
+        if(Objects.nonNull(params.get("semester")) && StringUtils.isNotBlank(MapUtils.getString(params,"semester"))){
+            sql.append(" and t11.semester =? ");
+            queryParams.add(params.get("semester"));
+        }
         return dao.findPage(sql.toString(),queryParams.toArray(),initPage);
     }
 
@@ -47,7 +71,7 @@ public class SchoolBookQueryDaoImpl implements ISchoolBookQueryDao {
         StringBuffer sql = new StringBuffer();
         sql.append("select t11.id,t11.book_name,t11.book_subject,t11.version_name,t11.book_grade,IF(t11.semester=1,'上学期','下学期') as semester,t11.book_year  ");
         sql.append(" from q_workbook t11 ");
-        sql.append(" where t11.status = 1 ");
+        sql.append(" where 1=1 ");
         if(Objects.nonNull(params.get("name")) && StringUtils.isNotBlank(MapUtils.getString(params,"name"))){
             sql.append(" and t11.book_name like concat('%',?,'%')");
             queryParams.add(params.get("name"));
@@ -64,6 +88,14 @@ public class SchoolBookQueryDaoImpl implements ISchoolBookQueryDao {
             sql.append(" and t11.version_code =? ");
             queryParams.add(params.get("version"));
         }
+        if(Objects.nonNull(params.get("year")) && StringUtils.isNotBlank(MapUtils.getString(params,"year"))){
+            sql.append(" and t11.book_year =? ");
+            queryParams.add(params.get("year"));
+        }
+        if(Objects.nonNull(params.get("semester")) && StringUtils.isNotBlank(MapUtils.getString(params,"semester"))){
+            sql.append(" and t11.semester =? ");
+            queryParams.add(params.get("semester"));
+        }
         return dao.findPage(sql.toString(),queryParams.toArray(),initPage);
     }
 }

+ 4 - 1
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantMealServiceImpl.java

@@ -387,7 +387,7 @@ public class MerchantMealServiceImpl extends BaseServiceImpl<MerchantMeal, Strin
 						//更新join表
 						TbLibJoin join = joinService.getById(merchant.getLibId());
 						join.setLibService(merchant.getLibService());
-						join.setSignType(merchant.getSignType());
+						join.setSignType(merchant.getMealType());
 						join.setSignTime(merchant.getStartActiveTime());
 						join.setEndSignTime(merchant.getEndActiveTime());
 						joinService.save(join);
@@ -398,6 +398,9 @@ public class MerchantMealServiceImpl extends BaseServiceImpl<MerchantMeal, Strin
 							libVipServiceService.updateStatByLibId(merchant.getLibId());
 							//解绑馆下所有学生
 							vipService.updateLibId(merchant.getLibId());
+
+							//关闭班级服务
+							vipService.closeClassByLibId(merchant.getLibId());
 						}else{
 							//更新服务时间
 							libVipServiceService.updateServiceEndTime(merchant.getLibId(),format.format(merchant.getEndActiveTime()));

+ 17 - 0
src/main/java/com/ssj/service/sys/imlibuser/service/impl/TbClassStudentTempServiceImpl.java

@@ -298,6 +298,23 @@ public class TbClassStudentTempServiceImpl extends BaseServiceImpl<TbClassStuden
 					//有学生,判断机构是为空,绑定机构
 					if(StringUtils.isEmpty(libVip.getLibId())) {
 						libVip.setLibId(libJoin.getId());
+						//更新学校以及年级信息角色家长信息
+						if(StringUtils.isNotEmpty(tbLibImStudentTemp.getSchool())){
+							libVip.setSchool(tbLibImStudentTemp.getSchool());
+						}
+						if(StringUtils.isNotEmpty(tbLibImStudentTemp.getGrade())){
+							libVip.setGrade(tbLibImStudentTemp.getGrade());
+						}
+						if(StringUtils.isNotEmpty(tbLibImStudentTemp.getParentName())){
+							libVip.setParentName(tbLibImStudentTemp.getParentName());
+						}
+						if(StringUtils.isNotEmpty(tbLibImStudentTemp.getParentRole())){
+							libVip.setParentRole(tbLibImStudentTemp.getParentRole());
+						}
+						if(StringUtils.isNotEmpty(tbLibImStudentTemp.getParentPhone())){
+							libVip.setPhone(tbLibImStudentTemp.getParentPhone());
+						}
+
 						libVip=vipService.save(libVip);
 					}else {
 						//有学生,判断机构不为空,判断是否机构和导入机构一致,一致的话反回导入不成功,不一致的话返回机构不合

+ 2 - 0
src/main/java/com/ssj/service/weixin/library/service/ILibVipService.java

@@ -166,4 +166,6 @@ public interface ILibVipService extends BaseService<LibVip, String> {
 	int countByLibId(String libId);
 	 
 	void updateLibId(String libId);
+
+    void closeClassByLibId(String libId);
 }

+ 7 - 0
src/main/java/com/ssj/service/weixin/library/service/impl/LibJoinServiceImpl.java

@@ -98,6 +98,13 @@ public class LibJoinServiceImpl extends BaseServiceImpl<TbLibJoin, String> imple
 			//删除audit 记录
 			libJoinDao.libAuditDelete(id);
 		}
+		//删除后查看是否还有老师数据
+		TbLibManager manager = managerService.getById(id);
+		List<TbLibManager> list = managerService.findAllValidTeacherList(manager.getUserId(),new int[]{2,10,15});
+		if(list == null || list.size()==0){
+			//班级老师数据更新为无效
+			libJoinDao.updateClassTeacherData(manager.getUserId());
+		}
 	}
 
 	@Override

+ 5 - 0
src/main/java/com/ssj/service/weixin/library/service/impl/LibVipServiceImpl.java

@@ -380,4 +380,9 @@ public class LibVipServiceImpl extends BaseServiceImpl<LibVip, String> implement
 	public void updateLibId(String libId) {
 		dao.updateLibId(libId);
 	}
+
+	@Override
+	public void closeClassByLibId(String libId) {
+		dao.closeClassByLibId(libId);
+	}
 }

+ 3 - 1
src/main/java/com/ssj/service/weixin/sales/service/impl/LibVipServiceServiceImpl.java

@@ -1874,7 +1874,7 @@ public class LibVipServiceServiceImpl extends BaseServiceImpl<LibVipService, Str
             libVipService.setVipId(vipId);
             libVipService.setLibId(libId);
             libVipService.setStartTime(now);
-            libVipService.setEndTime(endDate);
+
             libVipService.setStat(1);
             libVipService.setSpecies("S003");
             libVipService.setType("C025");
@@ -1887,6 +1887,7 @@ public class LibVipServiceServiceImpl extends BaseServiceImpl<LibVipService, Str
             this.save(libVipService);
         } else {
             libVipService.setStat(1);
+			libVipService.setEndTime(endDate);
 			libVipService.setOrderDetailsId("2");
             this.save(libVipService);
         }
@@ -1930,6 +1931,7 @@ public class LibVipServiceServiceImpl extends BaseServiceImpl<LibVipService, Str
             this.save(libVipService);
         } else {
             libVipService.setStat(1);
+			libVipService.setEndTime(endDate);
 			libVipService.setOrderDetailsId("2");
             this.save(libVipService);
         }

+ 249 - 42
src/main/java/com/ssj/sys/controller/ImLibUserController.java

@@ -370,6 +370,11 @@ public class ImLibUserController extends BaseController {
 		Map<String, Object> params = new HashMap<String, Object>();
 		params.put("libId", libId);
 		params.put("name", request.getParameter("name")==null?"":request.getParameter("name"));
+		String selectIds = request.getParameter("selectIds")==null?"":request.getParameter("selectIds");
+		if(selectIds.endsWith(",")){
+			selectIds = selectIds.substring(0,selectIds.length()-1);
+		}
+		params.put("selectIds",selectIds );
         SplitPage sp = new SplitPage();
         sp.setAction(request.getRequestURI());
         sp.setPageNo(pageNo);
@@ -508,6 +513,11 @@ public class ImLibUserController extends BaseController {
     		Map<String, Object> params = new HashMap<String, Object>();
     		params.put("libId", libId);
     		params.put("name", request.getParameter("name")==null?"":request.getParameter("name"));
+    		String selectIds = request.getParameter("selectIds")==null?"":request.getParameter("selectIds");
+    		if(selectIds.endsWith(",")){
+				selectIds = selectIds.substring(0,selectIds.length()-1);
+			}
+    		params.put("selectIds",selectIds );
             SplitPage sp = new SplitPage();
             sp.setAction(request.getRequestURI());
             sp.setPageNo(1);
@@ -536,6 +546,7 @@ public class ImLibUserController extends BaseController {
     		myColumns3.add(new ExcelColumn("家长姓名", "parent_name", 20));
     		myColumns3.add(new ExcelColumn("家长角色", "parent_role", 20));
     		myColumns3.add(new ExcelColumn("家长电话", "phone", 20));
+    		myColumns3.add(new ExcelColumn("班级", "class_name", 20));
     		myColumns3.add(new ExcelColumn("小塾号", "derver", 20));
 
 	    	CustomizeToExcel.downFile(myColumns3, list, os);
@@ -717,31 +728,43 @@ public class ImLibUserController extends BaseController {
 	@ResponseBody
 	public Response studentDel(Model model,@PathVariable String vipId) {
 		Response response = new  Response();
-		LibVip libVip=libVipService.getById(vipId);
-		if(libVip!=null){
-			if(StringUtils.isNotEmpty(libVip.getLibId())) {
-				List<LibVipService> libVipServices=libVipServiceService.findVipIdServiceByLibId(libVip.getLibId(),vipId,"S003");
-				if(libVipServices!=null && libVipServices.size()>0) {
-					for (LibVipService libVipService : libVipServices) {
-						libVipService.setStat(2);
+
+		response.success("成功");
+		return response;
+	}
+	//解除关联小塾
+	@RequestMapping(value="/student/data/del/studentDelBatch")
+	@ResponseBody
+	public Response studentDelBatch(Model model,String vipIds) {
+		Response response = new  Response();
+		if(vipIds.endsWith(",")){vipIds.substring(0,vipIds.length()-1);}
+		String[] str = vipIds.split(",");
+		for(String vipId:str){
+			LibVip libVip=libVipService.getById(vipId);
+			if(libVip!=null){
+				if(StringUtils.isNotEmpty(libVip.getLibId())) {
+					List<LibVipService> libVipServices=libVipServiceService.findVipIdServiceByLibId(libVip.getLibId(),vipId,"S003");
+					if(libVipServices!=null && libVipServices.size()>0) {
+						for (LibVipService libVipService : libVipServices) {
+							libVipService.setStat(2);
+						}
+						libVipServiceService.save(libVipServices);
 					}
-					libVipServiceService.save(libVipServices);
 				}
-			}
-			
-			TbClassStudent tbClassStudent=tbClassStudentService.findByLibIdAndVipId(libVip.getLibId(), vipId);
-			if(tbClassStudent!=null) {
-				tbClassStudentService.delete(tbClassStudent);
-			}
-			
-			libVip.setLibId(null);
-			libVipService.save(libVip);
 
+				TbClassStudent tbClassStudent=tbClassStudentService.findByLibIdAndVipId(libVip.getLibId(), vipId);
+				if(tbClassStudent!=null) {
+					tbClassStudentService.delete(tbClassStudent);
+				}
+
+				libVip.setLibId(null);
+				libVipService.save(libVip);
+
+			}
 		}
 		response.success("成功");
 		return response;
-	}	
-	
+	}
 	
 	//解除关联小塾
 	@RequestMapping(value="/student/data/del/derver/{vipId}")
@@ -751,8 +774,10 @@ public class ImLibUserController extends BaseController {
 		tbLibImStudentService.untyingTbClassTeacherByVipId(vipId);
 		response.success("成功");
 		return response;
-	}	
-	
+	}
+
+
+
 	//添加关联小塾
 	@RequestMapping(value="/student/data/bind/derver/{vipId}")
 	@ResponseBody
@@ -1133,6 +1158,12 @@ public class ImLibUserController extends BaseController {
 		params.put("libId", libId);
 		params.put("type", type);
 		params.put("name", request.getParameter("name")==null?"":request.getParameter("name"));
+		params.put("sele", request.getParameter("name")==null?"":request.getParameter("name"));
+		String selectIds = request.getParameter("selectIds")==null?"":request.getParameter("selectIds");
+		if(selectIds.endsWith(",")){
+			selectIds = selectIds.substring(0,selectIds.length()-1);
+		}
+		params.put("selectIds",selectIds );
         SplitPage sp = new SplitPage();
         sp.setAction(request.getRequestURI());
         sp.setPageNo(pageNo);
@@ -1161,6 +1192,11 @@ public class ImLibUserController extends BaseController {
 		Map<String, Object> params = new HashMap<String, Object>();
 		params.put("libId", libId);
 		params.put("name", request.getParameter("name")==null?"":request.getParameter("name"));
+		String selectIds = request.getParameter("selectIds")==null?"":request.getParameter("selectIds");
+		if(selectIds.endsWith(",")){
+			selectIds = selectIds.substring(0,selectIds.length()-1);
+		}
+		params.put("selectIds",selectIds );
 		params.put("type", type);
         SplitPage sp = new SplitPage();
         sp.setAction(request.getRequestURI());
@@ -1181,9 +1217,9 @@ public class ImLibUserController extends BaseController {
 	
 	
 	
-	@RequestMapping(value="/teacher/exlist/{libId}")
+	@RequestMapping(value="/teacher/exlist/{libId}/{type}")
     @ResponseBody
-    public void exportTeacher(@PathVariable String libId,HttpServletRequest request, HttpServletResponse response) {  
+    public void exportTeacher(@PathVariable String libId,@PathVariable String type,HttpServletRequest request, HttpServletResponse response) {
     	ServletOutputStream os = null;
     	try { 
     	
@@ -1199,17 +1235,43 @@ public class ImLibUserController extends BaseController {
     		Map<String, Object> params = new HashMap<String, Object>();
     		params.put("libId", libId);
     		params.put("name", request.getParameter("name")==null?"":request.getParameter("name"));
+			String selectIds = request.getParameter("selectIds")==null?"":request.getParameter("selectIds");
+			if(selectIds.endsWith(",")){
+				selectIds = selectIds.substring(0,selectIds.length()-1);
+			}
+			params.put("selectIds",selectIds );
+			params.put("type",type );
             SplitPage sp = new SplitPage();
             sp.setAction(request.getRequestURI());
             sp.setPageNo(1);
             sp.setPageSize(10000);
             sp.setParams(params);
-            Page<Map<String,Object>> page = tbLibImTeacherService.findTeacherByPage(params, initPage(1, 10000, Direction.DESC, new String[]{"create_time"}));
-            
+            Page<Map<String,Object>>  page =  null;
+            if("2".equals(type)||"4".equals(type)){
+            	page = tbLibImTeacherService.findTeacherByPage(params, initPage(1, 10000, Direction.DESC, new String[]{"create_time"}));
+			}else{
+				page = tbLibImTeacherService.findHeadmasterByPage(params, initPage(1, 10000, Direction.DESC, new String[]{"create_time"}));
+			}
  	        List<ExcelColumn> myColumns3 = new ArrayList<ExcelColumn>();
-    		myColumns3.add(new ExcelColumn("老师姓名", "name", 20));
-    		myColumns3.add(new ExcelColumn("所受科目", "course_name", 20));
-    		myColumns3.add(new ExcelColumn("老师电话", "telephone", 20));
+ 	        if("2".equals(type)||"4".equals(type)){
+				myColumns3.add(new ExcelColumn("老师姓名", "name", 20));
+				myColumns3.add(new ExcelColumn("所授科目", "course_name", 20));
+				myColumns3.add(new ExcelColumn("老师电话", "telephone", 20));
+			}else{
+				/**
+				 * <th>老师姓名</th>
+				 * <!-- 		    	<th>学校名称</th> -->
+				 * 		    	<th>老师电话</th>
+				 * 		    	<th>年级</th>
+				 * 		    	<th>班级</th>
+				 */
+				myColumns3.add(new ExcelColumn("老师姓名", "user_name", 20));
+				myColumns3.add(new ExcelColumn("老师电话", "mobile", 20));
+				myColumns3.add(new ExcelColumn("年级", "grade", 20));
+				myColumns3.add(new ExcelColumn("科目", "course_name", 20));
+				myColumns3.add(new ExcelColumn("班级", "class_name", 20));
+			}
+
     		List<Map<String, Object>> list=page.getContent();
 
 	    	CustomizeToExcel.downFile(myColumns3, list, os);
@@ -1227,10 +1289,62 @@ public class ImLibUserController extends BaseController {
     			}  
     		}
     	}
-    } 
-	
-	
-	
+    }
+
+	@RequestMapping(value="/teacher/exlistV2/{libId}")
+	@ResponseBody
+	public void exportTeacherV2(@PathVariable String libId,HttpServletRequest request, HttpServletResponse response) {
+		ServletOutputStream os = null;
+		try {
+			TbLibJoin libJoin=joinService.getById(libId);
+			String libName=libJoin.getLeagueName()+"_老师列表";
+			os = response.getOutputStream(); //获得输出流
+			response.reset();   //清空输出流
+			String fileName = new String(libName.getBytes("gb2312"), "ISO8859-1") +".xlsx";
+			response.setHeader("Content-disposition", "attachment; filename="+ fileName); //设定输出文件头
+			response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+			response.setCharacterEncoding("utf-8");
+
+			Map<String, Object> params = new HashMap<String, Object>();
+			params.put("libId", libId);
+			params.put("name", request.getParameter("name")==null?"":request.getParameter("name"));
+			String selectIds = request.getParameter("selectIds")==null?"":request.getParameter("selectIds");
+			if(selectIds.endsWith(",")){
+				selectIds = selectIds.substring(0,selectIds.length()-1);
+			}
+			params.put("selectIds",selectIds );
+			SplitPage sp = new SplitPage();
+			sp.setAction(request.getRequestURI());
+			sp.setPageNo(1);
+			sp.setPageSize(10000);
+			sp.setParams(params);
+			Page<Map<String,Object>> page = tbLibImTeacherService.findTeacherByPage(params, initPage(1, 10000, Direction.DESC, new String[]{"create_time"}));
+
+			List<ExcelColumn> myColumns3 = new ArrayList<ExcelColumn>();
+			myColumns3.add(new ExcelColumn("老师姓名", "name", 20));
+			myColumns3.add(new ExcelColumn("所授科目", "course_name", 20));
+			myColumns3.add(new ExcelColumn("老师电话", "telephone", 20));
+			List<Map<String, Object>> list=page.getContent();
+
+			CustomizeToExcel.downFile(myColumns3, list, os);
+		}catch (IOException e) {
+			logger.error("异常", e);
+		}catch (Exception e1){
+			logger.error("异常", e1);
+		}finally{
+			if(os != null){
+				try {
+					os.flush();
+					os.close();
+				} catch (IOException e) {
+					logger.error("异常", e);
+				}
+			}
+		}
+	}
+
+
+
 	private void getById(String libId) {
 		// TODO Auto-generated method stub
 		
@@ -1320,17 +1434,91 @@ public class ImLibUserController extends BaseController {
 //			bookManagerService.saveTbLibManagerListStatus(libId,teacherId, new int[]{Constant.LIB_TEACHER_TYPE,
 //	                Constant.ORG_TEACHER_TYPE, Constant.TEACHER_TYPE}, 2);
 //	        tbClassTeacherService.saveTbClassTeacherStatusByLibId(libId, teacherId, 0);
-			
+
 			TbClassTeacher tbClassTeacher=tbClassTeacherService.getTbLibImTeacherByClassIdAndType(classId, teacherId,1);
 			tbClassTeacher.setStatus(0);
 			tbClassTeacherService.save(tbClassTeacher);
-			
-	        response.success("删除成功");
+
+			response.success("删除成功");
 		} catch (Exception e) {
-			 response.failure("删除失败");
+			response.failure("删除失败");
 		}
 		return response;
-	}	
+	}
+
+	//删除老师,解除关联
+	@RequestMapping(value="/teacher/data/del/{libId}/{managerId}")
+	@ResponseBody
+	public Response teacherDel(Model model,@PathVariable String libId,@PathVariable String managerId) {
+		Response response = new  Response();
+		try {
+//			bookManagerService.saveTbLibManagerListStatus(libId,teacherId, new int[]{Constant.LIB_TEACHER_TYPE,
+//	                Constant.ORG_TEACHER_TYPE, Constant.TEACHER_TYPE}, 2);
+//	        tbClassTeacherService.saveTbClassTeacherStatusByLibId(libId, teacherId, 0);
+
+			TbLibManager manager = managerService.getById(managerId);
+			List<TbLibManager> list = managerService.findAllValidTeacherList(manager.getUserId(),new int[]{2,10,15});
+			for(TbLibManager ma :list){
+				libJoinService.libManagerDelete(ma.getId(),ma.getType());
+			}
+			response.success("删除成功");
+		} catch (Exception e) {
+			response.failure("删除失败");
+		}
+		return response;
+	}
+	//批量删除在馆老师
+	@RequestMapping(value="/teacher/data/teacherBatchDel")
+	@ResponseBody
+	public Response teacherDel(Model model) {
+		Response response = new  Response();
+		try {
+			String teacherIds = request.getParameter("teacherIds")==null?"":request.getParameter("teacherIds");
+			if(teacherIds.endsWith(",")){
+				teacherIds = teacherIds.substring(0,teacherIds.length()-1);
+			}
+			String[] dArr = teacherIds.split(",");
+			for(String managerId:dArr){
+				TbLibManager manager = managerService.getById(managerId);
+				List<TbLibManager> list = managerService.findAllValidTeacherList(manager.getUserId(),new int[]{2,10,15});
+				for(TbLibManager ma :list){
+					libJoinService.libManagerDelete(ma.getId(),ma.getType());
+				}
+			}
+			response.success("删除成功");
+		} catch (Exception e) {
+			response.failure("删除失败");
+		}
+		return response;
+	}
+
+	//删除老师,解除关联
+	@RequestMapping(value="/teacher/data/del/batchDelTeacher")
+	@ResponseBody
+	public Response batchDelTeacher(Model model, String libId,String teacherIds,String classIds) {
+		Response response = new  Response();
+		try {
+//			bookManagerService.saveTbLibManagerListStatus(libId,teacherId, new int[]{Constant.LIB_TEACHER_TYPE,
+//	                Constant.ORG_TEACHER_TYPE, Constant.TEACHER_TYPE}, 2);
+//	        tbClassTeacherService.saveTbClassTeacherStatusByLibId(libId, teacherId, 0);
+			if(teacherIds.endsWith(",")){teacherIds.substring(0,teacherIds.length()-1);}
+			String[]  tide = teacherIds.split(",");
+			if(classIds.endsWith(",")){classIds.substring(0,classIds.length()-1);}
+			String[]  cid = classIds.split(",");
+			for(int i = 0; i < tide.length; i++){
+				TbClassTeacher tbClassTeacher=tbClassTeacherService.getTbLibImTeacherByClassIdAndType(cid[i], tide[i],1);
+				tbClassTeacher.setStatus(0);
+				tbClassTeacherService.save(tbClassTeacher);
+			}
+
+
+			response.success("删除成功");
+		} catch (Exception e) {
+			e.printStackTrace();
+			response.failure("删除失败");
+		}
+		return response;
+	}
 	
 	
 	
@@ -1360,8 +1548,30 @@ public class ImLibUserController extends BaseController {
 			 response.failure("删除失败");
 		}
 		return response;
-	}	
-	
+	}
+
+
+	//删除班主任,解除关联
+	@RequestMapping(value="/headmaster/data/del/headmasterBatchDel")
+	@ResponseBody
+	public Response headmasterBatchDel(Model model, String libId,String teacherIds,String classIds) {
+		Response response = new  Response();
+		try {
+			if(teacherIds.endsWith(",")){teacherIds.substring(0,teacherIds.length()-1);}
+			String[]  tide = teacherIds.split(",");
+			if(classIds.endsWith(",")){classIds.substring(0,classIds.length()-1);}
+			String[]  cid = classIds.split(",");
+			for(int i = 0; i < tide.length; i++) {
+				TbClassTeacher tbClassTeacher = tbClassTeacherService.getTbLibImTeacherByClassIdAndType(cid[i], tide[i], 2);
+				tbClassTeacher.setStatus(0);
+				tbClassTeacherService.save(tbClassTeacher);
+			}
+			response.success("删除成功");
+		} catch (Exception e) {
+			response.failure("删除失败");
+		}
+		return response;
+	}
 	
 	//删除班主任,解除关联
 	@RequestMapping(value="/headmaster/data/del/{libId}/{teacherId}/{classId}")
@@ -1544,7 +1754,4 @@ public class ImLibUserController extends BaseController {
 		String text=cell.getStringCellValue()!=null ? String.valueOf(cell.getStringCellValue()):"";
 		return text.trim();
 	}
-
-	
-
 }

+ 82 - 1
src/main/java/com/ssj/sys/controller/SysProblemController.java

@@ -676,6 +676,75 @@ public Response cnAreaSave(HttpServletRequest request,HttpServletResponse respon
 	 response.success("添加成功");
 	 return response;
 }
+
+	@RequestMapping(value = "/cnAreaImport", method = RequestMethod.POST)
+	@ResponseBody
+	public Response cnAreaImport(HttpServletRequest request,HttpServletResponse response2) {
+		Response response = new Response();
+		XSSFWorkbook workbook = null;
+		try {
+			MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+			MultipartFile file = multipartRequest.getFile("file");
+			workbook = new XSSFWorkbook(file.getInputStream());
+			XSSFSheet sheet = workbook.getSheetAt(0);   //读取第一个工作簿
+			Row row = null;
+
+			int startReadLine = 1;
+			//int lastRow = -1;
+			for(int i=startReadLine; i<=sheet.getLastRowNum(); i++) {
+				Thread.sleep(1000);
+				CnArea cnArea= new CnArea();
+				row = sheet.getRow(i);
+				int x = 0;
+				cnArea.setType(4);
+				cnArea.setPy("xx");
+				cnArea.setIsHotcity(0);
+				String city = "";
+				for(Cell c : row) {
+					x = c.getColumnIndex();
+					c.setCellType(Cell.CELL_TYPE_STRING);
+					// Map<String, Integer> isMerge =ReadMergeRegionExcel.isMergedRegion(sheet, i, c.getColumnIndex());
+
+					//判断是否具有合并单元格
+					String rs  = c.getRichStringCellValue().toString().trim();
+					if(x == 0){
+						city = rs;
+					}else if (x==1){
+						String name = cnAreaService.getName(city,rs);
+						cnArea.setUpId(name);
+					}else if (x==2){
+						cnArea.setName(rs);
+					}else if (x==3){
+						cnArea.setSchoolAddress(rs);
+						String url = "https://apis.map.qq.com/ws/geocoder/v1/";
+						Map<String, Object> data = new HashMap<String, Object>();
+						try {
+							data.put("address",rs);
+							data.put("key", "CA5BZ-KRF3J-3RXFX-FUAYV-EUIC7-ADBDK");
+							JSONObject jsonObject = JSONObject.parseObject(HttpRemote.GETMethod(url, data));
+							if(jsonObject.getInteger("status") == 0){  //正常
+								String lat = jsonObject.getJSONObject("result").getJSONObject("location").getString("lat"); //纬度
+								String lng = jsonObject.getJSONObject("result").getJSONObject("location").getString("lng"); //经度
+								cnArea.setSchoolLng(lng);
+								cnArea.setSchoolLat(lat);
+							}
+						} catch (Exception e) {
+							logger.error("异常", e);
+						}
+						cnArea = cnAreaService.save(cnArea);
+					}
+				}
+			}
+		} catch (FileNotFoundException e) {
+			logger.error("异常", e);
+		} catch (Exception e) {
+			logger.error("异常", e);
+		}
+		response.success("添加成功");
+		return response;
+	}
+
+
 /**
  * 
 * 创建人:zhanglin
@@ -1086,6 +1155,12 @@ public String updateviplist(Model model,
 		Map<String, Object> params = new HashMap<String, Object>();
 		//学校名称
 		params.put("name", request.getParameter("name")==null?"":request.getParameter("name"));
+		params.put("id", request.getParameter("id")==null?"":request.getParameter("id"));
+		params.put("grade", request.getParameter("grade")==null?"":request.getParameter("grade"));
+		params.put("subject", request.getParameter("subject")==null?"":request.getParameter("subject"));
+		params.put("version", request.getParameter("version")==null?"":request.getParameter("version"));
+		params.put("year", request.getParameter("year")==null?"":request.getParameter("year"));
+		params.put("semester", request.getParameter("semester")==null?"":request.getParameter("semester"));
 		SplitPage sp = new SplitPage();
 		sp.setAction(request.getRequestURI());
 		sp.setPageNo(pageNo);
@@ -1098,6 +1173,9 @@ public String updateviplist(Model model,
 		model.addAttribute("page", sp);
 		model.addAttribute("search", params);
 		//model.addAttribute("version",SystemResourceLocator.getVersionList());
+		model.addAttribute("grade", sortService.getParamValByCode("grade"));
+		model.addAttribute("zyb_course", sortService.getParamValByCode("zyb_course"));
+		model.addAttribute("versions",SystemResourceLocator.getVersionList());
 		return "sys/school/schoolBookList";
 	}
 
@@ -1166,6 +1244,9 @@ public String updateviplist(Model model,
 		params.put("grade", request.getParameter("grade")==null?"":request.getParameter("grade"));
 		params.put("subject", request.getParameter("subject")==null?"":request.getParameter("subject"));
 		params.put("version", request.getParameter("version")==null?"":request.getParameter("version"));
+		params.put("year", request.getParameter("year")==null?"":request.getParameter("year"));
+		params.put("semester", request.getParameter("semester")==null?"":request.getParameter("semester"));
+		params.put("schoolId", request.getParameter("schoolId")==null?"":request.getParameter("schoolId"));
 		SplitPage sp = new SplitPage();
 		sp.setAction(request.getRequestURI());
 		sp.setPageNo(pageNo);
@@ -1179,7 +1260,7 @@ public String updateviplist(Model model,
 		model.addAttribute("search", params);
 		model.addAttribute("grade", sortService.getParamValByCode("grade"));
 		model.addAttribute("zyb_course", sortService.getParamValByCode("zyb_course"));
-		model.addAttribute("version",SystemResourceLocator.getVersionList());
+		model.addAttribute("versions",SystemResourceLocator.getVersionList());
 		return "sys/school/bookList";
 	}
 

+ 1 - 1
src/main/resources/templates/sys/fx/merchantAdd.html

@@ -732,7 +732,7 @@ function save(){
 		return
 	}
 
-	var title="您确定要保存商户信息?<br/>此动作会把商户塾币覆盖到机构塾币";
+	var title="您确定要保存商户信息?";
 	if(id!=''){
 		title="您确定要保存商户信息?";
 	}

+ 15 - 2
src/main/resources/templates/sys/fx/merchantAllList.html

@@ -358,10 +358,10 @@
 							<a href="javascript:;" th:if="${item.posType==3 && item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'savemerchantsc(\''+${item.id}+'\')'"  	class="tablelink">修改</a>
 						
 							<a href="javascript:;" th:if="${item.status!=1 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'updatemerchant(\''+${item.id}+'\',\'1\')'"   class="tablelink">冻结</a>
-							
+
 							<a href="javascript:;" th:if="${item.libId!='' && item.libId!=null && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'untyingmerchant(\''+${item.id}+'\')'"  	class="tablelink">解绑</a>
 						</di>
-						
+						<a href="javascript:;" th:if="${item.status!=1 && item.libId != null}"  th:onclick="'libServiceXfAdd(\''+${item.id}+'\')'" class="tablelink">续费</a>
 					 </td>  
 			</tr>
 		</tbody>
@@ -978,6 +978,19 @@ $("#button").on('click',function(){
 	$("#seachform").submit();
 	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/merchantAllList.html";
 });
+
+function libServiceXfAdd(id){
+	var title="购买服务包";
+	parent.layer.open({
+		type: 2,
+		title: title,
+		closeBtn: 1, //不显示关闭按钮
+		shift: 0.8,
+		offset: '10%',
+		area: ['1015px', '60%'],
+		content: '[[${sysUrl}]]/sys/fx/merchantMealSelfAdd.html?id='+id
+	});
+}
 </script>
 
 

+ 100 - 23
src/main/resources/templates/sys/imlibuser/headmasterList.html

@@ -26,8 +26,10 @@
 	</ul>
 </div>
 <div class="rightinfo">
-	<form id="seachform" th:action="${sysUrl+'/sys/imlibuser/teacher/list/'+tbLibJoin.id}" method="post">
+	<form id="seachform" th:action="${sysUrl+'/sys/imlibuser/headmaster/list/'+tbLibJoin.id+'/'+search.get('type')}" method="post">
 	  <input type="hidden" name="reportType" id="reportType" />
+	  <input type="hidden" name="type" id="type" th:value="${search.get('type')}" />
+		<input type="hidden" name="selectIds" id="selectIds" />
 		<ul class="seachform">
 			<li>
 			  <input style="width: 250px;" name="name" placeholder="输入老师名称" type="text" class="scinput" th:value="${search.get('name')}"/>
@@ -44,24 +46,30 @@
 		    
 		</ul>
 	</form>
-	
-<!-- 	<ul class="seachform"> -->
-<!-- 	    <li> -->
-<!-- 		  <input type="button" onclick="javascript:teacherAdd();" style="width: 100px;height: 30px"  class="scbtn" value="+ 添加老师" /> -->
-<!-- 	    </li> -->
-<!-- 	      <li> -->
-<!-- 		  	<input type="button" id="exbutton" style="width: 100px;height: 30px;background: #ccc no-repeat center;"  class="scbtn" value="导出老师" /> -->
-<!-- 	     </li> -->
-<!-- 	</ul> -->
+
+	<ul class="seachform">
+
+		<li>
+			<input type="button" id="exbutton" style="width: 100px;height: 30px;background: #ccc no-repeat center;"  class="scbtn" value="导出老师" />
+		</li>
+
+		<li>
+			<ul class="toolbar" id="deletion">
+				<li class="click" onclick="del()"><span><img style="width: 24px;height: 24px" th:src="@{/static/sys/images/select.png}" /></span>批量删除</li>
+			</ul>
+		</li>
+	</ul>
 	
 	
 	<table class="tablelist">
 		<thead>
 		    <tr>
+				<th style="width: 50px;"><input id="basecheckbox"  type="checkbox"></th>
 		    	<th>老师姓名</th>
 <!-- 		    	<th>学校名称</th> -->
 		    	<th>老师电话</th>
 		    	<th>年级</th>
+		    	<th>科目</th>
 		    	<th>班级</th>
 <!-- 		    	<th>是否批改作业</th> -->
 		        <th>操作</th>
@@ -69,10 +77,14 @@
 		</thead>
 		<tbody>
 			<tr th:each="item:${list}" >
+				<td><input name="selectlist" type="checkbox" th:data-id="${item.id}" th:data-cid="${item.cid}" /></td>
+				<input type="hidden" class="id" th:value="${item.id}" />
+				<input type="hidden" class="cid" th:value="${item.cid}" />
 				<td th:text="${item.user_name}"></td>
 <!-- 				<td th:text="${item.school}"></td> -->
 				<td th:text="${item.mobile}"></td>
 				<td th:text="${item.grade}"></td>
+				<td th:text="${item.course_name}"></td>
 				<td th:text="${item.class_name}"></td>
 <!-- 				<td > -->
 <!-- 					<a th:if="${item.is_correct==1}" th:href="${'javascript:teacherIsCorrectSave(''' + item.user_id + ''',0)'}"  class="tablelink" style="color:red">取消批改</a> -->
@@ -98,13 +110,50 @@
 
 <script type="text/javascript">
 $("#exbutton").on('click',function(){
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/imlibuser/teacher/exlist/[[${tbLibJoin.id}]]";
+	var teacherIds="";
+	$.each($('[name=selectlist]'), function () {
+		if ($(this).prop('checked')) {
+			var id= $(this).parent().siblings(".id").val();
+			teacherIds+=id+",";
+		}
+	});
+	$("#selectIds").val(teacherIds);
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/imlibuser/teacher/exlist/[[${tbLibJoin.id}]]/[[${search.get('type')}]]";
 	$("#seachform").submit();
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/imlibuser/teacher/list/[[${tbLibJoin.id}]]";
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/imlibuser/headmaster/list/[[${tbLibJoin.id}]]/[[${search.get('type')}]]";
 });
-</script>
 
-<script type="text/javascript">
+function del(){
+	var teacherIds="";
+	var cids="";
+	$.each($('[name=selectlist]'), function () {
+		if ($(this).prop('checked')) {
+			var id= $(this).parent().siblings(".id").val();
+			var cid= $(this).parent().siblings(".cid").val();
+			teacherIds+=id+",";
+			cids+=cid+",";
+		}
+	});
+	if(teacherIds == ""){
+		parent.layer.msg("请选择老师",{icon:1});
+		return;
+	}
+	var type = '[[${search.get("type")}]]';
+	if(type == "1"){
+		teacherBatchDel(teacherIds,cids);
+	}else{
+		headmasterBatchDel(teacherIds,cids);
+	}
+}
+
+	$("#basecheckbox").bind("click",function(){
+		if($("#basecheckbox").is(':checked')){
+			$("[name='selectlist']").prop("checked",true);
+		}
+		if(!$("#basecheckbox").is(':checked')){
+			$("[name='selectlist']").removeAttr("checked");
+		}
+	});
 	
 	function teacherAdd(){
 		layer.open({
@@ -118,6 +167,42 @@ $("#exbutton").on('click',function(){
 		});
 	}
 
+	function teacherBatchDel(teacherIds,classIds){
+		parent.layer.confirm("您确定要删除科任老师?", {
+			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+		}, function(){
+			var url="[[${sysUrl}]]/sys/imlibuser/teacher/data/del/batchDelTeacher";
+			var params ={'teacherIds':teacherIds,'classIds':classIds,'libId':'[[${tbLibJoin.id}]]'};
+			$.post(url,params,function(data){
+				if(data.meta.success){
+					parent.layer.msg("删除成功",{icon:1});
+					location.reload();
+				}else{
+					parent.layer.msg(data.meta.message,{icon:11});
+				}
+			});
+		});
+	}
+
+	function headmasterBatchDel(teacherIds,classIds){
+		parent.layer.confirm("您确定要删除班主任?", {
+			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+		}, function(){
+			var url="[[${sysUrl}]]/sys/imlibuser/headmaster/data/del/headmasterBatchDel";
+			var params ={'teacherIds':teacherIds,'classIds':classIds,'libId':'[[${tbLibJoin.id}]]'};
+			$.post(url,params,function(data){
+				if(data.meta.success){
+					parent.layer.msg("删除成功",{icon:1});
+					location.reload();
+				}else{
+					parent.layer.msg(data.meta.message,{icon:11});
+				}
+			});
+		});
+	}
+
+
+
 	function teacherDel(teacherId,classId){
 		parent.layer.confirm("您确定要删除科任老师?", {
 			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
@@ -152,12 +237,7 @@ $("#exbutton").on('click',function(){
 			});
 		});
 	}
-	
-	
-	
-	
-	
-	
+
 	
 	function teacherIsCorrectSave(teacherId,isCorrect){
 		var title="";
@@ -182,9 +262,6 @@ $("#exbutton").on('click',function(){
 			});
 		});
 	}
-	
-
-	
 </script>
 
 

+ 7 - 1
src/main/resources/templates/sys/imlibuser/schoolList.html

@@ -138,7 +138,8 @@
 		    	<th style="width: 10%">校长人数</th>
 		    	<th style="width: 10%">科目组长人数</th>
 		    	<th style="width: 10%">班主任人数</th>
-		    	<th style="width: 10%">科任老师人数</th>
+		    	<th style="width: 10%">已分班教师人数</th>
+		    	<th style="width: 10%">校区教师人数</th>
 		    	<th style="width: 10%">学生人数</th>
 		    	<th style="width: 10%">流失学生人数</th>
 <!-- 		        <th style="min-width: 14%">操作</th> -->
@@ -171,6 +172,11 @@
 					</a>
 				</td>
 				<td >
+					<a th:href="${sysUrl+'/sys/imlibuser/teacher/list/'+item.id+'/4'}"  class="tablelink">
+						[[${item.school_teacher_num+' 人'}]]
+					</a>
+				</td>
+				<td >
 					<a th:href="${sysUrl+'/sys/imlibuser/student/list/'+item.id}"  class="tablelink">
 						[[${item.student_num+' 人'}]]
 					</a>

+ 57 - 7
src/main/resources/templates/sys/imlibuser/studentList.html

@@ -39,6 +39,7 @@
 <div class="rightinfo">
 	<form id="seachform" th:action="${sysUrl+'/sys/imlibuser/student/list/'+tbLibJoin.id}" method="post">
 	  <input type="hidden" name="reportType" id="reportType" />
+	  <input type="hidden" name="selectIds" id="selectIds" />
 		<ul class="seachform">
 			<li>
 			  <input style="width: 250px;" name="name" placeholder="输入学生名称" type="text" class="scinput" th:value="${search.get('name')}"/>
@@ -64,22 +65,26 @@
 	      <li>
 		  	<input type="button" id="exbutton" style="width: 100px;height: 30px;background: #ccc no-repeat center;"  class="scbtn" value="导出学生" />
 	     </li>
-	    
-	     <li>
-<!-- 		  <input type="button" onclick="javascript:studentServiceEdit();" style="width: 100px;height: 30px;background: red"  class="scbtn" value="E 批量设置" /> -->
-	    </li>
+
+		<li>
+			<ul class="toolbar">
+				<li class="click"><span><img style="width: 24px;height: 24px" th:src="@{/static/sys/images/select.png}" /></span>批量解除</li>
+			</ul>
+		</li>
 	</ul>
 
 
 	<table class="tablelist">
 		<thead>
 		    <tr>
+				<th style="width: 2%"><input id="basecheckbox"  type="checkbox"></th>
 		    	<th style="width: 5%">学生姓名</th>
 		    	<th style="width: 5%">学校</th>
 		    	<th style="width: 5%">年级</th>
 		    	<th style="width: 5%">家长姓名</th>
 		    	<th style="width: 5%">家长角色</th>
 		    	<th style="width: 5%">家长电话</th>
+		    	<th style="width: 5%">班级</th>
 		    	<th style="width: 5%">小塾号</th>
 <!-- 		    	<th style="width: 6%">(现)服务开始时间</th> -->
 <!-- 		    	<th style="width: 6%">(现)服务结束时间</th> -->
@@ -90,14 +95,17 @@
 		</thead>
 		<tbody>
 			<tr th:each="item:${list}" >
+				<td><input name="selectlist" type="checkbox" th:data-id="${item.id}" /></td>
 				<td th:text="${item.child_name}"></td>
 				<td th:text="${item.school}"></td>
+				<input type="hidden" class="id" th:value="${item.id}" />
 				<td th:text="${item.grade}"></td>
 				<td th:text="${item.parent_name}"></td>
 				<td th:text="${item.parent_role}"></td>
 				<td>
 					<input type="number" th:value="${item.phone}" th:onBlur="'updateSort(\''+${item.id}+'\',\''+${item.phone}+'\',this)'"  class="dfinput" style="width: 160px; height: 30px;"  />
 				</td>
+				<td th:text="${item.class_name}"></td>
 				<td th:text="${item.derver}"></td>
 <!-- 				<td th:text="${item.libVipService.startTime}"></td> -->
 <!-- 				<td th:text="${item.libVipService.endTime}"></td> -->
@@ -174,6 +182,14 @@
 
 <script type="text/javascript">
 $("#exbutton").on('click',function(){
+	var vipIds="";
+	$.each($('[name=selectlist]'), function () {
+		if ($(this).prop('checked')) {
+			var id= $(this).parent().siblings(".id").val();
+			vipIds+=id+",";
+		}
+	});
+	$("#selectIds").val(vipIds);
 	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/imlibuser/student/exlist/[[${tbLibJoin.id}]]";
 	$("#seachform").submit();
 	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/imlibuser/student/list/[[${tbLibJoin.id}]]";
@@ -182,13 +198,30 @@ $("#exbutton").on('click',function(){
 
 <script type="text/javascript">
 
+	$(function(){
+		$('ul.toolbar li.click').click(function () {
+			var vipIds="";
+			$.each($('[name=selectlist]'), function () {
+				if ($(this).prop('checked')) {
+					var id= $(this).parent().siblings(".id").val();
+					vipIds+=id+",";
+				}
+			});
+			if(vipIds == ""){
+				parent.layer.msg("请选择学生",{icon:1});
+				return;
+			}
+			studentDerverDelBatch(vipIds);
+		});
+	})
+
 
 	$("#basecheckbox").bind("click",function(){
 	    if($("#basecheckbox").is(':checked')){
-	       $("[name='checkbox']").prop("checked",true);
+	       $("[name='selectlist']").prop("checked",true);
 	    }
 	    if(!$("#basecheckbox").is(':checked')){
-	       $("[name='checkbox']").removeAttr("checked");
+	       $("[name='selectlist']").removeAttr("checked");
 	    }
 	});
 
@@ -365,7 +398,24 @@ $("#exbutton").on('click',function(){
 		});
 	}
 
-	
+
+	function studentDerverDelBatch(vipIds){
+		parent.layer.confirm("您确定要删除学生关联?<br/>删除后会同步解绑该馆", {
+			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+		}, function(){
+			var url="[[${sysUrl}]]/sys/imlibuser/student/data/del/studentDelBatch";
+			var params ={"vipIds":vipIds};
+			$.post(url,params,function(data){
+				if(data.meta.success){
+					parent.layer.msg("删除成功",{icon:1});
+					location.reload();
+				}else{
+					parent.layer.msg(data.meta.message,{icon:11});
+				}
+			});
+		});
+	}
+
 	function studentDerverDel(vipId){
 		parent.layer.confirm("您确定要解绑学生小塾?", {
 			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮

+ 82 - 16
src/main/resources/templates/sys/imlibuser/teacherList.html

@@ -26,8 +26,10 @@
 	</ul>
 </div>
 <div class="rightinfo">
-	<form id="seachform" th:action="${sysUrl+'/sys/imlibuser/teacher/list/'+tbLibJoin.id}" method="post">
+	<form id="seachform" th:action="${sysUrl+'/sys/imlibuser/teacher/list/'+tbLibJoin.id+'/'+search.get('type')}" method="post">
 	  <input type="hidden" name="reportType" id="reportType" />
+		<input type="hidden" name="type" id="type" th:value="${search.get('type')}" />
+		<input type="hidden" name="selectIds" id="selectIds" />
 		<ul class="seachform">
 			<li>
 			  <input style="width: 250px;" name="name" placeholder="输入老师名称" type="text" class="scinput" th:value="${search.get('name')}"/>
@@ -44,26 +46,29 @@
 		    
 		</ul>
 	</form>
-	
-<!-- 	<ul class="seachform"> -->
-<!-- 	    <li> -->
-<!-- 		  <input type="button" onclick="javascript:teacherAdd();" style="width: 100px;height: 30px"  class="scbtn" value="+ 添加老师" /> -->
-<!-- 	    </li> -->
-	    
-<!-- 	      <li> -->
-<!-- 		  	<input type="button" id="exbutton" style="width: 100px;height: 30px;background: #ccc no-repeat center;"  class="scbtn" value="导出老师" /> -->
-<!-- 	     </li> -->
-	    
-<!-- 	</ul> -->
+
+	<ul class="seachform">
+
+		<li>
+			<input type="button" id="exbutton" style="width: 100px;height: 30px;background: #ccc no-repeat center;"  class="scbtn" value="导出老师" />
+		</li>
+
+		<li>
+			<ul class="toolbar" id="deletion">
+				<li class="click" onclick="del()"><span><img style="width: 24px;height: 24px" th:src="@{/static/sys/images/select.png}" /></span>批量删除</li>
+			</ul>
+		</li>
+	</ul>
 	
 	
 	<table class="tablelist">
 		<thead>
 		    <tr>
+				<th style="width: 50px;"><input id="basecheckbox"  type="checkbox"></th>
 		    	<th>老师姓名</th>
 <!-- 		    	<th>学校名称</th> -->
 <!-- 		    	<th>年级</th> -->
-		    	<th>所科目</th>
+		    	<th>所科目</th>
 		    	<th>老师电话</th>
 <!-- 		    	<th>是否批改作业</th> -->
 		        <th>操作</th>
@@ -71,6 +76,8 @@
 		</thead>
 		<tbody>
 			<tr th:each="item:${list}" >
+				<td><input name="selectlist" type="checkbox" /></td>
+				<input type="hidden" class="id" th:value="${item.id}" />
 				<td th:text="${item.name}"></td>
 <!-- 				<td th:text="${item.school}"></td> -->
 <!-- 				<td th:text="${item.grade}"></td> -->
@@ -83,6 +90,7 @@
 				<td>
 					<a th:if="${search.get('type')=='1'}" th:href="${'javascript:principalDel(''' + item.user_id + ''')'}"  class="tablelink">删除校长</a>
 					<a th:if="${search.get('type')=='2'}" th:href="${'javascript:leaderDel(''' + item.user_id + ''')'}"  class="tablelink">删除科目组长</a>
+					<a th:if="${search.get('type')=='4'}" th:href="${'javascript:teacherDel(''' + item.id + ''')'}"  class="tablelink">删除校区老师</a>
 				</td>
 			</tr>
 		</tbody>
@@ -99,13 +107,46 @@
 
 <script type="text/javascript">
 $("#exbutton").on('click',function(){
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/imlibuser/teacher/exlist/[[${tbLibJoin.id}]]";
+	var teacherIds="";
+	$.each($('[name=selectlist]'), function () {
+		if ($(this).prop('checked')) {
+			var id= $(this).parent().siblings(".id").val();
+			teacherIds+=id+",";
+		}
+	});
+	$("#selectIds").val(teacherIds);
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/imlibuser/teacher/exlist/[[${tbLibJoin.id}]]/[[${search.get('type')}]]";
 	$("#seachform").submit();
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/imlibuser/teacher/list/[[${tbLibJoin.id}]]";
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/imlibuser/teacher/list/[[${tbLibJoin.id}]]/[[${search.get('type')}]]";
 });
 </script>
 
 <script type="text/javascript">
+
+	function del(){
+		var teacherIds="";
+		var cids="";
+		$.each($('[name=selectlist]'), function () {
+			if ($(this).prop('checked')) {
+				var id= $(this).parent().siblings(".id").val();
+				var cid= $(this).parent().siblings(".cid").val();
+				teacherIds+=id+",";
+				cids+=cid+",";
+			}
+		});
+		if(teacherIds == ""){
+			parent.layer.msg("请选择老师",{icon:1});
+			return;
+		}
+		var type = '[[${search.get("type")}]]';
+		if(type == "1"){
+			teacherBatchDel(teacherIds,cids);
+		}else if(type == "2"){
+			headmasterBatchDel(teacherIds,cids);
+		}else if(type == "4"){
+			teacherBatchDel(teacherIds);
+		}
+	}
 	
 	function teacherAdd(){
 		layer.open({
@@ -119,6 +160,24 @@ $("#exbutton").on('click',function(){
 		});
 	}
 
+	function teacherBatchDel(teacherIds){
+		parent.layer.confirm("您确定要删除老师关联?", {
+			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+		}, function(){
+			var url="[[${sysUrl}]]/sys/imlibuser/teacher/data/teacherBatchDel";
+			var params ={'teacherIds':teacherIds};
+			$.post(url,params,function(data){
+				if(data.meta.success){
+					parent.layer.msg("删除成功",{icon:1});
+					location.reload();
+				}else{
+					parent.layer.msg(data.meta.message,{icon:11});
+				}
+			});
+		});
+	}
+
+
 	function teacherDel(teacherId){
 		parent.layer.confirm("您确定要删除老师关联?", {
 			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
@@ -153,7 +212,14 @@ $("#exbutton").on('click',function(){
 			});
 		});
 	}
-	
+	$("#basecheckbox").bind("click",function(){
+		if($("#basecheckbox").is(':checked')){
+			$("[name='selectlist']").prop("checked",true);
+		}
+		if(!$("#basecheckbox").is(':checked')){
+			$("[name='selectlist']").removeAttr("checked");
+		}
+	});
 	
 
 	function leaderDel(teacherId){

+ 1 - 0
src/main/resources/templates/sys/problem/cnArealist.html

@@ -112,6 +112,7 @@
 					<a th:href="@{/sys/problem/areaMerchantList.html(schoolAreaId=${cnArealist.get('id')})}" class="tablelink" >关联商户</a>
 					<a th:href="@{/sys/problem/addcnArea.html(id=${cnArealist.get('id')})}" class="tablelink" >修改</a>
 					<a href="javascript:;"  th:onclick="'deleteById(\''+${cnArealist.get('id')}+'\')'" class="tablelink" >删除</a>
+					<a th:href="@{/sys/problem/schoolBookList.html(id=${cnArealist.get('id')})}" class="tablelink" >关联练习册</a>
 				</td>
 			</tr>
 		</tbody>

+ 58 - 10
src/main/resources/templates/sys/school/bookList.html

@@ -2,7 +2,8 @@
 <head>
 <title>私塾家</title>
 <script th:include="sys/common/metaCSS" th:remove="tag"></script> 
-<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script>
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
 </head>
 <style>
 	.tablelink{margin-right:10px;}
@@ -13,6 +14,7 @@
 <body>
 <div class="rightinfo">
 	<form id="seachform" th:action="@{/sys/problem/bookList.html}" method="post">
+		<input type="hidden" th:value="${search.get('schoolId')}" name="schoolId" id="schoolId">
 	<ul class="seachform">
 		<li>
 			<label>练习册名称</label>
@@ -20,7 +22,7 @@
 		</li>
 		<li>
 			<label>科目</label>
-			<select class="scinput select_width" name="courseName" id="courseName">
+			<select class="scinput select_width" name="subject" id="subject">
 				<option value=""  th:selected="${ search.get('subject') eq '' }"  >全部</option>
 				<option  th:each="sort:${zyb_course}"  th:value="${sort.name}"  th:if="${sort.name ne '总体'}" th:selected="${ search.get('subject')  eq sort.name }" th:text="${sort.name}" ></option>
 			</select>
@@ -33,6 +35,27 @@
 			</select>
 		</li>
 		<li>
+			<label>版本</label>
+			<select class="scinput select_width2" name="version" id="version" >
+				<option value=""    >全部</option>
+				<option th:each="version:${versions['数学'] }"  th:selected="${search.get('version') eq (version.versionType+'') && search.get('subject') eq '数学'}"  th:value="${version.versionType }">[[${version.courseName +':'+version.versionName}]]</option>
+				<option th:each="version:${versions['语文'] }"  th:selected="${search.get('version') eq (version.versionType+'') && search.get('subject') eq '语文'}"  th:value="${version.versionType }">[[${version.courseName +':'+version.versionName}]]</option>
+				<option th:each="version:${versions['英语'] }"  th:selected="${search.get('version') eq (version.versionType+'') && search.get('subject') eq '英语'}"  th:value="${version.versionType }">[[${version.courseName +':'+version.versionName}]]</option>
+			</select>
+		</li>
+		<li>
+			<label>学期</label>
+			<select class="scinput select_width" name="semester">
+				<option value=""  th:selected="${ search.get('semester') eq '' }"  >全部</option>
+				<option value="1" th:selected="${ search.get('semester')  eq '1' }">上学期</option>
+				<option value="2" th:selected="${ search.get('semester')  eq '2' }">下学期</option>
+			</select>
+		</li>
+		<li>
+			<label>年份</label>
+			<input type="text" id="year" name="year"  onclick="WdatePicker({dateFmt: 'yyyy'})" th:value="${search.get('year') }" class="scinput date_width" placeholder="年份">
+		</li>
+		<li>
 			<label>&nbsp;</label>
 			<input type="button" class="scbtn" value="查询" />
 		</li>
@@ -48,7 +71,7 @@
 	<table class="tablelist">
 		<thead>
 		    <tr>
-				<th style="width: 50px;">序号</th>
+				<th style="width: 50px;"><input id="basecheckbox"  type="checkbox"></th>
 				<th>练习册名称</th>
 				<th>科目</th>
 				<th>年级</th>
@@ -81,22 +104,47 @@
 $(function(){
 	$('ul.toolbar li.click').click(function () {
 		var bookIds="";
-		var bookNames="";
+		// var bookNames="";
 		 $.each($('[name=selectlist]'), function () {
 			 if ($(this).prop('checked')) {
 			 var id= $(this).parent().siblings(".id").val();
-			 var bookName= $(this).parent().siblings(".bookName").text();
+			 // var bookName= $(this).parent().siblings(".bookName").text();
 			 bookIds+=id+",";
-			 bookNames+=bookName+",";
+			 // bookNames+=bookName+",";
 			 }
          });
-		 var index = parent.layer.getFrameIndex(window.name);
-		 parent.setBookIdValue(bookIds);
-		 parent.setBookNameValue(bookNames);
-		 parent.layer.close(index);
+		roleFrom(bookIds);
 	 });
 })
+$("#basecheckbox").bind("click",function(){
+	if($("#basecheckbox").is(':checked')){
+		$("[name='selectlist']").prop("checked",true);
+	}
+	if(!$("#basecheckbox").is(':checked')){
+		$("[name='selectlist']").removeAttr("checked");
+	}
+});
+function roleFrom(bookId){
+	var url="[[${sysUrl}]]/sys/problem/bookSave";
+	//取值
+	var params = {'schoolId':$("#schoolId").val(),'bookId':bookId};
+	$.post(url,params,function(data){
+		if(data != null){
+			if(data.meta.success){
+				parent.layer.msg("新增成功",{icon:1});
+				// closeWin();
+			}else{
+				parent.layer.msg(data.meta.message,{icon:11});
+				// closeWin();
+			}
+		}
 
+	});
+}
 
+function closeWin(){
+	parent.location.reload();
+	parent.layer.close(parent.layer.getFrameIndex(window.name));
+}
 </script>
 </html>

+ 55 - 3
src/main/resources/templates/sys/school/schoolBookList.html

@@ -3,6 +3,7 @@
 <title>私塾家</title>
 <script th:include="sys/common/metaCSS" th:remove="tag"></script> 
 <script th:include="sys/common/metaJS" th:remove="tag"></script>
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
 </head>
 <style>
 	.tablelink{margin-right:10px;}
@@ -28,15 +29,51 @@
 	<form id="seachform" th:action="@{/sys/problem/schoolBookList.html}" method="post">
 	<ul class="seachform">
 	<li>
-			<label>学校名字</label>
+			<label>练习册名称</label>
 			<input name="name" type="text" class="scinput" th:value="${search.get('name')}"/>
+			<input type="hidden" name="id" id="id" th:value="${search.get('id')}" />
+		</li>
+		<li>
+			<label>科目</label>
+			<select class="scinput select_width" name="subject" id="subject">
+				<option value=""  th:selected="${ search.get('subject') eq '' }"  >全部</option>
+				<option  th:each="sort:${zyb_course}"  th:value="${sort.name}"  th:if="${sort.name ne '总体'}" th:selected="${ search.get('subject')  eq sort.name }" th:text="${sort.name}" ></option>
+			</select>
+		</li>
+		<li>
+			<label>年级</label>
+			<select class="scinput select_width" name="grade">
+				<option value=""  th:selected="${ search.get('grade') eq '' }"  >全部</option>
+				<option th:value="${list.name}" th:if="${list.aliases ne '0'}" th:each="list:${grade}" th:selected="${ search.get('grade')  eq list.name }" th:text="${list.name}">学前</option>
+			</select>
+		</li>
+		<li>
+			<label>版本</label>
+			<select class="scinput select_width2" name="version" id="version" >
+				<option value=""    >全部</option>
+				<option th:each="version:${versions['数学'] }"  th:selected="${search.get('version') eq (version.versionType+'') && search.get('subject') eq '数学'}"  th:value="${version.versionType }">[[${version.courseName +':'+version.versionName}]]</option>
+				<option th:each="version:${versions['语文'] }"  th:selected="${search.get('version') eq (version.versionType+'') && search.get('subject') eq '语文'}"  th:value="${version.versionType }">[[${version.courseName +':'+version.versionName}]]</option>
+				<option th:each="version:${versions['英语'] }"  th:selected="${search.get('version') eq (version.versionType+'') && search.get('subject') eq '英语'}"  th:value="${version.versionType }">[[${version.courseName +':'+version.versionName}]]</option>
+			</select>
+		</li>
+		<li>
+			<label>学期</label>
+			<select class="scinput select_width" name="semester">
+				<option value=""  th:selected="${ search.get('semester') eq '' }"  >全部</option>
+				<option value="1" th:selected="${ search.get('semester')  eq '1' }">上学期</option>
+				<option value="2" th:selected="${ search.get('semester')  eq '2' }">下学期</option>
+			</select>
+		</li>
+		<li>
+			<label>年份</label>
+			<input type="text" id="year" name="year"  onclick="WdatePicker({dateFmt: 'yyyy'})" th:value="${search.get('year') }" class="scinput date_width" placeholder="年份">
 		</li>
 		<li>
 			<input type="button" class="scbtn" value="查询" />
 		</li>
 		<li>
 			<ul class="toolbar">
-				<a th:href="@{/sys/problem/schoolBookAdd.html}"><li class="click"><span><img th:src="@{/static/sys/images/t01.png}" /></span>添加</li></a>
+				<a href="javascript:;" onclick="funcblurschooltext()" ><li class="click"><span><img th:src="@{/static/sys/images/t01.png}" /></span>添加</li></a>
 			</ul>
 		</li>
 	</ul>
@@ -85,7 +122,7 @@ function deleteById(id){
 			{icon: 4, btn: ['确定','取消']
 			}, function(){
 				$.ajax({
-					url: '[[${sysUrl}]]/sys/problem/banbenDelete',
+					url: '[[${sysUrl}]]/sys/problem/bookDelete',
 					type: "post",
 					data:{
 						'id': id
@@ -105,4 +142,19 @@ function deleteById(id){
 				});
 			});
 }
+
+function funcblurschooltext(){
+	layer.open({
+		type: 2,
+		title: '选择练习册',
+		closeBtn: 1, //不显示关闭按钮
+		shift: 0.8,
+		offset: '150px',
+		area: ['80%', '60%'],
+		content: "[[${sysUrl}]]/sys/problem/bookList?schoolId="+$("#id").val(),
+		end: function () {//无论是确认还是取消,只要层被销毁了,end都会执行,不携带任何参数。layer.open关闭事件
+			location.reload();  //layer.open关闭刷新
+		}
+	});
+}
 </script>

+ 2 - 0
src/main/resources/templates/sys/termtrainQuestion/termtrainQuestionList.html

@@ -42,6 +42,7 @@
     <table class="tablelist">
         <thead>
         <tr>
+            <th>真题类型</th>
             <th>科目</th>
             <th>年级</th>
             <th>版本</th>
@@ -56,6 +57,7 @@
         </thead>
         <tbody>
         <tr th:each="item:${list}" >
+            <td th:text="${item.type}" ></td>
             <td th:text="${item.courseName}" ></td>
             <td th:text="${item.grade}" ></td>
             <td th:text="${item.bookName}" ></td>