Commit 2480c8896f05a3eb839fe64c3cad75b44f5a63d9
1 parent
4fd2e08c
添加软件管理模块。对软件形成统一的管理
Showing
25 changed files
with
2344 additions
and
38 deletions
WebRoot/WEB-INF/jsp/software/software/software_edit.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 | +</head> | ||
| 20 | +<body class="no-skin"> | ||
| 21 | +<!-- /section:basics/navbar.layout --> | ||
| 22 | +<div class="main-container" id="main-container"> | ||
| 23 | + <!-- /section:basics/sidebar --> | ||
| 24 | + <div class="main-content"> | ||
| 25 | + <div class="main-content-inner"> | ||
| 26 | + <div class="page-content"> | ||
| 27 | + <div class="row"> | ||
| 28 | + <div class="col-xs-12"> | ||
| 29 | + | ||
| 30 | + <form action="software/${msg }.do" name="Form" id="Form" method="post"> | ||
| 31 | + <input type="hidden" name="SOFTWARE_ID" id="SOFTWARE_ID" value="${pd.SOFTWARE_ID}"/> | ||
| 32 | + <div id="zhongxin" style="padding-top: 13px;"> | ||
| 33 | + <table id="table_report" class="table table-striped table-bordered table-hover"> | ||
| 34 | + <tr> | ||
| 35 | + <td style="width:75px;text-align: right;padding-top: 13px;">软件名称:</td> | ||
| 36 | + <td><input type="text" name="NAME" id="NAME" value="${pd.NAME}" maxlength="255" placeholder="这里输入软件名称" title="软件名称" style="width:98%;"/></td> | ||
| 37 | + </tr> | ||
| 38 | + <tr> | ||
| 39 | + <td style="width:75px;text-align: right;padding-top: 13px;">软件描述:</td> | ||
| 40 | + <td><input type="text" name="DESC" id="DESC" value="${pd.DESC}" maxlength="255" placeholder="这里输入软件描述" title="软件描述" style="width:98%;"/></td> | ||
| 41 | + </tr> | ||
| 42 | + <tr> | ||
| 43 | + <td style="text-align: center;" colspan="10"> | ||
| 44 | + <a class="btn btn-mini btn-primary" onclick="save();">保存</a> | ||
| 45 | + <a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a> | ||
| 46 | + </td> | ||
| 47 | + </tr> | ||
| 48 | + </table> | ||
| 49 | + </div> | ||
| 50 | + <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> | ||
| 51 | + </form> | ||
| 52 | + </div> | ||
| 53 | + <!-- /.col --> | ||
| 54 | + </div> | ||
| 55 | + <!-- /.row --> | ||
| 56 | + </div> | ||
| 57 | + <!-- /.page-content --> | ||
| 58 | + </div> | ||
| 59 | + </div> | ||
| 60 | + <!-- /.main-content --> | ||
| 61 | +</div> | ||
| 62 | +<!-- /.main-container --> | ||
| 63 | + | ||
| 64 | + | ||
| 65 | + <!-- 页面底部js¨ --> | ||
| 66 | + <%@ include file="../../system/index/foot.jsp"%> | ||
| 67 | + <!-- 下拉框 --> | ||
| 68 | + <script src="static/ace/js/chosen.jquery.js"></script> | ||
| 69 | + <!-- 日期框 --> | ||
| 70 | + <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script> | ||
| 71 | + <!--提示框--> | ||
| 72 | + <script type="text/javascript" src="static/js/jquery.tips.js"></script> | ||
| 73 | + <script type="text/javascript"> | ||
| 74 | + $(top.hangge()); | ||
| 75 | + //保存 | ||
| 76 | + function save(){ | ||
| 77 | + if($("#NAME").val()==""){ | ||
| 78 | + $("#NAME").tips({ | ||
| 79 | + side:3, | ||
| 80 | + msg:'请输入软件名称', | ||
| 81 | + bg:'#AE81FF', | ||
| 82 | + time:2 | ||
| 83 | + }); | ||
| 84 | + $("#NAME").focus(); | ||
| 85 | + return false; | ||
| 86 | + } | ||
| 87 | + if($("#DESC").val()==""){ | ||
| 88 | + $("#DESC").tips({ | ||
| 89 | + side:3, | ||
| 90 | + msg:'请输入软件描述', | ||
| 91 | + bg:'#AE81FF', | ||
| 92 | + time:2 | ||
| 93 | + }); | ||
| 94 | + $("#DESC").focus(); | ||
| 95 | + return false; | ||
| 96 | + } | ||
| 97 | + $("#Form").submit(); | ||
| 98 | + $("#zhongxin").hide(); | ||
| 99 | + $("#zhongxin2").show(); | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + $(function() { | ||
| 103 | + //日期框 | ||
| 104 | + $('.date-picker').datepicker({autoclose: true,todayHighlight: true}); | ||
| 105 | + }); | ||
| 106 | + </script> | ||
| 107 | +</body> | ||
| 108 | +</html> | ||
| 0 | \ No newline at end of file | 109 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/software/software/software_list.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 | +<% | ||
| 5 | + String path = request.getContextPath(); | ||
| 6 | + String basePath = request.getScheme() + "://" | ||
| 7 | + + request.getServerName() + ":" + request.getServerPort() | ||
| 8 | + + path + "/"; | ||
| 9 | +%> | ||
| 10 | +<!DOCTYPE html> | ||
| 11 | +<html lang="en"> | ||
| 12 | +<head> | ||
| 13 | +<base href="<%=basePath%>"> | ||
| 14 | +<!-- 下拉框 --> | ||
| 15 | +<link rel="stylesheet" href="static/ace/css/chosen.css" /> | ||
| 16 | +<!-- jsp文件头和头部 --> | ||
| 17 | +<%@ include file="../../system/index/top.jsp"%> | ||
| 18 | +<!-- 日期框 --> | ||
| 19 | +<link rel="stylesheet" href="static/ace/css/datepicker.css" /> | ||
| 20 | +</head> | ||
| 21 | +<body class="no-skin"> | ||
| 22 | + | ||
| 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="software/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 | + </tr> | ||
| 73 | + </thead> | ||
| 74 | + | ||
| 75 | + <tbody> | ||
| 76 | + <!-- 开始循环 --> | ||
| 77 | + <c:choose> | ||
| 78 | + <c:when test="${not empty varList}"> | ||
| 79 | + <c:if test="${QX.cha == 1 }"> | ||
| 80 | + <c:forEach items="${varList}" var="var" varStatus="vs"> | ||
| 81 | + <tr> | ||
| 82 | + <td class='center'> | ||
| 83 | + <label class="pos-rel"><input type='checkbox' name='ids' value="${var.SOFTWARE_ID}" class="ace" /><span class="lbl"></span></label> | ||
| 84 | + </td> | ||
| 85 | + <td class='center' style="width: 30px;">${vs.index+1}</td> | ||
| 86 | + <td class='center'>${var.NAME}</td> | ||
| 87 | + <td class='center'>${var.DESC}</td> | ||
| 88 | + <td class="center"> | ||
| 89 | + <c:if test="${QX.edit != 1 && QX.del != 1 }"> | ||
| 90 | + <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span> | ||
| 91 | + </c:if> | ||
| 92 | + <div class="hidden-sm hidden-xs btn-group"> | ||
| 93 | + <c:if test="${QX.edit == 1 }"> | ||
| 94 | + <a class="btn btn-xs btn-success" title="编辑" onclick="edit('${var.SOFTWARE_ID}');"> | ||
| 95 | + <i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i> | ||
| 96 | + </a> | ||
| 97 | + </c:if> | ||
| 98 | + <c:if test="${QX.del == 1 }"> | ||
| 99 | + <a class="btn btn-xs btn-danger" onclick="del('${var.SOFTWARE_ID}');"> | ||
| 100 | + <i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i> | ||
| 101 | + </a> | ||
| 102 | + </c:if> | ||
| 103 | + </div> | ||
| 104 | + <div class="hidden-md hidden-lg"> | ||
| 105 | + <div class="inline pos-rel"> | ||
| 106 | + <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto"> | ||
| 107 | + <i class="ace-icon fa fa-cog icon-only bigger-110"></i> | ||
| 108 | + </button> | ||
| 109 | + | ||
| 110 | + <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close"> | ||
| 111 | + <c:if test="${QX.edit == 1 }"> | ||
| 112 | + <li> | ||
| 113 | + <a style="cursor:pointer;" onclick="edit('${var.SOFTWARE_ID}');" class="tooltip-success" data-rel="tooltip" title="修改"> | ||
| 114 | + <span class="green"> | ||
| 115 | + <i class="ace-icon fa fa-pencil-square-o bigger-120"></i> | ||
| 116 | + </span> | ||
| 117 | + </a> | ||
| 118 | + </li> | ||
| 119 | + </c:if> | ||
| 120 | + <c:if test="${QX.del == 1 }"> | ||
| 121 | + <li> | ||
| 122 | + <a style="cursor:pointer;" onclick="del('${var.SOFTWARE_ID}');" class="tooltip-error" data-rel="tooltip" title="删除"> | ||
| 123 | + <span class="red"> | ||
| 124 | + <i class="ace-icon fa fa-trash-o bigger-120"></i> | ||
| 125 | + </span> | ||
| 126 | + </a> | ||
| 127 | + </li> | ||
| 128 | + </c:if> | ||
| 129 | + </ul> | ||
| 130 | + </div> | ||
| 131 | + </div> | ||
| 132 | + </td> | ||
| 133 | + </tr> | ||
| 134 | + | ||
| 135 | + </c:forEach> | ||
| 136 | + </c:if> | ||
| 137 | + <c:if test="${QX.cha == 0 }"> | ||
| 138 | + <tr> | ||
| 139 | + <td colspan="100" class="center">您无权查看</td> | ||
| 140 | + </tr> | ||
| 141 | + </c:if> | ||
| 142 | + </c:when> | ||
| 143 | + <c:otherwise> | ||
| 144 | + <tr class="main_info"> | ||
| 145 | + <td colspan="100" class="center" >没有相关数据</td> | ||
| 146 | + </tr> | ||
| 147 | + </c:otherwise> | ||
| 148 | + </c:choose> | ||
| 149 | + </tbody> | ||
| 150 | + </table> | ||
| 151 | + <div class="page-header position-relative"> | ||
| 152 | + <table style="width:100%;"> | ||
| 153 | + <tr> | ||
| 154 | + <td style="vertical-align:top;"> | ||
| 155 | + <c:if test="${QX.add == 1 }"> | ||
| 156 | + <a class="btn btn-mini btn-success" onclick="add();">新增</a> | ||
| 157 | + </c:if> | ||
| 158 | + <c:if test="${QX.del == 1 }"> | ||
| 159 | + <a class="btn btn-mini btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" title="批量删除" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a> | ||
| 160 | + </c:if> | ||
| 161 | + </td> | ||
| 162 | + <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td> | ||
| 163 | + </tr> | ||
| 164 | + </table> | ||
| 165 | + </div> | ||
| 166 | + </form> | ||
| 167 | + | ||
| 168 | + </div> | ||
| 169 | + <!-- /.col --> | ||
| 170 | + </div> | ||
| 171 | + <!-- /.row --> | ||
| 172 | + </div> | ||
| 173 | + <!-- /.page-content --> | ||
| 174 | + </div> | ||
| 175 | + </div> | ||
| 176 | + <!-- /.main-content --> | ||
| 177 | + | ||
| 178 | + <!-- 返回顶部 --> | ||
| 179 | + <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> | ||
| 180 | + <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i> | ||
| 181 | + </a> | ||
| 182 | + | ||
| 183 | + </div> | ||
| 184 | + <!-- /.main-container --> | ||
| 185 | + | ||
| 186 | + <!-- basic scripts --> | ||
| 187 | + <!-- 页面底部js¨ --> | ||
| 188 | + <%@ include file="../../system/index/foot.jsp"%> | ||
| 189 | + <!-- 删除时确认窗口 --> | ||
| 190 | + <script src="static/ace/js/bootbox.js"></script> | ||
| 191 | + <!-- ace scripts --> | ||
| 192 | + <script src="static/ace/js/ace/ace.js"></script> | ||
| 193 | + <!-- 下拉框 --> | ||
| 194 | + <script src="static/ace/js/chosen.jquery.js"></script> | ||
| 195 | + <!-- 日期框 --> | ||
| 196 | + <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script> | ||
| 197 | + <!--提示框--> | ||
| 198 | + <script type="text/javascript" src="static/js/jquery.tips.js"></script> | ||
| 199 | + <script type="text/javascript"> | ||
| 200 | + $(top.hangge());//关闭加载状态 | ||
| 201 | + //检索 | ||
| 202 | + function tosearch(){ | ||
| 203 | + top.jzts(); | ||
| 204 | + $("#Form").submit(); | ||
| 205 | + } | ||
| 206 | + $(function() { | ||
| 207 | + | ||
| 208 | + //日期框 | ||
| 209 | + $('.date-picker').datepicker({ | ||
| 210 | + autoclose: true, | ||
| 211 | + todayHighlight: true | ||
| 212 | + }); | ||
| 213 | + | ||
| 214 | + //下拉框 | ||
| 215 | + if(!ace.vars['touch']) { | ||
| 216 | + $('.chosen-select').chosen({allow_single_deselect:true}); | ||
| 217 | + $(window) | ||
| 218 | + .off('resize.chosen') | ||
| 219 | + .on('resize.chosen', function() { | ||
| 220 | + $('.chosen-select').each(function() { | ||
| 221 | + var $this = $(this); | ||
| 222 | + $this.next().css({'width': $this.parent().width()}); | ||
| 223 | + }); | ||
| 224 | + }).trigger('resize.chosen'); | ||
| 225 | + $(document).on('settings.ace.chosen', function(e, event_name, event_val) { | ||
| 226 | + if(event_name != 'sidebar_collapsed') return; | ||
| 227 | + $('.chosen-select').each(function() { | ||
| 228 | + var $this = $(this); | ||
| 229 | + $this.next().css({'width': $this.parent().width()}); | ||
| 230 | + }); | ||
| 231 | + }); | ||
| 232 | + $('#chosen-multiple-style .btn').on('click', function(e){ | ||
| 233 | + var target = $(this).find('input[type=radio]'); | ||
| 234 | + var which = parseInt(target.val()); | ||
| 235 | + if(which == 2) $('#form-field-select-4').addClass('tag-input-style'); | ||
| 236 | + else $('#form-field-select-4').removeClass('tag-input-style'); | ||
| 237 | + }); | ||
| 238 | + } | ||
| 239 | + | ||
| 240 | + | ||
| 241 | + //复选框全选控制 | ||
| 242 | + var active_class = 'active'; | ||
| 243 | + $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){ | ||
| 244 | + var th_checked = this.checked;//checkbox inside "TH" table header | ||
| 245 | + $(this).closest('table').find('tbody > tr').each(function(){ | ||
| 246 | + var row = this; | ||
| 247 | + if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true); | ||
| 248 | + else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false); | ||
| 249 | + }); | ||
| 250 | + }); | ||
| 251 | + }); | ||
| 252 | + | ||
| 253 | + //新增 | ||
| 254 | + function add(){ | ||
| 255 | + top.jzts(); | ||
| 256 | + var diag = new top.Dialog(); | ||
| 257 | + diag.Drag=true; | ||
| 258 | + diag.Title ="新增"; | ||
| 259 | + diag.URL = '<%=basePath%>software/goAdd.do'; | ||
| 260 | + diag.Width = 450; | ||
| 261 | + diag.Height = 355; | ||
| 262 | + diag.Modal = true; //有无遮罩窗口 | ||
| 263 | + diag. ShowMaxButton = true; //最大化按钮 | ||
| 264 | + diag.ShowMinButton = true; //最小化按钮 | ||
| 265 | + diag.CancelEvent = function(){ //关闭事件 | ||
| 266 | + if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){ | ||
| 267 | + if('${page.currentPage}' == '0'){ | ||
| 268 | + tosearch(); | ||
| 269 | + }else{ | ||
| 270 | + tosearch(); | ||
| 271 | + } | ||
| 272 | + } | ||
| 273 | + diag.close(); | ||
| 274 | + }; | ||
| 275 | + diag.show(); | ||
| 276 | + } | ||
| 277 | + | ||
| 278 | + //删除 | ||
| 279 | + function del(Id){ | ||
| 280 | + bootbox.confirm("确定要删除吗?", function(result) { | ||
| 281 | + if(result) { | ||
| 282 | + top.jzts(); | ||
| 283 | + var url = "<%=basePath%>software/delete.do?SOFTWARE_ID="+Id+"&tm="+new Date().getTime(); | ||
| 284 | + $.get(url,function(data){ | ||
| 285 | + tosearch(); | ||
| 286 | + }); | ||
| 287 | + } | ||
| 288 | + }); | ||
| 289 | + } | ||
| 290 | + | ||
| 291 | + //修改 | ||
| 292 | + function edit(Id){ | ||
| 293 | + top.jzts(); | ||
| 294 | + var diag = new top.Dialog(); | ||
| 295 | + diag.Drag=true; | ||
| 296 | + diag.Title ="编辑"; | ||
| 297 | + diag.URL = '<%=basePath%>software/goEdit.do?SOFTWARE_ID='+Id; | ||
| 298 | + diag.Width = 450; | ||
| 299 | + diag.Height = 355; | ||
| 300 | + diag.Modal = true; //有无遮罩窗口 | ||
| 301 | + diag. ShowMaxButton = true; //最大化按钮 | ||
| 302 | + diag.ShowMinButton = true; //最小化按钮 | ||
| 303 | + diag.CancelEvent = function(){ //关闭事件 | ||
| 304 | + if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){ | ||
| 305 | + tosearch(); | ||
| 306 | + } | ||
| 307 | + diag.close(); | ||
| 308 | + }; | ||
| 309 | + diag.show(); | ||
| 310 | + } | ||
| 311 | + | ||
| 312 | + //批量操作 | ||
| 313 | + function makeAll(msg){ | ||
| 314 | + bootbox.confirm(msg, function(result) { | ||
| 315 | + if(result) { | ||
| 316 | + var str = ''; | ||
| 317 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
| 318 | + if(document.getElementsByName('ids')[i].checked){ | ||
| 319 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
| 320 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
| 321 | + } | ||
| 322 | + } | ||
| 323 | + if(str==''){ | ||
| 324 | + bootbox.dialog({ | ||
| 325 | + message: "<span class='bigger-110'>您没有选择任何内容!</span>", | ||
| 326 | + buttons: | ||
| 327 | + { "button":{ "label":"确定", "className":"btn-sm btn-success"}} | ||
| 328 | + }); | ||
| 329 | + $("#zcheckbox").tips({ | ||
| 330 | + side:1, | ||
| 331 | + msg:'点这里全选', | ||
| 332 | + bg:'#AE81FF', | ||
| 333 | + time:8 | ||
| 334 | + }); | ||
| 335 | + return; | ||
| 336 | + }else{ | ||
| 337 | + if(msg == '确定要删除选中的数据吗?'){ | ||
| 338 | + top.jzts(); | ||
| 339 | + $.ajax({ | ||
| 340 | + type: "POST", | ||
| 341 | + url: '<%=basePath%>software/deleteAll.do?tm='+new Date().getTime(), | ||
| 342 | + data: {DATA_IDS:str}, | ||
| 343 | + dataType:'json', | ||
| 344 | + //beforeSend: validateData, | ||
| 345 | + cache: false, | ||
| 346 | + success: function(data){ | ||
| 347 | + $.each(data.list, function(i, list){ | ||
| 348 | + tosearch(); | ||
| 349 | + }); | ||
| 350 | + } | ||
| 351 | + }); | ||
| 352 | + } | ||
| 353 | + } | ||
| 354 | + } | ||
| 355 | + }); | ||
| 356 | + }; | ||
| 357 | + | ||
| 358 | + //导出excel | ||
| 359 | + function toExcel(){ | ||
| 360 | + window.location.href='<%=basePath%>software/excel.do'; | ||
| 361 | + } | ||
| 362 | + </script> | ||
| 363 | + | ||
| 364 | + | ||
| 365 | +</body> | ||
| 366 | +</html> | ||
| 0 | \ No newline at end of file | 367 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_edit.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 | +<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%> | ||
| 6 | +<% | ||
| 7 | + String path = request.getContextPath(); | ||
| 8 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
| 9 | +%> | ||
| 10 | +<!DOCTYPE html> | ||
| 11 | +<html lang="en"> | ||
| 12 | + <head> | ||
| 13 | + <base href="<%=basePath%>"> | ||
| 14 | + <!-- 下拉框 --> | ||
| 15 | + <link rel="stylesheet" href="static/ace/css/chosen.css" /> | ||
| 16 | + <!-- jsp文件头和头部 --> | ||
| 17 | + <%@ include file="../../system/index/top.jsp"%> | ||
| 18 | + <!-- 日期框 --> | ||
| 19 | + <link rel="stylesheet" href="static/ace/css/datepicker.css" /> | ||
| 20 | +</head> | ||
| 21 | +<body class="no-skin"> | ||
| 22 | +<!-- /section:basics/navbar.layout --> | ||
| 23 | +<div class="main-container" id="main-container"> | ||
| 24 | + <!-- /section:basics/sidebar --> | ||
| 25 | + <div class="main-content"> | ||
| 26 | + <div class="main-content-inner"> | ||
| 27 | + <div class="page-content"> | ||
| 28 | + <div class="row"> | ||
| 29 | + <div class="col-xs-12"> | ||
| 30 | + | ||
| 31 | + <form action="softwareversion/${msg }.do" name="Form" id="Form" method="post" enctype="multipart/form-data"> | ||
| 32 | + <input type="hidden" name="SOFTWAREVERSION_ID" id="SOFTWAREVERSION_ID" value="${pd.SOFTWAREVERSION_ID}"/> | ||
| 33 | + <div id="zhongxin" style="padding-top: 13px;"> | ||
| 34 | + <table id="table_report" class="table table-striped table-bordered table-hover"> | ||
| 35 | + <tr> | ||
| 36 | + <td style="width:75px;text-align: right;padding-top: 13px;">软件名称:</td> | ||
| 37 | + <td> | ||
| 38 | + <select class="chosen-select form-control" name="SOFTWARE_ID" id="SOFTWARE_ID" data-placeholder="软件"> | ||
| 39 | + <c:forEach var="item" items="${softwares}"> | ||
| 40 | + <option value="${item.SOFTWARE_ID}" <c:if test="${pd.SOFTWARE_ID==item.SOFTWARE_ID}">selected="true"</c:if>>${item.NAME}</option> | ||
| 41 | + </c:forEach> | ||
| 42 | + </select> | ||
| 43 | + </td> | ||
| 44 | + </tr> | ||
| 45 | + <tr> | ||
| 46 | + <td style="width:75px;text-align: right;padding-top: 13px;">版本名称:</td> | ||
| 47 | + <td><input type="text" name="VERSION_NAME" id="VERSION_NAME" value="${pd.VERSION_NAME}" maxlength="255" placeholder="输入版本信息,用作版本显示的标志" title="版本名称" style="width:98%;"/></td> | ||
| 48 | + </tr> | ||
| 49 | + <tr> | ||
| 50 | + <td style="width:75px;text-align: right;padding-top: 13px;">版本代号:</td> | ||
| 51 | + <td><input type="text" name="VERSION_CODE" id="VERSION_CODE" value="${pd.VERSION_CODE}" maxlength="255" placeholder="输入版本代码,用作版本更新的依据" title="版本代号" style="width:98%;"/></td> | ||
| 52 | + </tr> | ||
| 53 | + <tr> | ||
| 54 | + <td style="width:75px;text-align: right;padding-top: 13px;">文件:</td> | ||
| 55 | + <td><input type="file" name="VERSION_PATH" style="width:98%;"/></td> | ||
| 56 | + </tr> | ||
| 57 | + <tr> | ||
| 58 | + <td style="width:75px;text-align: right;padding-top: 13px;">版本描述:</td> | ||
| 59 | + <td><input type="text" name="VERSION_DESC" id="VERSION_DESC" value="${pd.VERSION_DESC}" maxlength="255" placeholder="该版本更新的功能,用作选择是否更新的依据" title="更新描述" style="width:98%;"/></td> | ||
| 60 | + </tr> | ||
| 61 | + <tr> | ||
| 62 | + <td style="text-align: center;" colspan="10"> | ||
| 63 | + <a class="btn btn-mini btn-primary" onclick="save();">保存</a> | ||
| 64 | + <a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a> | ||
| 65 | + </td> | ||
| 66 | + </tr> | ||
| 67 | + </table> | ||
| 68 | + </div> | ||
| 69 | + <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> | ||
| 70 | + </form> | ||
| 71 | + </div> | ||
| 72 | + <!-- /.col --> | ||
| 73 | + </div> | ||
| 74 | + <!-- /.row --> | ||
| 75 | + </div> | ||
| 76 | + <!-- /.page-content --> | ||
| 77 | + </div> | ||
| 78 | + </div> | ||
| 79 | + <!-- /.main-content --> | ||
| 80 | +</div> | ||
| 81 | +<!-- /.main-container --> | ||
| 82 | + | ||
| 83 | + | ||
| 84 | + <!-- 页面底部js¨ --> | ||
| 85 | + <%@ include file="../../system/index/foot.jsp"%> | ||
| 86 | + <!-- 下拉框 --> | ||
| 87 | + <script src="static/ace/js/chosen.jquery.js"></script> | ||
| 88 | + <!-- 日期框 --> | ||
| 89 | + <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script> | ||
| 90 | + <!--提示框--> | ||
| 91 | + <script type="text/javascript" src="static/js/jquery.tips.js"></script> | ||
| 92 | + <script type="text/javascript"> | ||
| 93 | + $(top.hangge()); | ||
| 94 | + //保存 | ||
| 95 | + function save(){ | ||
| 96 | + if($("#SOFTWARE_ID").val()==""){ | ||
| 97 | + $("#SOFTWARE_ID").tips({ | ||
| 98 | + side:3, | ||
| 99 | + msg:'请输入软件名称', | ||
| 100 | + bg:'#AE81FF', | ||
| 101 | + time:2 | ||
| 102 | + }); | ||
| 103 | + $("#SOFTWARE_ID").focus(); | ||
| 104 | + return false; | ||
| 105 | + } | ||
| 106 | + if($("#VERSION_NAME").val()==""){ | ||
| 107 | + $("#VERSION_NAME").tips({ | ||
| 108 | + side:3, | ||
| 109 | + msg:'请输入版本名称', | ||
| 110 | + bg:'#AE81FF', | ||
| 111 | + time:2 | ||
| 112 | + }); | ||
| 113 | + $("#VERSION_NAME").focus(); | ||
| 114 | + return false; | ||
| 115 | + } | ||
| 116 | + if($("#VERSION_CODE").val()==""){ | ||
| 117 | + $("#VERSION_CODE").tips({ | ||
| 118 | + side:3, | ||
| 119 | + msg:'请输入版本代号', | ||
| 120 | + bg:'#AE81FF', | ||
| 121 | + time:2 | ||
| 122 | + }); | ||
| 123 | + $("#VERSION_CODE").focus(); | ||
| 124 | + return false; | ||
| 125 | + } | ||
| 126 | + /* if($("#VERSION_PATH").val()==""){ | ||
| 127 | + $("#VERSION_PATH").tips({ | ||
| 128 | + side:3, | ||
| 129 | + msg:'请输入版本存放路径', | ||
| 130 | + bg:'#AE81FF', | ||
| 131 | + time:2 | ||
| 132 | + }); | ||
| 133 | + $("#VERSION_PATH").focus(); | ||
| 134 | + return false; | ||
| 135 | + } */ | ||
| 136 | + if($("#VERSION_DESC").val()==""){ | ||
| 137 | + $("#VERSION_DESC").tips({ | ||
| 138 | + side:3, | ||
| 139 | + msg:'请输入更新描述', | ||
| 140 | + bg:'#AE81FF', | ||
| 141 | + time:2 | ||
| 142 | + }); | ||
| 143 | + $("#VERSION_DESC").focus(); | ||
| 144 | + return false; | ||
| 145 | + } | ||
| 146 | + var action = document.Form.action; | ||
| 147 | + action += "?SOFTWARE_ID=" + $("#SOFTWARE_ID").val() + "&VERSION_NAME=" + $("#VERSION_NAME").val() + "&VERSION_CODE=" + $("#VERSION_CODE").val()+ "&VERSION_DESC=" + $("#VERSION_DESC").val(); | ||
| 148 | + document.Form.action = action; | ||
| 149 | + $("#Form").submit(); | ||
| 150 | + $("#zhongxin").hide(); | ||
| 151 | + $("#zhongxin2").show(); | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + $(function() { | ||
| 155 | + //日期框 | ||
| 156 | + $('.date-picker').datepicker({autoclose: true,todayHighlight: true}); | ||
| 157 | + }); | ||
| 158 | + </script> | ||
| 159 | +</body> | ||
| 160 | +</html> | ||
| 0 | \ No newline at end of file | 161 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/software/softwareversion/softwareversion_list.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="myelfun" uri="/WEB-INF/tld/elfun.tld"%> | ||
| 5 | +<% | ||
| 6 | + String path = request.getContextPath(); | ||
| 7 | + String basePath = request.getScheme() + "://" | ||
| 8 | + + request.getServerName() + ":" + request.getServerPort() | ||
| 9 | + + path + "/"; | ||
| 10 | +%> | ||
| 11 | +<!DOCTYPE html> | ||
| 12 | +<html lang="en"> | ||
| 13 | +<head> | ||
| 14 | +<base href="<%=basePath%>"> | ||
| 15 | +<!-- 下拉框 --> | ||
| 16 | +<link rel="stylesheet" href="static/ace/css/chosen.css" /> | ||
| 17 | +<!-- jsp文件头和头部 --> | ||
| 18 | +<%@ include file="../../system/index/top.jsp"%> | ||
| 19 | +<!-- 日期框 --> | ||
| 20 | +<link rel="stylesheet" href="static/ace/css/datepicker.css" /> | ||
| 21 | +</head> | ||
| 22 | +<body class="no-skin"> | ||
| 23 | + | ||
| 24 | + <!-- /section:basics/navbar.layout --> | ||
| 25 | + <div class="main-container" id="main-container"> | ||
| 26 | + <!-- /section:basics/sidebar --> | ||
| 27 | + <div class="main-content"> | ||
| 28 | + <div class="main-content-inner"> | ||
| 29 | + <div class="page-content"> | ||
| 30 | + <div class="row"> | ||
| 31 | + <div class="col-xs-12"> | ||
| 32 | + | ||
| 33 | + <!-- 检索 --> | ||
| 34 | + <form action="softwareversion/list.do" method="post" name="Form" id="Form"> | ||
| 35 | + <table style="margin-top:5px;"> | ||
| 36 | + <tr> | ||
| 37 | + <td> | ||
| 38 | + <div class="nav-search"> | ||
| 39 | + <span class="input-icon"> | ||
| 40 | + <input type="text" placeholder="这里输入关键词" class="nav-search-input" id="nav-search-input" autocomplete="off" name="keywords" value="${pd.keywords }" placeholder="这里输入关键词"/> | ||
| 41 | + <i class="ace-icon fa fa-search nav-search-icon"></i> | ||
| 42 | + </span> | ||
| 43 | + </div> | ||
| 44 | + </td> | ||
| 45 | + <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> | ||
| 46 | + <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> | ||
| 47 | + <td style="vertical-align:top;padding-left:2px;"> | ||
| 48 | + <select class="chosen-select form-control" name="name" id="id" data-placeholder="请选择" style="vertical-align:top;width: 120px;"> | ||
| 49 | + <option value=""></option> | ||
| 50 | + <option value="">全部</option> | ||
| 51 | + <option value="">1</option> | ||
| 52 | + <option value="">2</option> | ||
| 53 | + </select> | ||
| 54 | + </td> | ||
| 55 | + <c:if test="${QX.cha == 1 }"> | ||
| 56 | + <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> | ||
| 57 | + </c:if> | ||
| 58 | + <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> | ||
| 59 | + </tr> | ||
| 60 | + </table> | ||
| 61 | + <!-- 检索 --> | ||
| 62 | + | ||
| 63 | + <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;"> | ||
| 64 | + <thead> | ||
| 65 | + <tr> | ||
| 66 | + <th class="center" style="width:35px;"> | ||
| 67 | + <label class="pos-rel"><input type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label> | ||
| 68 | + </th> | ||
| 69 | + <th class="center" style="width:50px;">序号</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.SOFTWAREVERSION_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'>${myelfun:findSoftwareName(var.SOFTWARE_ID)}</td> | ||
| 91 | + <td class='center'>${var.VERSION_NAME}</td> | ||
| 92 | + <td class='center'>${var.VERSION_CODE}</td> | ||
| 93 | + <td class='center'><a target= '_blank' href='<%=basePath %>uploadFiles/uploadFile/${var.VERSION_PATH}'>下载</a></td> | ||
| 94 | + <td class='center'>${var.VERSION_DESC}</td> | ||
| 95 | + <td class="center"> | ||
| 96 | + <c:if test="${QX.edit != 1 && QX.del != 1 }"> | ||
| 97 | + <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span> | ||
| 98 | + </c:if> | ||
| 99 | + <div class="hidden-sm hidden-xs btn-group"> | ||
| 100 | + <c:if test="${QX.edit == 1 }"> | ||
| 101 | + <a class="btn btn-xs btn-success" title="编辑" onclick="edit('${var.SOFTWAREVERSION_ID}');"> | ||
| 102 | + <i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i> | ||
| 103 | + </a> | ||
| 104 | + </c:if> | ||
| 105 | + <c:if test="${QX.del == 1 }"> | ||
| 106 | + <a class="btn btn-xs btn-danger" onclick="del('${var.SOFTWAREVERSION_ID}');"> | ||
| 107 | + <i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i> | ||
| 108 | + </a> | ||
| 109 | + </c:if> | ||
| 110 | + </div> | ||
| 111 | + <div class="hidden-md hidden-lg"> | ||
| 112 | + <div class="inline pos-rel"> | ||
| 113 | + <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto"> | ||
| 114 | + <i class="ace-icon fa fa-cog icon-only bigger-110"></i> | ||
| 115 | + </button> | ||
| 116 | + | ||
| 117 | + <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close"> | ||
| 118 | + <c:if test="${QX.edit == 1 }"> | ||
| 119 | + <li> | ||
| 120 | + <a style="cursor:pointer;" onclick="edit('${var.SOFTWAREVERSION_ID}');" class="tooltip-success" data-rel="tooltip" title="修改"> | ||
| 121 | + <span class="green"> | ||
| 122 | + <i class="ace-icon fa fa-pencil-square-o bigger-120"></i> | ||
| 123 | + </span> | ||
| 124 | + </a> | ||
| 125 | + </li> | ||
| 126 | + </c:if> | ||
| 127 | + <c:if test="${QX.del == 1 }"> | ||
| 128 | + <li> | ||
| 129 | + <a style="cursor:pointer;" onclick="del('${var.SOFTWAREVERSION_ID}');" class="tooltip-error" data-rel="tooltip" title="删除"> | ||
| 130 | + <span class="red"> | ||
| 131 | + <i class="ace-icon fa fa-trash-o bigger-120"></i> | ||
| 132 | + </span> | ||
| 133 | + </a> | ||
| 134 | + </li> | ||
| 135 | + </c:if> | ||
| 136 | + </ul> | ||
| 137 | + </div> | ||
| 138 | + </div> | ||
| 139 | + </td> | ||
| 140 | + </tr> | ||
| 141 | + | ||
| 142 | + </c:forEach> | ||
| 143 | + </c:if> | ||
| 144 | + <c:if test="${QX.cha == 0 }"> | ||
| 145 | + <tr> | ||
| 146 | + <td colspan="100" class="center">您无权查看</td> | ||
| 147 | + </tr> | ||
| 148 | + </c:if> | ||
| 149 | + </c:when> | ||
| 150 | + <c:otherwise> | ||
| 151 | + <tr class="main_info"> | ||
| 152 | + <td colspan="100" class="center" >没有相关数据</td> | ||
| 153 | + </tr> | ||
| 154 | + </c:otherwise> | ||
| 155 | + </c:choose> | ||
| 156 | + </tbody> | ||
| 157 | + </table> | ||
| 158 | + <div class="page-header position-relative"> | ||
| 159 | + <table style="width:100%;"> | ||
| 160 | + <tr> | ||
| 161 | + <td style="vertical-align:top;"> | ||
| 162 | + <c:if test="${QX.add == 1 }"> | ||
| 163 | + <a class="btn btn-mini btn-success" onclick="add();">新增</a> | ||
| 164 | + </c:if> | ||
| 165 | + <c:if test="${QX.del == 1 }"> | ||
| 166 | + <a class="btn btn-mini btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" title="批量删除" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a> | ||
| 167 | + </c:if> | ||
| 168 | + </td> | ||
| 169 | + <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td> | ||
| 170 | + </tr> | ||
| 171 | + </table> | ||
| 172 | + </div> | ||
| 173 | + </form> | ||
| 174 | + | ||
| 175 | + </div> | ||
| 176 | + <!-- /.col --> | ||
| 177 | + </div> | ||
| 178 | + <!-- /.row --> | ||
| 179 | + </div> | ||
| 180 | + <!-- /.page-content --> | ||
| 181 | + </div> | ||
| 182 | + </div> | ||
| 183 | + <!-- /.main-content --> | ||
| 184 | + | ||
| 185 | + <!-- 返回顶部 --> | ||
| 186 | + <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> | ||
| 187 | + <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i> | ||
| 188 | + </a> | ||
| 189 | + | ||
| 190 | + </div> | ||
| 191 | + <!-- /.main-container --> | ||
| 192 | + | ||
| 193 | + <!-- basic scripts --> | ||
| 194 | + <!-- 页面底部js¨ --> | ||
| 195 | + <%@ include file="../../system/index/foot.jsp"%> | ||
| 196 | + <!-- 删除时确认窗口 --> | ||
| 197 | + <script src="static/ace/js/bootbox.js"></script> | ||
| 198 | + <!-- ace scripts --> | ||
| 199 | + <script src="static/ace/js/ace/ace.js"></script> | ||
| 200 | + <!-- 下拉框 --> | ||
| 201 | + <script src="static/ace/js/chosen.jquery.js"></script> | ||
| 202 | + <!-- 日期框 --> | ||
| 203 | + <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script> | ||
| 204 | + <!--提示框--> | ||
| 205 | + <script type="text/javascript" src="static/js/jquery.tips.js"></script> | ||
| 206 | + <script type="text/javascript"> | ||
| 207 | + $(top.hangge());//关闭加载状态 | ||
| 208 | + //检索 | ||
| 209 | + function tosearch(){ | ||
| 210 | + top.jzts(); | ||
| 211 | + $("#Form").submit(); | ||
| 212 | + } | ||
| 213 | + $(function() { | ||
| 214 | + | ||
| 215 | + //日期框 | ||
| 216 | + $('.date-picker').datepicker({ | ||
| 217 | + autoclose: true, | ||
| 218 | + todayHighlight: true | ||
| 219 | + }); | ||
| 220 | + | ||
| 221 | + //下拉框 | ||
| 222 | + if(!ace.vars['touch']) { | ||
| 223 | + $('.chosen-select').chosen({allow_single_deselect:true}); | ||
| 224 | + $(window) | ||
| 225 | + .off('resize.chosen') | ||
| 226 | + .on('resize.chosen', function() { | ||
| 227 | + $('.chosen-select').each(function() { | ||
| 228 | + var $this = $(this); | ||
| 229 | + $this.next().css({'width': $this.parent().width()}); | ||
| 230 | + }); | ||
| 231 | + }).trigger('resize.chosen'); | ||
| 232 | + $(document).on('settings.ace.chosen', function(e, event_name, event_val) { | ||
| 233 | + if(event_name != 'sidebar_collapsed') return; | ||
| 234 | + $('.chosen-select').each(function() { | ||
| 235 | + var $this = $(this); | ||
| 236 | + $this.next().css({'width': $this.parent().width()}); | ||
| 237 | + }); | ||
| 238 | + }); | ||
| 239 | + $('#chosen-multiple-style .btn').on('click', function(e){ | ||
| 240 | + var target = $(this).find('input[type=radio]'); | ||
| 241 | + var which = parseInt(target.val()); | ||
| 242 | + if(which == 2) $('#form-field-select-4').addClass('tag-input-style'); | ||
| 243 | + else $('#form-field-select-4').removeClass('tag-input-style'); | ||
| 244 | + }); | ||
| 245 | + } | ||
| 246 | + | ||
| 247 | + | ||
| 248 | + //复选框全选控制 | ||
| 249 | + var active_class = 'active'; | ||
| 250 | + $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){ | ||
| 251 | + var th_checked = this.checked;//checkbox inside "TH" table header | ||
| 252 | + $(this).closest('table').find('tbody > tr').each(function(){ | ||
| 253 | + var row = this; | ||
| 254 | + if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true); | ||
| 255 | + else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false); | ||
| 256 | + }); | ||
| 257 | + }); | ||
| 258 | + }); | ||
| 259 | + | ||
| 260 | + //新增 | ||
| 261 | + function add(){ | ||
| 262 | + top.jzts(); | ||
| 263 | + var diag = new top.Dialog(); | ||
| 264 | + diag.Drag=true; | ||
| 265 | + diag.Title ="新增"; | ||
| 266 | + diag.URL = '<%=basePath%>softwareversion/goAdd.do'; | ||
| 267 | + diag.Width = 450; | ||
| 268 | + diag.Height = 355; | ||
| 269 | + diag.Modal = true; //有无遮罩窗口 | ||
| 270 | + diag. ShowMaxButton = true; //最大化按钮 | ||
| 271 | + diag.ShowMinButton = true; //最小化按钮 | ||
| 272 | + diag.CancelEvent = function(){ //关闭事件 | ||
| 273 | + if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){ | ||
| 274 | + if('${page.currentPage}' == '0'){ | ||
| 275 | + tosearch(); | ||
| 276 | + }else{ | ||
| 277 | + tosearch(); | ||
| 278 | + } | ||
| 279 | + } | ||
| 280 | + diag.close(); | ||
| 281 | + }; | ||
| 282 | + diag.show(); | ||
| 283 | + } | ||
| 284 | + | ||
| 285 | + //删除 | ||
| 286 | + function del(Id){ | ||
| 287 | + bootbox.confirm("确定要删除吗?", function(result) { | ||
| 288 | + if(result) { | ||
| 289 | + top.jzts(); | ||
| 290 | + var url = "<%=basePath%>softwareversion/delete.do?SOFTWAREVERSION_ID="+Id+"&tm="+new Date().getTime(); | ||
| 291 | + $.get(url,function(data){ | ||
| 292 | + tosearch(); | ||
| 293 | + }); | ||
| 294 | + } | ||
| 295 | + }); | ||
| 296 | + } | ||
| 297 | + | ||
| 298 | + //修改 | ||
| 299 | + function edit(Id){ | ||
| 300 | + top.jzts(); | ||
| 301 | + var diag = new top.Dialog(); | ||
| 302 | + diag.Drag=true; | ||
| 303 | + diag.Title ="编辑"; | ||
| 304 | + diag.URL = '<%=basePath%>softwareversion/goEdit.do?SOFTWAREVERSION_ID='+Id; | ||
| 305 | + diag.Width = 450; | ||
| 306 | + diag.Height = 355; | ||
| 307 | + diag.Modal = true; //有无遮罩窗口 | ||
| 308 | + diag. ShowMaxButton = true; //最大化按钮 | ||
| 309 | + diag.ShowMinButton = true; //最小化按钮 | ||
| 310 | + diag.CancelEvent = function(){ //关闭事件 | ||
| 311 | + if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){ | ||
| 312 | + tosearch(); | ||
| 313 | + } | ||
| 314 | + diag.close(); | ||
| 315 | + }; | ||
| 316 | + diag.show(); | ||
| 317 | + } | ||
| 318 | + | ||
| 319 | + //批量操作 | ||
| 320 | + function makeAll(msg){ | ||
| 321 | + bootbox.confirm(msg, function(result) { | ||
| 322 | + if(result) { | ||
| 323 | + var str = ''; | ||
| 324 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | ||
| 325 | + if(document.getElementsByName('ids')[i].checked){ | ||
| 326 | + if(str=='') str += document.getElementsByName('ids')[i].value; | ||
| 327 | + else str += ',' + document.getElementsByName('ids')[i].value; | ||
| 328 | + } | ||
| 329 | + } | ||
| 330 | + if(str==''){ | ||
| 331 | + bootbox.dialog({ | ||
| 332 | + message: "<span class='bigger-110'>您没有选择任何内容!</span>", | ||
| 333 | + buttons: | ||
| 334 | + { "button":{ "label":"确定", "className":"btn-sm btn-success"}} | ||
| 335 | + }); | ||
| 336 | + $("#zcheckbox").tips({ | ||
| 337 | + side:1, | ||
| 338 | + msg:'点这里全选', | ||
| 339 | + bg:'#AE81FF', | ||
| 340 | + time:8 | ||
| 341 | + }); | ||
| 342 | + return; | ||
| 343 | + }else{ | ||
| 344 | + if(msg == '确定要删除选中的数据吗?'){ | ||
| 345 | + top.jzts(); | ||
| 346 | + $.ajax({ | ||
| 347 | + type: "POST", | ||
| 348 | + url: '<%=basePath%>softwareversion/deleteAll.do?tm='+new Date().getTime(), | ||
| 349 | + data: {DATA_IDS:str}, | ||
| 350 | + dataType:'json', | ||
| 351 | + //beforeSend: validateData, | ||
| 352 | + cache: false, | ||
| 353 | + success: function(data){ | ||
| 354 | + $.each(data.list, function(i, list){ | ||
| 355 | + tosearch(); | ||
| 356 | + }); | ||
| 357 | + } | ||
| 358 | + }); | ||
| 359 | + } | ||
| 360 | + } | ||
| 361 | + } | ||
| 362 | + }); | ||
| 363 | + }; | ||
| 364 | + | ||
| 365 | + //导出excel | ||
| 366 | + function toExcel(){ | ||
| 367 | + window.location.href='<%=basePath%>softwareversion/excel.do'; | ||
| 368 | + } | ||
| 369 | + </script> | ||
| 370 | + | ||
| 371 | + | ||
| 372 | +</body> | ||
| 373 | +</html> | ||
| 0 | \ No newline at end of file | 374 | \ No newline at end of file |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_edit.jsp
| @@ -76,10 +76,10 @@ | @@ -76,10 +76,10 @@ | ||
| 76 | </td> | 76 | </td> |
| 77 | <%-- <input type="number" name="SEX" id="SEX" value="${pd.SEX}" maxlength="32" placeholder="这里输入性别" title="性别" style="width:98%;"/></td> --%> | 77 | <%-- <input type="number" name="SEX" id="SEX" value="${pd.SEX}" maxlength="32" placeholder="这里输入性别" title="性别" style="width:98%;"/></td> --%> |
| 78 | </tr> | 78 | </tr> |
| 79 | - <tr> | 79 | + <%-- <tr> |
| 80 | <td style="width:75px;text-align: right;padding-top: 13px;">科目列表:</td> | 80 | <td style="width:75px;text-align: right;padding-top: 13px;">科目列表:</td> |
| 81 | <td><input type="text" name="SUBJECT_IDS" id="SUBJECT_IDS" value="${pd.SUBJECT_IDS}" maxlength="255" placeholder="这里输入科目列表" title="科目列表" style="width:98%;"/></td> | 81 | <td><input type="text" name="SUBJECT_IDS" id="SUBJECT_IDS" value="${pd.SUBJECT_IDS}" maxlength="255" placeholder="这里输入科目列表" title="科目列表" style="width:98%;"/></td> |
| 82 | - </tr> | 82 | + </tr> --%> |
| 83 | <tr> | 83 | <tr> |
| 84 | <td style="width:75px;text-align: right;padding-top: 13px;">教师卡编号:</td> | 84 | <td style="width:75px;text-align: right;padding-top: 13px;">教师卡编号:</td> |
| 85 | <td><input type="text" name="KEYPAD_ID" id="KEYPAD_ID" value="${pd.KEYPAD_ID}" maxlength="255" placeholder="这里输入教师卡编号" title="教师卡编号" style="width:98%;"/></td> | 85 | <td><input type="text" name="KEYPAD_ID" id="KEYPAD_ID" value="${pd.KEYPAD_ID}" maxlength="255" placeholder="这里输入教师卡编号" title="教师卡编号" style="width:98%;"/></td> |
| @@ -199,16 +199,6 @@ | @@ -199,16 +199,6 @@ | ||
| 199 | $("#SEX").focus(); | 199 | $("#SEX").focus(); |
| 200 | return false; | 200 | return false; |
| 201 | } | 201 | } |
| 202 | - if($("#SUBJECT_IDS").val()==""){ | ||
| 203 | - $("#SUBJECT_IDS").tips({ | ||
| 204 | - side:3, | ||
| 205 | - msg:'请输入科目列表', | ||
| 206 | - bg:'#AE81FF', | ||
| 207 | - time:2 | ||
| 208 | - }); | ||
| 209 | - $("#SUBJECT_IDS").focus(); | ||
| 210 | - return false; | ||
| 211 | - } | ||
| 212 | if($("#KEYPAD_ID").val()==""){ | 202 | if($("#KEYPAD_ID").val()==""){ |
| 213 | $("#KEYPAD_ID").tips({ | 203 | $("#KEYPAD_ID").tips({ |
| 214 | side:3, | 204 | side:3, |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_list.jsp
| @@ -74,7 +74,6 @@ | @@ -74,7 +74,6 @@ | ||
| 74 | <th class="center">证件号</th> | 74 | <th class="center">证件号</th> |
| 75 | <th class="center">账号</th> | 75 | <th class="center">账号</th> |
| 76 | <th class="center">性别</th> | 76 | <th class="center">性别</th> |
| 77 | - <th class="center">科目列表</th> | ||
| 78 | <th class="center">教师卡编号</th> | 77 | <th class="center">教师卡编号</th> |
| 79 | <th class="center">操作</th> | 78 | <th class="center">操作</th> |
| 80 | </tr> | 79 | </tr> |
| @@ -98,7 +97,6 @@ | @@ -98,7 +97,6 @@ | ||
| 98 | <td class='center'>${var.CARD_NO}</td> | 97 | <td class='center'>${var.CARD_NO}</td> |
| 99 | <td class='center'>${var.ACCOUT}</td> | 98 | <td class='center'>${var.ACCOUT}</td> |
| 100 | <td class='center'>${var.SEX == 1? "男":"女"}</td> | 99 | <td class='center'>${var.SEX == 1? "男":"女"}</td> |
| 101 | - <td class='center'>${var.SUBJECT_IDS}</td> | ||
| 102 | <td class='center'>${var.KEYPAD_ID}</td> | 100 | <td class='center'>${var.KEYPAD_ID}</td> |
| 103 | <td class="center"> | 101 | <td class="center"> |
| 104 | <c:if test="${QX.edit != 1 && QX.del != 1 }"> | 102 | <c:if test="${QX.edit != 1 && QX.del != 1 }"> |
WebRoot/WEB-INF/tld/elfun.tld
| @@ -126,6 +126,14 @@ | @@ -126,6 +126,14 @@ | ||
| 126 | <example>${myelfun:findTestPaperName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | 126 | <example>${myelfun:findTestPaperName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> |
| 127 | </function> | 127 | </function> |
| 128 | 128 | ||
| 129 | + <function> | ||
| 130 | + <description>根据ID查找软件名称</description><!-- 对该标签的说明 --> | ||
| 131 | + <name>findSoftwareName</name><!-- 定义标签名,放在短标签之后 --> | ||
| 132 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | ||
| 133 | + <function-signature>java.lang.String findSoftwareName(java.lang.String)</function-signature><!-- 标签处理域值的具体的类方法 --> | ||
| 134 | + <example>${myelfun:findSoftwareName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | ||
| 135 | + </function> | ||
| 136 | + | ||
| 129 | 137 | ||
| 130 | 138 | ||
| 131 | </taglib> | 139 | </taglib> |
resources/mybatis1/software/SoftWareMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | +<mapper namespace="SoftWareMapper"> | ||
| 4 | + | ||
| 5 | + <!--表名 --> | ||
| 6 | + <sql id="tableName"> | ||
| 7 | + SW_SOFTWARE | ||
| 8 | + </sql> | ||
| 9 | + | ||
| 10 | + <!-- 字段 --> | ||
| 11 | + <sql id="Field"> | ||
| 12 | + `NAME`, | ||
| 13 | + `DESC`, | ||
| 14 | + SOFTWARE_ID | ||
| 15 | + </sql> | ||
| 16 | + | ||
| 17 | + <!-- 字段值 --> | ||
| 18 | + <sql id="FieldValue"> | ||
| 19 | + #{NAME}, | ||
| 20 | + #{DESC}, | ||
| 21 | + #{SOFTWARE_ID} | ||
| 22 | + </sql> | ||
| 23 | + | ||
| 24 | + <!-- 新增--> | ||
| 25 | + <insert id="save" parameterType="pd"> | ||
| 26 | + insert into | ||
| 27 | + <include refid="tableName"></include> | ||
| 28 | + ( | ||
| 29 | + <include refid="Field"></include> | ||
| 30 | + ) values ( | ||
| 31 | + <include refid="FieldValue"></include> | ||
| 32 | + ) | ||
| 33 | + </insert> | ||
| 34 | + | ||
| 35 | + <!-- 删除--> | ||
| 36 | + <delete id="delete" parameterType="pd"> | ||
| 37 | + delete from | ||
| 38 | + <include refid="tableName"></include> | ||
| 39 | + where | ||
| 40 | + SOFTWARE_ID = #{SOFTWARE_ID} | ||
| 41 | + </delete> | ||
| 42 | + | ||
| 43 | + <!-- 修改 --> | ||
| 44 | + <update id="edit" parameterType="pd"> | ||
| 45 | + update | ||
| 46 | + <include refid="tableName"></include> | ||
| 47 | + set | ||
| 48 | + `NAME` = #{NAME}, | ||
| 49 | + `DESC` = #{DESC}, | ||
| 50 | + SOFTWARE_ID = SOFTWARE_ID | ||
| 51 | + where | ||
| 52 | + SOFTWARE_ID = #{SOFTWARE_ID} | ||
| 53 | + </update> | ||
| 54 | + | ||
| 55 | + <!-- 通过ID获取数据 --> | ||
| 56 | + <select id="findById" parameterType="pd" resultType="pd"> | ||
| 57 | + select | ||
| 58 | + <include refid="Field"></include> | ||
| 59 | + from | ||
| 60 | + <include refid="tableName"></include> | ||
| 61 | + where | ||
| 62 | + SOFTWARE_ID = #{SOFTWARE_ID} | ||
| 63 | + </select> | ||
| 64 | + | ||
| 65 | + <!-- 列表 --> | ||
| 66 | + <select id="datalistPage" parameterType="page" resultType="pd"> | ||
| 67 | + select | ||
| 68 | + <include refid="Field"></include> | ||
| 69 | + from | ||
| 70 | + <include refid="tableName"></include> | ||
| 71 | + where 1=1 | ||
| 72 | + <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 --> | ||
| 73 | + and | ||
| 74 | + ( | ||
| 75 | + <!-- 根据需求自己加检索条件 | ||
| 76 | + 字段1 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
| 77 | + or | ||
| 78 | + 字段2 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
| 79 | + --> | ||
| 80 | + ) | ||
| 81 | + </if> | ||
| 82 | + </select> | ||
| 83 | + | ||
| 84 | + <!-- 列表(全部) --> | ||
| 85 | + <select id="listAll" parameterType="pd" resultType="pd"> | ||
| 86 | + select | ||
| 87 | + <include refid="Field"></include> | ||
| 88 | + from | ||
| 89 | + <include refid="tableName"></include> | ||
| 90 | + </select> | ||
| 91 | + | ||
| 92 | + <!-- 批量删除 --> | ||
| 93 | + <delete id="deleteAll" parameterType="String"> | ||
| 94 | + delete from | ||
| 95 | + <include refid="tableName"></include> | ||
| 96 | + where | ||
| 97 | + SOFTWARE_ID in | ||
| 98 | + <foreach item="item" index="index" collection="array" open="(" separator="," close=")"> | ||
| 99 | + #{item} | ||
| 100 | + </foreach> | ||
| 101 | + </delete> | ||
| 102 | + | ||
| 103 | + <!-- fh313596790qq(青苔) --> | ||
| 104 | +</mapper> | ||
| 0 | \ No newline at end of file | 105 | \ No newline at end of file |
resources/mybatis1/software/SoftwareVersionMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | +<mapper namespace="SoftwareVersionMapper"> | ||
| 4 | + | ||
| 5 | + <!--表名 --> | ||
| 6 | + <sql id="tableName"> | ||
| 7 | + SW_SOFTWAREVERSION | ||
| 8 | + </sql> | ||
| 9 | + | ||
| 10 | + <!-- 字段 --> | ||
| 11 | + <sql id="Field"> | ||
| 12 | + SOFTWARE_ID, | ||
| 13 | + VERSION_NAME, | ||
| 14 | + VERSION_CODE, | ||
| 15 | + VERSION_PATH, | ||
| 16 | + VERSION_DESC, | ||
| 17 | + SOFTWAREVERSION_ID | ||
| 18 | + </sql> | ||
| 19 | + | ||
| 20 | + <!-- 字段值 --> | ||
| 21 | + <sql id="FieldValue"> | ||
| 22 | + #{SOFTWARE_ID}, | ||
| 23 | + #{VERSION_NAME}, | ||
| 24 | + #{VERSION_CODE}, | ||
| 25 | + #{VERSION_PATH}, | ||
| 26 | + #{VERSION_DESC}, | ||
| 27 | + #{SOFTWAREVERSION_ID} | ||
| 28 | + </sql> | ||
| 29 | + | ||
| 30 | + <!-- 新增--> | ||
| 31 | + <insert id="save" parameterType="pd"> | ||
| 32 | + insert into | ||
| 33 | + <include refid="tableName"></include> | ||
| 34 | + ( | ||
| 35 | + <include refid="Field"></include> | ||
| 36 | + ) values ( | ||
| 37 | + <include refid="FieldValue"></include> | ||
| 38 | + ) | ||
| 39 | + </insert> | ||
| 40 | + | ||
| 41 | + <!-- 删除--> | ||
| 42 | + <delete id="delete" parameterType="pd"> | ||
| 43 | + delete from | ||
| 44 | + <include refid="tableName"></include> | ||
| 45 | + where | ||
| 46 | + SOFTWAREVERSION_ID = #{SOFTWAREVERSION_ID} | ||
| 47 | + </delete> | ||
| 48 | + | ||
| 49 | + <!-- 修改 --> | ||
| 50 | + <update id="edit" parameterType="pd"> | ||
| 51 | + update | ||
| 52 | + <include refid="tableName"></include> | ||
| 53 | + set | ||
| 54 | + SOFTWARE_ID = #{SOFTWARE_ID}, | ||
| 55 | + VERSION_NAME = #{VERSION_NAME}, | ||
| 56 | + VERSION_CODE = #{VERSION_CODE}, | ||
| 57 | + VERSION_PATH = #{VERSION_PATH}, | ||
| 58 | + VERSION_DESC = #{VERSION_DESC}, | ||
| 59 | + SOFTWAREVERSION_ID = SOFTWAREVERSION_ID | ||
| 60 | + where | ||
| 61 | + SOFTWAREVERSION_ID = #{SOFTWAREVERSION_ID} | ||
| 62 | + </update> | ||
| 63 | + | ||
| 64 | + <!-- 通过ID获取数据 --> | ||
| 65 | + <select id="findById" parameterType="pd" resultType="pd"> | ||
| 66 | + select | ||
| 67 | + <include refid="Field"></include> | ||
| 68 | + from | ||
| 69 | + <include refid="tableName"></include> | ||
| 70 | + where | ||
| 71 | + SOFTWAREVERSION_ID = #{SOFTWAREVERSION_ID} | ||
| 72 | + </select> | ||
| 73 | + | ||
| 74 | + <!-- 通过ID获取数据 --> | ||
| 75 | + <select id="findNewVersion" parameterType="pd" resultType="pd"> | ||
| 76 | + select | ||
| 77 | + <include refid="Field"></include> | ||
| 78 | + from | ||
| 79 | + <include refid="tableName"></include> | ||
| 80 | + where 1 = 1 | ||
| 81 | + <if test="SOFTWARE_ID != null and SOFTWARE_ID != ''"><!-- 关键词检索 --> | ||
| 82 | + and SOFTWARE_ID = #{SOFTWARE_ID} | ||
| 83 | + </if> | ||
| 84 | + | ||
| 85 | + HAVING VERSION_CODE = max(VERSION_CODE) | ||
| 86 | + | ||
| 87 | + </select> | ||
| 88 | + | ||
| 89 | + <!-- 列表 --> | ||
| 90 | + <select id="datalistPage" parameterType="page" resultType="pd"> | ||
| 91 | + select | ||
| 92 | + <include refid="Field"></include> | ||
| 93 | + from | ||
| 94 | + <include refid="tableName"></include> | ||
| 95 | + where 1=1 | ||
| 96 | + <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 --> | ||
| 97 | + and | ||
| 98 | + ( | ||
| 99 | + <!-- 根据需求自己加检索条件 | ||
| 100 | + 字段1 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
| 101 | + or | ||
| 102 | + 字段2 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
| 103 | + --> | ||
| 104 | + ) | ||
| 105 | + </if> | ||
| 106 | + </select> | ||
| 107 | + | ||
| 108 | + <!-- 列表(全部) --> | ||
| 109 | + <select id="listAll" parameterType="pd" resultType="pd"> | ||
| 110 | + select | ||
| 111 | + <include refid="Field"></include> | ||
| 112 | + from | ||
| 113 | + <include refid="tableName"></include> | ||
| 114 | + </select> | ||
| 115 | + | ||
| 116 | + <!-- 批量删除 --> | ||
| 117 | + <delete id="deleteAll" parameterType="String"> | ||
| 118 | + delete from | ||
| 119 | + <include refid="tableName"></include> | ||
| 120 | + where | ||
| 121 | + SOFTWAREVERSION_ID in | ||
| 122 | + <foreach item="item" index="index" collection="array" open="(" separator="," close=")"> | ||
| 123 | + #{item} | ||
| 124 | + </foreach> | ||
| 125 | + </delete> | ||
| 126 | + | ||
| 127 | + <!-- fh313596790qq(青苔) --> | ||
| 128 | +</mapper> | ||
| 0 | \ No newline at end of file | 129 | \ No newline at end of file |
resources/mybatis1/sunvote/StudentTestMapper.xml
| @@ -42,8 +42,22 @@ | @@ -42,8 +42,22 @@ | ||
| 42 | <delete id="delete" parameterType="pd"> | 42 | <delete id="delete" parameterType="pd"> |
| 43 | delete from | 43 | delete from |
| 44 | <include refid="tableName"></include> | 44 | <include refid="tableName"></include> |
| 45 | - where | ||
| 46 | - STUDENTTEST_ID = #{STUDENTTEST_ID} | 45 | + where 1 =1 |
| 46 | + <if test="STUDENTTEST_ID != null and STUDENTTEST_ID != ''"> | ||
| 47 | + and STUDENTTEST_ID = #{STUDENTTEST_ID} | ||
| 48 | + </if> | ||
| 49 | + <if test="STUDENT_ID != null and STUDENT_ID != ''"> | ||
| 50 | + and STUDENT_ID = #{STUDENT_ID} | ||
| 51 | + </if> | ||
| 52 | + <if test="TEST_ID != null and TEST_ID != ''"> | ||
| 53 | + and TEST_ID = #{TEST_ID} | ||
| 54 | + </if> | ||
| 55 | + <if test="PAPER_ID != null and PAPER_ID != ''"> | ||
| 56 | + and PAPER_ID = #{PAPER_ID} | ||
| 57 | + </if> | ||
| 58 | + <if test="CLASS_ID != null and CLASS_ID != ''"> | ||
| 59 | + and CLASS_ID = #{CLASS_ID} | ||
| 60 | + </if> | ||
| 47 | </delete> | 61 | </delete> |
| 48 | 62 | ||
| 49 | <!-- 修改 --> | 63 | <!-- 修改 --> |
resources/mybatis1/sunvote/TestPaperInfoMapper.xml
| @@ -58,12 +58,65 @@ | @@ -58,12 +58,65 @@ | ||
| 58 | ) | 58 | ) |
| 59 | </insert> | 59 | </insert> |
| 60 | 60 | ||
| 61 | + <!-- 新增--> | ||
| 62 | + <insert id="batchSave" parameterType="java.util.List"> | ||
| 63 | + insert into | ||
| 64 | + <include refid="tableName"></include> | ||
| 65 | + ( | ||
| 66 | + <include refid="Field"></include> | ||
| 67 | + ) values | ||
| 68 | + | ||
| 69 | + <foreach collection="list" index="index" item="item" separator=","> | ||
| 70 | + ( | ||
| 71 | + #{item.PAPER_ID}, | ||
| 72 | + #{item.STUDENT_ID}, | ||
| 73 | + #{item.TEST_ID}, | ||
| 74 | + #{item.QUESTION_ID}, | ||
| 75 | + #{item.ANSWER}, | ||
| 76 | + #{item.RIGHT}, | ||
| 77 | + #{item.SCORE}, | ||
| 78 | + #{item.LIKES}, | ||
| 79 | + #{item.ANSWER_TYPE}, | ||
| 80 | + #{item.PRESS_TIME}, | ||
| 81 | + #{item.RECEIVER_DATE}, | ||
| 82 | + #{item.SUBJECTIVE}, | ||
| 83 | + #{item.NOTE}, | ||
| 84 | + #{item.MARK_NO}, | ||
| 85 | + #{item.RANK}, | ||
| 86 | + #{item.TESTPAPERINFO_ID} | ||
| 87 | + ) | ||
| 88 | + </foreach> | ||
| 89 | + | ||
| 90 | + </insert> | ||
| 91 | + | ||
| 61 | <!-- 删除--> | 92 | <!-- 删除--> |
| 62 | <delete id="delete" parameterType="pd"> | 93 | <delete id="delete" parameterType="pd"> |
| 63 | delete from | 94 | delete from |
| 64 | <include refid="tableName"></include> | 95 | <include refid="tableName"></include> |
| 65 | - where | ||
| 66 | - TESTPAPERINFO_ID = #{TESTPAPERINFO_ID} | 96 | + where 1 =1 |
| 97 | + <if test="TESTPAPERINFO_ID != null and TESTPAPERINFO_ID != ''"> | ||
| 98 | + and TESTPAPERINFO_ID = #{TESTPAPERINFO_ID} | ||
| 99 | + </if> | ||
| 100 | + <if test="TEST_ID != null and TEST_ID != ''"> | ||
| 101 | + and TEST_ID = #{TEST_ID} | ||
| 102 | + </if> | ||
| 103 | + <if test="STUDENT_ID != null and STUDENT_ID != ''"> | ||
| 104 | + and STUDENT_ID = #{STUDENT_ID} | ||
| 105 | + </if> | ||
| 106 | + <if test="PAPER_ID != null and PAPER_ID != ''"> | ||
| 107 | + and PAPER_ID = #{PAPER_ID} | ||
| 108 | + </if> | ||
| 109 | + <if test="QUESTION_ID != null and QUESTION_ID != ''"> | ||
| 110 | + and QUESTION_ID = #{QUESTION_ID} | ||
| 111 | + </if> | ||
| 112 | + | ||
| 113 | + <if test="(TESTPAPERINFO_ID == null or TESTPAPERINFO_ID == '') | ||
| 114 | + and (TEST_ID == null or TEST_ID == '') | ||
| 115 | + and (STUDENT_ID == null or STUDENT_ID == '') | ||
| 116 | + and (PAPER_ID == null or PAPER_ID == '') | ||
| 117 | + and (QUESTION_ID == null or QUESTION_ID == '')"> | ||
| 118 | + and 1 = 2 | ||
| 119 | + </if> | ||
| 67 | </delete> | 120 | </delete> |
| 68 | 121 | ||
| 69 | <!-- 修改 --> | 122 | <!-- 修改 --> |
resources/mybatis1/sunvote/TestPaperMapper.xml
| @@ -129,6 +129,9 @@ | @@ -129,6 +129,9 @@ | ||
| 129 | <if test="TEACHER_ID != null and TEACHER_ID != ''"><!-- 关键词检索 --> | 129 | <if test="TEACHER_ID != null and TEACHER_ID != ''"><!-- 关键词检索 --> |
| 130 | and (TEACHER_ID = #{TEACHER_ID}) | 130 | and (TEACHER_ID = #{TEACHER_ID}) |
| 131 | </if> | 131 | </if> |
| 132 | + <if test="CREATE_DATE != null and CREATE_DATE != ''"><!-- 关键词检索 --> | ||
| 133 | + and (CREATE_DATE = #{CREATE_DATE}) | ||
| 134 | + </if> | ||
| 132 | <if test="NAME != null and NAME != ''"><!-- 关键词检索 --> | 135 | <if test="NAME != null and NAME != ''"><!-- 关键词检索 --> |
| 133 | and (NAME = #{NAME}) | 136 | and (NAME = #{NAME}) |
| 134 | </if> | 137 | </if> |
| @@ -146,5 +149,29 @@ | @@ -146,5 +149,29 @@ | ||
| 146 | </foreach> | 149 | </foreach> |
| 147 | </delete> | 150 | </delete> |
| 148 | 151 | ||
| 152 | + <!-- 批量删除 --> | ||
| 153 | + <delete id="deleteList" parameterType="pd"> | ||
| 154 | + delete from | ||
| 155 | + <include refid="tableName"></include> | ||
| 156 | + where 1 =1 | ||
| 157 | + | ||
| 158 | + <if test="PAPER_ID != null and PAPER_ID != ''"><!-- 关键词检索 --> | ||
| 159 | + and (PAPER_ID = #{PAPER_ID}) | ||
| 160 | + </if> | ||
| 161 | + <if test="CLASS_ID != null and CLASS_ID != ''"><!-- 关键词检索 --> | ||
| 162 | + and (SCLASS_ID = #{CLASS_ID}) | ||
| 163 | + </if> | ||
| 164 | + <if test="TEACHER_ID != null and TEACHER_ID != ''"><!-- 关键词检索 --> | ||
| 165 | + and (TEACHER_ID = #{TEACHER_ID}) | ||
| 166 | + </if> | ||
| 167 | + <if test="CREATE_DATE != null and CREATE_DATE != ''"><!-- 关键词检索 --> | ||
| 168 | + and (CREATE_DATE = #{CREATE_DATE}) | ||
| 169 | + </if> | ||
| 170 | + <if test="NAME != null and NAME != ''"><!-- 关键词检索 --> | ||
| 171 | + and (NAME = #{NAME}) | ||
| 172 | + </if> | ||
| 173 | + | ||
| 174 | + </delete> | ||
| 175 | + | ||
| 149 | <!-- fh313596790qq(青苔) --> | 176 | <!-- fh313596790qq(青苔) --> |
| 150 | </mapper> | 177 | </mapper> |
| 151 | \ No newline at end of file | 178 | \ No newline at end of file |
src/com/fh/controller/api/ApiServer.java
| @@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletRequest; | @@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletRequest; | ||
| 12 | import org.springframework.stereotype.Controller; | 12 | import org.springframework.stereotype.Controller; |
| 13 | import org.springframework.web.bind.annotation.RequestMapping; | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| 14 | import org.springframework.web.bind.annotation.ResponseBody; | 14 | import org.springframework.web.bind.annotation.ResponseBody; |
| 15 | -import org.springframework.web.multipart.MultipartFile; | 15 | +import org.springframework.web.multipart.commons.CommonsMultipartFile; |
| 16 | 16 | ||
| 17 | import Decoder.BASE64Decoder; | 17 | import Decoder.BASE64Decoder; |
| 18 | 18 | ||
| @@ -348,7 +348,7 @@ public class ApiServer extends BaseController { | @@ -348,7 +348,7 @@ public class ApiServer extends BaseController { | ||
| 348 | 348 | ||
| 349 | @RequestMapping(value = "/feedback/add", produces = "application/json;charset=UTF-8") | 349 | @RequestMapping(value = "/feedback/add", produces = "application/json;charset=UTF-8") |
| 350 | @ResponseBody | 350 | @ResponseBody |
| 351 | - public Object feedbackAdd(MultipartFile file, HttpServletRequest request) | 351 | + public Object feedbackAdd(CommonsMultipartFile file, HttpServletRequest request) |
| 352 | throws Exception { | 352 | throws Exception { |
| 353 | PageData pd = this.getPageData(); | 353 | PageData pd = this.getPageData(); |
| 354 | ResponseGson<PageData> res = new ResponseGson(); | 354 | ResponseGson<PageData> res = new ResponseGson(); |
src/com/fh/controller/api/V1.java
| @@ -5,9 +5,11 @@ import java.util.Date; | @@ -5,9 +5,11 @@ import java.util.Date; | ||
| 5 | import java.util.List; | 5 | import java.util.List; |
| 6 | 6 | ||
| 7 | import javax.annotation.Resource; | 7 | import javax.annotation.Resource; |
| 8 | +import javax.servlet.http.HttpServletRequest; | ||
| 8 | 9 | ||
| 9 | import org.apache.commons.lang.StringUtils; | 10 | import org.apache.commons.lang.StringUtils; |
| 10 | import org.springframework.stereotype.Controller; | 11 | import org.springframework.stereotype.Controller; |
| 12 | +import org.springframework.transaction.annotation.Transactional; | ||
| 11 | import org.springframework.web.bind.annotation.RequestMapping; | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| 12 | import org.springframework.web.bind.annotation.ResponseBody; | 14 | import org.springframework.web.bind.annotation.ResponseBody; |
| 13 | 15 | ||
| @@ -22,6 +24,7 @@ import com.fh.entity.Page; | @@ -22,6 +24,7 @@ import com.fh.entity.Page; | ||
| 22 | import com.fh.service.api.V1Manager; | 24 | import com.fh.service.api.V1Manager; |
| 23 | import com.fh.service.feedback.feedback.FeedbackManager; | 25 | import com.fh.service.feedback.feedback.FeedbackManager; |
| 24 | import com.fh.service.feedback.problemphenomenon.ProblemPhenomenonManager; | 26 | import com.fh.service.feedback.problemphenomenon.ProblemPhenomenonManager; |
| 27 | +import com.fh.service.software.softwareversion.SoftwareVersionManager; | ||
| 25 | import com.fh.service.sunvote.basestation.BasestationManager; | 28 | import com.fh.service.sunvote.basestation.BasestationManager; |
| 26 | import com.fh.service.sunvote.chapter.ChapterManager; | 29 | import com.fh.service.sunvote.chapter.ChapterManager; |
| 27 | import com.fh.service.sunvote.classbasetation.ClassBasetationManager; | 30 | import com.fh.service.sunvote.classbasetation.ClassBasetationManager; |
| @@ -141,6 +144,9 @@ public class V1 extends BaseController { | @@ -141,6 +144,9 @@ public class V1 extends BaseController { | ||
| 141 | 144 | ||
| 142 | @Resource(name = "v1Service") | 145 | @Resource(name = "v1Service") |
| 143 | private V1Manager v1Service; | 146 | private V1Manager v1Service; |
| 147 | + | ||
| 148 | + @Resource(name="softwareversionService") | ||
| 149 | + private SoftwareVersionManager softwareversionService; | ||
| 144 | 150 | ||
| 145 | @RequestMapping(value = "/login", produces = "application/json;charset=UTF-8") | 151 | @RequestMapping(value = "/login", produces = "application/json;charset=UTF-8") |
| 146 | @ResponseBody | 152 | @ResponseBody |
| @@ -185,6 +191,7 @@ public class V1 extends BaseController { | @@ -185,6 +191,7 @@ public class V1 extends BaseController { | ||
| 185 | @RequestMapping(value = "/class", produces = "application/json;charset=UTF-8") | 191 | @RequestMapping(value = "/class", produces = "application/json;charset=UTF-8") |
| 186 | @ResponseBody | 192 | @ResponseBody |
| 187 | public Object sclass() throws Exception { | 193 | public Object sclass() throws Exception { |
| 194 | + long cur = System.currentTimeMillis(); | ||
| 188 | PageData pd = this.getPageData(); | 195 | PageData pd = this.getPageData(); |
| 189 | if (pd.containsKey("ID")) { | 196 | if (pd.containsKey("ID")) { |
| 190 | ResponseGson<PageData> res = new ResponseGson(); | 197 | ResponseGson<PageData> res = new ResponseGson(); |
| @@ -198,39 +205,45 @@ public class V1 extends BaseController { | @@ -198,39 +205,45 @@ public class V1 extends BaseController { | ||
| 198 | } else { | 205 | } else { |
| 199 | res.set2Error(); | 206 | res.set2Error(); |
| 200 | } | 207 | } |
| 208 | + logger.info("class cost time : " + (System.currentTimeMillis() - cur)); | ||
| 201 | return res.toJson(); | 209 | return res.toJson(); |
| 202 | } else { | 210 | } else { |
| 203 | ResponseGson<List<PageData>> res = new ResponseGson(); | 211 | ResponseGson<List<PageData>> res = new ResponseGson(); |
| 204 | List<PageData> list = sclassService.listAll(pd); | 212 | List<PageData> list = sclassService.listAll(pd); |
| 205 | res.setData(list); | 213 | res.setData(list); |
| 214 | + logger.info("class cost time : " + (System.currentTimeMillis() - cur)); | ||
| 206 | return res.toJson(); | 215 | return res.toJson(); |
| 207 | - | ||
| 208 | } | 216 | } |
| 209 | } | 217 | } |
| 210 | 218 | ||
| 211 | @RequestMapping(value = "/questiontype", produces = "application/json;charset=UTF-8") | 219 | @RequestMapping(value = "/questiontype", produces = "application/json;charset=UTF-8") |
| 212 | @ResponseBody | 220 | @ResponseBody |
| 213 | public Object questiontype() throws Exception { | 221 | public Object questiontype() throws Exception { |
| 222 | + long cur = System.currentTimeMillis(); | ||
| 214 | PageData pd = this.getPageData(); | 223 | PageData pd = this.getPageData(); |
| 215 | ResponseGson<List<PageData>> res = new ResponseGson(); | 224 | ResponseGson<List<PageData>> res = new ResponseGson(); |
| 216 | List<PageData> list = questiontypeService.listAll(pd); | 225 | List<PageData> list = questiontypeService.listAll(pd); |
| 217 | res.setData(list); | 226 | res.setData(list); |
| 227 | + logger.info("questiontype cost time : " + (System.currentTimeMillis() - cur)); | ||
| 218 | return res.toJson(); | 228 | return res.toJson(); |
| 219 | } | 229 | } |
| 220 | 230 | ||
| 221 | @RequestMapping(value = "/classtype", produces = "application/json;charset=UTF-8") | 231 | @RequestMapping(value = "/classtype", produces = "application/json;charset=UTF-8") |
| 222 | @ResponseBody | 232 | @ResponseBody |
| 223 | public Object classtype() throws Exception { | 233 | public Object classtype() throws Exception { |
| 234 | + long cur = System.currentTimeMillis(); | ||
| 224 | PageData pd = this.getPageData(); | 235 | PageData pd = this.getPageData(); |
| 225 | ResponseGson<List<PageData>> res = new ResponseGson(); | 236 | ResponseGson<List<PageData>> res = new ResponseGson(); |
| 226 | List<PageData> list = classtypeService.listAll(pd); | 237 | List<PageData> list = classtypeService.listAll(pd); |
| 227 | res.setData(list); | 238 | res.setData(list); |
| 239 | + logger.info("classtype cost time : " + (System.currentTimeMillis() - cur)); | ||
| 228 | return res.toJson(); | 240 | return res.toJson(); |
| 229 | } | 241 | } |
| 230 | 242 | ||
| 231 | @RequestMapping(value = "/grade", produces = "application/json;charset=UTF-8") | 243 | @RequestMapping(value = "/grade", produces = "application/json;charset=UTF-8") |
| 232 | @ResponseBody | 244 | @ResponseBody |
| 233 | public Object grade() throws Exception { | 245 | public Object grade() throws Exception { |
| 246 | + long cur = System.currentTimeMillis(); | ||
| 234 | PageData pd = this.getPageData(); | 247 | PageData pd = this.getPageData(); |
| 235 | ResponseGson<List<PageData>> res = new ResponseGson(); | 248 | ResponseGson<List<PageData>> res = new ResponseGson(); |
| 236 | if (!pd.containsKey("SCHOOL_ID")) { | 249 | if (!pd.containsKey("SCHOOL_ID")) { |
| @@ -240,12 +253,14 @@ public class V1 extends BaseController { | @@ -240,12 +253,14 @@ public class V1 extends BaseController { | ||
| 240 | List<PageData> list = schoolgradesubjectService.listAllGrade(pd); | 253 | List<PageData> list = schoolgradesubjectService.listAllGrade(pd); |
| 241 | res.setData(list); | 254 | res.setData(list); |
| 242 | } | 255 | } |
| 256 | + logger.info("class cost time : " + (System.currentTimeMillis() - cur)); | ||
| 243 | return res.toJson(); | 257 | return res.toJson(); |
| 244 | } | 258 | } |
| 245 | 259 | ||
| 246 | @RequestMapping(value = "/subject", produces = "application/json;charset=UTF-8") | 260 | @RequestMapping(value = "/subject", produces = "application/json;charset=UTF-8") |
| 247 | @ResponseBody | 261 | @ResponseBody |
| 248 | public Object subject() throws Exception { | 262 | public Object subject() throws Exception { |
| 263 | + long cur = System.currentTimeMillis(); | ||
| 249 | PageData pd = this.getPageData(); | 264 | PageData pd = this.getPageData(); |
| 250 | ResponseGson<List<PageData>> res = new ResponseGson(); | 265 | ResponseGson<List<PageData>> res = new ResponseGson(); |
| 251 | if (!pd.containsKey("SCHOOL_ID")) { | 266 | if (!pd.containsKey("SCHOOL_ID")) { |
| @@ -255,6 +270,7 @@ public class V1 extends BaseController { | @@ -255,6 +270,7 @@ public class V1 extends BaseController { | ||
| 255 | List<PageData> list = schoolgradesubjectService.listAllSubject(pd); | 270 | List<PageData> list = schoolgradesubjectService.listAllSubject(pd); |
| 256 | res.setData(list); | 271 | res.setData(list); |
| 257 | } | 272 | } |
| 273 | + logger.info("subject cost time : " + (System.currentTimeMillis() - cur)); | ||
| 258 | return res.toJson(); | 274 | return res.toJson(); |
| 259 | } | 275 | } |
| 260 | 276 | ||
| @@ -263,6 +279,7 @@ public class V1 extends BaseController { | @@ -263,6 +279,7 @@ public class V1 extends BaseController { | ||
| 263 | @RequestMapping(value = "/keypadscan", produces = "application/json;charset=UTF-8") | 279 | @RequestMapping(value = "/keypadscan", produces = "application/json;charset=UTF-8") |
| 264 | @ResponseBody | 280 | @ResponseBody |
| 265 | public Object keypadScan() throws Exception { | 281 | public Object keypadScan() throws Exception { |
| 282 | + long cur = System.currentTimeMillis(); | ||
| 266 | PageData pd = this.getPageData(); | 283 | PageData pd = this.getPageData(); |
| 267 | ResponseGson<String> res = new ResponseGson(); | 284 | ResponseGson<String> res = new ResponseGson(); |
| 268 | String ID = get32UUID(); | 285 | String ID = get32UUID(); |
| @@ -275,12 +292,14 @@ public class V1 extends BaseController { | @@ -275,12 +292,14 @@ public class V1 extends BaseController { | ||
| 275 | } catch (Exception ex) { | 292 | } catch (Exception ex) { |
| 276 | res.setDataError(); | 293 | res.setDataError(); |
| 277 | } | 294 | } |
| 295 | + logger.info("keypadScan cost time : " + (System.currentTimeMillis() - cur)); | ||
| 278 | return res.toJson(); | 296 | return res.toJson(); |
| 279 | } | 297 | } |
| 280 | 298 | ||
| 281 | @RequestMapping(value = "/paper", produces = "application/json;charset=UTF-8") | 299 | @RequestMapping(value = "/paper", produces = "application/json;charset=UTF-8") |
| 282 | @ResponseBody | 300 | @ResponseBody |
| 283 | public Object paper() throws Exception { | 301 | public Object paper() throws Exception { |
| 302 | + long cur = System.currentTimeMillis(); | ||
| 284 | PageData pd = this.getPageData(); | 303 | PageData pd = this.getPageData(); |
| 285 | ResponseGson<List<PageData>> res = new ResponseGson<List<PageData>>(); | 304 | ResponseGson<List<PageData>> res = new ResponseGson<List<PageData>>(); |
| 286 | if (pd.containsKey("PAPER_TYPE") && pd.containsKey("USER_ID")) { | 305 | if (pd.containsKey("PAPER_TYPE") && pd.containsKey("USER_ID")) { |
| @@ -308,12 +327,14 @@ public class V1 extends BaseController { | @@ -308,12 +327,14 @@ public class V1 extends BaseController { | ||
| 308 | } else { | 327 | } else { |
| 309 | res.setParmError(); | 328 | res.setParmError(); |
| 310 | } | 329 | } |
| 330 | + logger.info("paper cost time : " + (System.currentTimeMillis() - cur)); | ||
| 311 | return res.toJson(); | 331 | return res.toJson(); |
| 312 | } | 332 | } |
| 313 | 333 | ||
| 314 | @RequestMapping(value = "/paperinfo", produces = "application/json;charset=UTF-8") | 334 | @RequestMapping(value = "/paperinfo", produces = "application/json;charset=UTF-8") |
| 315 | @ResponseBody | 335 | @ResponseBody |
| 316 | public Object paperInfo() throws Exception { | 336 | public Object paperInfo() throws Exception { |
| 337 | + long cur = System.currentTimeMillis(); | ||
| 317 | PageData pd = this.getPageData(); | 338 | PageData pd = this.getPageData(); |
| 318 | ResponseGson<Paper> res = new ResponseGson<Paper>(); | 339 | ResponseGson<Paper> res = new ResponseGson<Paper>(); |
| 319 | if (pd.containsKey("PAPER_ID")) { | 340 | if (pd.containsKey("PAPER_ID")) { |
| @@ -412,21 +433,24 @@ public class V1 extends BaseController { | @@ -412,21 +433,24 @@ public class V1 extends BaseController { | ||
| 412 | } else { | 433 | } else { |
| 413 | res.setOtherError(); | 434 | res.setOtherError(); |
| 414 | } | 435 | } |
| 436 | + logger.info("paperInfo cost time : " + (System.currentTimeMillis() - cur)); | ||
| 415 | return res.toJson(); | 437 | return res.toJson(); |
| 416 | } | 438 | } |
| 417 | 439 | ||
| 418 | @RequestMapping(value = "/paperquestion", produces = "application/json;charset=UTF-8") | 440 | @RequestMapping(value = "/paperquestion", produces = "application/json;charset=UTF-8") |
| 419 | @ResponseBody | 441 | @ResponseBody |
| 420 | public Object paperQuestion() throws Exception { | 442 | public Object paperQuestion() throws Exception { |
| 443 | + long cur = System.currentTimeMillis(); | ||
| 421 | PageData pd = this.getPageData(); | 444 | PageData pd = this.getPageData(); |
| 422 | ResponseGson<PageData> res = new ResponseGson(); | 445 | ResponseGson<PageData> res = new ResponseGson(); |
| 423 | - | 446 | + logger.info("paperquestion cost time : " + (System.currentTimeMillis() - cur)); |
| 424 | return res.toJson(); | 447 | return res.toJson(); |
| 425 | } | 448 | } |
| 426 | 449 | ||
| 427 | @RequestMapping(value = "/question", produces = "application/json;charset=UTF-8") | 450 | @RequestMapping(value = "/question", produces = "application/json;charset=UTF-8") |
| 428 | @ResponseBody | 451 | @ResponseBody |
| 429 | public Object question() throws Exception { | 452 | public Object question() throws Exception { |
| 453 | + long cur = System.currentTimeMillis(); | ||
| 430 | PageData pd = this.getPageData(); | 454 | PageData pd = this.getPageData(); |
| 431 | ResponseGson<PageData> res = new ResponseGson(); | 455 | ResponseGson<PageData> res = new ResponseGson(); |
| 432 | if(pd.containsKey("ID")){ | 456 | if(pd.containsKey("ID")){ |
| @@ -436,22 +460,26 @@ public class V1 extends BaseController { | @@ -436,22 +460,26 @@ public class V1 extends BaseController { | ||
| 436 | }else{ | 460 | }else{ |
| 437 | res.setDataError(); | 461 | res.setDataError(); |
| 438 | } | 462 | } |
| 463 | + logger.info("question cost time : " + (System.currentTimeMillis() - cur)); | ||
| 439 | return res.toJson(); | 464 | return res.toJson(); |
| 440 | } | 465 | } |
| 441 | 466 | ||
| 442 | @RequestMapping(value = "/question/add", produces = "application/json;charset=UTF-8") | 467 | @RequestMapping(value = "/question/add", produces = "application/json;charset=UTF-8") |
| 443 | @ResponseBody | 468 | @ResponseBody |
| 444 | public Object questionAdd() throws Exception { | 469 | public Object questionAdd() throws Exception { |
| 470 | + long cur = System.currentTimeMillis(); | ||
| 445 | PageData pd = this.getPageData(); | 471 | PageData pd = this.getPageData(); |
| 446 | ResponseGson<PageData> res = new ResponseGson(); | 472 | ResponseGson<PageData> res = new ResponseGson(); |
| 447 | pd.put("QUESTION_ID", this.get32UUID()); | 473 | pd.put("QUESTION_ID", this.get32UUID()); |
| 448 | questionService.save(pd); | 474 | questionService.save(pd); |
| 475 | + logger.info("questionAdd cost time : " + (System.currentTimeMillis() - cur)); | ||
| 449 | return res.toJson(); | 476 | return res.toJson(); |
| 450 | } | 477 | } |
| 451 | 478 | ||
| 452 | @RequestMapping(value = "/uploadpaper", produces = "application/json;charset=UTF-8") | 479 | @RequestMapping(value = "/uploadpaper", produces = "application/json;charset=UTF-8") |
| 453 | @ResponseBody | 480 | @ResponseBody |
| 454 | public Object uploadpaper() throws Exception { | 481 | public Object uploadpaper() throws Exception { |
| 482 | + long cur = System.currentTimeMillis(); | ||
| 455 | PageData pd = this.getPageData(); | 483 | PageData pd = this.getPageData(); |
| 456 | ResponseGson<String> res = new ResponseGson(); | 484 | ResponseGson<String> res = new ResponseGson(); |
| 457 | 485 | ||
| @@ -571,7 +599,7 @@ public class V1 extends BaseController { | @@ -571,7 +599,7 @@ public class V1 extends BaseController { | ||
| 571 | } else { | 599 | } else { |
| 572 | res.setDataError(); | 600 | res.setDataError(); |
| 573 | } | 601 | } |
| 574 | - | 602 | + logger.info("uploadpaper cost time : " + (System.currentTimeMillis() - cur)); |
| 575 | return res.toJson(); | 603 | return res.toJson(); |
| 576 | } | 604 | } |
| 577 | 605 | ||
| @@ -588,18 +616,140 @@ public class V1 extends BaseController { | @@ -588,18 +616,140 @@ public class V1 extends BaseController { | ||
| 588 | try { | 616 | try { |
| 589 | PageData testPd = new PageData(); | 617 | PageData testPd = new PageData(); |
| 590 | String testPaperId = this.get32UUID(); | 618 | String testPaperId = this.get32UUID(); |
| 591 | - testPd.put("TESTPAPER_ID", testPaperId); | ||
| 592 | testPd.put("TEACHER_ID", testPaper.getTeacherId()); | 619 | testPd.put("TEACHER_ID", testPaper.getTeacherId()); |
| 593 | - testPd.put("NAME", testPaper.getName()); | ||
| 594 | testPd.put("PAPER_ID", testPaper.getPaperId()); | 620 | testPd.put("PAPER_ID", testPaper.getPaperId()); |
| 595 | testPd.put("SCLASS_ID", testPaper.getClassId()); | 621 | testPd.put("SCLASS_ID", testPaper.getClassId()); |
| 596 | - testPd.put("START_DATE", testPaper.getStartDate()); | ||
| 597 | - testPd.put("END_DATE", testPaper.getEndDate()); | ||
| 598 | testPd.put( | 622 | testPd.put( |
| 599 | "CREATE_DATE", | 623 | "CREATE_DATE", |
| 600 | testPaper.getCreateDate() == null ? Tools | 624 | testPaper.getCreateDate() == null ? Tools |
| 601 | .date2Str(new Date()) : testPaper | 625 | .date2Str(new Date()) : testPaper |
| 602 | .getCreateDate()); | 626 | .getCreateDate()); |
| 627 | + List<PageData> listData = testpaperService.listAll(testPd); | ||
| 628 | + if (!(listData != null && listData.size() > 0)) { | ||
| 629 | + testPd.put("START_DATE", testPaper.getStartDate()); | ||
| 630 | + testPd.put("END_DATE", testPaper.getEndDate()); | ||
| 631 | + testPd.put("NAME", testPaper.getName()); | ||
| 632 | + testPd.put("TESTPAPER_ID", testPaperId); | ||
| 633 | + testPd.put("OTHER_SCORE", testPaper.getOtherScore()); | ||
| 634 | + testPd.put("HIGHT_SCORE", testPaper.getHighScore()); | ||
| 635 | + testPd.put("LOW_SCORE", testPaper.getLowScore()); | ||
| 636 | + testPd.put("AVG_SCORE", testPaper.getAvgScore()); | ||
| 637 | + testPd.put("REMARK", testPaper.getRemark()); | ||
| 638 | + testpaperService.save(testPd); | ||
| 639 | + if (testPaper.getStudents() != null) { | ||
| 640 | + List<PageData> testInfoPdList = new ArrayList(); | ||
| 641 | + PageData testInfoPd = null; | ||
| 642 | + for (StudentAnswer studentAnswer : testPaper | ||
| 643 | + .getStudents()) { | ||
| 644 | + if (studentAnswer.getQuestions() != null) { | ||
| 645 | + PageData studentPageData = new PageData(); | ||
| 646 | + studentPageData.put("STUDENTTEST_ID", | ||
| 647 | + get32UUID()); | ||
| 648 | + studentPageData.put("STUDENT_ID", | ||
| 649 | + studentAnswer.getStudentId()); | ||
| 650 | + studentPageData.put("TEST_ID", testPaperId); | ||
| 651 | + studentPageData.put("PAPER_ID", | ||
| 652 | + testPaper.getPaperId()); | ||
| 653 | + studentPageData.put("SCORE", | ||
| 654 | + studentAnswer.getScore()); | ||
| 655 | + studentPageData.put("CLASS_ID", | ||
| 656 | + testPaper.getClassId()); | ||
| 657 | + studenttestService.save(studentPageData); | ||
| 658 | + | ||
| 659 | + for (TestPaperInfo testPaperInfo : studentAnswer | ||
| 660 | + .getQuestions()) { | ||
| 661 | + testInfoPd = new PageData(); | ||
| 662 | + testInfoPd.put("TESTPAPERINFO_ID", | ||
| 663 | + this.get32UUID()); | ||
| 664 | + testInfoPd.put("PAPER_ID", | ||
| 665 | + testPaper.getPaperId()); | ||
| 666 | + testInfoPd.put("STUDENT_ID", | ||
| 667 | + studentAnswer.getStudentId()); | ||
| 668 | + testInfoPd.put("TEST_ID", testPaperId); | ||
| 669 | + testInfoPd.put("QUESTION_ID", | ||
| 670 | + testPaperInfo.getQuestionId()); | ||
| 671 | + testInfoPd.put("ANSWER", | ||
| 672 | + testPaperInfo.getAnswer()); | ||
| 673 | + testInfoPd.put("RIGHT", | ||
| 674 | + testPaperInfo.getRight()); | ||
| 675 | + testInfoPd.put("SCORE", | ||
| 676 | + testPaperInfo.getScore()); | ||
| 677 | + testInfoPd.put("LIKES", | ||
| 678 | + testPaperInfo.getLikes()); | ||
| 679 | + testInfoPd | ||
| 680 | + .put("ANSWER_TYPE", | ||
| 681 | + testPaperInfo | ||
| 682 | + .getAnswerType() == null ? "1" | ||
| 683 | + : testPaperInfo | ||
| 684 | + .getAnswerType()); | ||
| 685 | + testInfoPd.put("PRESS_TIME", | ||
| 686 | + testPaperInfo.getPressTime()); | ||
| 687 | + testInfoPd.put("RECEIVER_DATE", | ||
| 688 | + testPaperInfo.getReceiverDate()); | ||
| 689 | + testInfoPd.put("SUBJECTIVE", | ||
| 690 | + testPaperInfo.getSubjective()); | ||
| 691 | + testInfoPd.put("NOTE", | ||
| 692 | + testPaperInfo.getNote()); | ||
| 693 | + testInfoPd.put("MARK_NO", | ||
| 694 | + testPaperInfo.getMarkNo()); | ||
| 695 | + testInfoPdList.add(testInfoPd); | ||
| 696 | + } | ||
| 697 | + } | ||
| 698 | + } | ||
| 699 | + testpaperinfoService.batchSave(testInfoPdList); | ||
| 700 | + } | ||
| 701 | + }else{ | ||
| 702 | + testPaperId = listData.get(0).getString("TESTPAPER_ID"); | ||
| 703 | + } | ||
| 704 | + res.setData(testPaperId); | ||
| 705 | + } catch (Exception e) { | ||
| 706 | + e.printStackTrace(); | ||
| 707 | + res.setError(); | ||
| 708 | + res.setMessage(e.getMessage()); | ||
| 709 | + } | ||
| 710 | + } else { | ||
| 711 | + res.setDataError(); | ||
| 712 | + } | ||
| 713 | + logger.info("uploadtestpaper cost time:" + (System.currentTimeMillis() - cur)); | ||
| 714 | + | ||
| 715 | + return res.toJson(); | ||
| 716 | + | ||
| 717 | + } | ||
| 718 | + | ||
| 719 | + | ||
| 720 | + // 上传测验成绩 | ||
| 721 | + @RequestMapping(value = "/uploadupdatetestpaper", produces = "application/json;charset=UTF-8") | ||
| 722 | + @ResponseBody | ||
| 723 | + public Object uploadupdateTestpaper() { | ||
| 724 | + long cur = System.currentTimeMillis(); | ||
| 725 | + PageData pd = this.getPageData(); | ||
| 726 | + ResponseGson<String> res = new ResponseGson(); | ||
| 727 | + if (!StringUtils.isEmpty(pd.getJsonString())) { | ||
| 728 | + logger.info(pd.getJsonString()); | ||
| 729 | + TestPaper testPaper = TestPaper.parse(pd.getJsonString()); | ||
| 730 | + try { | ||
| 731 | + PageData testPd = new PageData(); | ||
| 732 | + String testPaperId = this.get32UUID(); | ||
| 733 | + testPd.put("TEACHER_ID", testPaper.getTeacherId()); | ||
| 734 | + testPd.put("PAPER_ID", testPaper.getPaperId()); | ||
| 735 | + testPd.put("SCLASS_ID", testPaper.getClassId()); | ||
| 736 | + testPd.put( | ||
| 737 | + "CREATE_DATE", | ||
| 738 | + testPaper.getCreateDate() == null ? Tools | ||
| 739 | + .date2Str(new Date()) : testPaper | ||
| 740 | + .getCreateDate()); | ||
| 741 | + List<PageData> listData = testpaperService.listAll(testPd); | ||
| 742 | + if ((listData != null && listData.size() > 0)) { | ||
| 743 | + testPaperId = listData.get(0).getString("TESTPAPER_ID"); | ||
| 744 | + testpaperService.deleteList(testPd); | ||
| 745 | + testPd.put("TEST_ID", testPaperId); | ||
| 746 | + testpaperinfoService.delete(testPd); | ||
| 747 | + studenttestService.delete(testPd); | ||
| 748 | + } | ||
| 749 | + testPd.put("START_DATE", testPaper.getStartDate()); | ||
| 750 | + testPd.put("END_DATE", testPaper.getEndDate()); | ||
| 751 | + testPd.put("NAME", testPaper.getName()); | ||
| 752 | + testPd.put("TESTPAPER_ID", testPaperId); | ||
| 603 | testPd.put("OTHER_SCORE", testPaper.getOtherScore()); | 753 | testPd.put("OTHER_SCORE", testPaper.getOtherScore()); |
| 604 | testPd.put("HIGHT_SCORE", testPaper.getHighScore()); | 754 | testPd.put("HIGHT_SCORE", testPaper.getHighScore()); |
| 605 | testPd.put("LOW_SCORE", testPaper.getLowScore()); | 755 | testPd.put("LOW_SCORE", testPaper.getLowScore()); |
| @@ -607,10 +757,11 @@ public class V1 extends BaseController { | @@ -607,10 +757,11 @@ public class V1 extends BaseController { | ||
| 607 | testPd.put("REMARK", testPaper.getRemark()); | 757 | testPd.put("REMARK", testPaper.getRemark()); |
| 608 | testpaperService.save(testPd); | 758 | testpaperService.save(testPd); |
| 609 | if (testPaper.getStudents() != null) { | 759 | if (testPaper.getStudents() != null) { |
| 760 | + List<PageData> testInfoPdList = new ArrayList(); | ||
| 761 | + PageData testInfoPd = null; | ||
| 610 | for (StudentAnswer studentAnswer : testPaper.getStudents()) { | 762 | for (StudentAnswer studentAnswer : testPaper.getStudents()) { |
| 611 | if (studentAnswer.getQuestions() != null) { | 763 | if (studentAnswer.getQuestions() != null) { |
| 612 | PageData studentPageData = new PageData(); | 764 | PageData studentPageData = new PageData(); |
| 613 | - studentPageData.put("STUDENTTEST_ID", get32UUID()); | ||
| 614 | studentPageData.put("STUDENT_ID", | 765 | studentPageData.put("STUDENT_ID", |
| 615 | studentAnswer.getStudentId()); | 766 | studentAnswer.getStudentId()); |
| 616 | studentPageData.put("TEST_ID", testPaperId); | 767 | studentPageData.put("TEST_ID", testPaperId); |
| @@ -620,11 +771,12 @@ public class V1 extends BaseController { | @@ -620,11 +771,12 @@ public class V1 extends BaseController { | ||
| 620 | studentAnswer.getScore()); | 771 | studentAnswer.getScore()); |
| 621 | studentPageData.put("CLASS_ID", | 772 | studentPageData.put("CLASS_ID", |
| 622 | testPaper.getClassId()); | 773 | testPaper.getClassId()); |
| 774 | + studentPageData.put("STUDENTTEST_ID", get32UUID()); | ||
| 623 | studenttestService.save(studentPageData); | 775 | studenttestService.save(studentPageData); |
| 624 | 776 | ||
| 625 | for (TestPaperInfo testPaperInfo : studentAnswer | 777 | for (TestPaperInfo testPaperInfo : studentAnswer |
| 626 | .getQuestions()) { | 778 | .getQuestions()) { |
| 627 | - PageData testInfoPd = new PageData(); | 779 | + testInfoPd = new PageData(); |
| 628 | testInfoPd.put("TESTPAPERINFO_ID", | 780 | testInfoPd.put("TESTPAPERINFO_ID", |
| 629 | this.get32UUID()); | 781 | this.get32UUID()); |
| 630 | testInfoPd.put("PAPER_ID", | 782 | testInfoPd.put("PAPER_ID", |
| @@ -642,8 +794,9 @@ public class V1 extends BaseController { | @@ -642,8 +794,9 @@ public class V1 extends BaseController { | ||
| 642 | testPaperInfo.getScore()); | 794 | testPaperInfo.getScore()); |
| 643 | testInfoPd.put("LIKES", | 795 | testInfoPd.put("LIKES", |
| 644 | testPaperInfo.getLikes()); | 796 | testPaperInfo.getLikes()); |
| 645 | - testInfoPd.put("ANSWER_TYPE", | ||
| 646 | - testPaperInfo.getAnswerType()); | 797 | + testInfoPd.put("ANSWER_TYPE", testPaperInfo |
| 798 | + .getAnswerType() == null ? "1" | ||
| 799 | + : testPaperInfo.getAnswerType()); | ||
| 647 | testInfoPd.put("PRESS_TIME", | 800 | testInfoPd.put("PRESS_TIME", |
| 648 | testPaperInfo.getPressTime()); | 801 | testPaperInfo.getPressTime()); |
| 649 | testInfoPd.put("RECEIVER_DATE", | 802 | testInfoPd.put("RECEIVER_DATE", |
| @@ -653,10 +806,11 @@ public class V1 extends BaseController { | @@ -653,10 +806,11 @@ public class V1 extends BaseController { | ||
| 653 | testInfoPd.put("NOTE", testPaperInfo.getNote()); | 806 | testInfoPd.put("NOTE", testPaperInfo.getNote()); |
| 654 | testInfoPd.put("MARK_NO", | 807 | testInfoPd.put("MARK_NO", |
| 655 | testPaperInfo.getMarkNo()); | 808 | testPaperInfo.getMarkNo()); |
| 656 | - testpaperinfoService.save(testInfoPd); | 809 | + testInfoPdList.add(testInfoPd); |
| 657 | } | 810 | } |
| 658 | } | 811 | } |
| 659 | } | 812 | } |
| 813 | + testpaperinfoService.batchSave(testInfoPdList); | ||
| 660 | } | 814 | } |
| 661 | res.setData(testPaperId); | 815 | res.setData(testPaperId); |
| 662 | } catch (Exception e) { | 816 | } catch (Exception e) { |
| @@ -667,7 +821,8 @@ public class V1 extends BaseController { | @@ -667,7 +821,8 @@ public class V1 extends BaseController { | ||
| 667 | } else { | 821 | } else { |
| 668 | res.setDataError(); | 822 | res.setDataError(); |
| 669 | } | 823 | } |
| 670 | - logger.info("uploadtestpaper cost time:" + (System.currentTimeMillis() - cur)); | 824 | + logger.info("uploadtestpaper cost time:" |
| 825 | + + (System.currentTimeMillis() - cur)); | ||
| 671 | 826 | ||
| 672 | return res.toJson(); | 827 | return res.toJson(); |
| 673 | 828 | ||
| @@ -677,6 +832,7 @@ public class V1 extends BaseController { | @@ -677,6 +832,7 @@ public class V1 extends BaseController { | ||
| 677 | @RequestMapping(value = "/downloadtestpaper", produces = "application/json;charset=UTF-8") | 832 | @RequestMapping(value = "/downloadtestpaper", produces = "application/json;charset=UTF-8") |
| 678 | @ResponseBody | 833 | @ResponseBody |
| 679 | public Object downloadTestpaper() { | 834 | public Object downloadTestpaper() { |
| 835 | + long cur = System.currentTimeMillis(); | ||
| 680 | PageData pd = this.getPageData(); | 836 | PageData pd = this.getPageData(); |
| 681 | ResponseGson<TestPaper> res = new ResponseGson(); | 837 | ResponseGson<TestPaper> res = new ResponseGson(); |
| 682 | 838 | ||
| @@ -752,7 +908,7 @@ public class V1 extends BaseController { | @@ -752,7 +908,7 @@ public class V1 extends BaseController { | ||
| 752 | res.setError(); | 908 | res.setError(); |
| 753 | } | 909 | } |
| 754 | } | 910 | } |
| 755 | - | 911 | + logger.info("downloadtestpaper cost time:" + (System.currentTimeMillis() - cur)); |
| 756 | return res.toJson(); | 912 | return res.toJson(); |
| 757 | 913 | ||
| 758 | } | 914 | } |
| @@ -761,6 +917,7 @@ public class V1 extends BaseController { | @@ -761,6 +917,7 @@ public class V1 extends BaseController { | ||
| 761 | @RequestMapping(value = "/testpaper", produces = "application/json;charset=UTF-8") | 917 | @RequestMapping(value = "/testpaper", produces = "application/json;charset=UTF-8") |
| 762 | @ResponseBody | 918 | @ResponseBody |
| 763 | public Object testpaper() { | 919 | public Object testpaper() { |
| 920 | + long cur = System.currentTimeMillis(); | ||
| 764 | PageData pd = this.getPageData(); | 921 | PageData pd = this.getPageData(); |
| 765 | ResponseGson<List<TestPaper>> res = new ResponseGson(); | 922 | ResponseGson<List<TestPaper>> res = new ResponseGson(); |
| 766 | pd.put("TEACHER_ID", pd.getString("USER_ID")); | 923 | pd.put("TEACHER_ID", pd.getString("USER_ID")); |
| @@ -792,7 +949,7 @@ public class V1 extends BaseController { | @@ -792,7 +949,7 @@ public class V1 extends BaseController { | ||
| 792 | res.setMessage(e.getMessage()); | 949 | res.setMessage(e.getMessage()); |
| 793 | e.printStackTrace(); | 950 | e.printStackTrace(); |
| 794 | } | 951 | } |
| 795 | - | 952 | + logger.info("testpaper cost time:" + (System.currentTimeMillis() - cur)); |
| 796 | return res.toJson(); | 953 | return res.toJson(); |
| 797 | 954 | ||
| 798 | } | 955 | } |
| @@ -803,8 +960,36 @@ public class V1 extends BaseController { | @@ -803,8 +960,36 @@ public class V1 extends BaseController { | ||
| 803 | public void schoolAdmin(){ | 960 | public void schoolAdmin(){ |
| 804 | PageData pd = this.getPageData(); | 961 | PageData pd = this.getPageData(); |
| 805 | this.getUserID(); | 962 | this.getUserID(); |
| 806 | - | ||
| 807 | - | ||
| 808 | } | 963 | } |
| 809 | 964 | ||
| 965 | + @RequestMapping(value = "/newversion", produces = "application/json;charset=UTF-8") | ||
| 966 | + @ResponseBody | ||
| 967 | + public Object getNewVersion(HttpServletRequest request) throws Exception{ | ||
| 968 | + PageData pd = this.getPageData(); | ||
| 969 | + String softId = pd.getString("SOFTID"); | ||
| 970 | + String path = request.getContextPath(); | ||
| 971 | + String basePath = request.getScheme() + "://" | ||
| 972 | + + request.getServerName() + ":" + request.getServerPort() | ||
| 973 | + + path + "/"; | ||
| 974 | + ResponseGson<PageData> res = new ResponseGson(); | ||
| 975 | + if(softId != null && !"".equals(softId)){ | ||
| 976 | + pd.put("SOFTWARE_ID", softId); | ||
| 977 | + PageData result = softwareversionService.findNewVersion(pd); | ||
| 978 | + if(result != null){ | ||
| 979 | + result.remove("SOFTWAREVERSION_ID"); | ||
| 980 | + result.remove("SOFTWARE_ID"); | ||
| 981 | + result.put("VERSION_PATH",basePath + "/uploadFiles/uploadFile/" + result.getString("VERSION_PATH")); | ||
| 982 | + res.setData(result); | ||
| 983 | + }else{ | ||
| 984 | + res.setDataError(); | ||
| 985 | + } | ||
| 986 | + }else{ | ||
| 987 | + res.setDataError(); | ||
| 988 | + } | ||
| 989 | + return res.toJson(); | ||
| 990 | + } | ||
| 991 | + | ||
| 992 | + | ||
| 993 | + | ||
| 994 | + | ||
| 810 | } | 995 | } |
src/com/fh/controller/software/software/SoftWareController.java
0 → 100644
| 1 | +package com.fh.controller.software.software; | ||
| 2 | + | ||
| 3 | +import java.io.PrintWriter; | ||
| 4 | +import java.text.DateFormat; | ||
| 5 | +import java.text.SimpleDateFormat; | ||
| 6 | +import java.util.ArrayList; | ||
| 7 | +import java.util.Date; | ||
| 8 | +import java.util.HashMap; | ||
| 9 | +import java.util.List; | ||
| 10 | +import java.util.Map; | ||
| 11 | +import javax.annotation.Resource; | ||
| 12 | +import org.springframework.beans.propertyeditors.CustomDateEditor; | ||
| 13 | +import org.springframework.stereotype.Controller; | ||
| 14 | +import org.springframework.web.bind.WebDataBinder; | ||
| 15 | +import org.springframework.web.bind.annotation.InitBinder; | ||
| 16 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 17 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
| 18 | +import org.springframework.web.servlet.ModelAndView; | ||
| 19 | +import com.fh.controller.base.BaseController; | ||
| 20 | +import com.fh.entity.Page; | ||
| 21 | +import com.fh.util.AppUtil; | ||
| 22 | +import com.fh.util.ObjectExcelView; | ||
| 23 | +import com.fh.util.PageData; | ||
| 24 | +import com.fh.util.Jurisdiction; | ||
| 25 | +import com.fh.util.Tools; | ||
| 26 | +import com.fh.service.software.software.SoftWareManager; | ||
| 27 | + | ||
| 28 | +/** | ||
| 29 | + * 说明:软件管理 | ||
| 30 | + * 创建人:FH Q313596790 | ||
| 31 | + * 创建时间:2018-06-14 | ||
| 32 | + */ | ||
| 33 | +@Controller | ||
| 34 | +@RequestMapping(value="/software") | ||
| 35 | +public class SoftWareController extends BaseController { | ||
| 36 | + | ||
| 37 | + String menuUrl = "software/list.do"; //菜单地址(权限用) | ||
| 38 | + @Resource(name="softwareService") | ||
| 39 | + private SoftWareManager softwareService; | ||
| 40 | + | ||
| 41 | + /**保存 | ||
| 42 | + * @param | ||
| 43 | + * @throws Exception | ||
| 44 | + */ | ||
| 45 | + @RequestMapping(value="/save") | ||
| 46 | + public ModelAndView save() throws Exception{ | ||
| 47 | + logBefore(logger, Jurisdiction.getUsername()+"新增SoftWare"); | ||
| 48 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限 | ||
| 49 | + ModelAndView mv = this.getModelAndView(); | ||
| 50 | + PageData pd = new PageData(); | ||
| 51 | + pd = this.getPageData(); | ||
| 52 | + pd.put("SOFTWARE_ID", this.get32UUID()); //主键 | ||
| 53 | + softwareService.save(pd); | ||
| 54 | + mv.addObject("msg","success"); | ||
| 55 | + mv.setViewName("save_result"); | ||
| 56 | + return mv; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /**删除 | ||
| 60 | + * @param out | ||
| 61 | + * @throws Exception | ||
| 62 | + */ | ||
| 63 | + @RequestMapping(value="/delete") | ||
| 64 | + public void delete(PrintWriter out) throws Exception{ | ||
| 65 | + logBefore(logger, Jurisdiction.getUsername()+"删除SoftWare"); | ||
| 66 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return;} //校验权限 | ||
| 67 | + PageData pd = new PageData(); | ||
| 68 | + pd = this.getPageData(); | ||
| 69 | + softwareService.delete(pd); | ||
| 70 | + out.write("success"); | ||
| 71 | + out.close(); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /**修改 | ||
| 75 | + * @param | ||
| 76 | + * @throws Exception | ||
| 77 | + */ | ||
| 78 | + @RequestMapping(value="/edit") | ||
| 79 | + public ModelAndView edit() throws Exception{ | ||
| 80 | + logBefore(logger, Jurisdiction.getUsername()+"修改SoftWare"); | ||
| 81 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限 | ||
| 82 | + ModelAndView mv = this.getModelAndView(); | ||
| 83 | + PageData pd = new PageData(); | ||
| 84 | + pd = this.getPageData(); | ||
| 85 | + softwareService.edit(pd); | ||
| 86 | + mv.addObject("msg","success"); | ||
| 87 | + mv.setViewName("save_result"); | ||
| 88 | + return mv; | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + /**列表 | ||
| 92 | + * @param page | ||
| 93 | + * @throws Exception | ||
| 94 | + */ | ||
| 95 | + @RequestMapping(value="/list") | ||
| 96 | + public ModelAndView list(Page page) throws Exception{ | ||
| 97 | + logBefore(logger, Jurisdiction.getUsername()+"列表SoftWare"); | ||
| 98 | + //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | ||
| 99 | + ModelAndView mv = this.getModelAndView(); | ||
| 100 | + PageData pd = new PageData(); | ||
| 101 | + pd = this.getPageData(); | ||
| 102 | + String keywords = pd.getString("keywords"); //关键词检索条件 | ||
| 103 | + if(null != keywords && !"".equals(keywords)){ | ||
| 104 | + pd.put("keywords", keywords.trim()); | ||
| 105 | + } | ||
| 106 | + page.setPd(pd); | ||
| 107 | + List<PageData> varList = softwareService.list(page); //列出SoftWare列表 | ||
| 108 | + mv.setViewName("software/software/software_list"); | ||
| 109 | + mv.addObject("varList", varList); | ||
| 110 | + mv.addObject("pd", pd); | ||
| 111 | + mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 | ||
| 112 | + return mv; | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + /**去新增页面 | ||
| 116 | + * @param | ||
| 117 | + * @throws Exception | ||
| 118 | + */ | ||
| 119 | + @RequestMapping(value="/goAdd") | ||
| 120 | + public ModelAndView goAdd()throws Exception{ | ||
| 121 | + ModelAndView mv = this.getModelAndView(); | ||
| 122 | + PageData pd = new PageData(); | ||
| 123 | + pd = this.getPageData(); | ||
| 124 | + mv.setViewName("software/software/software_edit"); | ||
| 125 | + mv.addObject("msg", "save"); | ||
| 126 | + mv.addObject("pd", pd); | ||
| 127 | + return mv; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + /**去修改页面 | ||
| 131 | + * @param | ||
| 132 | + * @throws Exception | ||
| 133 | + */ | ||
| 134 | + @RequestMapping(value="/goEdit") | ||
| 135 | + public ModelAndView goEdit()throws Exception{ | ||
| 136 | + ModelAndView mv = this.getModelAndView(); | ||
| 137 | + PageData pd = new PageData(); | ||
| 138 | + pd = this.getPageData(); | ||
| 139 | + pd = softwareService.findById(pd); //根据ID读取 | ||
| 140 | + mv.setViewName("software/software/software_edit"); | ||
| 141 | + mv.addObject("msg", "edit"); | ||
| 142 | + mv.addObject("pd", pd); | ||
| 143 | + return mv; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + /**批量删除 | ||
| 147 | + * @param | ||
| 148 | + * @throws Exception | ||
| 149 | + */ | ||
| 150 | + @RequestMapping(value="/deleteAll") | ||
| 151 | + @ResponseBody | ||
| 152 | + public Object deleteAll() throws Exception{ | ||
| 153 | + logBefore(logger, Jurisdiction.getUsername()+"批量删除SoftWare"); | ||
| 154 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;} //校验权限 | ||
| 155 | + PageData pd = new PageData(); | ||
| 156 | + Map<String,Object> map = new HashMap<String,Object>(); | ||
| 157 | + pd = this.getPageData(); | ||
| 158 | + List<PageData> pdList = new ArrayList<PageData>(); | ||
| 159 | + String DATA_IDS = pd.getString("DATA_IDS"); | ||
| 160 | + if(null != DATA_IDS && !"".equals(DATA_IDS)){ | ||
| 161 | + String ArrayDATA_IDS[] = DATA_IDS.split(","); | ||
| 162 | + softwareService.deleteAll(ArrayDATA_IDS); | ||
| 163 | + pd.put("msg", "ok"); | ||
| 164 | + }else{ | ||
| 165 | + pd.put("msg", "no"); | ||
| 166 | + } | ||
| 167 | + pdList.add(pd); | ||
| 168 | + map.put("list", pdList); | ||
| 169 | + return AppUtil.returnObject(pd, map); | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + /**导出到excel | ||
| 173 | + * @param | ||
| 174 | + * @throws Exception | ||
| 175 | + */ | ||
| 176 | + @RequestMapping(value="/excel") | ||
| 177 | + public ModelAndView exportExcel() throws Exception{ | ||
| 178 | + logBefore(logger, Jurisdiction.getUsername()+"导出SoftWare到excel"); | ||
| 179 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} | ||
| 180 | + ModelAndView mv = new ModelAndView(); | ||
| 181 | + PageData pd = new PageData(); | ||
| 182 | + pd = this.getPageData(); | ||
| 183 | + Map<String,Object> dataMap = new HashMap<String,Object>(); | ||
| 184 | + List<String> titles = new ArrayList<String>(); | ||
| 185 | + titles.add("软件名称"); //1 | ||
| 186 | + titles.add("软件描述"); //2 | ||
| 187 | + dataMap.put("titles", titles); | ||
| 188 | + List<PageData> varOList = softwareService.listAll(pd); | ||
| 189 | + List<PageData> varList = new ArrayList<PageData>(); | ||
| 190 | + for(int i=0;i<varOList.size();i++){ | ||
| 191 | + PageData vpd = new PageData(); | ||
| 192 | + vpd.put("var1", varOList.get(i).getString("NAME")); //1 | ||
| 193 | + vpd.put("var2", varOList.get(i).getString("DESC")); //2 | ||
| 194 | + varList.add(vpd); | ||
| 195 | + } | ||
| 196 | + dataMap.put("varList", varList); | ||
| 197 | + ObjectExcelView erv = new ObjectExcelView(); | ||
| 198 | + mv = new ModelAndView(erv,dataMap); | ||
| 199 | + return mv; | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + @InitBinder | ||
| 203 | + public void initBinder(WebDataBinder binder){ | ||
| 204 | + DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 205 | + binder.registerCustomEditor(Date.class, new CustomDateEditor(format,true)); | ||
| 206 | + } | ||
| 207 | +} |
src/com/fh/controller/software/softwareversion/SoftwareVersionController.java
0 → 100644
| 1 | +package com.fh.controller.software.softwareversion; | ||
| 2 | + | ||
| 3 | +import java.io.File; | ||
| 4 | +import java.io.PrintWriter; | ||
| 5 | +import java.text.DateFormat; | ||
| 6 | +import java.text.SimpleDateFormat; | ||
| 7 | +import java.util.ArrayList; | ||
| 8 | +import java.util.Date; | ||
| 9 | +import java.util.HashMap; | ||
| 10 | +import java.util.List; | ||
| 11 | +import java.util.Map; | ||
| 12 | + | ||
| 13 | +import javax.annotation.Resource; | ||
| 14 | +import javax.servlet.http.HttpServletRequest; | ||
| 15 | + | ||
| 16 | +import org.springframework.beans.propertyeditors.CustomDateEditor; | ||
| 17 | +import org.springframework.stereotype.Controller; | ||
| 18 | +import org.springframework.web.bind.WebDataBinder; | ||
| 19 | +import org.springframework.web.bind.annotation.InitBinder; | ||
| 20 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 21 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 22 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
| 23 | +import org.springframework.web.multipart.MultipartFile; | ||
| 24 | +import org.springframework.web.servlet.ModelAndView; | ||
| 25 | + | ||
| 26 | +import com.fh.controller.base.BaseController; | ||
| 27 | +import com.fh.controller.sunvote.Myelfun; | ||
| 28 | +import com.fh.entity.Page; | ||
| 29 | +import com.fh.service.software.software.SoftWareManager; | ||
| 30 | +import com.fh.service.software.softwareversion.SoftwareVersionManager; | ||
| 31 | +import com.fh.util.AppUtil; | ||
| 32 | +import com.fh.util.Jurisdiction; | ||
| 33 | +import com.fh.util.ObjectExcelView; | ||
| 34 | +import com.fh.util.PageData; | ||
| 35 | + | ||
| 36 | +/** | ||
| 37 | + * 说明:软件管理 | ||
| 38 | + * 创建人:FH Q313596790 | ||
| 39 | + * 创建时间:2018-06-14 | ||
| 40 | + */ | ||
| 41 | +@Controller | ||
| 42 | +@RequestMapping(value="/softwareversion") | ||
| 43 | +public class SoftwareVersionController extends BaseController { | ||
| 44 | + | ||
| 45 | + String menuUrl = "softwareversion/list.do"; //菜单地址(权限用) | ||
| 46 | + @Resource(name="softwareversionService") | ||
| 47 | + private SoftwareVersionManager softwareversionService; | ||
| 48 | + | ||
| 49 | + @Resource(name="softwareService") | ||
| 50 | + private SoftWareManager softwareService; | ||
| 51 | + /**保存 | ||
| 52 | + * @param | ||
| 53 | + * @throws Exception | ||
| 54 | + */ | ||
| 55 | + @RequestMapping(value="/save") | ||
| 56 | + public ModelAndView save(@RequestParam(value="VERSION_PATH",required=false) MultipartFile file, HttpServletRequest request) throws Exception{ | ||
| 57 | + logBefore(logger, Jurisdiction.getUsername()+"新增SoftwareVersion"); | ||
| 58 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限 | ||
| 59 | + ModelAndView mv = this.getModelAndView(); | ||
| 60 | + PageData pd = new PageData(); | ||
| 61 | + pd = this.getPageData(); | ||
| 62 | + pd.put("SOFTWAREVERSION_ID", this.get32UUID()); //主键 | ||
| 63 | + if (file != null && pd.getString("SOFTWARE_ID") != null) { | ||
| 64 | + String path = request.getSession().getServletContext() | ||
| 65 | + .getRealPath("/uploadFiles/uploadFile/"); | ||
| 66 | + String name = Myelfun.findSoftwareName(pd.getString("SOFTWARE_ID")) | ||
| 67 | + + "_" + pd.getString("VERSION_NAME") + "_" | ||
| 68 | + + file.getOriginalFilename(); | ||
| 69 | + File pathFile = new File(path); | ||
| 70 | + pathFile.mkdirs(); | ||
| 71 | + File saveFile = new File(path + File.separator + name); | ||
| 72 | + if(saveFile.exists()){ | ||
| 73 | + saveFile.delete(); | ||
| 74 | + } | ||
| 75 | + saveFile.createNewFile(); | ||
| 76 | + file.transferTo(saveFile); | ||
| 77 | + pd.put("VERSION_PATH", name); | ||
| 78 | + softwareversionService.save(pd); | ||
| 79 | + mv.addObject("msg", "success"); | ||
| 80 | + }else{ | ||
| 81 | + mv.addObject("msg", "fail"); | ||
| 82 | + } | ||
| 83 | + mv.setViewName("save_result"); | ||
| 84 | + return mv; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + /**删除 | ||
| 88 | + * @param out | ||
| 89 | + * @throws Exception | ||
| 90 | + */ | ||
| 91 | + @RequestMapping(value="/delete") | ||
| 92 | + public void delete(PrintWriter out) throws Exception{ | ||
| 93 | + logBefore(logger, Jurisdiction.getUsername()+"删除SoftwareVersion"); | ||
| 94 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return;} //校验权限 | ||
| 95 | + PageData pd = new PageData(); | ||
| 96 | + pd = this.getPageData(); | ||
| 97 | + softwareversionService.delete(pd); | ||
| 98 | + out.write("success"); | ||
| 99 | + out.close(); | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + /**修改 | ||
| 103 | + * @param | ||
| 104 | + * @throws Exception | ||
| 105 | + */ | ||
| 106 | + @RequestMapping(value="/edit") | ||
| 107 | + public ModelAndView edit() throws Exception{ | ||
| 108 | + logBefore(logger, Jurisdiction.getUsername()+"修改SoftwareVersion"); | ||
| 109 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限 | ||
| 110 | + ModelAndView mv = this.getModelAndView(); | ||
| 111 | + PageData pd = new PageData(); | ||
| 112 | + pd = this.getPageData(); | ||
| 113 | + softwareversionService.edit(pd); | ||
| 114 | + mv.addObject("msg","success"); | ||
| 115 | + mv.setViewName("save_result"); | ||
| 116 | + return mv; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + /**列表 | ||
| 120 | + * @param page | ||
| 121 | + * @throws Exception | ||
| 122 | + */ | ||
| 123 | + @RequestMapping(value="/list") | ||
| 124 | + public ModelAndView list(Page page, HttpServletRequest request) throws Exception{ | ||
| 125 | + logBefore(logger, Jurisdiction.getUsername()+"列表SoftwareVersion"); | ||
| 126 | + //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | ||
| 127 | + ModelAndView mv = this.getModelAndView(); | ||
| 128 | + PageData pd = new PageData(); | ||
| 129 | + pd = this.getPageData(); | ||
| 130 | + String keywords = pd.getString("keywords"); //关键词检索条件 | ||
| 131 | + if(null != keywords && !"".equals(keywords)){ | ||
| 132 | + pd.put("keywords", keywords.trim()); | ||
| 133 | + } | ||
| 134 | + page.setPd(pd); | ||
| 135 | + List<PageData> varList = softwareversionService.list(page); //列出SoftwareVersion列表 | ||
| 136 | + mv.setViewName("software/softwareversion/softwareversion_list"); | ||
| 137 | + mv.addObject("varList", varList); | ||
| 138 | + mv.addObject("pd", pd); | ||
| 139 | + mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 | ||
| 140 | + return mv; | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + /**去新增页面 | ||
| 144 | + * @param | ||
| 145 | + * @throws Exception | ||
| 146 | + */ | ||
| 147 | + @RequestMapping(value="/goAdd") | ||
| 148 | + public ModelAndView goAdd()throws Exception{ | ||
| 149 | + ModelAndView mv = this.getModelAndView(); | ||
| 150 | + PageData pd = new PageData(); | ||
| 151 | + pd = this.getPageData(); | ||
| 152 | + mv.setViewName("software/softwareversion/softwareversion_edit"); | ||
| 153 | + List<PageData> softwares = softwareService.listAll(pd); | ||
| 154 | + mv.addObject("softwares", softwares); | ||
| 155 | + mv.addObject("msg", "save"); | ||
| 156 | + mv.addObject("pd", pd); | ||
| 157 | + return mv; | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + /**去修改页面 | ||
| 161 | + * @param | ||
| 162 | + * @throws Exception | ||
| 163 | + */ | ||
| 164 | + @RequestMapping(value="/goEdit") | ||
| 165 | + public ModelAndView goEdit()throws Exception{ | ||
| 166 | + ModelAndView mv = this.getModelAndView(); | ||
| 167 | + PageData pd = new PageData(); | ||
| 168 | + pd = this.getPageData(); | ||
| 169 | + pd = softwareversionService.findById(pd); //根据ID读取 | ||
| 170 | + mv.setViewName("software/softwareversion/softwareversion_edit"); | ||
| 171 | + List<PageData> softwares = softwareService.listAll(pd); | ||
| 172 | + mv.addObject("softwares", softwares); | ||
| 173 | + mv.addObject("msg", "edit"); | ||
| 174 | + mv.addObject("pd", pd); | ||
| 175 | + return mv; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + /**批量删除 | ||
| 179 | + * @param | ||
| 180 | + * @throws Exception | ||
| 181 | + */ | ||
| 182 | + @RequestMapping(value="/deleteAll") | ||
| 183 | + @ResponseBody | ||
| 184 | + public Object deleteAll() throws Exception{ | ||
| 185 | + logBefore(logger, Jurisdiction.getUsername()+"批量删除SoftwareVersion"); | ||
| 186 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;} //校验权限 | ||
| 187 | + PageData pd = new PageData(); | ||
| 188 | + Map<String,Object> map = new HashMap<String,Object>(); | ||
| 189 | + pd = this.getPageData(); | ||
| 190 | + List<PageData> pdList = new ArrayList<PageData>(); | ||
| 191 | + String DATA_IDS = pd.getString("DATA_IDS"); | ||
| 192 | + if(null != DATA_IDS && !"".equals(DATA_IDS)){ | ||
| 193 | + String ArrayDATA_IDS[] = DATA_IDS.split(","); | ||
| 194 | + softwareversionService.deleteAll(ArrayDATA_IDS); | ||
| 195 | + pd.put("msg", "ok"); | ||
| 196 | + }else{ | ||
| 197 | + pd.put("msg", "no"); | ||
| 198 | + } | ||
| 199 | + pdList.add(pd); | ||
| 200 | + map.put("list", pdList); | ||
| 201 | + return AppUtil.returnObject(pd, map); | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + /**导出到excel | ||
| 205 | + * @param | ||
| 206 | + * @throws Exception | ||
| 207 | + */ | ||
| 208 | + @RequestMapping(value="/excel") | ||
| 209 | + public ModelAndView exportExcel() throws Exception{ | ||
| 210 | + logBefore(logger, Jurisdiction.getUsername()+"导出SoftwareVersion到excel"); | ||
| 211 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} | ||
| 212 | + ModelAndView mv = new ModelAndView(); | ||
| 213 | + PageData pd = new PageData(); | ||
| 214 | + pd = this.getPageData(); | ||
| 215 | + Map<String,Object> dataMap = new HashMap<String,Object>(); | ||
| 216 | + List<String> titles = new ArrayList<String>(); | ||
| 217 | + titles.add("软件名称"); //1 | ||
| 218 | + titles.add("版本名称"); //2 | ||
| 219 | + titles.add("版本代号"); //3 | ||
| 220 | + titles.add("版本存放路径"); //4 | ||
| 221 | + titles.add("更新描述"); //5 | ||
| 222 | + dataMap.put("titles", titles); | ||
| 223 | + List<PageData> varOList = softwareversionService.listAll(pd); | ||
| 224 | + List<PageData> varList = new ArrayList<PageData>(); | ||
| 225 | + for(int i=0;i<varOList.size();i++){ | ||
| 226 | + PageData vpd = new PageData(); | ||
| 227 | + vpd.put("var1", varOList.get(i).getString("SOFTWARE_ID")); //1 | ||
| 228 | + vpd.put("var2", varOList.get(i).getString("VERSION_NAME")); //2 | ||
| 229 | + vpd.put("var3", varOList.get(i).getString("VERSION_CODE")); //3 | ||
| 230 | + vpd.put("var4", varOList.get(i).getString("VERSION_PATH")); //4 | ||
| 231 | + vpd.put("var5", varOList.get(i).getString("VERSION_DESC")); //5 | ||
| 232 | + varList.add(vpd); | ||
| 233 | + } | ||
| 234 | + dataMap.put("varList", varList); | ||
| 235 | + ObjectExcelView erv = new ObjectExcelView(); | ||
| 236 | + mv = new ModelAndView(erv,dataMap); | ||
| 237 | + return mv; | ||
| 238 | + } | ||
| 239 | + | ||
| 240 | + @InitBinder | ||
| 241 | + public void initBinder(WebDataBinder binder){ | ||
| 242 | + DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 243 | + binder.registerCustomEditor(Date.class, new CustomDateEditor(format,true)); | ||
| 244 | + } | ||
| 245 | +} |
src/com/fh/controller/sunvote/Myelfun.java
| @@ -2,6 +2,7 @@ package com.fh.controller.sunvote; | @@ -2,6 +2,7 @@ package com.fh.controller.sunvote; | ||
| 2 | 2 | ||
| 3 | import org.springframework.stereotype.Service; | 3 | import org.springframework.stereotype.Service; |
| 4 | 4 | ||
| 5 | +import com.fh.service.software.software.SoftWareManager; | ||
| 5 | import com.fh.service.sunvote.basestation.impl.BasestationService; | 6 | import com.fh.service.sunvote.basestation.impl.BasestationService; |
| 6 | import com.fh.service.sunvote.classtype.impl.ClassTypeService; | 7 | import com.fh.service.sunvote.classtype.impl.ClassTypeService; |
| 7 | import com.fh.service.sunvote.grade.impl.GradeService; | 8 | import com.fh.service.sunvote.grade.impl.GradeService; |
| @@ -303,5 +304,19 @@ public class Myelfun { | @@ -303,5 +304,19 @@ public class Myelfun { | ||
| 303 | } | 304 | } |
| 304 | } | 305 | } |
| 305 | 306 | ||
| 306 | - | 307 | + public static String findSoftwareName(String id){ |
| 308 | + SoftWareManager softwareService = (SoftWareManager)SpringBeanFactoryUtils.getBean("softwareService"); | ||
| 309 | + PageData pageData = new PageData(); | ||
| 310 | + pageData.put("SOFTWARE_ID", id); | ||
| 311 | + try { | ||
| 312 | + pageData = softwareService.findById(pageData); | ||
| 313 | + } catch (Exception e) { | ||
| 314 | + e.printStackTrace(); | ||
| 315 | + } | ||
| 316 | + if(pageData != null){ | ||
| 317 | + return pageData.getString("NAME"); | ||
| 318 | + }else{ | ||
| 319 | + return "" ; | ||
| 320 | + } | ||
| 321 | + } | ||
| 307 | } | 322 | } |
src/com/fh/service/software/software/SoftWareManager.java
0 → 100644
| 1 | +package com.fh.service.software.software; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import com.fh.entity.Page; | ||
| 5 | +import com.fh.util.PageData; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 说明: 软件管理接口 | ||
| 9 | + * 创建人:FH Q313596790 | ||
| 10 | + * 创建时间:2018-06-14 | ||
| 11 | + * @version | ||
| 12 | + */ | ||
| 13 | +public interface SoftWareManager{ | ||
| 14 | + | ||
| 15 | + /**新增 | ||
| 16 | + * @param pd | ||
| 17 | + * @throws Exception | ||
| 18 | + */ | ||
| 19 | + public void save(PageData pd)throws Exception; | ||
| 20 | + | ||
| 21 | + /**删除 | ||
| 22 | + * @param pd | ||
| 23 | + * @throws Exception | ||
| 24 | + */ | ||
| 25 | + public void delete(PageData pd)throws Exception; | ||
| 26 | + | ||
| 27 | + /**修改 | ||
| 28 | + * @param pd | ||
| 29 | + * @throws Exception | ||
| 30 | + */ | ||
| 31 | + public void edit(PageData pd)throws Exception; | ||
| 32 | + | ||
| 33 | + /**列表 | ||
| 34 | + * @param page | ||
| 35 | + * @throws Exception | ||
| 36 | + */ | ||
| 37 | + public List<PageData> list(Page page)throws Exception; | ||
| 38 | + | ||
| 39 | + /**列表(全部) | ||
| 40 | + * @param pd | ||
| 41 | + * @throws Exception | ||
| 42 | + */ | ||
| 43 | + public List<PageData> listAll(PageData pd)throws Exception; | ||
| 44 | + | ||
| 45 | + /**通过id获取数据 | ||
| 46 | + * @param pd | ||
| 47 | + * @throws Exception | ||
| 48 | + */ | ||
| 49 | + public PageData findById(PageData pd)throws Exception; | ||
| 50 | + | ||
| 51 | + /**批量删除 | ||
| 52 | + * @param ArrayDATA_IDS | ||
| 53 | + * @throws Exception | ||
| 54 | + */ | ||
| 55 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; | ||
| 56 | + | ||
| 57 | +} | ||
| 58 | + |
src/com/fh/service/software/software/impl/SoftWareService.java
0 → 100644
| 1 | +package com.fh.service.software.software.impl; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import javax.annotation.Resource; | ||
| 5 | +import org.springframework.stereotype.Service; | ||
| 6 | +import com.fh.dao.DaoSupport; | ||
| 7 | +import com.fh.entity.Page; | ||
| 8 | +import com.fh.util.PageData; | ||
| 9 | +import com.fh.service.software.software.SoftWareManager; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 说明: 软件管理 | ||
| 13 | + * 创建人:FH Q313596790 | ||
| 14 | + * 创建时间:2018-06-14 | ||
| 15 | + * @version | ||
| 16 | + */ | ||
| 17 | +@Service("softwareService") | ||
| 18 | +public class SoftWareService implements SoftWareManager{ | ||
| 19 | + | ||
| 20 | + @Resource(name = "daoSupport") | ||
| 21 | + private DaoSupport dao; | ||
| 22 | + | ||
| 23 | + /**新增 | ||
| 24 | + * @param pd | ||
| 25 | + * @throws Exception | ||
| 26 | + */ | ||
| 27 | + public void save(PageData pd)throws Exception{ | ||
| 28 | + dao.save("SoftWareMapper.save", pd); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + /**删除 | ||
| 32 | + * @param pd | ||
| 33 | + * @throws Exception | ||
| 34 | + */ | ||
| 35 | + public void delete(PageData pd)throws Exception{ | ||
| 36 | + dao.delete("SoftWareMapper.delete", pd); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + /**修改 | ||
| 40 | + * @param pd | ||
| 41 | + * @throws Exception | ||
| 42 | + */ | ||
| 43 | + public void edit(PageData pd)throws Exception{ | ||
| 44 | + dao.update("SoftWareMapper.edit", pd); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + /**列表 | ||
| 48 | + * @param page | ||
| 49 | + * @throws Exception | ||
| 50 | + */ | ||
| 51 | + @SuppressWarnings("unchecked") | ||
| 52 | + public List<PageData> list(Page page)throws Exception{ | ||
| 53 | + return (List<PageData>)dao.findForList("SoftWareMapper.datalistPage", page); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /**列表(全部) | ||
| 57 | + * @param pd | ||
| 58 | + * @throws Exception | ||
| 59 | + */ | ||
| 60 | + @SuppressWarnings("unchecked") | ||
| 61 | + public List<PageData> listAll(PageData pd)throws Exception{ | ||
| 62 | + return (List<PageData>)dao.findForList("SoftWareMapper.listAll", pd); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + /**通过id获取数据 | ||
| 66 | + * @param pd | ||
| 67 | + * @throws Exception | ||
| 68 | + */ | ||
| 69 | + public PageData findById(PageData pd)throws Exception{ | ||
| 70 | + return (PageData)dao.findForObject("SoftWareMapper.findById", pd); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + /**批量删除 | ||
| 74 | + * @param ArrayDATA_IDS | ||
| 75 | + * @throws Exception | ||
| 76 | + */ | ||
| 77 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ | ||
| 78 | + dao.delete("SoftWareMapper.deleteAll", ArrayDATA_IDS); | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | +} | ||
| 82 | + |
src/com/fh/service/software/softwareversion/SoftwareVersionManager.java
0 → 100644
| 1 | +package com.fh.service.software.softwareversion; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import com.fh.entity.Page; | ||
| 5 | +import com.fh.util.PageData; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * 说明: 软件管理接口 | ||
| 9 | + * 创建人:FH Q313596790 | ||
| 10 | + * 创建时间:2018-06-14 | ||
| 11 | + * @version | ||
| 12 | + */ | ||
| 13 | +public interface SoftwareVersionManager{ | ||
| 14 | + | ||
| 15 | + /**新增 | ||
| 16 | + * @param pd | ||
| 17 | + * @throws Exception | ||
| 18 | + */ | ||
| 19 | + public void save(PageData pd)throws Exception; | ||
| 20 | + | ||
| 21 | + /**删除 | ||
| 22 | + * @param pd | ||
| 23 | + * @throws Exception | ||
| 24 | + */ | ||
| 25 | + public void delete(PageData pd)throws Exception; | ||
| 26 | + | ||
| 27 | + /**修改 | ||
| 28 | + * @param pd | ||
| 29 | + * @throws Exception | ||
| 30 | + */ | ||
| 31 | + public void edit(PageData pd)throws Exception; | ||
| 32 | + | ||
| 33 | + /**列表 | ||
| 34 | + * @param page | ||
| 35 | + * @throws Exception | ||
| 36 | + */ | ||
| 37 | + public List<PageData> list(Page page)throws Exception; | ||
| 38 | + | ||
| 39 | + /**列表(全部) | ||
| 40 | + * @param pd | ||
| 41 | + * @throws Exception | ||
| 42 | + */ | ||
| 43 | + public List<PageData> listAll(PageData pd)throws Exception; | ||
| 44 | + | ||
| 45 | + /**通过id获取数据 | ||
| 46 | + * @param pd | ||
| 47 | + * @throws Exception | ||
| 48 | + */ | ||
| 49 | + public PageData findById(PageData pd)throws Exception; | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + public PageData findNewVersion(PageData pd)throws Exception; | ||
| 53 | + | ||
| 54 | + /**批量删除 | ||
| 55 | + * @param ArrayDATA_IDS | ||
| 56 | + * @throws Exception | ||
| 57 | + */ | ||
| 58 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; | ||
| 59 | + | ||
| 60 | +} | ||
| 61 | + |
src/com/fh/service/software/softwareversion/impl/SoftwareVersionService.java
0 → 100644
| 1 | +package com.fh.service.software.softwareversion.impl; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import javax.annotation.Resource; | ||
| 5 | +import org.springframework.stereotype.Service; | ||
| 6 | +import com.fh.dao.DaoSupport; | ||
| 7 | +import com.fh.entity.Page; | ||
| 8 | +import com.fh.util.PageData; | ||
| 9 | +import com.fh.service.software.softwareversion.SoftwareVersionManager; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 说明: 软件管理 | ||
| 13 | + * 创建人:FH Q313596790 | ||
| 14 | + * 创建时间:2018-06-14 | ||
| 15 | + * @version | ||
| 16 | + */ | ||
| 17 | +@Service("softwareversionService") | ||
| 18 | +public class SoftwareVersionService implements SoftwareVersionManager{ | ||
| 19 | + | ||
| 20 | + @Resource(name = "daoSupport") | ||
| 21 | + private DaoSupport dao; | ||
| 22 | + | ||
| 23 | + /**新增 | ||
| 24 | + * @param pd | ||
| 25 | + * @throws Exception | ||
| 26 | + */ | ||
| 27 | + public void save(PageData pd)throws Exception{ | ||
| 28 | + dao.save("SoftwareVersionMapper.save", pd); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + /**删除 | ||
| 32 | + * @param pd | ||
| 33 | + * @throws Exception | ||
| 34 | + */ | ||
| 35 | + public void delete(PageData pd)throws Exception{ | ||
| 36 | + dao.delete("SoftwareVersionMapper.delete", pd); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + /**修改 | ||
| 40 | + * @param pd | ||
| 41 | + * @throws Exception | ||
| 42 | + */ | ||
| 43 | + public void edit(PageData pd)throws Exception{ | ||
| 44 | + dao.update("SoftwareVersionMapper.edit", pd); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + /**列表 | ||
| 48 | + * @param page | ||
| 49 | + * @throws Exception | ||
| 50 | + */ | ||
| 51 | + @SuppressWarnings("unchecked") | ||
| 52 | + public List<PageData> list(Page page)throws Exception{ | ||
| 53 | + return (List<PageData>)dao.findForList("SoftwareVersionMapper.datalistPage", page); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /**列表(全部) | ||
| 57 | + * @param pd | ||
| 58 | + * @throws Exception | ||
| 59 | + */ | ||
| 60 | + @SuppressWarnings("unchecked") | ||
| 61 | + public List<PageData> listAll(PageData pd)throws Exception{ | ||
| 62 | + return (List<PageData>)dao.findForList("SoftwareVersionMapper.listAll", pd); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + /**通过id获取数据 | ||
| 66 | + * @param pd | ||
| 67 | + * @throws Exception | ||
| 68 | + */ | ||
| 69 | + public PageData findById(PageData pd)throws Exception{ | ||
| 70 | + return (PageData)dao.findForObject("SoftwareVersionMapper.findById", pd); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + /**通过id获取数据 | ||
| 74 | + * @param pd | ||
| 75 | + * @throws Exception | ||
| 76 | + */ | ||
| 77 | + public PageData findNewVersion(PageData pd)throws Exception{ | ||
| 78 | + return (PageData)dao.findForObject("SoftwareVersionMapper.findNewVersion", pd); | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + /**批量删除 | ||
| 82 | + * @param ArrayDATA_IDS | ||
| 83 | + * @throws Exception | ||
| 84 | + */ | ||
| 85 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ | ||
| 86 | + dao.delete("SoftwareVersionMapper.deleteAll", ArrayDATA_IDS); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | +} | ||
| 90 | + |
src/com/fh/service/sunvote/testpaper/TestPaperManager.java
| 1 | package com.fh.service.sunvote.testpaper; | 1 | package com.fh.service.sunvote.testpaper; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 4 | import com.fh.entity.Page; | 5 | import com.fh.entity.Page; |
| 5 | import com.fh.util.PageData; | 6 | import com.fh.util.PageData; |
| 6 | 7 | ||
| @@ -53,5 +54,12 @@ public interface TestPaperManager{ | @@ -53,5 +54,12 @@ public interface TestPaperManager{ | ||
| 53 | */ | 54 | */ |
| 54 | public void deleteAll(String[] ArrayDATA_IDS)throws Exception; | 55 | public void deleteAll(String[] ArrayDATA_IDS)throws Exception; |
| 55 | 56 | ||
| 57 | + /** | ||
| 58 | + * | ||
| 59 | + * @param pd | ||
| 60 | + * @throws Exception | ||
| 61 | + */ | ||
| 62 | + public void deleteList(PageData pd)throws Exception; | ||
| 63 | + | ||
| 56 | } | 64 | } |
| 57 | 65 |
src/com/fh/service/sunvote/testpaper/impl/TestPaperService.java
| @@ -61,6 +61,15 @@ public class TestPaperService implements TestPaperManager{ | @@ -61,6 +61,15 @@ public class TestPaperService implements TestPaperManager{ | ||
| 61 | return (List<PageData>)dao.findForList("TestPaperMapper.listAll", pd); | 61 | return (List<PageData>)dao.findForList("TestPaperMapper.listAll", pd); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | + /**列表(全部) | ||
| 65 | + * @param pd | ||
| 66 | + * @throws Exception | ||
| 67 | + */ | ||
| 68 | + @SuppressWarnings("unchecked") | ||
| 69 | + public void deleteList(PageData pd)throws Exception{ | ||
| 70 | + dao.delete("TestPaperMapper.deleteList", pd); | ||
| 71 | + } | ||
| 72 | + | ||
| 64 | /**通过id获取数据 | 73 | /**通过id获取数据 |
| 65 | * @param pd | 74 | * @param pd |
| 66 | * @throws Exception | 75 | * @throws Exception |
| @@ -69,6 +78,7 @@ public class TestPaperService implements TestPaperManager{ | @@ -69,6 +78,7 @@ public class TestPaperService implements TestPaperManager{ | ||
| 69 | return (PageData)dao.findForObject("TestPaperMapper.findById", pd); | 78 | return (PageData)dao.findForObject("TestPaperMapper.findById", pd); |
| 70 | } | 79 | } |
| 71 | 80 | ||
| 81 | + | ||
| 72 | /**批量删除 | 82 | /**批量删除 |
| 73 | * @param ArrayDATA_IDS | 83 | * @param ArrayDATA_IDS |
| 74 | * @throws Exception | 84 | * @throws Exception |
src/com/fh/service/sunvote/testpaperinfo/TestPaperInfoManager.java
| 1 | package com.fh.service.sunvote.testpaperinfo; | 1 | package com.fh.service.sunvote.testpaperinfo; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 4 | import com.fh.entity.Page; | 5 | import com.fh.entity.Page; |
| 5 | import com.fh.util.PageData; | 6 | import com.fh.util.PageData; |
| 6 | 7 | ||
| @@ -17,6 +18,13 @@ public interface TestPaperInfoManager{ | @@ -17,6 +18,13 @@ public interface TestPaperInfoManager{ | ||
| 17 | */ | 18 | */ |
| 18 | public void save(PageData pd)throws Exception; | 19 | public void save(PageData pd)throws Exception; |
| 19 | 20 | ||
| 21 | + | ||
| 22 | + /**新增 | ||
| 23 | + * @param pd | ||
| 24 | + * @throws Exception | ||
| 25 | + */ | ||
| 26 | + public void batchSave(List<PageData> pd)throws Exception; | ||
| 27 | + | ||
| 20 | /**删除 | 28 | /**删除 |
| 21 | * @param pd | 29 | * @param pd |
| 22 | * @throws Exception | 30 | * @throws Exception |
src/com/fh/service/sunvote/testpaperinfo/impl/TestPaperInfoService.java
| @@ -27,6 +27,14 @@ public class TestPaperInfoService implements TestPaperInfoManager{ | @@ -27,6 +27,14 @@ public class TestPaperInfoService implements TestPaperInfoManager{ | ||
| 27 | dao.save("TestPaperInfoMapper.save", pd); | 27 | dao.save("TestPaperInfoMapper.save", pd); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | + /**新增 | ||
| 31 | + * @param pd | ||
| 32 | + * @throws Exception | ||
| 33 | + */ | ||
| 34 | + public void batchSave(List<PageData> pd)throws Exception{ | ||
| 35 | + dao.save("TestPaperInfoMapper.batchSave", pd); | ||
| 36 | + } | ||
| 37 | + | ||
| 30 | /**删除 | 38 | /**删除 |
| 31 | * @param pd | 39 | * @param pd |
| 32 | * @throws Exception | 40 | * @throws Exception |