当前位置:网站首页>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
边栏推荐
- ORACLE APEX 21.2安装及一键部署
- TCP attack
- JSP智能小区物业管理系统
- Oracle EBs and apex integrated login and principle analysis
- 第一个快应用(quickapp)demo
- Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
- 使用Matlab实现:Jacobi、Gauss-Seidel迭代
- view的绘制机制(二)
- ORACLE EBS接口开发-json格式数据快捷生成
- ORACLE 11.2.0.3 不停机处理SYSAUX表空间一直增长问题
猜你喜欢
随机推荐
JSP intelligent community property management system
php中计算树状结构数据中的合计
php中在二维数组中根据值返回对应的键值
php中的二维数组去重
A summary of a middle-aged programmer's study of modern Chinese history
ARP attack
Oracle EBS interface development - quick generation of JSON format data
离线数仓和bi开发的实践和思考
图解Kubernetes中的etcd的访问
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'
腾讯机试题
php中的数字金额转换大写数字
Oracle EBS ADI development steps
Two table Association of pyspark in idea2020 (field names are the same)
Take you to master the formatter of visual studio code
CSRF攻击
ORACLE EBS中消息队列fnd_msg_pub、fnd_message在PL/SQL中的应用
@Transational踩坑
使用 Compose 实现可见 ScrollBar
Principle analysis of spark