|
@@ -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();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|