当前位置:网站首页>SSM personnel management system
SSM personnel management system
2022-07-02 07:19:00 【Night Weiyang 5788】
Author URI : In the middle of the night 5788
brief introduction :Java Quality creators in the field 、Java project 、 Learning materials 、 Technical assistance
Get the source code at the end of the article
Project introduction
ssm Personnel management system . The main functions are :
User management : User query 、 Add users ;
Department of management : Department query 、 Add Department ;
Position management : Position query 、 Add position ;
Employee management : Employee inquiries 、 Add employees ;
Announcement management : Announcement query 、 Add announcement ;
Download Center : Document query 、 Upload documents ;
Environmental needs
1. Running environment : It is best to java jdk 1.8, We run on this platform . Other versions can, in theory .
2.IDE Environmental Science :IDEA,Eclipse,Myeclipse Fine . recommend IDEA;
3.tomcat Environmental Science :Tomcat 7.x,8.x,9.x All versions are available
4. Hardware environment :windows 7/8/10 1G Above memory ; perhaps Mac OS;
5. whether Maven project : yes ; See if the source directory contains pom.xml; If included , Then for maven project , Otherwise, it is not maven project
6. database :MySql 5.7 edition ;
Technology stack
1. Back end :Spring SpringMVC MyBatis
2. front end :ligerUI+jquery+metronic+jsp
Instructions
1. Use Navicat Or other tools , stay mysql Create a database with the corresponding name in , And import the sql file ;
2. In the project db.properties Change the database configuration in the configuration file to your own configuration
3. Use IDEA/Eclipse/MyEclipse Import the project ,Eclipse/MyEclipse Import time , if maven Item, please select maven;
if maven project , After importing successfully, please execute maven clean;maven install command , To configure tomcat, And then run ;
4. Run the project , Input localhost:8080/ Sign in
Run a screenshot

Related codes
Position controller
@Controller
@RequestMapping("/job")
public class JobHandler {
@Autowired
private IJobService jobService;
@RequestMapping("findJob.do")
public String findJob(@RequestParam(defaultValue = "1") int pageIndex, Model model, String name,String flag){
PageModel pageModel=new PageModel();
int count=jobService.findJobCount(name);
pageModel.setRecordCount(count);
if(flag!=null){
pageModel.setPageIndex(pageModel.getTotalSize());
}else{
pageModel.setPageIndex(pageIndex);
}
List<Job> jobs=jobService.findJob(pageModel,name);
model.addAttribute("name",name);
model.addAttribute("pageModel",pageModel);
model.addAttribute("jobs",jobs);
return "/jsp/job/job.jsp";
}
/* Press id Find a position */
@RequestMapping("findJobById.do")
public String findJobById(Integer id,Model model,int pageIndex){
Job job=jobService.findJobById(id);
model.addAttribute("pageIndex",pageIndex);
model.addAttribute("job",job);
return "/jsp/job/showUpdateJob.jsp";
}
/* Change position */
@RequestMapping("modifyJob.do")
@ResponseBody
public String modifyJob(Job job){
int row=jobService.modifyJob(job);
if(row>0){
return "OK";
}
else{
return "FAIL";
}
}
/* Delete position */
@RequestMapping("removeJob.do")
@ResponseBody
public String remove(Integer[] ids){
try {
int rows = jobService.removeJob(ids);
if (rows == ids.length) {
return "OK";
} else {
return "FAIL";
}
}catch (DataIntegrityViolationException e){
return "ERROR";
}
}
/* Add position */
@RequestMapping("addJob.do")
@ResponseBody
public String addJob(Job job){
int row=jobService.addJob(job);
if(row>0){
return "OK";
}else{
return "FAIL";
}
}
}
User controller
@Controller
@RequestMapping("/user")
public class UserHandler {
@Autowired
private IUserService userService;
@RequestMapping("/login.do")
public String login(User user, HttpSession session, Model model){
//System.out.println(user);
User login_user = userService.findUserByLoginnameAndPassword(user);
//System.out.println(login_user);
if (login_user != null){
session.setAttribute("login_user",login_user);
return "/jsp/main.jsp";
}else {
model.addAttribute("login_error"," Username or password incorrect , Please re-enter !");
return "/index.jsp";
}
}
@RequestMapping("/logout.do")
public String logout(HttpSession session,Model model){
session.removeAttribute("login_user");
model.addAttribute("login_error"," Quit successfully , Please login again !");
return "/index.jsp";
}
@RequestMapping("/aaa.do")
public String aaa(){
return "/jsp/main.jsp";
}
@RequestMapping("/findUser.do")
public String findUser(@RequestParam(defaultValue = "1") int pageIndex, User user,Model model){
PageModel pageModel = new PageModel();
pageModel.setPageIndex(pageIndex);
int count = userService.findUserCount(user);
pageModel.setRecordCount(count);
List<User> users = userService.findUser(pageModel,user);
model.addAttribute("pageModel",pageModel);
model.addAttribute("user",user);
model.addAttribute("users",users);
return "/jsp/user/user.jsp";
}
@RequestMapping("/modifyUser.do")
public String modifyUser(User user,String flag,Model model){
if (flag == null){
user = userService.findUserById(user.getId());
model.addAttribute("user",user);
return "/jsp/user/showUpdateUser.jsp";
}else {
int rows = userService.modifyUser(user);
if (rows > 0){
return "redirect:/user/findUser.do";
}else {
model.addAttribute("fail"," User information modification failed !");
return "/jsp/fail.jsp";
}
}
}
@RequestMapping("/removeUser.do")
public String removeUser(Integer[] ids,Model model,HttpSession session){
User login_user = (User) session.getAttribute("login_user");
for (Integer id:ids){
if (id==login_user.getId()){
model.addAttribute("fail"," Cannot delete the currently logged in user !");
return "/jsp/fail.jsp";
}
}
try {
int rows = userService.removeUserById(ids);
if (rows == ids.length){
return "redirect:/user/findUser.do";
}else {
model.addAttribute("fail"," User information deletion failed !");
return "/jsp/fail.jsp";
}
}catch (DataIntegrityViolationException e){
model.addAttribute("fail"," Users have issued announcements or documents , Can't delete !");
return "/jsp/fail.jsp";
}
/*int rows=0;
for (Integer id:ids){
int row = userService.removeUser(id);
if (row >0){
rows++;
}
}
if (rows == ids.length){
return "redirect:/user/findUser.do";
}else {
model.addAttribute("fail"," User information deletion failed !");
return "/jsp/fail.jsp";
}*/
}
@RequestMapping("/addUser.do")
public String addUser(User user,Model model){
int rows = userService.addUser(user);
if (rows > 0){
return "redirect:/user/findUser.do";
}else {
model.addAttribute("fail"," Failed to add user information !");
return "/jsp/fail.jsp";
}
}
}
If you want to learn this system , Now get . reply :054ssm
边栏推荐
- sparksql数据倾斜那些事儿
- 离线数仓和bi开发的实践和思考
- Sqli Labs clearance summary - page 2
- 软件开发模式之敏捷开发(scrum)
- ORACLE 11.2.0.3 不停机处理SYSAUX表空间一直增长问题
- DNS attack details
- view的绘制机制(一)
- Oracle EBS DataGuard setup
- Oracle 11.2.0.3 handles the problem of continuous growth of sysaux table space without downtime
- Build FRP for intranet penetration
猜你喜欢
随机推荐
CSRF攻击
Sqli labs customs clearance summary-page4
Take you to master the formatter of visual studio code
The boss said: whoever wants to use double to define the amount of goods, just pack up and go
php中生成随机的6位邀请码
JSP智能小区物业管理系统
ssm垃圾分类管理系统
php中的二维数组去重
RMAN incremental recovery example (1) - without unbacked archive logs
php中树形结构转数组(拉平树结构,保留上下级排序)
Oracle EBS database monitoring -zabbix+zabbix-agent2+orabbix
ORACLE EBS 和 APEX 集成登录及原理分析
view的绘制机制(一)
软件开发模式之敏捷开发(scrum)
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'
Explanation of suffix of Oracle EBS standard table
【信息检索导论】第一章 布尔检索
mapreduce概念和案例(尚硅谷学习笔记)
离线数仓和bi开发的实践和思考
Three principles of architecture design








