




已阅读5页,还剩18页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
20112012学年第二学期Java EE技术及应用课程大作业设计题目:企业人事管理系统专业:_计算机软件班级:09级 计算机一班学号: 090400421Java EE技术及应用评价标准项目内容单项分值标准分值软件分析设计(1)题目明确、分析合理,有用例图530(2)功能结构分析准确,有结构图5(3)数据结构设计合理,有ER图,Sql脚本正确5(4)系统架构清晰,有相关说明5(5)开发环境和运行环境明确5(6)文档格式规范5软件实现(7)功能较完整、能正确运行520(8)界面设计合理、易用、协调5(9)代码规范(命名、注释、格式)5(10)程序有一定难度(至少包含四个以上数据表)5总体效果(11)项目完成总体质量510(12)软件功能及技术水平5答辩(13)讲解清楚明了510(14)功能演示流畅5评语得分 企业人事管理系统系统分析 在企业中,人事管理工作是非常重要的一项工作,它负责整个企业的日常人事安排,人员的人事管理等。高效的人事管理可以提高企业的市场竞争力,使企业具有更强的凝聚力和活力。人事部门的工作一般都是日常性的而且是比较繁杂的,大量重复性工作很容易导致员工工作没有新鲜感。使用人事管理系统可以让繁杂的工作电子化管理,提高人事部门员工的工作效率。总体设计1 功能模块设计企业人事管理系统站点首页员工信息员工管理用户管理用户登录用户注册2 数据库设计create database person;use person;create table news_category( cat_id int auto_increment primary key, cat_title varchar(50) not null);create table news_user( user_id int auto_increment primary key, user_name varchar(50) not null, user_pwd varchar(50) not null, user_right int default 1, user_pic blob);create table news_content( cont_id int auto_increment primary key, cat_id int not null references news_category(cat_id), cont_title varchar(200) not null, cont_content text not null, cont_pic varchar(200), cont_datetime timestamp);3 系统架构设计表示层业务逻辑层数据操作层数据库4 包和文件夹划分5 系统文件结构NetbeansJavaEEMy-SQL实体类设计Action CheckAction.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */package person.action;/* * * author Administrator */import java.io.IOException;import java.util.List;import javax.servlet.RequestDispatcher;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import mon.MyFactory;import mon.PageList;import person.iservice.ICheckService;import person.model.Check;public class CheckAction private ICheckService CheckService = MyFactory.createCheckService(); private final int PAGE_SIZE = 3; private Check Check; private Integer checkId; private PageList plist; private String message; private Integer pageNo; public String add() throws Exception if (CheckService.addCheck(Check) 0) message = 添加成功!返回; else message = 添加失败!返回; return msg; public String edit() throws Exception if (CheckService.editCheck(Check) 0) message = 修改成功!返回; else message = 修改失败!返回; return msg; public String willedit() throws Exception Check=CheckService.findCheckById(checkId); return edit; public String manage() throws Exception if(pageNo=null)pageNo=1; List list = CheckService.findChecks(PAGE_SIZE, pageNo); int count = CheckService.findCount(); plist = new PageList(list, count, PAGE_SIZE, pageNo, /person/CheckAction_manage.action); return manage; public String delet() throws Exception if (CheckService.deleteCheck(checkId) 0) message = 删除成功!返回; else message = 删除失败!返回; return msg; public Integer getCheckId() return checkId; public void setCheckId(Integer checkId) this.checkId = checkId; public Check getCheck() return Check; public void setCheck(Check Check) this.Check = Check; public String getMessage() return message; public void setMessage(String message) this.message = message; public Integer getPageNo() return pageNo; public void setPageNo(Integer pageNo) this.pageNo = pageNo; public PageList getPlist() return plist; public void setPlist(PageList plist) this.plist = plist; InfoAction.java/* * To change this template, choose Tools | Templates * and open the template in the editor. */package person.action;/* * * author Administrator */import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.util.Date;import java.util.List;import java.util.logging.Level;import java.util.logging.Logger;import mon.MyFactory;import mon.PageList;import person.iservice.IInfoService;import person.model.Info;import org.apache.struts2.ServletActionContext;/* * * author Administrator */public class InfoAction private IInfoService InfoService = MyFactory.createInfoService(); private final Integer PAGE_SIZE = 3; private File upfile; private String upfileFileName; private Info Info; private PageList plist; private Integer checkId; private String infoName; private Integer infoId; private Integer pageNo; private String message; public String manage() throws Exception if (pageNo = null) pageNo = 1; if (infoName = null) infoName = ; List list = InfoService.findInfos(checkId, infoName, PAGE_SIZE, pageNo); int count = InfoService.findCount(infoName); plist = new PageList(list, count, PAGE_SIZE, pageNo, /person/InfoAction!manage.action); return manage; public String browse() throws Exception if (pageNo = null) pageNo = 1; if (infoName = null) infoName = ; List list = InfoService.findInfos(checkId, infoName, PAGE_SIZE, pageNo); int count = InfoService.findCount(infoName); plist = new PageList(list, count, PAGE_SIZE, pageNo, /person/InfoAction!browse.action); return browse; public String add() throws Exception System.out.println(upfile=null); String newFilename = new Date().getTime() + getExt(upfileFileName); String path = ServletActionContext.getServletContext().getRealPath(/upfiles); File file = new File(path + + newFilename); if(upfile!=null) copy(upfile, file); Info.setInfoDepart(newFilename); if (InfoService.addInfo(Info) 0) message = 添加成功!返回; else message = 添加失败!返回; return msg; private void copy(File src, File dst) InputStream in = null; OutputStream out = null; try in = new BufferedInputStream(new FileInputStream(src); out = new BufferedOutputStream(new FileOutputStream(dst); byte buffer = new byte1024; int c = 0; while (c = in.read(buffer, 0, 1024) 0) out.write(buffer, 0, c); catch (Exception e) e.printStackTrace(); finally try in.close(); catch (IOException ex) try out.close(); catch (IOException ex) private String getExt(String filename) int pos = filename.lastIndexOf(.); return filename.substring(pos); public String willedit() throws Exception Info = InfoService.findInfoById(infoId); return edit; public String show() throws Exception Info = InfoService.findInfoById(infoId); return show; public String edit() throws Exception if (InfoService.editInfo(Info) 0) message = 修改成功!返回; else message = 修改失败!返回; return msg; public String delete() throws Exception Info=InfoService.findInfoById(infoId); String path = ServletActionContext.getServletContext().getRealPath(/upfiles); File file = new File(path + + Info.getInfoDepart(); if(file.exists() file.delete(); if (InfoService.deleteInfo(infoId) 0) message = 删除成功!返回; else message = 删除失败!返回; return msg; public Integer getCheckId() return checkId; public void setCheckId(Integer checkId) this.checkId = checkId; public Integer getInfoId() return infoId; public void setInfoId(Integer infoId) Id = infoId; public String getContTitle() return infoName; public void setContTitle(String contTitle) Name = infoName; public Info getInfo() return Info; public void setInfo(Info Info) this.Info = Info; public String getMessage() return message; public void setMessage(String message) this.message = message; public Integer getPageNo() return pageNo; public void setPageNo(Integer pageNo) this.pageNo = pageNo; public PageList getPlist() return plist; public void setPlist(PageList plist) this.plist = plist; public File getUpfile() return upfile; public void setUpfile(File upfile) this.upfile = upfile; public String getUpfileFileName() return upfileFileName; public void setUpfileFileName(String upfileFileName) this.upfileFileName = upfileFileName; UserAction.java/* * To change this template, choose Tools | Templates * and open the template in the editor. */package person.action;/* * * author Administrator */import com.opensymphony.xwork2.ActionContext;import ernal.messaging.saaj.util.ByteInputStream;import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.util.List;import java.util.Map;import java.util.logging.Level;import java.util.logging.Logger;import javax.servlet.ServletOutputStream;import mon.MyFactory;import mon.PageList;import person.iservice.IUserService;import person.model.User;import org.apache.struts2.ServletActionContext;/* * * author Administrator */public class UserAction private IUserService userService = MyFactory.createUserService(); private final Integer PAGE_SIZE = 3; private File upfile; private String upfileFileName; private User user; private PageList plist; private Integer userId; private Integer pageNo; private String message; public String manage() throws Exception if (pageNo = null) pageNo = 1; List list = userService.findUsers(PAGE_SIZE, pageNo); int count = userService.findCount(); plist = new PageList(list, count, PAGE_SIZE, pageNo, /person/UserAction_manage.action); return manage; public String login() user=userService.findUser(user.getUserName(), user.getUserPwd(); if(user!=null) Map map=ActionContext.getContext().getSession(); map.put(user, user); message=登录成功!主页; else message=登录成功!返回; return msg; public void showDepart() ServletOutputStream out = null; try ServletActionContext.getResponse().addHeader(pragma, no-cache); ServletActionContext.getResponse().addHeader(Cache-Control, no-cache); / 设置网页过期时间 ServletActionContext.getResponse().addDateHeader(Expries, 0); user = userService.findUserById(userId); byte b=user.getUserDepart(); out = ServletActionContext.getResponse().getOutputStream(); out.write(b); out.flush(); out.close(); catch (IOException ex) Logger.getLogger(UserAction.class.getName().log(Level.SEVERE, null, ex); finally try out.close(); catch (IOException ex) Logger.getLogger(UserAction.class.getName().log(Level.SEVERE, null, ex); public String add() throws Exception if (upfile != null) InputStream in = new FileInputStream(upfile); ByteArrayOutputStream out = new ByteArrayOutputStream(1024 * 1024 * 5); int c; byte b = new byte1024; while (c = in.read(b, 0, 1024) 0) out.write(b, 0, c); byte bu = out.toByteArray(); out.close(); in.close(); user.setUserDepart(bu); if (userService.addUser(user) 0) message = 注册成功!返回; else message = 注册失败!返回; return msg; public String willedit() throws Exception user = userService.findUserById(userId); return edit; public String edit() throws Exception if (userService.editUser(user) 0) message = 修改成功!返回; else message = 修改失败!返回; return msg; public String delete() throws Exception if (userService.deleteUser(userId) 0) message = 删除成功!返回; else message = 删除失败!返回; return msg; public String getMessage() return message; public void setMessage(String message) this.message = message; public Integer getPageNo() return pageNo; public void setPageNo(Integer pageNo) this.pageNo = pageNo; public PageList getPlist() return plist; public void setPlist(PageList plist) this.plist = plist; public User getUser() return user; public void setUser(User user) this.user = user; public Integer getUserId() return userId; public void setUserId(Integer userId) this.userId = userId; public File getUpfile() return upfile; public void setUpfile(File upfile) this.upfile = upfile; public String getUpfileFileName() return upfileFileName; public void setUpfileFileName(String upfileFileName) this.upfileFileName = upfileFileName; Common CodeServlet.javapackage mon;import com.sun.image.codec.jpeg.JPEGCodec;import com.sun.image.codec.jpeg.JPEGImageEncoder;import java.awt.Color;import java.awt.Font;import java.awt.Graphics;import java.awt.image.BufferedImage;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.ServletOutputStream;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.servlet.http.HttpSession;WebServlet(name = CodeServlet, urlPatterns = /CodeServlet)public class CodeServlet extends HttpServlet private static final long serialVersionUID = 2835215498536942683L;Overrideprotected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException doPost(request, response);Overrideprotected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException response.setContentType(image/jpeg);/ 设置发送给客户端的数据类型是图像/ 设置网页不缓存response.addHeader(pragma, no-cache);response.addHeader(Cache-Control, no-cache);/ 设置网页过期时间response.addDateHeader(Expries, 0);/ 在内存建立一个图像缓冲区,用于画图BufferedImage bim = new BufferedImage(54, 20,BufferedImage.TYPE_INT_RGB);Graphics g = bim.getGraphics();g.setColor(Color.green); / 设置为绿色g.fillRect(0, 0, 54, 25); / 画背景HttpSession session = request.getSession();String str = 0123456789ABCDEFGHIJKLM
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年验船师考试(C级船舶检验专业实务)考前模拟试题及答案一
- 2025年公共卫生管理与政策考试试题及答案
- 2025年绿色经济课程测试题及答案
- 2025注册验船师考试(C级船舶检验专业综合能力)冲刺模拟试题及答案一
- 2025年银行招聘考试笔试模拟题及高分秘籍
- 2025年【G1工业锅炉司炉】考试试卷及G1工业锅炉司炉作业考试题库(含答案)
- 管理课程银行笔试题目及答案
- 2026届福建省泉州市德化一中化学高二上期中质量跟踪监视试题含解析
- 2025年初级电子信息技术应用模拟考试题库及答案详解
- 2025年法律事务助理招聘考试题库及答案解析
- 待灭菌物品的装载
- 《急性肺栓塞诊断和治疗指南2025》解读
- 2025年职业卫生技术服务专业技术人员考试(放射卫生检测与评价)历年参考题库含答案详解(5套)
- 2025至2030年中国小信号分立器件行业市场运行现状及投资战略研究报告
- 在县政协党组理论学习中心组2025年第六次集中学习上的研讨发言(五个进一步到位)
- 2025年邮政柜员考试题库及答案
- 第8课 认识TCP-IP 课件 2025-2026学年七年级上册信息技术浙教版
- 足球裁判规则讲解
- 2025年重庆对外建设集团招聘考试笔试试题(含答案)
- 信访工作心得及改进措施总结报告
- 老年人基础照护护理协助协助老人床椅转移
评论
0/150
提交评论