瀏覽代碼

流失学生删除,重启服务

shenhao 4 年之前
父節點
當前提交
af5d8ebc1c

+ 2 - 1
src/main/java/com/ssj/dao/sys/imlibuser/dao/TbClassQueryDao.java

@@ -68,6 +68,7 @@ public interface TbClassQueryDao {
 	  * @return
 	  */
 	 Page<Map<String, Object>> findClassByPage(Map<String, Object> searchParam, Pageable pageable);
-	 
 
+
+	Page<Map<String, Object>> findInvalidStudentByPage(Map<String, Object> params, Pageable initPage);
 }

+ 32 - 0
src/main/java/com/ssj/dao/sys/imlibuser/dao/TbClassStudentDao.java

@@ -48,6 +48,38 @@ public interface TbClassStudentDao extends JpaRepository<TbClassStudent, String>
 	@Query(nativeQuery = true, value = "SELECT vip_id from tb_class_student where status=1 and class_id in ?1")
 	List<String> findByClassIds(List<String> classIds);
 
+	@Query(nativeQuery = true, value = "SELECT count(1) from tb_lib_bind_audit where status=?2 and vip_id = ?1")
+	int findCountByVipIdAndStatus(String id, int i);
+	@Query(nativeQuery = true, value = "SELECT count(1) from tb_lib_vip_service where vip_id = ?1 and ((type not in ('C024','C025') and lib_id=?2) or lib_id<>?2) and stat=1 ")
+	int findServiceNotAny(String vipId,String libId);
 
+	@Modifying
+	@Query(nativeQuery = true,value = "delete  from  tb_lib_vip_service  where vip_id=?1 and lib_id=?2 and type  in ('C024','C025') ")
+	void delVipServiceData(String vipId, String libId);
+
+	@Modifying
+	@Query(nativeQuery = true,value = "delete from tb_class_student  where vip_id=?1 and lib_id=?2")
+	void delStudentData(String vipId, String libId);
+
+	@Query(nativeQuery = true, value = "select t1.class_id\n" +
+			"    from tb_class_student t1,\n" +
+			"         tb_class t2\n" +
+			"    where 1 = 1\n" +
+			"      and t1.vip_id = ?1\n" +
+			"      and t1.lib_id = ?2\n" +
+			"      and t1.status = 2\n" +
+			"      and t2.status = 1\n" +
+			"      and t1.class_id = t2.id\n" +
+			"    order by t1.create_time desc\n" +
+			"    limit 1")
+	String findRecentOwnedClassId(String vipId, String libId);
 
+	@Modifying
+	@Query(nativeQuery = true,value = "update tb_class_student\n" +
+			"set status=1\n" +
+			"where vip_id = ?1\n" +
+			"  and lib_id = ?2\n" +
+			"  and class_id = ?3\n" +
+			"  and status = 2")
+	void updateStatusByVipIdAndLibId(String vipId, String libId, String classId);
 }

+ 28 - 1
src/main/java/com/ssj/dao/sys/imlibuser/dao/impl/TbClassQueryDaoImpl.java

@@ -25,6 +25,7 @@ public class TbClassQueryDaoImpl implements TbClassQueryDao {
 		List<Object> queryParams = new ArrayList<Object>();
 		selSql.append(" SELECT t.*    ");
 		selSql.append(" ,( SELECT COUNT(DISTINCT(v.id)) from tb_lib_vip v  where v.stat=1 AND v.lib_id=t.id  ) as student_num     ");
+		selSql.append(" ,( select COUNT(DISTINCT(t11.id)) from tb_lib_vip_service t12 join tb_lib_vip t11 on t12.vip_id = t11.id where t12.lib_id=t.id and t12.type in('C024','C025') and t12.species='S003' and t12.stat=2 ) as invalid_student_num     ");
 		selSql.append(" ,( SELECT COUNT(a.teacher_id) from tb_class_teacher a  where a.status=1 and a.type=1 AND a.lib_id=t.id ) as teacher_num    ");
 		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    ");
@@ -206,7 +207,33 @@ public class TbClassQueryDaoImpl implements TbClassQueryDao {
 		return dao.findPage(selSql.toString(),queryParams.toArray(), pageable);
 	}
 
-
+	@Override
+	public Page<Map<String, Object>> findInvalidStudentByPage(Map<String, Object> params, Pageable initPage) {
+		StringBuffer selSql = new StringBuffer();
+		List<Object> queryParams = new ArrayList<Object>();
+		selSql.append("select t2.parent_role,t2.parent_name,t.class_name ,t.id class_id, t2.id,t2.child_name ,t2.img_url ,t2.grade,t2.sex,t2.school,IF(t3.mobile is null,t2.phone,t3.mobile) phone\n");
+		selSql.append(" from tb_lib_vip t2 \n");
+		selSql.append(" left join (select tc.class_name,tc.id,tcs.vip_id\n");
+		selSql.append(" from tb_class_student tcs,tb_class tc\n");
+		selSql.append(" where tcs.status in (1,2)\n");
+		selSql.append(" and tcs.lib_id=?\n");
+		selSql.append(" and tc.status=1\n");
+		selSql.append(" and tcs.class_id=tc.id\n");
+		selSql.append(" ) t on t2.id=t.vip_id\n");
+		selSql.append(" left join tb_user t3 on t2.user_id=t3.id\n");
+		selSql.append(" left join (select lib_id, vip_id, min(stat) stat from tb_lib_vip_service where lib_id=? and type in('C024','C025') and stat=2 and species='S003' group by lib_id,vip_id) t4\n");
+		selSql.append(" on t2.id = t4.vip_id\n");
+		selSql.append(" where 1=1\n");
+		selSql.append(" and t4.lib_id=?\n");
+		queryParams.add(params.get("libId"));
+		queryParams.add(params.get("libId"));
+		queryParams.add(params.get("libId"));
+		if(!"".equals(params.get("name"))){
+			selSql.append(" AND t2.child_name LIKE  CONCAT('%',?,'%')   ");
+			queryParams.add(params.get("name"));
+		}
+		return dao.findPage(selSql.toString(),queryParams.toArray(), initPage);
+	}
 
 
 }

+ 24 - 0
src/main/java/com/ssj/service/sys/imlibuser/service/TbClassStudentService.java

@@ -1,5 +1,6 @@
 package com.ssj.service.sys.imlibuser.service;
 
+import com.ssj.bean.common.framework.core.domain.Response;
 import com.ssj.bean.sys.imlibuser.TbClassStudent;
 import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
 import com.ssj.framework.core.common.service.BaseService;
@@ -73,4 +74,27 @@ public interface TbClassStudentService extends BaseService<TbClassStudent, Strin
 	 */
 	TbClassStudent findByVipIdAndLibId(String vipId,String libId);
 
+	/**
+	 * 查询失效的学生
+	 * @param params
+	 * @param initPage
+	 * @return
+	 */
+    Page<Map<String, Object>> findInvalidStudentByPage(Map<String, Object> params, Pageable initPage);
+
+	/**
+	 * 删除学生
+	 * @param libId
+	 * @param vipId
+	 * @return
+	 */
+	Response delStudent(String libId, String vipId);
+
+	/**
+	 * 重启服务
+	 * @param libId
+	 * @param vipId
+	 * @return
+	 */
+	Response addChildBack(String libId, String vipId) throws Exception;
 }

+ 93 - 0
src/main/java/com/ssj/service/sys/imlibuser/service/impl/TbClassStudentServiceImpl.java

@@ -1,14 +1,20 @@
 package com.ssj.service.sys.imlibuser.service.impl;
 
+import com.ssj.bean.common.framework.core.domain.Response;
+import com.ssj.bean.curator.TbLibBindAudit;
 import com.ssj.bean.sys.imlibuser.TbClassStudent;
 import com.ssj.bean.weixin.libmy.domain.LibVip;
 import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
 import com.ssj.dao.sys.imlibuser.dao.TbClassQueryDao;
 import com.ssj.dao.sys.imlibuser.dao.TbClassStudentDao;
 import com.ssj.framework.core.common.service.BaseServiceImpl;
+import com.ssj.framework.core.util.StringUtil;
 import com.ssj.service.conch.conch.service.ConchDerverService;
 import com.ssj.service.sys.imlibuser.service.TbClassStudentService;
+import com.ssj.service.weixin.library.service.ILibJoinService;
 import com.ssj.service.weixin.library.service.ILibVipService;
+import com.ssj.service.weixin.sales.service.LibVipServiceService;
+import com.ssj.service.weixin.user.service.UserService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -19,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 @Service
 @Transactional
@@ -35,6 +42,15 @@ public class TbClassStudentServiceImpl extends BaseServiceImpl<TbClassStudent, S
 	
 	@Autowired
 	private ILibVipService vipService;
+
+	@Autowired
+	private UserService userService;
+
+	@Autowired
+	private ILibJoinService joinService;
+
+	@Autowired
+	private LibVipServiceService vipServiceService;
 	
 	
 	
@@ -123,4 +139,81 @@ public class TbClassStudentServiceImpl extends BaseServiceImpl<TbClassStudent, S
 	 return 	dao.findByVipIdAndLibId(vipId,libId);
 	}
 
+	@Override
+	public Page<Map<String, Object>> findInvalidStudentByPage(Map<String, Object> params, Pageable initPage) {
+		return queryDao.findInvalidStudentByPage(params,initPage);
+	}
+
+	@Override
+	public Response delStudent(String libId, String vipId) {
+		//先检查数据是否可以删除
+		LibVip vip = vipService.getById(vipId);
+		Response response = new Response();
+//		check(vip,response);
+//		if(!response.getMeta().isSuccess()){
+//			return  response;
+//		}
+		//查询vipId 是否有S003,'C024','C025'外的服务
+        int count = dao.findServiceNotAny(vipId,libId);
+		if(count==0){
+			//删除user表数据
+			if(StringUtils.isNotBlank(vip.getChildUserId())){
+				userService.delete(vip.getChildUserId());
+			}
+			//删除vip表数据 ?
+			vipService.delete(vipId);
+		}
+		//删除service表数据S003,'C024','C025'
+		dao.delVipServiceData(vipId,libId);
+		//删除student表数据
+		dao.delStudentData(vipId,libId);
+		return response.success();
+	}
+
+	@Override
+	public Response addChildBack(String libId, String vipId)  throws Exception{
+		LibVip libVip = vipService.getById(vipId);
+		Response response = new Response();
+		if (StringUtil.isBlank(libVip.getUserId())) {
+			return response.failure("此学⽣已被删除,执行失败");
+		}
+		check(libVip,response);
+		TbLibJoin libJoin =joinService.getById(libId);
+		//已经升级新服务了
+		if (libJoin.getSignType() != null && !Objects.equals(libJoin.getSignType(), 0)) {
+			int studentNum = vipService.countByLibId(libId);
+			if (studentNum > libJoin.getLibService()) {
+				return response.failure("校区⼈数达到上限,重启失败");
+			}
+			//添加校区批改服务
+			vipServiceService.insertLibServiceV1(vipId, libId);
+		}else {
+			//添加校区批改服务
+			vipServiceService.insertLibCorrectService(vipId, libId);
+		}
+		libVip.setLibId(libId);
+		vipService.save(libVip);
+		//还原原来所在班级
+		//最近所在的班级
+		String classId = dao.findRecentOwnedClassId(vipId, libId);
+		if (StringUtil.isNotBlank(classId)) {
+			//更新为有效
+			dao.updateStatusByVipIdAndLibId(vipId, libId, classId);
+		}
+		return response;
+	}
+
+	private Response check(LibVip libVip,Response response){
+		if (StringUtil.isNotBlank(libVip.getLibId())) {
+			return response.failure("此学⽣已绑定其他校区,执行失败");
+		}
+
+		int count = dao.findCountByVipIdAndStatus(libVip.getId(), 1);
+		if (count >0) {
+			return response.failure("此学⽣已在校区绑定审核中,执行失败");
+		}
+		response.success();
+		return response;
+	}
+
 }

+ 4 - 1
src/main/java/com/ssj/service/weixin/sales/service/LibVipServiceService.java

@@ -640,5 +640,8 @@ public interface LibVipServiceService extends BaseService<LibVipService, String>
     public void insertLibServiceByType(String vipId, String libId, Date endDate, int signType);
     
     public void insertLibCorrectServiceByType(String vipId, String libId, Date endDate, int signType);
-    
+
+	void insertLibServiceV1(String vipId, String libId) throws Exception;
+
+	void insertLibCorrectService(String vipId, String libId);
 }

+ 81 - 2
src/main/java/com/ssj/service/weixin/sales/service/impl/LibVipServiceServiceImpl.java

@@ -10,6 +10,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
+import com.ssj.api.controller.ApiMerchantController;
+import com.ssj.api.domain.vo.merchant.ServiceVo;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 import org.slf4j.Logger;
@@ -125,6 +127,9 @@ public class LibVipServiceServiceImpl extends BaseServiceImpl<LibVipService, Str
 	private GiveRecordService giveRecordService;
 	@Autowired
 	private MerchantService merchantService;
+
+	@Autowired
+	private ApiMerchantController apiMerchantController;
 	@Override
 	public PagingAndSortingRepository<LibVipService, String> getDao() {
 		return libVipServiceDao;
@@ -1717,9 +1722,83 @@ public class LibVipServiceServiceImpl extends BaseServiceImpl<LibVipService, Str
             //老套餐,直接给永久服务
             this.insertLibCorrectService(vipId, libId, DateUtil.parse_yyyyMMdd("9999-01-01"));
         }
-    }   
+    }
 
-    /**
+	@Override
+	public void insertLibServiceV1(String vipId, String libId) throws Exception{
+		//查询这个馆下有没有有效的服务
+		int type = this.findValidTopService(vipId, "S003", 2) != null ? 2 : 1;
+		//查询这个服务是否有效
+		ServiceVo vo = new ServiceVo();
+		vo.setLibId(libId);
+		vo.setType(type);
+		ResponseEntity entity = apiMerchantController.service(vo);
+		if(!"999".equals(entity.getCode())){
+			throw new Exception();
+		}
+		Map<String, Object> data =(Map<String, Object>) entity.getData();
+		Date endDate = null;
+		String endSignTime = (String) data.get("endSummaryTime");
+		if (StringUtil.isNotBlank(endSignTime)) {
+			endDate = DateHelper.parseDate(endSignTime, "yyyy-MM-dd");
+		}
+		Date now = new Date();
+		//是否期满
+		boolean expired = false;
+		if (!DateHelper.compareTwoDate(now, endDate)) {
+			expired = true;
+		}
+		//之前的校区服务
+		LibVipService libVipService = libVipServiceDao.findTopByVipIdAndLibIdAndSpeciesAndTypeOrderByCreateTimeDesc(vipId, libId, "S003", "C024");
+		if (libVipService == null) {
+			libVipService = new LibVipService();
+			libVipService.setVipId(vipId);
+			libVipService.setLibId(libId);
+			libVipService.setStartTime(now);
+			libVipService.setEndTime(endDate);
+			libVipService.setSpecies("S003");
+			libVipService.setType("C024");
+			libVipService.setCreateTime(now);
+			//为校区服务
+			libVipService.setCorrectType(2);
+			//排所有服务优先级第3
+			libVipService.setServiceSort(3);
+		}
+		if (expired) {
+			//期满,设置为失效
+			libVipService.setStat(2);
+		} else {
+			libVipService.setStat(1);
+		}
+		this.save(libVipService);
+	}
+
+	@Override
+	public void insertLibCorrectService(String vipId, String libId) {
+		Date now = new Date();
+		//之前的校区批改服务
+		LibVipService libVipService = libVipServiceDao.findTopByVipIdAndLibIdAndSpeciesAndTypeOrderByCreateTimeDesc(vipId, libId, "S003", "C025");
+		if (libVipService == null) {
+			libVipService = new LibVipService();
+			libVipService.setVipId(vipId);
+			libVipService.setLibId(libId);
+			libVipService.setStartTime(now);
+			libVipService.setEndTime(DateUtil.parse_yyyyMMdd("9999-01-01"));
+			libVipService.setStat(1);
+			libVipService.setSpecies("S003");
+			libVipService.setType("C025");
+			libVipService.setCreateTime(now);
+			//为校区批改服务
+			libVipService.setCorrectType(5);
+			//排所有服务优先级第4
+			libVipService.setServiceSort(4);
+		} else {
+			libVipService.setStat(1);
+		}
+		this.save(libVipService);
+	}
+
+	/**
      * 获取馆服务的结束时间
      *
      * @param vipId

+ 50 - 0
src/main/java/com/ssj/sys/controller/ImLibUserController.java

@@ -380,6 +380,56 @@ public class ImLibUserController extends BaseController {
 		model.addAttribute("tbLibJoin", tbLibJoin);
 		return "sys/imlibuser/studentList";
 	}
+	//流失学生列表
+	@RequestMapping(value="/invalidStudent/list/{libId}")
+	public String invalidStudent(Model model,@PathVariable String libId,
+            @RequestParam(required = false, defaultValue = "10") int pageSize,
+            @RequestParam(required = false, defaultValue = "1") int pageNo) {
+
+		Map<String, Object> params = new HashMap<String, Object>();
+		params.put("libId", libId);
+		params.put("name", request.getParameter("name")==null?"":request.getParameter("name"));
+        SplitPage sp = new SplitPage();
+        sp.setAction(request.getRequestURI());
+        sp.setPageNo(pageNo);
+        sp.setPageSize(pageSize);
+        sp.setParams(params);
+        Page<Map<String,Object>> page = tbLibImStudentService.findInvalidStudentByPage(params, initPage(pageNo, pageSize));
+        sp.setRowCnt((int) page.getTotalElements());
+        model.addAttribute("list", page.getContent());
+        model.addAttribute("listNavigatHtml", sp.getSysPaginHtml());
+        model.addAttribute("page", sp);
+        model.addAttribute("search", params);
+
+		TbLibJoin tbLibJoin=joinService.getById(libId);
+		model.addAttribute("tbLibJoin", tbLibJoin);
+		return "sys/imlibuser/invalidStudentList";
+	}
+
+	@RequestMapping(value = "/student/addChildBack", method = RequestMethod.POST)
+	@ResponseBody
+	public Response addChildBack(String libId, String vipId){
+		Response response = new Response();
+		try {
+			response = tbLibImStudentService.addChildBack(libId,vipId);
+		}catch (Exception e){
+			response.failure("重启学生服务失败");
+		}
+
+		return  response;
+	}
+	@RequestMapping(value = "/student/delStudent", method = RequestMethod.POST)
+	@ResponseBody
+	public Response delStudent(String libId, String vipId){
+		Response response = new Response();
+		try {
+			response = tbLibImStudentService.delStudent(libId,vipId);
+		}catch (Exception e){
+			response.failure("删除学生发生异常");
+		}
+
+		return  response;
+	}
 
 	@RequestMapping(value = "/updateSortNo", method = RequestMethod.POST)
 	@ResponseBody

+ 183 - 0
src/main/resources/templates/sys/imlibuser/invalidStudentList.html

@@ -0,0 +1,183 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<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;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+   .select1{
+  		    width:100%;
+	    height: 32px;
+	    line-height: 32px;
+	    border-top: solid 1px #a7b5bc;
+	    border-left: solid 1px #a7b5bc;
+	    border-right: solid 1px #ced9df;
+	    border-bottom: solid 1px #ced9df;
+	    opacity:1;
+        margin-bottom: 10px;
+   	}
+</style>
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a th:href="@{/sys/imlibuser/school/list}">导入老师/学生</a></li>
+		<li><a href="#">流失学生列表</a></li>
+	</ul>
+</div>
+<div class="rightinfo">
+	<form id="seachform" th:action="${sysUrl+'/sys/imlibuser/invalidStudent/list/'+tbLibJoin.id}" method="post">
+	  <input type="hidden" name="reportType" id="reportType" />
+		<ul class="seachform">
+			<li>
+			  <input style="width: 250px;" name="name" placeholder="输入学生名称" type="text" class="scinput" th:value="${search.get('name')}"/>
+		    </li>
+		    <li>
+			  <input type="button" class="scbtn" value="查询" />
+		    </li>
+		    <li style="line-height: 35px;">
+		    	<span style="font-size: 15px;color: red" th:text="${tbLibJoin.leagueName} "></span> 
+		    </li>
+		      <li style="line-height: 35px;">
+		    	<a th:href="${sysUrl+'/sys/imlibuser/school/list'}">返回上一级</a> 
+		    </li>
+		    
+		</ul>
+	</form>
+	
+	<ul class="seachform">
+<!-- 	    <li> -->
+<!-- 		  <input type="button" onclick="javascript:studentAdd();" 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>-->
+	    
+	     <li>
+<!-- 		  <input type="button" onclick="javascript:studentServiceEdit();" style="width: 100px;height: 30px;background: red"  class="scbtn" value="E 批量设置" /> -->
+	    </li>
+	</ul>
+
+
+	<table class="tablelist">
+		<thead>
+		    <tr>
+		    	<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> -->
+<!-- 		    	<th style="width: 6%">(现)批改方式</th> -->
+		        <th style="width: 10%">操作</th>
+		    </tr> 
+		</thead>
+		<tbody>
+			<tr th:each="item:${list}" >
+				<td th:text="${item.child_name}"></td>
+				<td th:text="${item.school}"></td>
+				<td th:text="${item.grade}"></td>
+				<td th:text="${item.parent_name}"></td>
+				<td th:text="${item.parent_role}"></td>
+				<td th:text="${item.phone}"></td>
+				<td th:text="${item.class_name}"></td>
+<!-- 				<td th:text="${item.libVipService.startTime}"></td> -->
+<!-- 				<td th:text="${item.libVipService.endTime}"></td> -->
+<!-- 				<td th:text="${item.libVipService.startTime ==null ? '无服务' : (item.libVipService.species eq 'S999' ? '内部用户' :(item.libVipService.correctType==1 ? '平台批改' :  item.libVipService.correctType==2 ? '机构自批改' : item.libVipService.correctType==3 ? '家长自批改' : '平台批改'))}"></td> -->
+				<td>
+<!-- 					<a th:href="${'javascript:studentServiceAdd('''+item.id+''')'}"  class="tablelink">添加服务</a> -->
+					<a th:href="${'javascript:addBack('''+item.id+''','''+tbLibJoin.id+''')'}"  class="tablelink">重启服务</a>
+					<a th:href="${'javascript:studentDel('''+item.id+''','''+tbLibJoin.id+''')'}"  class="tablelink">删除</a>
+				</td>
+			</tr>
+		</tbody>
+	</table>
+
+
+	<!-- 分页 -->
+	<div class="pagin">
+    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录,当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
+    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
+   	</div>
+</div>
+</body>
+
+<script type="text/javascript">
+
+
+	$("#basecheckbox").bind("click",function(){
+	    if($("#basecheckbox").is(':checked')){
+	       $("[name='checkbox']").prop("checked",true);
+	    }
+	    if(!$("#basecheckbox").is(':checked')){
+	       $("[name='checkbox']").removeAttr("checked");
+	    }
+	});
+
+	function closeWin(){
+		parent.layer.closeAll();
+		layer.closeAll();
+	}
+	
+	
+	function addBack(vipId,libId){
+		parent.layer.confirm("您确定要重启学生服务吗?",
+				{
+				icon: 4, 
+				btn: ['确定','关闭'],
+				offset: '150px' //按钮
+		}, function(){
+			var url="[[${sysUrl}]]/sys/imlibuser//student/addChildBack";
+			var params ={"vipId":vipId,"libId":libId};
+			$.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 studentDel(vipId,libId){
+		parent.layer.confirm("您确定要删除学生?", {
+			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+		}, function(){
+			var url="[[${sysUrl}]]/sys/imlibuser/student/delStudent";
+			var params ={"vipId":vipId,"libId":libId};
+			$.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});
+				}
+			});
+		});
+	}
+	
+	
+	
+
+	
+</script>
+
+
+</html>

+ 6 - 3
src/main/resources/templates/sys/imlibuser/schoolList.html

@@ -119,13 +119,14 @@
 		    <tr>
 		    	<th style="min-width: 20%">校区 </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="width: 10%">科任老师人数</th>
 		    	<th style="width: 10%">学生人数</th>
+		    	<th style="width: 10%">流失学生人数</th>
 <!-- 		        <th style="min-width: 14%">操作</th> -->
 		    </tr> 
 		</thead>
@@ -133,7 +134,7 @@
 			<tr th:each="item:${list}" th:style="${item.principal_num>0 || item.teacher_num>0 || item.student_num>0 ? 'color:red' : '' }">
 				<td onclick="copyContent(this);"  th:text="${item.league_name}"></td>
 				<td th:text="${item.lib_service+' 个'}"></td>
-				<td th:text="${item.platform_service+' 个'}"></td>
+<!--				<td th:text="${item.platform_service+' 个'}"></td>-->
 				<td th:text="${item.port_num+' 个'}"></td>
 				<td >
 					<a th:href="${sysUrl+'/sys/imlibuser/teacher/list/'+item.id+'/1'}"  class="tablelink">
@@ -161,7 +162,9 @@
 					</a>
 				</td>
 				<td>
-				
+					<a th:href="${sysUrl+'/sys/imlibuser/invalidStudent/list/'+item.id}"  class="tablelink">
+						[[${item.invalid_student_num+' 人'}]]
+					</a>
 				</td>
 			</tr>
 		</tbody>

+ 3 - 3
src/main/resources/templates/sys/org/edit.html

@@ -26,15 +26,15 @@
 			</li>
 			<li>
 				<label>编码<b>*</b></label>
-				<input type="text" name="code" th:value="${org.code}" class="dfinput" disabled/>
+				<input type="text" name="code" th:value="${org.code}" class="dfinput" th:disabled="${org.id}" />
 			</li>
 			<li>
 				<label>地区<b>*</b></label>
-				<input type="text" name="area" th:value="${org.area}" class="dfinput" disabled/>
+				<input type="text" name="area" th:value="${org.area}" class="dfinput" th:disabled="${org.id}"/>
 			</li>
 			<li>
 				<label>排序号</label>
-				<input type="number" name="sortNo" th:value="${org.sortNo}" class="dfinput" disabled/>
+				<input type="number" name="sortNo" th:value="${org.sortNo}" class="dfinput" th:disabled="${org.id}"/>
 			</li>
 			<li>
 				<label>&nbsp;</label>