当前位置:网站首页>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
边栏推荐
- 外币记账及重估总账余额表变化(下)
- Sqli-labs customs clearance (less2-less5)
- Network security -- intrusion detection of emergency response
- Yaml file of ingress controller 0.47.0
- spark sql任务性能优化(基础)
- DNS attack details
- Proteus -- RS-232 dual computer communication
- Oracle EBS ADI development steps
- Principle analysis of spark
- A summary of a middle-aged programmer's study of modern Chinese history
猜你喜欢
ORACLE 11G利用 ORDS+pljson来实现json_table 效果
中年人的认知科普
离线数仓和bi开发的实践和思考
ssm超市订单管理系统
Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
@Transational踩坑
Sqli-labs customs clearance (less15-less17)
Yolov5 practice: teach object detection by hand
Oracle apex Ajax process + dy verification
Oracle EBs and apex integrated login and principle analysis
随机推荐
MySQL composite index with or without ID
Oracle apex Ajax process + dy verification
php中根据数字月份返回月份的英文缩写
Oracle RMAN automatic recovery script (migration of production data to test)
Two table Association of pyspark in idea2020 (field names are the same)
Module not found: Error: Can't resolve './$$_ gendir/app/app. module. ngfactory'
一个中年程序员学习中国近代史的小结
ORACLE EBS接口开发-json格式数据快捷生成
Go package name
IDEA2020中测试PySpark的运行出错
oracle-外币记账时总账余额表gl_balance变化(上)
php中计算树状结构数据中的合计
【信息检索导论】第一章 布尔检索
Pratique et réflexion sur l'entrepôt de données hors ligne et le développement Bi
Go common compilation fails
使用Matlab实现:幂法、反幂法(原点位移)
JSP智能小区物业管理系统
Oracle segment advisor, how to deal with row link row migration, reduce high water level
RMAN增量恢复示例(1)-不带未备份的归档日志
oracle apex ajax process + dy 校验