使用技术:java,Jsp,Mysql,Servlet比较适合初学者用了解学习,课设使用,写的不好的地方请各位大佬多多指教
目录
使用技术:java,Jsp,Mysql,Servlet比较适合初学者用了解学习,课设使用,写的不好的地方请各位大佬多多指教,本系统一共有四个功能模块:员工管理、公告管理、上报事件管理、任务派发四个模块。本文最后附有源码
使用list集合来保存从数据库检索出来的数据,并使用迭代器进行遍历
1.管理员端口界面
2.管理员主界面
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>员工管理主界面</title>
<style type="text/css">
.id{
text-align: center;
}
button{
text-align: center;
width: 150px;
height: 80px;
color: #fff;
background-color: #6496c8;
border: none;
border-radius: 15px;
box-shadow: 0 10px #27496d;
margin: 20px;
}
a{
color: white;
text-decoration:none
}
p{ color: white;
font-size: 20px;
}
a:hover{ text-decoration:underline}
</style>
</head>
<body background="backgrond.png" style="background-repeat:no-repeat;
background-attachment:fixed;
background-size:100% 100%;" >
<h1 style="color: #57b2c9;text-align: center;font-size: 70px">欢迎登录</h1>
<div class="id">
<button><p><a href="listAll.jsp">员工总览</a></p></button>
<button><p><a href="insert.jsp">新增员工</a></p></button>
<button><p><a href="selectOne.jsp">查询员工</a></p></button><br>
<button><p><a href="delete.jsp">删除员工</a></p></button>
<button><p><a href="update.jsp">修改员工信息</a></p></button>
<button><p><a href="wagesCompute.jsp">员工实发工资计算</a></p></button><br>
<button><p><a href="sort.jsp">员工工资排序</a></p></button>
<button><p><a href="addPublicity.jsp">发布公告</a></p></button>
<button><p><a href="doEvent.jsp">待处理事件</a></p></button><br>
<button><p><a href="index.jsp"> 退出系统</a></p></button>
</table>
</div>
</body>
</html>
3.管理员功能展示
使用list集合来保存从数据库检索出来的数据,并使用迭代器进行遍历
<%@ page import="dao.EmpDao" %>
<%@ page import="dao.EmpDaoImplement" %>
<%@ page import="java.util.List" %>
<%@ page import="po.Emp" %>
<%@ page import="java.util.Iterator" %><%--
Created by IntelliJ IDEA.
User: 86134
Date: 2022/10/9
Time: 20:46
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>总览员工</title>
</head>
<body background="backgrond.png" style="background-repeat:no-repeat;
background-attachment:fixed;
background-size:100% 100%;">
<h1 style="text-align: center">员工信息表</h1>
<button><a href="main.jsp" style="text-decoration:none">返回首页</a></button>
<table border="2px" align="center" cellspacing="0">
<tr bgcolor="#708090">
<td>员工工号</td>
<td>员工姓名</td>
<td>员工性别</td>
<td>员工工作</td>
<td>员工年龄</td>
<td>员工手机号</td>
<td>员工基本工资</td>
</tr>
<%
EmpDao emp = new EmpDaoImplement();
List<Emp> list = emp.getAll();
Iterator<Emp> it = list.iterator();
while (it.hasNext()){
Emp e = it.next();
%>
<tr bgcolor="white">
<td><%=e.getId()%></td>
<td><%=e.getName()%></td>
<td><%=e.getSex()%></td>
<td><%=e.getJob()%></td>
<td><%=e.getAge()%></td>
<td><%=e.getPhoneNumber()%></td>
<td><%=e.getWages()%></td>
</tr>
<%}%>
</table>
</body>
</html>
<%@ page import="po.Emp" %>
<%@ page import="dao.EmpDao" %>
<%@ page import="dao.EmpDaoImplement" %><%--
Created by IntelliJ IDEA.
User: 86134
Date: 2022/10/9
Time: 20:42
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<style type="text/css">
form{
width: 420px;
height: 500px;
padding-top:30px;
margin: 80px auto;
border-radius: 10px;
background: rgba(255,255,255,0.1);
border: 1px solid rgba(255,255,255,0.3)
}
input{
margin:15px;
}
h1{
text-align: center;
}
</style>
<title>新增员工</title>
</head>
<body background="backgrond.png" style="background-repeat:no-repeat;
background-attachment:fixed;
background-size:100% 100%;">
<h1>请填写员工信息</h1>
<button><a href="main.jsp" style="text-decoration:none">返回首页</a></button>
<form action="insert" method="post" style="text-align: center">
请输入员工工号:<input type="text" name="id"><br>
请输入员工姓名:<input type="text" name="name"><br>
请选择员工的性别:<input type="radio" name="sex" value="男">男
<input type="radio" name="sex" value="女">女<br>
请选择工作:<input type="radio" name="job" value="软件开发">软件开发
<input type="radio" name="job" value="软件测试">软件测试
<input type="radio" name="job" value="UI设计">UI设计
<input type="radio" name="job" value="原型设计">原型设计
<input type="radio" name="job" value="需求分析">需求分析<br>
请输入年龄:<input type="text" name="age"><br>
请输入手机号:<input type="text" name="phoneNumber"><br>
请输入基本工资:<input type="text" name="wages"><br>
<input type="submit" value="提交" style="width: 190px;height: 25px;border-radius: 3px;border: 2px solid #000;margin-left: 65px;background: #0d40d7;color: #fff;border: none;">
<input type="reset" style="width: 190px;height: 25px;border-radius: 3px;border: 2px solid #000;margin-left: 65px;background: #0d40d7;color: #fff;border: none;">
</form>
</body>
</html>
4.员工端主界面
<%@ page import="po.Publicity" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ page import="dao.PublicityDao" %>
<%@ page import="dao.PublicityDaoImp" %>
<%@ page import="java.util.Iterator" %><%--
Created by IntelliJ IDEA.
User: 86134
Date: 2022/11/9
Time: 11:03
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<style>
.d1{
background-color: antiquewhite;
border:10px solid blue;
width: 400px;
height: 200px;
padding: 20px;
margin: 20px;
padding: 20px 30px;
padding:20px 30px 40px;
padding-left: 70px;
border: 4px dotted blue;
border: 4px dashed blue;
border: 4px double blue;
}
.p3{
padding-left:300px
}
.p2{
padding-left:300px
}
</style>
<body background="2.jpg" style="background-repeat:no-repeat;
background-attachment:fixed;
background-size:100% 100%;">
<h1 style="text-align: center">公司公告</h1>
<button><a href="empInsertEvent.jsp">上报事件</a></button>   <button><a href="showMeEvent.jsp">查看我上报的事件</a></button>  <button><a href="empLogin.jsp">退出系统</a></button>
<%
List<Publicity> list = new ArrayList<Publicity>();
PublicityDao dao = new PublicityDaoImp();
Publicity pu = null;
list = dao.getAll();
for(int i= list.size()-1;i>=0;i--){
pu=new Publicity();
pu = list.get(i);
%>
<body>
<div class="d1">
<h1 style="text-align: center"><%=pu.getTitle()%></h1>
<p><%=pu.getContent()%></p>
<p class="p3">通知时间:</p><p class="p2"><%=pu.getDate()%></p>
</div>
</body>
<%}%>
</body>
</html>
5员工端功能展示
员工端首页