Просмотр исходного кода

新增桌面版考勤设备管理

HD_wangm 10 месяцев назад
Родитель
Сommit
16716e9c0f

+ 80 - 0
src/main/master1_eu/com/yw/master1_eu/action/MTFaceEquipmentAction.java

@@ -0,0 +1,80 @@
+package com.yw.master1_eu.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+
+import com.yw.core.framework.http.BaseAction;
+import com.yw.core.framework.view.service.PagerService;
+import com.yw.core.utils.DateJson;
+import com.yw.core.utils.DateUtil;
+import com.yw.core.utils.StringUtil;
+import com.yw.hr.attendance.action.AttendanceSegmentAction;
+import com.yw.hr.attendance.model.AttendanceRuleSet;
+import com.yw.hr.attendance.model.AttendanceSegment;
+import com.yw.hr.attendance.model.SegmentMessage;
+import com.yw.hr.attendance.service.AttendanceSegmentService;
+import com.yw.hr.attendance.service.AttendanceSegmentServiceImpl;
+import com.yw.hr.attendance.service.AttendanceSetService;
+import com.yw.hr.attendance.service.AttendanceSetServiceImpl;
+import com.yw.hr.utils.CommonUtil;
+import com.yw.oa.face.action.FaceEquipmentConfigAction;
+/**
+ * 班别
+ * @author leilw
+ */
+public class MTFaceEquipmentAction extends FaceEquipmentConfigAction {
+	
+	private Logger logger = Logger.getLogger(MTFaceEquipmentAction.class);
+	
+	private String listFaceEquipmentUrl = "/yw/master1_eu/faceEquipment/listFaceEquipment.jsp";
+	private String editFaceEquipmentUrl = "/yw/master1_eu/faceEquipment/editFaceEquipment.jsp";
+	private String tipUrl = "/yw/oa/tips.jsp";
+	
+	public void afterSourceAction(HttpServletRequest request, HttpServletResponse response) throws Exception {
+		super.afterSourceAction(request, response);
+		String CONTENT_TYPE = "text/html;charset=UTF-8";
+		request.setCharacterEncoding("UTF-8");
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType(CONTENT_TYPE);
+		String tabid = request.getParameter("tabid");
+		request.setAttribute("tabid", tabid);
+		String task = request.getParameter("task");
+		task = task == null ? "" : task;
+		if("toFaceEquipmentList".equals(task)){
+			this.path = this.listFaceEquipmentUrl;
+			return;
+		}else if ("query".equals(task)) {
+			return;
+		}else if ("toEditFaceEquipment".equals(task)){
+			this.path = this.editFaceEquipmentUrl;
+			return;
+		}else if ("editFaceEquipment".equals(task)){
+			if(this.tipUrl.equals(super.path)){
+    			 this.path = this.listFaceEquipmentUrl;	
+	      	}
+			return;
+		}else if ("delete".equals(task)){
+			if(this.tipUrl.equals(super.path)){
+   			 this.path = this.listFaceEquipmentUrl;	
+	      	}
+			return;
+		}else if("updateSegment".equals(task)){
+			this.path=PATH_AJAX;
+		}
+		
+	}
+
+}

+ 7 - 1
src/main/master1_eu/com/yw/master1_eu/desktop.xml

@@ -57,6 +57,12 @@
 	           <bgColor>#e86123</bgColor>
 	       </attrs>
 	    </block>
-
+	    <block id="mtFaceEquipmentAction" title="考勤设备管理" action="/mtFaceEquipmentAction.do?task=toFaceEquipmentList">
+			<attrs>
+				<iconUrl>/shares/images/master1_ams/icon/amsbrrowManger.png</iconUrl>
+				<iconType>bigStyle</iconType>
+				<bgColor>#9400D3</bgColor>
+			</attrs>
+		</block>
 	</blocks>
 </yw>

+ 14 - 2
src/main/master1_eu/com/yw/master1_eu/pageflow/master1_eu.xml

@@ -19,10 +19,10 @@
 		<param list="v" listValue="positionlist" />
 	</action>
 
-	<action>
+	<!-- <action>
 		<forward id="/mtPositionList?v=positionlist" author="/positionList" isAuthor="1" />
 		<class name="com.yw.core.framework.view.action.ViewList" needLogin="true" />
-	</action>
+	</action> -->
 
 	<!-- 平台信息管理 -->
 	<action>
@@ -128,4 +128,16 @@
 		<class name="com.yw.master1_eu.action.MTEuclientAction" needLogin="true"/>
 		<param list="" />
 	</action>
+	
+	<!-- 考勤设备管理
+	<action>
+		<forward id="/mtFaceEquipmentList" author="/faceEquipmentConfig?task=toFaceEquipmentList" isAuthor="1" />
+		<class name="com.yw.oa.face.action.FaceEquipmentConfigAction" needLogin="true" />
+		<param list="" />
+	</action> -->
+	<!-- 考勤设备管理 -->
+	<action>
+		<forward id="/mtFaceEquipmentAction" author="/mtFaceEquipmentAction" />
+		<class name="com.yw.master1_eu.action.MTFaceEquipmentAction" needLogin="true" />
+	</action>
 </pageflow>

+ 131 - 0
src/main/webapp/yw/master1_eu/faceEquipment/editFaceEquipment.jsp

@@ -0,0 +1,131 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"
+    pageEncoding="UTF-8"%>
+    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<% String  documentId = "";%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>修改考勤设备配置</title>
+<link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css" />
+<link href="/shares/css/yw/master1/reset.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="/shares/js/jquery-1.3.2.min.js"></script>
+<script type="text/javascript" src="/shares/js/constant.js"></script> 
+<script type="text/javascript" src="/shares/js/common.js"></script> 
+<link href="main.css" rel="stylesheet" type="text/css" />
+<link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
+<script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
+<script type="text/javascript" src="/shares/js/file.js"></script>
+<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath }/ueditor1_4_3-gbk-jsp/ueditor.config.js"></script>
+<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath }/ueditor1_4_3-gbk-jsp/ueditor.all.min.js"> </script>
+<script type="text/javascript" src="/shares/js/yw/master1/page.js"></script>
+<script type="text/javascript" src="/shares/js/yw/master1/common.js"></script>
+<script type="text/javascript">
+function checkForm(){
+	var rs = $.validate({
+		name : "faceEquipment.serialname",
+		model : [ {
+			type : "require",
+			msg : "设备名称不能为空!"
+		} ]
+	});
+	if(!rs)return;
+	if(!checkSerialname()){
+		return;
+	}
+	$("#theForm").submit();
+}
+function checkSerialnameProcess(data){
+	 if(data != null && data !=""){ 
+		 addFieldErrors("serialname","该用户名已存在!");
+        flag=false ;
+    }else{
+ 	   flag=true; 
+    }
+}
+
+function checkSerialname(){
+	clearSingelMsg("serialname"); 
+	var serialname = $("#serialname").val();
+	var initserialname = $("#initserialname").val();
+	var id = $("#id").val();
+	var url = "faceEquipmentConfig.do?&task=checkSerialname&id=" + id;
+	if (serialname != initserialname) { 
+		var param = {'serialname':serialname, 'id':id};
+		sendAjaxParam(param,url,"text",checkSerialnameProcess); 
+	}else{
+		flag=true;
+	}  
+	return flag;
+}
+</script>
+<style type="text/css">
+/* .container-layout {
+    width: 100%;
+} */
+</style>
+</head>
+<Body>
+	<%@ include file="/include/message.jsp"%>
+	<FORM method="post" name="theForm" id="theForm" action="mtFaceEquipmentAction.do" >
+		<div class="s_title b10 f6" style="text-align: left;">
+			<img src="/shares/images/master1/gg_ico.png" width="27" height="26" /> 修考勤设备配置
+			<div class="article_title" style="margin-left: -30px;">
+				<input class="art_back" title="返回" name="" onclick="history.back(-1);" type="button" style="width:40px;" />&nbsp;
+				<input class="art_sub" title="保存" name="" type="button" value="" onclick="checkForm()" style="width:40px;"/>&nbsp;
+			</div>
+		</div>	
+		<div class="container-layout" style="margin-top: 50px;">
+			<div class="forum-container"> 
+				<!-- <div id="titles" class="form-button">
+					<input type="button" id="message_save" class="l-button tijiao" onclick="checkForm();" value="提交" style="width: 90px"/>
+				</div> -->
+				<Table border="0" cellspacing="1" cellpadding="0"  class="l-table-edit line">
+					<tr><th colspan="2">修改人脸设备</th></tr>
+					<tr>
+						<td class="l-table-edit-text">设备编号:</td>
+					 	<td class="l-table-edit-td">
+					 		${faceEquipment.serialno }
+					 	</td>
+					</tr>
+					<tr>
+						<td class="l-table-edit-text">设备名称:</td>
+					 	<td class="l-table-edit-td">
+					 		<input type="text" name="faceEquipment.serialname" id="serialname"  value='${faceEquipment.serialname }' width="300" />
+					 	</td>
+					</tr>
+					<tr>
+						<td class="l-table-edit-text">设备地点:</td>
+					 	<td class="l-table-edit-td">
+					 		<input type="text" name="faceEquipment.serialplace" id="serialplace"  value='${faceEquipment.serialplace }' width="200" />
+					 	</td>
+					</tr>
+					<tr>
+						<td class="l-table-edit-text">设备ip:</td>
+					 	<td class="l-table-edit-td">
+					 		<input type="text" name="faceEquipment.ip" id="ip"  value='${faceEquipment.ip }' width="200" />
+					 	</td>
+					</tr>
+					<tr>
+						<td class="l-table-edit-text">设备端口:</td>
+					 	<td class="l-table-edit-td">
+					 		<input type="text" name="faceEquipment.port" id="port"  value='${faceEquipment.port }' width="200" />
+					 	</td>
+					</tr>
+					<tr>
+						<td class="l-table-edit-text">设备密码:</td>
+					 	<td class="l-table-edit-td">
+					 		<input type="text" name="faceEquipment.secretkey" id="secretkey"  value="${faceEquipment.secretkey }" width="200" />
+					 	</td>
+					</tr>
+					<input type="hidden" id="id" name="faceEquipment.id" value="${faceEquipment.id }">
+					<input type="hidden" id="initserialname" value="${faceEquipment.serialname }">
+					<input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
+					<input type="hidden" id="task" name="task" value="editFaceEquipment">
+					<input type="hidden" id="type" name="type" value="${type}">
+				</TABLE>
+			</div>
+		</div>
+	</FORM>
+</BODY>
+</html>

+ 110 - 0
src/main/webapp/yw/master1_eu/faceEquipment/listFaceEquipment.jsp

@@ -0,0 +1,110 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"
+    pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>考勤设备列表</title>
+<link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
+<script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
+<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
+<script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script> 
+<link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
+<script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"
+	type="text/javascript"></script>
+<script type="text/javascript" src="/shares/js/constant.js"></script> 
+<script type="text/javascript" src="/shares/js/common.js"></script> 
+<script type="text/javascript" src="/shares/js/yw/oa/oa.js"></script>
+<script type="text/javascript" src="/shares/js/yw/master1/page.js"></script>
+<script type="text/javascript" src="/shares/js/yw/master1/common.js"></script>
+<script type="text/javascript">
+//编辑考勤设备
+function editFaceEquipment(id){
+	item('mtFaceEquipmentAction.do?task=toEditFaceEquipment&id='+id+'');
+}
+</script>
+
+<script type="text/javascript">
+        var grid = null;
+        $(function () {
+        	searchByKword();
+        });
+        function searchByKword(){
+        	var serialname = document.getElementById("serialname");
+        	var serialno = document.getElementById("serialno");
+    		var s = "";
+    		if(serialname.value != "" && typeof(serialname.value) != "undefined"  ){
+    			s += "&serialname=" + encodeURI(encodeURI(serialname.value));
+    		}  
+    		if(serialno.value != "" && typeof(serialno.value) != "undefined"  ){
+    			s += "&serialno=" + encodeURI(encodeURI(serialno.value));
+    		} 
+    		$(function () {
+                grid = $("#maingrid4").ligerGrid({
+                    columns: [
+                    { display: '设备编号', name: 'serialno',  width: 200},
+                    { display: '设备名称', name: 'serialname',  width: 200},
+                    { display: '设备地点', name: 'serialplace',  width: 300},
+                    { display: '设备ip', name: 'ip',  width: 200},
+                    { display: '设备端口', name: 'port',  width: 100},
+                    { display: '设备密码', name: 'secretkey',  width: 100},
+                    {
+                        display: '操作', isAllowHide: false,width: 150,
+                        render: function (row)
+                        {
+                        	var html = '<a href=\"#\" onclick=\"editFaceEquipment('+ row.id + ')\">编辑</a>&nbsp;';
+                            return html;
+                        }
+                    }
+                    ],  
+                    pageSize:20, 
+                    url: 'faceEquipmentConfig.do?task=listFaceEquipment&time=' + new Date().getTime()+s,
+                    pageParmName: 'p',               //页索引参数名,(提交给服务器)
+            		pagesizeParmName: 'pSize',        //页记录数参数名,(提交给服务器)
+            		 width: '99.8%',
+                     height: '99%'
+                });
+                $("#pageloading").hide();
+            });
+		}
+
+    </script>
+<style type="text/css">
+	.default_search li.title {
+		width:auto;
+	}
+	.container-layout {
+    	padding-top: 0px;
+	    width: 100%;
+	}
+</style>
+</head>
+<body >
+<div class="container-layout">
+	<div class="default_search" >
+		<ul class="list_search">
+			<li class="title">设备名称:</li>
+			<li class="text">
+				<input type="text"  name="serialname" id="serialname" >
+			</li>
+		</ul>
+		<ul class="list_search">
+			<li class="title">设备编号:</li>
+			<li class="text">
+				<input type="text"  name="serialno" id="serialno" >
+			</li>
+		</ul>
+		<ul>
+			<li class="search-button" >
+				<input type="button" class='l-button chaxun' name="search" onclick="searchByKword()" value="查询"/>
+			</li>
+		</ul>
+	</div>
+	<div style="clear: both;">
+	<div id="maingrid4" style="margin: 0; padding: 0"></div>
+	</div>
+</div>
+
+</body>
+</html>

+ 1 - 1
src/main/webapp/yw/oa/face/editFaceEquipment.jsp

@@ -102,7 +102,7 @@ function checkSerialname(){
 					<tr>
 						<td class="l-table-edit-text">设备密码:</td>
 					 	<td class="l-table-edit-td">
-					 		<input type="text" name="faceEquipment.key" id="key"  value="${faceEquipment.key }" width="200" />
+					 		<input type="text" name="faceEquipment.secretkey" id="secretkey"  value="${faceEquipment.secretkey }" width="200" />
 					 	</td>
 					</tr>
 					<input type="hidden" id="id" name="faceEquipment.id" value="${faceEquipment.id }">