当前位置:网站首页>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
边栏推荐
猜你喜欢

mapreduce概念和案例(尚硅谷学习笔记)

view的绘制机制(一)

Brief analysis of PHP session principle

Sqli labs customs clearance summary-page1

Network security -- intrusion detection of emergency response

Principle analysis of spark

oracle apex ajax process + dy 校验

ssm+mysql实现进销存系统

ssm超市订单管理系统

Oracle apex Ajax process + dy verification
随机推荐
CAD secondary development object
User login function: simple but difficult
第一个快应用(quickapp)demo
php中树形结构转数组(拉平树结构,保留上下级排序)
数仓模型事实表模型设计
Oracle 11g uses ords+pljson to implement JSON_ Table effect
Oracle RMAN semi automatic recovery script restore phase
【调参Tricks】WhiteningBERT: An Easy Unsupervised Sentence Embedding Approach
ERNIE1.0 与 ERNIE2.0 论文解读
sqli-labs通關匯總-page2
ssm超市订单管理系统
Alpha Beta Pruning in Adversarial Search
parser.parse_args 布尔值类型将False解析为True
Ding Dong, here comes the redis om object mapping framework
php中生成随机的6位邀请码
php中的数字金额转换大写数字
华为机试题-20190417
【Ranking】Pre-trained Language Model based Ranking in Baidu Search
Laravel8中的find_in_set、upsert的使用方法
JSP智能小区物业管理系统