当前位置:网站首页>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
边栏推荐
- DNS attack details
- JSP intelligent community property management system
- 【Ranking】Pre-trained Language Model based Ranking in Baidu Search
- spark sql任务性能优化(基础)
- 在php的开发环境中如何调取WebService?
- Oracle 11g uses ords+pljson to implement JSON_ Table effect
- 解决万恶的open failed: ENOENT (No such file or directory)/(Operation not permitted)
- php中获取汉字拼音大写首字母
- 【信息检索导论】第六章 词项权重及向量空间模型
- php中生成随机的6位邀请码
猜你喜欢

IDEA2020中PySpark的两表关联(字段名相同)

Illustration of etcd access in kubernetes

User login function: simple but difficult

第一个快应用(quickapp)demo

叮咚,Redis OM对象映射框架来了

Two table Association of pyspark in idea2020 (field names are the same)

How to call WebService in PHP development environment?

Explain in detail the process of realizing Chinese text classification by CNN

Basic knowledge of software testing

【信息检索导论】第二章 词项词典与倒排记录表
随机推荐
Build FRP for intranet penetration
Basic knowledge of software testing
@Transitional step pit
Sqli labs customs clearance summary-page1
Laravel8中的find_in_set、upsert的使用方法
Thinkphp5中一个字段对应多个模糊查询
Practice and thinking of offline data warehouse and Bi development
JSP intelligent community property management system
【BERT,GPT+KG调研】Pretrain model融合knowledge的论文集锦
使用Matlab实现:幂法、反幂法(原点位移)
IDEA2020中PySpark的两表关联(字段名相同)
Two table Association of pyspark in idea2020 (field names are the same)
华为机试题
parser.parse_args 布尔值类型将False解析为True
Oracle EBS ADI development steps
view的绘制机制(三)
图解Kubernetes中的etcd的访问
Ding Dong, here comes the redis om object mapping framework
Principle analysis of spark
離線數倉和bi開發的實踐和思考