Commit 05dfd5ca39604e87d0d2f4485149c9070707997e

Authored by jack
2 parents 5361dc04 7d79f4b6

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

WebRoot/WEB-INF/jsp/sunvote/admin/admin_main.jsp
... ... @@ -348,7 +348,7 @@
348 348 }
349 349  
350 350 function monitor(school_id){
351   - var path = "../headmaster/list.do?school_id=" + school_id ;
  351 + var path = "../headmaster/listcs.do?school_id=" + school_id ;
352 352 $("#mainFrame").attr('src',path);
353 353 window.top.loading.show();
354 354 }
... ...
WebRoot/WEB-INF/jsp/sunvote/headmaster/headmaster_edit2.jsp 0 → 100644
  1 +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2 +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  3 +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  4 +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  5 +<%
  6 + String path = request.getContextPath();
  7 + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  8 +%>
  9 +<!DOCTYPE html>
  10 +<html lang="en">
  11 + <head>
  12 + <base href="<%=basePath%>">
  13 + <!-- 下拉框 -->
  14 + <link rel="stylesheet" href="static/ace/css/chosen.css" />
  15 + <!-- jsp文件头和头部 -->
  16 + <%@ include file="../../system/index/top.jsp"%>
  17 + <!-- 日期框 -->
  18 + <link rel="stylesheet" href="static/ace/css/datepicker.css" />
  19 + <!-- 编辑页样式覆盖 -->
  20 + <link rel="stylesheet" href="static/css/edit.css" />
  21 +</head>
  22 +<body class="no-skin">
  23 +<!-- /section:basics/navbar.layout -->
  24 +<div class="main-container" id="main-container">
  25 + <!-- /section:basics/sidebar -->
  26 + <div class="main-content">
  27 + <div class="main-content-inner">
  28 + <div class="page-content">
  29 + <div class="row">
  30 + <div class="col-xs-12">
  31 +
  32 + <form action="headmaster/${msg }.do" name="Form" id="Form" method="post">
  33 + <input type="hidden" name="HEADMASTER_ID" id="HEADMASTER_ID" value="${pd.HEADMASTER_ID}"/>
  34 + <div id="zhongxin" style="padding-top: 13px;">
  35 + <table id="table_report" class="table">
  36 + <tr>
  37 + <td style="width:75px;text-align: right;padding-top: 13px;">班级:</td>
  38 + <td>
  39 + <select class="chosen-select form-control" name="CLASS_ID" id="CLASS_ID" disabled="disabled" data-placeholder="这里输入所属学校">
  40 + <c:forEach var="item" items="${classes}">
  41 + <option value="${item.ID}" <c:if test="${pd.CLASS_ID==item.ID}">selected="true"</c:if>>${item.CLASS_NAME}</option>
  42 + </c:forEach>
  43 + </select>
  44 + </td>
  45 + </tr>
  46 + <tr>
  47 + <td style="width:75px;text-align: right;padding-top: 13px;">姓名:</td>
  48 + <td><input type="text" name="NAME" id="NAME" value="${pd.NAME}" maxlength="255" placeholder="这里输入姓名" title="姓名" style="width:98%;"/></td>
  49 + </tr>
  50 + <tr>
  51 + <td style="width:75px;text-align: right;padding-top: 13px;">用户名:</td>
  52 + <td><input type="text" name="USERNAME" id="USERNAME" value="${pd.USERNAME}" maxlength="255" placeholder="这里输入用户名" title="用户名" style="width:98%;"/></td>
  53 + </tr>
  54 + <tr>
  55 + <td style="width:75px;text-align: right;padding-top: 13px;">密码:</td>
  56 + <td><input type="text" name="PASSWORD" id="PASSWORD" value="${pd.PASSWORD}" maxlength="255" placeholder="这里输入密码" title="密码" style="width:98%;"/></td>
  57 + </tr>
  58 + <tr>
  59 + <td style="width:75px;text-align: right;padding-top: 13px;">联系电话:</td>
  60 + <td><input type="text" name="PHONE" id="PHONE" value="${pd.PHONE}" maxlength="255" placeholder="这里输入联系电话" title="联系电话" style="width:98%;"/></td>
  61 + </tr>
  62 +
  63 + <tr>
  64 + <td style="text-align: center;" colspan="10">
  65 + <a class="btn btn-mini btn-primary" onclick="save();">保存</a>
  66 + <a class="btn btn-mini btn-danger" onclick="window.top.modal.remove();">取消</a>
  67 + </td>
  68 + </tr>
  69 + </table>
  70 + </div>
  71 + <div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div>
  72 + </form>
  73 + </div>
  74 + <!-- /.col -->
  75 + </div>
  76 + <!-- /.row -->
  77 + </div>
  78 + <!-- /.page-content -->
  79 + </div>
  80 + </div>
  81 + <!-- /.main-content -->
  82 +</div>
  83 +<!-- /.main-container -->
  84 +
  85 +
  86 + <!-- 页面底部js¨ -->
  87 + <%@ include file="../../system/index/foot.jsp"%>
  88 + <!-- 下拉框 -->
  89 + <script src="static/ace/js/chosen.jquery.js"></script>
  90 + <!-- 日期框 -->
  91 + <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
  92 + <!--提示框-->
  93 + <script type="text/javascript" src="static/js/jquery.tips.js"></script>
  94 + <script type="text/javascript">
  95 +
  96 + //保存
  97 + function save(){
  98 + if($("#NAME").val()==""){
  99 + $("#NAME").tips({
  100 + side:3,
  101 + msg:'请输入姓名',
  102 + bg:'#AE81FF',
  103 + time:2
  104 + });
  105 + $("#NAME").focus();
  106 + return false;
  107 + }
  108 + if($("#USERNAME").val()==""){
  109 + $("#USERNAME").tips({
  110 + side:3,
  111 + msg:'请输入用户名',
  112 + bg:'#AE81FF',
  113 + time:2
  114 + });
  115 + $("#USERNAME").focus();
  116 + return false;
  117 + }
  118 + if($("#PASSWORD").val()==""){
  119 + $("#PASSWORD").tips({
  120 + side:3,
  121 + msg:'请输入密码',
  122 + bg:'#AE81FF',
  123 + time:2
  124 + });
  125 + $("#PASSWORD").focus();
  126 + return false;
  127 + }
  128 +
  129 + if($("#PHONE").val()==""){
  130 + $("#PHONE").tips({
  131 + side:3,
  132 + msg:'请输入联系电话',
  133 + bg:'#AE81FF',
  134 + time:2
  135 + });
  136 + $("#PHONE").focus();
  137 + return false;
  138 + }
  139 + $("#Form").submit();
  140 + $("#zhongxin").hide();
  141 + $("#zhongxin2").show();
  142 + }
  143 +
  144 + $(function() {
  145 + //日期框
  146 + $('.date-picker').datepicker({autoclose: true,todayHighlight: true});
  147 + });
  148 + </script>
  149 +</body>
  150 +</html>
0 151 \ No newline at end of file
... ...
WebRoot/WEB-INF/jsp/sunvote/headmaster/headmaster_list.jsp
1   -<%@ page language="java" contentType="text/html; charset=UTF-8"
2   - pageEncoding="UTF-8"%>
  1 +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
3 2 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
4 3 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
5   -<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%>
6 4 <%
7 5 String path = request.getContextPath();
8 6 String basePath = request.getScheme() + "://"
... ... @@ -11,150 +9,364 @@
11 9 %>
12 10 <!DOCTYPE html>
13 11 <html lang="en">
14   -<title>中天电子-教育管理系统</title>
15 12 <head>
16 13 <base href="<%=basePath%>">
17   -
18 14 <!-- 下拉框 -->
19 15 <link rel="stylesheet" href="static/ace/css/chosen.css" />
20 16 <!-- jsp文件头和头部 -->
21   -
  17 +<%@ include file="../../system/index/top.jsp"%>
22 18 <!-- 日期框 -->
23 19 <link rel="stylesheet" href="static/ace/css/datepicker.css" />
24   -<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
25   -<link href="static/css/teach.css" rel="stylesheet">
26 20 </head>
27 21 <body class="no-skin">
28 22  
29   -
30   - <!-- 检索 -->
31   - <form action="headmaster/list.do" method="post" name="Form" id="Form">
32   - <input type="hidden" name="SCHOOL_ID" id="SCHOOL_ID" value="${pd.SCHOOL_ID}"/>
33   - <input type="hidden" name="GRADE_ID" id="GRADE_ID" value="${pd.GRADE_ID}"/>
34   - <div class="head_box">
35   - <div class="box_header">
36   - <div class="head_box_l">
37   - <p>
38   - <span class="right_b"></span>班长管理
39   - </p>
  23 + <!-- /section:basics/navbar.layout -->
  24 + <div class="main-container" id="main-container">
  25 + <!-- /section:basics/sidebar -->
  26 + <div class="main-content">
  27 + <div class="main-content-inner">
  28 + <div class="page-content">
  29 + <div class="row">
  30 + <div class="col-xs-12">
  31 +
  32 + <!-- 检索 -->
  33 + <form action="headmaster/list.do" method="post" name="Form" id="Form">
  34 + <table style="margin-top:5px;">
  35 + <tr>
  36 + <td>
  37 + <div class="nav-search">
  38 + <span class="input-icon">
  39 + <input type="text" placeholder="这里输入关键词" class="nav-search-input" id="nav-search-input" autocomplete="off" name="keywords" value="${pd.keywords }" placeholder="这里输入关键词"/>
  40 + <i class="ace-icon fa fa-search nav-search-icon"></i>
  41 + </span>
  42 + </div>
  43 + </td>
  44 + <td style="padding-left:2px;"><input class="span10 date-picker" name="lastStart" id="lastStart" value="" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="开始日期" title="开始日期"/></td>
  45 + <td style="padding-left:2px;"><input class="span10 date-picker" name="lastEnd" name="lastEnd" value="" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="结束日期" title="结束日期"/></td>
  46 + <td style="vertical-align:top;padding-left:2px;">
  47 + <select class="chosen-select form-control" name="name" id="id" data-placeholder="请选择" style="vertical-align:top;width: 120px;">
  48 + <option value=""></option>
  49 + <option value="">全部</option>
  50 + <option value="">1</option>
  51 + <option value="">2</option>
  52 + </select>
  53 + </td>
  54 + <c:if test="${QX.cha == 1 }">
  55 + <td style="vertical-align:top;padding-left:2px"><a class="btn btn-light btn-xs" onclick="tosearch();" title="检索"><i id="nav-search-icon" class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a></td>
  56 + </c:if>
  57 + <c:if test="${QX.toExcel == 1 }"><td style="vertical-align:top;padding-left:2px;"><a class="btn btn-light btn-xs" onclick="toExcel();" title="导出到EXCEL"><i id="nav-search-icon" class="ace-icon fa fa-download bigger-110 nav-search-icon blue"></i></a></td></c:if>
  58 + </tr>
  59 + </table>
  60 + <!-- 检索 -->
  61 +
  62 + <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;">
  63 + <thead>
  64 + <tr>
  65 + <th class="center" style="width:35px;">
  66 + <label class="pos-rel"><input type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label>
  67 + </th>
  68 + <th class="center" style="width:50px;">序号</th>
  69 + <th class="center">姓名</th>
  70 + <th class="center">用户名</th>
  71 + <th class="center">密码</th>
  72 + <th class="center">所在学校</th>
  73 + <th class="center">权限</th>
  74 + <th class="center">联系电话</th>
  75 + <th class="center">操作</th>
  76 + </tr>
  77 + </thead>
  78 +
  79 + <tbody>
  80 + <!-- 开始循环 -->
  81 + <c:choose>
  82 + <c:when test="${not empty varList}">
  83 + <c:if test="${QX.cha == 1 }">
  84 + <c:forEach items="${varList}" var="var" varStatus="vs">
  85 + <tr>
  86 + <td class='center'>
  87 + <label class="pos-rel"><input type='checkbox' name='ids' value="${var.HEADMASTER_ID}" class="ace" /><span class="lbl"></span></label>
  88 + </td>
  89 + <td class='center' style="width: 30px;">${vs.index+1}</td>
  90 + <td class='center'>${var.NAME}</td>
  91 + <td class='center'>${var.USERNAME}</td>
  92 + <td class='center'>${var.PASSWORD}</td>
  93 + <td class='center'>${var.SCHOOL_ID}</td>
  94 + <td class='center'>${var.PERMISSION}</td>
  95 + <td class='center'>${var.PHONE}</td>
  96 + <td class="center">
  97 + <c:if test="${QX.edit != 1 && QX.del != 1 }">
  98 + <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span>
  99 + </c:if>
  100 + <div class="hidden-sm hidden-xs btn-group">
  101 + <c:if test="${QX.edit == 1 }">
  102 + <a class="btn btn-xs btn-success" title="编辑" onclick="edit('${var.HEADMASTER_ID}');">
  103 + <i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i>
  104 + </a>
  105 + </c:if>
  106 + <c:if test="${QX.del == 1 }">
  107 + <a class="btn btn-xs btn-danger" onclick="del('${var.HEADMASTER_ID}');">
  108 + <i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i>
  109 + </a>
  110 + </c:if>
  111 + </div>
  112 + <div class="hidden-md hidden-lg">
  113 + <div class="inline pos-rel">
  114 + <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
  115 + <i class="ace-icon fa fa-cog icon-only bigger-110"></i>
  116 + </button>
  117 +
  118 + <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
  119 + <c:if test="${QX.edit == 1 }">
  120 + <li>
  121 + <a style="cursor:pointer;" onclick="edit('${var.HEADMASTER_ID}');" class="tooltip-success" data-rel="tooltip" title="修改">
  122 + <span class="green">
  123 + <i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
  124 + </span>
  125 + </a>
  126 + </li>
  127 + </c:if>
  128 + <c:if test="${QX.del == 1 }">
  129 + <li>
  130 + <a style="cursor:pointer;" onclick="del('${var.HEADMASTER_ID}');" class="tooltip-error" data-rel="tooltip" title="删除">
  131 + <span class="red">
  132 + <i class="ace-icon fa fa-trash-o bigger-120"></i>
  133 + </span>
  134 + </a>
  135 + </li>
  136 + </c:if>
  137 + </ul>
  138 + </div>
  139 + </div>
  140 + </td>
  141 + </tr>
  142 +
  143 + </c:forEach>
  144 + </c:if>
  145 + <c:if test="${QX.cha == 0 }">
  146 + <tr>
  147 + <td colspan="100" class="center">您无权查看</td>
  148 + </tr>
  149 + </c:if>
  150 + </c:when>
  151 + <c:otherwise>
  152 + <tr class="main_info">
  153 + <td colspan="100" class="center" >没有相关数据</td>
  154 + </tr>
  155 + </c:otherwise>
  156 + </c:choose>
  157 + </tbody>
  158 + </table>
  159 + <div class="page-header position-relative">
  160 + <table style="width:100%;">
  161 + <tr>
  162 + <td style="vertical-align:top;">
  163 + <c:if test="${QX.add == 1 }">
  164 + <a class="btn btn-mini btn-success" onclick="add();">新增</a>
  165 + </c:if>
  166 + <c:if test="${QX.del == 1 }">
  167 + <a class="btn btn-mini btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" title="批量删除" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a>
  168 + </c:if>
  169 + </td>
  170 + <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td>
  171 + </tr>
  172 + </table>
  173 + </div>
  174 + </form>
  175 +
  176 + </div>
  177 + <!-- /.col -->
  178 + </div>
  179 + <!-- /.row -->
40 180 </div>
41   - <div class="clearfix"></div>
  181 + <!-- /.page-content -->
42 182 </div>
43   - <div style="background:#fff;padding:0 5%;" >
44   -
45   - <table class="table table-striped" >
46   - <col style="width: 10%" />
47   - <col style="width: 10%" />
48   - <col style="width: 10%" />
49   - <col style="width: 10%" />
50   - <col style="width: 20%" />
51   - <col style="width: 20%" />
52   - <thead>
53   - <tr>
54   - <th><input type="checkbox" value="0" name='ids' id="ids" />序号</th>
55   - <th class="center">姓名</th>
56   - <th class="center">用户名</th>
57   - <th class="center">密码</th>
58   - <th class="center">联系电话</th>
59   - <th class="center">操作</th>
60   - </tr>
61   -
62   - </thead>
63   - </table>
64   - </div>
65   -
66   - <div class="clearfix"></div>
67   - <!-- 检索 -->
68   -
69 183 </div>
70   - <div class="table_box" >
71   - <table class="table table-striped" >
72   - <col style="width: 10%" />
73   - <col style="width: 10%" />
74   - <col style="width: 10%" />
75   - <col style="width: 10%" />
76   - <col style="width: 20%" />
77   - <col style="width: 20%" />
78   - <tbody>
79   - <!-- 开始循环 -->
80   - <c:choose>
81   - <c:when test="${not empty varList}">
82   - <c:forEach items="${varList}" var="var" varStatus="vs">
83   - <tr>
84   - <td><input type="checkbox" name='ids' id="ids"
85   - value="${var.ID}" />${vs.index+1}</td>
86   - <td class='center'>${var.NAME}</td>
87   - <td class='center'>${var.USERNAME}</td>
88   - <td class='center'>${var.PASSWORD}</td>
89   - <td class='center'>${var.PHONE}</td>
90   - <td><a onclick="edit('${var.HEADMASTER_ID}');" style="margin-right:10px;"><img src="static/images/eidtor.png" /></a><a href="#" onclick="del('${var.HEADMASTER_ID}');"><img src="static/images/remove.png" /></a></td>
91   - </tr>
  184 + <!-- /.main-content -->
  185 +
  186 + <!-- 返回顶部 -->
  187 + <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
  188 + <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
  189 + </a>
92 190  
93   - </c:forEach>
94   - </c:when>
95   - <c:otherwise>
96   - <tr class="main_info">
97   - <td colspan="100" class="center">没有相关数据</td>
98   - </tr>
99   - </c:otherwise>
100   - </c:choose>
101   - </tbody>
102   - </table>
103   - <div class="footer" style="width:auto;margin: 0px 5%;">
104   - <div class="creat">
105   - <input type="button" onclick="add();" value="添加班级" />
106   - </div>
107   - <div class="removeAll">
108   - <input type="button" onclick="del();" value="删除" />
109   - </div>
110   -
111   - <div class="page_box">
112   - <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div>
113   - </div>
114   - </div>
115   - </div>
116   - </form>
117 191 </div>
118 192 <!-- /.main-container -->
119 193  
120 194 <!-- basic scripts -->
121 195 <!-- 页面底部js¨ -->
122 196 <%@ include file="../../system/index/foot.jsp"%>
123   -
  197 + <!-- 删除时确认窗口 -->
  198 + <script src="static/ace/js/bootbox.js"></script>
  199 + <!-- ace scripts -->
  200 + <script src="static/ace/js/ace/ace.js"></script>
  201 + <!-- 下拉框 -->
  202 + <script src="static/ace/js/chosen.jquery.js"></script>
  203 + <!-- 日期框 -->
  204 + <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
  205 + <!--提示框-->
  206 + <script type="text/javascript" src="static/js/jquery.tips.js"></script>
124 207 <script type="text/javascript">
125   - window.top.loading.remove();
  208 + $(top.hangge());//关闭加载状态
126 209 //检索
127 210 function tosearch(){
  211 + top.jzts();
128 212 $("#Form").submit();
129 213 }
130   - //修改
131   - function edit(Id){
132   - window.top.modal.init({
133   - 'title':'修改信息',
134   - 'url':'<%=basePath%>headmaster/goEdit.do?HEADMASTER_ID='+Id,
135   - func:function() {
136   - tosearch();
  214 + $(function() {
  215 +
  216 + //日期框
  217 + $('.date-picker').datepicker({
  218 + autoclose: true,
  219 + todayHighlight: true
  220 + });
  221 +
  222 + //下拉框
  223 + if(!ace.vars['touch']) {
  224 + $('.chosen-select').chosen({allow_single_deselect:true});
  225 + $(window)
  226 + .off('resize.chosen')
  227 + .on('resize.chosen', function() {
  228 + $('.chosen-select').each(function() {
  229 + var $this = $(this);
  230 + $this.next().css({'width': $this.parent().width()});
  231 + });
  232 + }).trigger('resize.chosen');
  233 + $(document).on('settings.ace.chosen', function(e, event_name, event_val) {
  234 + if(event_name != 'sidebar_collapsed') return;
  235 + $('.chosen-select').each(function() {
  236 + var $this = $(this);
  237 + $this.next().css({'width': $this.parent().width()});
  238 + });
  239 + });
  240 + $('#chosen-multiple-style .btn').on('click', function(e){
  241 + var target = $(this).find('input[type=radio]');
  242 + var which = parseInt(target.val());
  243 + if(which == 2) $('#form-field-select-4').addClass('tag-input-style');
  244 + else $('#form-field-select-4').removeClass('tag-input-style');
  245 + });
137 246 }
  247 +
  248 +
  249 + //复选框全选控制
  250 + var active_class = 'active';
  251 + $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){
  252 + var th_checked = this.checked;//checkbox inside "TH" table header
  253 + $(this).closest('table').find('tbody > tr').each(function(){
  254 + var row = this;
  255 + if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true);
  256 + else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false);
  257 + });
138 258 });
139   - window.top.modal.show();
140   - }
  259 + });
  260 +
  261 + //新增
141 262 function add(){
142   - window.top.modal.init({
143   - 'title':'添加班长',
144   - 'url':'<%=basePath%>headmaster/goAdd.do?school_id=${pd.SCHOOL_ID}&grade_id=${pd.GRADE_ID}',
145   - func:function() {
146   - tosearch();
147   - }
  263 + top.jzts();
  264 + var diag = new top.Dialog();
  265 + diag.Drag=true;
  266 + diag.Title ="新增";
  267 + diag.URL = '<%=basePath%>headmaster/goAdd.do';
  268 + diag.Width = 450;
  269 + diag.Height = 355;
  270 + diag.Modal = true; //有无遮罩窗口
  271 + diag. ShowMaxButton = true; //最大化按钮
  272 + diag.ShowMinButton = true; //最小化按钮
  273 + diag.CancelEvent = function(){ //关闭事件
  274 + if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  275 + if('${page.currentPage}' == '0'){
  276 + tosearch();
  277 + }else{
  278 + tosearch();
  279 + }
  280 + }
  281 + diag.close();
  282 + };
  283 + diag.show();
  284 + }
  285 +
  286 + //删除
  287 + function del(Id){
  288 + bootbox.confirm("确定要删除吗?", function(result) {
  289 + if(result) {
  290 + top.jzts();
  291 + var url = "<%=basePath%>headmaster/delete.do?HEADMASTER_ID="+Id+"&tm="+new Date().getTime();
  292 + $.get(url,function(data){
  293 + tosearch();
  294 + });
  295 + }
148 296 });
149   - window.top.modal.show();
150 297 }
151   - $(function() {
152   -
153 298  
  299 + //修改
  300 + function edit(Id){
  301 + top.jzts();
  302 + var diag = new top.Dialog();
  303 + diag.Drag=true;
  304 + diag.Title ="编辑";
  305 + diag.URL = '<%=basePath%>headmaster/goEdit.do?HEADMASTER_ID='+Id;
  306 + diag.Width = 450;
  307 + diag.Height = 355;
  308 + diag.Modal = true; //有无遮罩窗口
  309 + diag. ShowMaxButton = true; //最大化按钮
  310 + diag.ShowMinButton = true; //最小化按钮
  311 + diag.CancelEvent = function(){ //关闭事件
  312 + if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
  313 + tosearch();
  314 + }
  315 + diag.close();
  316 + };
  317 + diag.show();
  318 + }
154 319  
  320 + //批量操作
  321 + function makeAll(msg){
  322 + bootbox.confirm(msg, function(result) {
  323 + if(result) {
  324 + var str = '';
  325 + for(var i=0;i < document.getElementsByName('ids').length;i++){
  326 + if(document.getElementsByName('ids')[i].checked){
  327 + if(str=='') str += document.getElementsByName('ids')[i].value;
  328 + else str += ',' + document.getElementsByName('ids')[i].value;
  329 + }
  330 + }
  331 + if(str==''){
  332 + bootbox.dialog({
  333 + message: "<span class='bigger-110'>您没有选择任何内容!</span>",
  334 + buttons:
  335 + { "button":{ "label":"确定", "className":"btn-sm btn-success"}}
  336 + });
  337 + $("#zcheckbox").tips({
  338 + side:1,
  339 + msg:'点这里全选',
  340 + bg:'#AE81FF',
  341 + time:8
  342 + });
  343 + return;
  344 + }else{
  345 + if(msg == '确定要删除选中的数据吗?'){
  346 + top.jzts();
  347 + $.ajax({
  348 + type: "POST",
  349 + url: '<%=basePath%>headmaster/deleteAll.do?tm='+new Date().getTime(),
  350 + data: {DATA_IDS:str},
  351 + dataType:'json',
  352 + //beforeSend: validateData,
  353 + cache: false,
  354 + success: function(data){
  355 + $.each(data.list, function(i, list){
  356 + tosearch();
  357 + });
  358 + }
  359 + });
  360 + }
  361 + }
  362 + }
  363 + });
  364 + };
155 365  
156   - })
157   -
  366 + //导出excel
  367 + function toExcel(){
  368 + window.location.href='<%=basePath%>headmaster/excel.do';
  369 + }
158 370 </script>
159 371  
160 372  
... ...
WebRoot/WEB-INF/jsp/sunvote/headmaster/headmaster_list2.jsp
1   -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  1 +<%@ page language="java" contentType="text/html; charset=UTF-8"
  2 + pageEncoding="UTF-8"%>
2 3 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
3 4 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
  5 +<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%>
4 6 <%
5 7 String path = request.getContextPath();
6 8 String basePath = request.getScheme() + "://"
... ... @@ -9,364 +11,152 @@
9 11 %>
10 12 <!DOCTYPE html>
11 13 <html lang="en">
  14 +<title>中天电子-教育管理系统</title>
12 15 <head>
13 16 <base href="<%=basePath%>">
  17 +
14 18 <!-- 下拉框 -->
15 19 <link rel="stylesheet" href="static/ace/css/chosen.css" />
16 20 <!-- jsp文件头和头部 -->
17   -<%@ include file="../../system/index/top.jsp"%>
  21 +
18 22 <!-- 日期框 -->
19 23 <link rel="stylesheet" href="static/ace/css/datepicker.css" />
  24 +<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
  25 +<link href="static/css/teach.css" rel="stylesheet">
20 26 </head>
21 27 <body class="no-skin">
22 28  
23   - <!-- /section:basics/navbar.layout -->
24   - <div class="main-container" id="main-container">
25   - <!-- /section:basics/sidebar -->
26   - <div class="main-content">
27   - <div class="main-content-inner">
28   - <div class="page-content">
29   - <div class="row">
30   - <div class="col-xs-12">
31   -
32   - <!-- 检索 -->
33   - <form action="headmaster/list.do" method="post" name="Form" id="Form">
34   - <table style="margin-top:5px;">
35   - <tr>
36   - <td>
37   - <div class="nav-search">
38   - <span class="input-icon">
39   - <input type="text" placeholder="这里输入关键词" class="nav-search-input" id="nav-search-input" autocomplete="off" name="keywords" value="${pd.keywords }" placeholder="这里输入关键词"/>
40   - <i class="ace-icon fa fa-search nav-search-icon"></i>
41   - </span>
42   - </div>
43   - </td>
44   - <td style="padding-left:2px;"><input class="span10 date-picker" name="lastStart" id="lastStart" value="" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="开始日期" title="开始日期"/></td>
45   - <td style="padding-left:2px;"><input class="span10 date-picker" name="lastEnd" name="lastEnd" value="" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="结束日期" title="结束日期"/></td>
46   - <td style="vertical-align:top;padding-left:2px;">
47   - <select class="chosen-select form-control" name="name" id="id" data-placeholder="请选择" style="vertical-align:top;width: 120px;">
48   - <option value=""></option>
49   - <option value="">全部</option>
50   - <option value="">1</option>
51   - <option value="">2</option>
52   - </select>
53   - </td>
54   - <c:if test="${QX.cha == 1 }">
55   - <td style="vertical-align:top;padding-left:2px"><a class="btn btn-light btn-xs" onclick="tosearch();" title="检索"><i id="nav-search-icon" class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a></td>
56   - </c:if>
57   - <c:if test="${QX.toExcel == 1 }"><td style="vertical-align:top;padding-left:2px;"><a class="btn btn-light btn-xs" onclick="toExcel();" title="导出到EXCEL"><i id="nav-search-icon" class="ace-icon fa fa-download bigger-110 nav-search-icon blue"></i></a></td></c:if>
58   - </tr>
59   - </table>
60   - <!-- 检索 -->
61   -
62   - <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;">
63   - <thead>
64   - <tr>
65   - <th class="center" style="width:35px;">
66   - <label class="pos-rel"><input type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label>
67   - </th>
68   - <th class="center" style="width:50px;">序号</th>
69   - <th class="center">姓名</th>
70   - <th class="center">用户名</th>
71   - <th class="center">密码</th>
72   - <th class="center">所在学校</th>
73   - <th class="center">权限</th>
74   - <th class="center">联系电话</th>
75   - <th class="center">操作</th>
76   - </tr>
77   - </thead>
78   -
79   - <tbody>
80   - <!-- 开始循环 -->
81   - <c:choose>
82   - <c:when test="${not empty varList}">
83   - <c:if test="${QX.cha == 1 }">
84   - <c:forEach items="${varList}" var="var" varStatus="vs">
85   - <tr>
86   - <td class='center'>
87   - <label class="pos-rel"><input type='checkbox' name='ids' value="${var.HEADMASTER_ID}" class="ace" /><span class="lbl"></span></label>
88   - </td>
89   - <td class='center' style="width: 30px;">${vs.index+1}</td>
90   - <td class='center'>${var.NAME}</td>
91   - <td class='center'>${var.USERNAME}</td>
92   - <td class='center'>${var.PASSWORD}</td>
93   - <td class='center'>${var.SCHOOL_ID}</td>
94   - <td class='center'>${var.PERMISSION}</td>
95   - <td class='center'>${var.PHONE}</td>
96   - <td class="center">
97   - <c:if test="${QX.edit != 1 && QX.del != 1 }">
98   - <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span>
99   - </c:if>
100   - <div class="hidden-sm hidden-xs btn-group">
101   - <c:if test="${QX.edit == 1 }">
102   - <a class="btn btn-xs btn-success" title="编辑" onclick="edit('${var.HEADMASTER_ID}');">
103   - <i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i>
104   - </a>
105   - </c:if>
106   - <c:if test="${QX.del == 1 }">
107   - <a class="btn btn-xs btn-danger" onclick="del('${var.HEADMASTER_ID}');">
108   - <i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i>
109   - </a>
110   - </c:if>
111   - </div>
112   - <div class="hidden-md hidden-lg">
113   - <div class="inline pos-rel">
114   - <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
115   - <i class="ace-icon fa fa-cog icon-only bigger-110"></i>
116   - </button>
117   -
118   - <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
119   - <c:if test="${QX.edit == 1 }">
120   - <li>
121   - <a style="cursor:pointer;" onclick="edit('${var.HEADMASTER_ID}');" class="tooltip-success" data-rel="tooltip" title="修改">
122   - <span class="green">
123   - <i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
124   - </span>
125   - </a>
126   - </li>
127   - </c:if>
128   - <c:if test="${QX.del == 1 }">
129   - <li>
130   - <a style="cursor:pointer;" onclick="del('${var.HEADMASTER_ID}');" class="tooltip-error" data-rel="tooltip" title="删除">
131   - <span class="red">
132   - <i class="ace-icon fa fa-trash-o bigger-120"></i>
133   - </span>
134   - </a>
135   - </li>
136   - </c:if>
137   - </ul>
138   - </div>
139   - </div>
140   - </td>
141   - </tr>
142   -
143   - </c:forEach>
144   - </c:if>
145   - <c:if test="${QX.cha == 0 }">
146   - <tr>
147   - <td colspan="100" class="center">您无权查看</td>
148   - </tr>
149   - </c:if>
150   - </c:when>
151   - <c:otherwise>
152   - <tr class="main_info">
153   - <td colspan="100" class="center" >没有相关数据</td>
154   - </tr>
155   - </c:otherwise>
156   - </c:choose>
157   - </tbody>
158   - </table>
159   - <div class="page-header position-relative">
160   - <table style="width:100%;">
161   - <tr>
162   - <td style="vertical-align:top;">
163   - <c:if test="${QX.add == 1 }">
164   - <a class="btn btn-mini btn-success" onclick="add();">新增</a>
165   - </c:if>
166   - <c:if test="${QX.del == 1 }">
167   - <a class="btn btn-mini btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" title="批量删除" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a>
168   - </c:if>
169   - </td>
170   - <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td>
171   - </tr>
172   - </table>
173   - </div>
174   - </form>
175   -
176   - </div>
177   - <!-- /.col -->
178   - </div>
179   - <!-- /.row -->
  29 +
  30 + <!-- 检索 -->
  31 + <form action="headmaster/listcs.do" method="post" name="Form" id="Form">
  32 + <input type="hidden" name="SCHOOL_ID" id="SCHOOL_ID" value="${pd.SCHOOL_ID}"/>
  33 + <input type="hidden" name="GRADE_ID" id="GRADE_ID" value="${pd.GRADE_ID}"/>
  34 + <div class="head_box">
  35 + <div class="box_header">
  36 + <div class="head_box_l">
  37 + <p>
  38 + <span class="right_b"></span>班长管理
  39 + </p>
180 40 </div>
181   - <!-- /.page-content -->
  41 + <div class="clearfix"></div>
  42 + </div>
  43 + <div style="background:#fff;padding:0 5%;" >
  44 +
  45 + <table class="table table-striped" >
  46 + <col style="width: 10%" />
  47 + <col style="width: 10%" />
  48 + <col style="width: 10%" />
  49 + <col style="width: 10%" />
  50 + <col style="width: 20%" />
  51 + <col style="width: 20%" />
  52 + <thead>
  53 + <tr>
  54 + <th><input type="checkbox" value="0" name='ids' id="ids" />序号</th>
  55 + <th class="center">姓名</th>
  56 + <th class="center">用户名</th>
  57 + <th class="center">密码</th>
  58 + <th class="center">联系电话</th>
  59 + <th class="center">班级</th>
  60 + <th class="center">操作</th>
  61 + </tr>
  62 +
  63 + </thead>
  64 + </table>
182 65 </div>
183   - </div>
184   - <!-- /.main-content -->
185 66  
186   - <!-- 返回顶部 -->
187   - <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
188   - <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
189   - </a>
  67 + <div class="clearfix"></div>
  68 + <!-- 检索 -->
190 69  
  70 + </div>
  71 + <div class="table_box" >
  72 + <table class="table table-striped" >
  73 + <col style="width: 10%" />
  74 + <col style="width: 10%" />
  75 + <col style="width: 10%" />
  76 + <col style="width: 10%" />
  77 + <col style="width: 20%" />
  78 + <col style="width: 20%" />
  79 + <tbody>
  80 + <!-- 开始循环 -->
  81 + <c:choose>
  82 + <c:when test="${not empty varList}">
  83 + <c:forEach items="${varList}" var="var" varStatus="vs">
  84 + <tr>
  85 + <td><input type="checkbox" name='ids' id="ids"
  86 + value="${var.ID}" />${vs.index+1}</td>
  87 + <td class='center'>${var.NAME}</td>
  88 + <td class='center'>${var.USERNAME}</td>
  89 + <td class='center'>${var.PASSWORD}</td>
  90 + <td class='center'>${var.PHONE}</td>
  91 + <td class='center'>${var.CLASS_NAME}</td>
  92 + <td><a onclick="edit('${var.HEADMASTER_ID}');" style="margin-right:10px;"><img src="static/images/eidtor.png" /></a><a href="#" onclick="del('${var.HEADMASTER_ID}');"><img src="static/images/remove.png" /></a></td>
  93 + </tr>
  94 +
  95 + </c:forEach>
  96 + </c:when>
  97 + <c:otherwise>
  98 + <tr class="main_info">
  99 + <td colspan="100" class="center">没有相关数据</td>
  100 + </tr>
  101 + </c:otherwise>
  102 + </c:choose>
  103 + </tbody>
  104 + </table>
  105 + <div class="footer" style="width:auto;margin: 0px 5%;">
  106 + <div class="creat">
  107 + <input type="button" onclick="add();" value="添加班长" />
  108 + </div>
  109 + <div class="removeAll">
  110 + <input type="button" onclick="del();" value="删除" />
  111 + </div>
  112 +
  113 + <div class="page_box">
  114 + <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div>
  115 + </div>
  116 + </div>
  117 + </div>
  118 + </form>
191 119 </div>
192 120 <!-- /.main-container -->
193 121  
194 122 <!-- basic scripts -->
195 123 <!-- 页面底部js¨ -->
196 124 <%@ include file="../../system/index/foot.jsp"%>
197   - <!-- 删除时确认窗口 -->
198   - <script src="static/ace/js/bootbox.js"></script>
199   - <!-- ace scripts -->
200   - <script src="static/ace/js/ace/ace.js"></script>
201   - <!-- 下拉框 -->
202   - <script src="static/ace/js/chosen.jquery.js"></script>
203   - <!-- 日期框 -->
204   - <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script>
205   - <!--提示框-->
206   - <script type="text/javascript" src="static/js/jquery.tips.js"></script>
  125 +
207 126 <script type="text/javascript">
208   - $(top.hangge());//关闭加载状态
  127 + window.top.loading.remove();
209 128 //检索
210 129 function tosearch(){
211   - top.jzts();
212 130 $("#Form").submit();
213 131 }
214   - $(function() {
215   -
216   - //日期框
217   - $('.date-picker').datepicker({
218   - autoclose: true,
219   - todayHighlight: true
220   - });
221   -
222   - //下拉框
223   - if(!ace.vars['touch']) {
224   - $('.chosen-select').chosen({allow_single_deselect:true});
225   - $(window)
226   - .off('resize.chosen')
227   - .on('resize.chosen', function() {
228   - $('.chosen-select').each(function() {
229   - var $this = $(this);
230   - $this.next().css({'width': $this.parent().width()});
231   - });
232   - }).trigger('resize.chosen');
233   - $(document).on('settings.ace.chosen', function(e, event_name, event_val) {
234   - if(event_name != 'sidebar_collapsed') return;
235   - $('.chosen-select').each(function() {
236   - var $this = $(this);
237   - $this.next().css({'width': $this.parent().width()});
238   - });
239   - });
240   - $('#chosen-multiple-style .btn').on('click', function(e){
241   - var target = $(this).find('input[type=radio]');
242   - var which = parseInt(target.val());
243   - if(which == 2) $('#form-field-select-4').addClass('tag-input-style');
244   - else $('#form-field-select-4').removeClass('tag-input-style');
245   - });
  132 + //修改
  133 + function edit(Id){
  134 + window.top.modal.init({
  135 + 'title':'修改信息',
  136 + 'url':'<%=basePath%>headmaster/goEdit.do?HEADMASTER_ID='+Id,
  137 + func:function() {
  138 + tosearch();
246 139 }
247   -
248   -
249   - //复选框全选控制
250   - var active_class = 'active';
251   - $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){
252   - var th_checked = this.checked;//checkbox inside "TH" table header
253   - $(this).closest('table').find('tbody > tr').each(function(){
254   - var row = this;
255   - if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true);
256   - else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false);
257   - });
258 140 });
259   - });
260   -
261   - //新增
262   - function add(){
263   - top.jzts();
264   - var diag = new top.Dialog();
265   - diag.Drag=true;
266   - diag.Title ="新增";
267   - diag.URL = '<%=basePath%>headmaster/goAdd.do';
268   - diag.Width = 450;
269   - diag.Height = 355;
270   - diag.Modal = true; //有无遮罩窗口
271   - diag. ShowMaxButton = true; //最大化按钮
272   - diag.ShowMinButton = true; //最小化按钮
273   - diag.CancelEvent = function(){ //关闭事件
274   - if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
275   - if('${page.currentPage}' == '0'){
276   - tosearch();
277   - }else{
278   - tosearch();
279   - }
280   - }
281   - diag.close();
282   - };
283   - diag.show();
  141 + window.top.modal.show();
284 142 }
285   -
286   - //删除
287   - function del(Id){
288   - bootbox.confirm("确定要删除吗?", function(result) {
289   - if(result) {
290   - top.jzts();
291   - var url = "<%=basePath%>headmaster/delete.do?HEADMASTER_ID="+Id+"&tm="+new Date().getTime();
292   - $.get(url,function(data){
293   - tosearch();
294   - });
295   - }
  143 + function add(){
  144 + window.top.modal.init({
  145 + 'title':'添加班长',
  146 + 'url':'<%=basePath%>headmaster/goAdd2.do?school_id=${pd.SCHOOL_ID}&grade_id=${pd.GRADE_ID}',
  147 + func:function() {
  148 + tosearch();
  149 + }
296 150 });
  151 + window.top.modal.show();
297 152 }
  153 + $(function() {
  154 +
298 155  
299   - //修改
300   - function edit(Id){
301   - top.jzts();
302   - var diag = new top.Dialog();
303   - diag.Drag=true;
304   - diag.Title ="编辑";
305   - diag.URL = '<%=basePath%>headmaster/goEdit.do?HEADMASTER_ID='+Id;
306   - diag.Width = 450;
307   - diag.Height = 355;
308   - diag.Modal = true; //有无遮罩窗口
309   - diag. ShowMaxButton = true; //最大化按钮
310   - diag.ShowMinButton = true; //最小化按钮
311   - diag.CancelEvent = function(){ //关闭事件
312   - if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){
313   - tosearch();
314   - }
315   - diag.close();
316   - };
317   - diag.show();
318   - }
319 156  
320   - //批量操作
321   - function makeAll(msg){
322   - bootbox.confirm(msg, function(result) {
323   - if(result) {
324   - var str = '';
325   - for(var i=0;i < document.getElementsByName('ids').length;i++){
326   - if(document.getElementsByName('ids')[i].checked){
327   - if(str=='') str += document.getElementsByName('ids')[i].value;
328   - else str += ',' + document.getElementsByName('ids')[i].value;
329   - }
330   - }
331   - if(str==''){
332   - bootbox.dialog({
333   - message: "<span class='bigger-110'>您没有选择任何内容!</span>",
334   - buttons:
335   - { "button":{ "label":"确定", "className":"btn-sm btn-success"}}
336   - });
337   - $("#zcheckbox").tips({
338   - side:1,
339   - msg:'点这里全选',
340   - bg:'#AE81FF',
341   - time:8
342   - });
343   - return;
344   - }else{
345   - if(msg == '确定要删除选中的数据吗?'){
346   - top.jzts();
347   - $.ajax({
348   - type: "POST",
349   - url: '<%=basePath%>headmaster/deleteAll.do?tm='+new Date().getTime(),
350   - data: {DATA_IDS:str},
351   - dataType:'json',
352   - //beforeSend: validateData,
353   - cache: false,
354   - success: function(data){
355   - $.each(data.list, function(i, list){
356   - tosearch();
357   - });
358   - }
359   - });
360   - }
361   - }
362   - }
363   - });
364   - };
365 157  
366   - //导出excel
367   - function toExcel(){
368   - window.location.href='<%=basePath%>headmaster/excel.do';
369   - }
  158 + })
  159 +
370 160 </script>
371 161  
372 162  
... ...
resources/mybatis1/sunvote/HeadmasterMapper.xml
... ... @@ -78,6 +78,16 @@
78 78 </select>
79 79  
80 80 <!-- 通过ID获取数据 -->
  81 + <select id="findClassByHeaderId" parameterType="pd" resultType="pd">
  82 + select
  83 + *
  84 + from
  85 + sv_sclass
  86 + where
  87 + HEADMASTER_ID = #{HEADMASTER_ID}
  88 + </select>
  89 +
  90 + <!-- 通过ID获取数据 -->
81 91 <select id="findByUsenameAndPassword" parameterType="pd" resultType="pd">
82 92 select
83 93 <include refid="Field"></include>
... ... @@ -105,6 +115,28 @@
105 115 </if>
106 116 </select>
107 117  
  118 + <!-- 列表 -->
  119 + <select id="dataClasslistPage" parameterType="page" resultType="pd">
  120 + select
  121 + NAME,
  122 + USERNAME,
  123 + PASSWORD,
  124 + sv_headmaster.SCHOOL_ID,
  125 + PERMISSION,
  126 + PHONE,
  127 + KEYPAD_ID,
  128 + sv_headmaster.HEADMASTER_ID,
  129 + sv_sclass.CLASS_NAME,
  130 + sv_sclass.ID
  131 + from
  132 + <include refid="tableName"></include>
  133 + INNER JOIN sv_sclass ON sv_sclass.HEADMASTER_ID = sv_headmaster.HEADMASTER_ID
  134 + where 1=1
  135 + <if test="pd.SCHOOL_ID != null and pd.SCHOOL_ID != ''">
  136 + and sv_headmaster.SCHOOL_ID = #{pd.SCHOOL_ID}
  137 + </if>
  138 + </select>
  139 +
108 140 <!-- 列表(全部) -->
109 141 <select id="listAll" parameterType="pd" resultType="pd">
110 142 select
... ... @@ -117,6 +149,30 @@
117 149 </if>
118 150 </select>
119 151  
  152 + <!-- 列表(全部) -->
  153 + <select id="listNoHeaderClass" parameterType="pd" resultType="pd">
  154 + select
  155 + ID,CLASS_NAME
  156 + from
  157 + sv_sclass
  158 + where 1 = 1
  159 + <if test="SCHOOL_ID != null and SCHOOL_ID != ''">
  160 + and SCHOOL_ID = #{SCHOOL_ID}
  161 + </if>
  162 + and HEADMASTER_ID is NULL
  163 + </select>
  164 +
  165 + <!-- 修改 -->
  166 + <update id="updateHeaderMaster" parameterType="pd">
  167 + update
  168 + sv_sclass
  169 + set
  170 + HEADMASTER_ID = #{HEADMASTER_ID}
  171 + where
  172 + ID = #{ID}
  173 + </update>
  174 +
  175 +
120 176 <!-- 批量删除 -->
121 177 <delete id="deleteAll" parameterType="String">
122 178 delete from
... ...
src/com/fh/controller/sunvote/headmaster/HeadmasterController.java
... ... @@ -58,6 +58,27 @@ public class HeadmasterController extends BaseController {
58 58 return mv;
59 59 }
60 60  
  61 + /**保存
  62 + * @param
  63 + * @throws Exception
  64 + */
  65 + @RequestMapping(value="/save2")
  66 + public ModelAndView save2() throws Exception{
  67 + logBefore(logger, Jurisdiction.getUsername()+"新增Headmaster");
  68 + ModelAndView mv = this.getModelAndView();
  69 + PageData pd = new PageData();
  70 + pd = this.getPageData();
  71 + pd.put("HEADMASTER_ID", this.get32UUID()); //主键
  72 + headmasterService.save(pd);
  73 + PageData classPageData = new PageData();
  74 + classPageData.put("ID", pd.get("CLASS_ID"));
  75 + classPageData.put("HEADMASTER_ID", pd.get("HEADMASTER_ID"));
  76 + headmasterService.updateHeaderMaster(classPageData);
  77 + mv.addObject("msg","success");
  78 + mv.setViewName("save_result2");
  79 + return mv;
  80 + }
  81 +
61 82 /**删除
62 83 * @param out
63 84 * @throws Exception
... ... @@ -129,7 +150,7 @@ public class HeadmasterController extends BaseController {
129 150 pd.put("keywords", keywords.trim());
130 151 }
131 152 page.setPd(pd);
132   - List<PageData> varList = headmasterService.list(page); //列出Headmaster列表
  153 + List<PageData> varList = headmasterService.listClass(page); //列出Headmaster列表
133 154 mv.setViewName("sunvote/headmaster/headmaster_list2");
134 155 mv.addObject("varList", varList);
135 156 mv.addObject("pd", pd);
... ... @@ -151,6 +172,23 @@ public class HeadmasterController extends BaseController {
151 172 return mv;
152 173 }
153 174  
  175 + /**去新增页面
  176 + * @param
  177 + * @throws Exception
  178 + */
  179 + @RequestMapping(value="/goAdd2")
  180 + public ModelAndView goAdd2()throws Exception{
  181 + ModelAndView mv = this.getModelAndView();
  182 + PageData pd = new PageData();
  183 + pd = this.getPageData();
  184 + mv.setViewName("sunvote/headmaster/headmaster_edit2");
  185 + List<PageData> classes = headmasterService.listNoHeaderClass(pd);
  186 + mv.addObject("classes",classes);
  187 + mv.addObject("msg", "save2");
  188 + mv.addObject("pd", pd);
  189 + return mv;
  190 + }
  191 +
154 192 /**去修改页面
155 193 * @param
156 194 * @throws Exception
... ... @@ -167,6 +205,27 @@ public class HeadmasterController extends BaseController {
167 205 return mv;
168 206 }
169 207  
  208 + /**去修改页面
  209 + * @param
  210 + * @throws Exception
  211 + */
  212 + @RequestMapping(value="/goEdit2")
  213 + public ModelAndView goEdit2()throws Exception{
  214 + ModelAndView mv = this.getModelAndView();
  215 + PageData pd = new PageData();
  216 + pd = this.getPageData();
  217 + pd = headmasterService.findById(pd); //根据ID读取
  218 + PageData classPageData = headmasterService.findClassByHeaderId(pd);
  219 + pd.put("CLASS_ID", classPageData.get("ID"));
  220 + pd.put("CLASS_NAME", classPageData.get("CLASS_NAME"));
  221 + List<PageData> classes = headmasterService.listNoHeaderClass(pd);
  222 + mv.addObject("classes",classes);
  223 + mv.setViewName("sunvote/headmaster/headmaster_edit2");
  224 + mv.addObject("msg", "edit");
  225 + mv.addObject("pd", pd);
  226 + return mv;
  227 + }
  228 +
170 229 /**批量删除
171 230 * @param
172 231 * @throws Exception
... ...
src/com/fh/controller/sunvote/homework/HomeworkController.java
... ... @@ -29,6 +29,7 @@ import com.fh.service.sunvote.coursemanagement.CourseManagementManager;
29 29 import com.fh.service.sunvote.homework.HomeworkManager;
30 30 import com.fh.service.sunvote.homework.HomeworkReportManager;
31 31 import com.fh.service.sunvote.homeworkproblem.HomeworkProblemManager;
  32 +import com.fh.service.sunvote.student.StudentManager;
32 33 import com.fh.util.AppUtil;
33 34 import com.fh.util.Jurisdiction;
34 35 import com.fh.util.ObjectExcelView;
... ... @@ -56,6 +57,9 @@ public class HomeworkController extends BaseController {
56 57  
57 58 @Resource(name="homeworkReporService")
58 59 private HomeworkReportManager homeworkReporkService;
  60 +
  61 + @Resource(name="studentService")
  62 + private StudentManager studentService;
59 63  
60 64 /**
61 65 * 保存
... ... @@ -247,7 +251,12 @@ public class HomeworkController extends BaseController {
247 251 for(PageData ptd : list){
248 252  
249 253 ptd.put("CLASS_ID", ptd.get("ID"));
250   -
  254 + List<PageData> studentList = studentService.findByClassId(ptd);
  255 + int studentNum = 0 ;
  256 + if(studentList != null){
  257 + studentNum = studentList.size();
  258 + }
  259 + ptd.put("STUDENT_NUM", studentNum);
251 260 ptd.put("TEACHER_ID", pd.get("TEACHER_ID"));
252 261 List<PageData> homeworkList = homeworkService.listAll(ptd);
253 262 for(PageData hpd:homeworkList){
... ...
src/com/fh/service/sunvote/headmaster/HeadmasterManager.java
... ... @@ -30,11 +30,27 @@ public interface HeadmasterManager{
30 30 */
31 31 public void edit(PageData pd)throws Exception;
32 32  
  33 + /**修改
  34 + * @param pd
  35 + * @throws Exception
  36 + */
  37 + public void updateHeaderMaster(PageData pd)throws Exception;
  38 +
33 39 /**列表
34 40 * @param page
35 41 * @throws Exception
36 42 */
37 43 public List<PageData> list(Page page)throws Exception;
  44 + /**列表
  45 + * @param page
  46 + * @throws Exception
  47 + */
  48 + public List<PageData> listClass(Page page)throws Exception;
  49 + /**列表
  50 + * @param page
  51 + * @throws Exception
  52 + */
  53 + public List<PageData> listNoHeaderClass(PageData pd)throws Exception;
38 54  
39 55 /**列表(全部)
40 56 * @param pd
... ... @@ -47,6 +63,11 @@ public interface HeadmasterManager{
47 63 * @throws Exception
48 64 */
49 65 public PageData findById(PageData pd)throws Exception;
  66 + /**通过id获取数据
  67 + * @param pd
  68 + * @throws Exception
  69 + */
  70 + public PageData findClassByHeaderId(PageData pd)throws Exception;
50 71  
51 72 /**通过id获取数据
52 73 * @param pd
... ...
src/com/fh/service/sunvote/headmaster/impl/HeadmasterService.java
1 1 package com.fh.service.sunvote.headmaster.impl;
2 2  
3 3 import java.util.List;
  4 +
4 5 import javax.annotation.Resource;
  6 +
5 7 import org.springframework.stereotype.Service;
  8 +
6 9 import com.fh.dao.DaoSupport;
7 10 import com.fh.entity.Page;
8 11 import com.fh.util.PageData;
... ... @@ -85,6 +88,30 @@ public class HeadmasterService implements HeadmasterManager{
85 88 public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
86 89 dao.delete("HeadmasterMapper.deleteAll", ArrayDATA_IDS);
87 90 }
  91 +
  92 +
  93 + @Override
  94 + @SuppressWarnings("unchecked")
  95 + public List<PageData> listClass(Page page) throws Exception {
  96 + return (List<PageData>)dao.findForList("HeadmasterMapper.dataClasslistPage", page);
  97 + }
  98 +
  99 + @Override
  100 + @SuppressWarnings("unchecked")
  101 + public List<PageData> listNoHeaderClass(PageData pd) throws Exception {
  102 + return (List<PageData>)dao.findForList("HeadmasterMapper.listNoHeaderClass", pd);
  103 + }
  104 +
  105 + @Override
  106 + public void updateHeaderMaster(PageData pd) throws Exception {
  107 + dao.update("HeadmasterMapper.updateHeaderMaster", pd);
  108 +
  109 + }
  110 +
  111 + @Override
  112 + public PageData findClassByHeaderId(PageData pd) throws Exception {
  113 + return (PageData)dao.findForObject("HeadmasterMapper.findClassByHeaderId", pd);
  114 + }
88 115  
89 116 }
90 117  
... ...