• 大小: 48.42MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-30
  • 语言: 数据库
  • 标签: java  web  ssm  mysql  

资源简介

开发工具:eclipse 数据库:mysql 框架:SSM 适合企业或者自学者 2018的HR必备办公系统

资源截图

代码片段和文件信息

package top.dreamyy.hrm.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import top.dreamyy.hrm.domain.Dept;
import top.dreamyy.hrm.service.HrmService;
import top.dreamyy.hrm.util.tag.PageModel;



@Controller
public class DeptController {

/**
 * 自动注入UserService
 * */
@Autowired
@Qualifier(“hrmService“)
private HrmService hrmService;

/**
 * 处理/login请求
 * */
@RequestMapping(value=“/dept/selectDept“)
 public String selectDept(Model modelInteger pageIndex
 @ModelAttribute Dept dept){
System.out.println(“selectDept -->>“);
System.out.println(“pageIndex = “ + pageIndex);
System.out.println(“dept = “ + dept);
PageModel pageModel = new PageModel();
System.out.println(“getPageIndex = “ + pageModel.getPageIndex());
System.out.println(“getPageSize = “ + pageModel.getPageSize());
System.out.println(“getRecordCount = “ + pageModel.getRecordCount());
if(pageIndex != null){
pageModel.setPageIndex(pageIndex);
}
/** 查询用户信息     */
List depts = hrmService.findDept(dept pageModel);
model.addAttribute(“depts“ depts);
model.addAttribute(“pageModel“ pageModel);
return “dept/dept“;

}

/**
 * 处理删除部门请求
 * @param String ids 需要删除的id字符串
 * @param ModelAndView mv
 * */
@RequestMapping(value=“/dept/removeDept“)
 public ModelAndView removeDept(String idsModelAndView mv){
// 分解id字符串
String[] idArray = ids.split(““);
for(String id : idArray){
// 根据id删除部门
hrmService.removeDeptById(Integer.parseInt(id));
}
// 设置客户端跳转到查询请求
mv.setViewName(“redirect:/dept/selectDept“);
// 返回ModelAndView
return mv;
}

/**
 * 处理添加请求
 * @param String flag 标记, 1表示跳转到添加页面,2表示执行添加操作
 * @param Dept  dept  要添加的部门对象
 * @param ModelAndView mv
 * */
@RequestMapping(value=“/dept/addDept“)
 public ModelAndView addDept(
 String flag
 @ModelAttribute Dept dept
 ModelAndView mv){
if(flag.equals(“1“)){
// 设置跳转到添加页面
mv.setViewName(“dept/showAddDept“);
}else{
// 执行添加操作
hrmService.addDept(dept);
// 设置客户端跳转到查询请求
mv.setViewName(“redirect:/dept/selectDept“);
}
// 返回
return mv;
}


/**
 * 处理修改部门请求
 * @param String flag 标记, 1表示跳转到修改页面,2表示执行修改操作
 * @param Dept dept 要修改部门的对象
 * @param ModelAndView mv
 * */
@RequestMapping(value=“/dept/updateDept“)
 public ModelAndView updateDpet(
 String flag
 @ModelAttribute Dept dept
 ModelAndView mv){
if(flag.equals(“1“)){
// 根据id查询部门
Dept target = hrmService.findDeptById(dept.getId());
// 设置Model数据
mv.addobject(“dept“ target);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        6630  2018-06-13 22:00  HRAPP\dept.sql
     目录           0  2018-06-13 21:59  HRAPP\hrmapp\
     文件         725  2018-06-13 21:31  HRAPP\hrmapp\.classpath
     文件         906  2017-05-30 17:33  HRAPP\hrmapp\.project
     目录           0  2018-06-13 21:59  HRAPP\hrmapp\.settings\
     文件         567  2017-05-30 17:33  HRAPP\hrmapp\.settings\.jsdtscope
     文件          57  2018-06-13 21:26  HRAPP\hrmapp\.settings\org.eclipse.core.resources.prefs
     文件          52  2018-06-13 21:26  HRAPP\hrmapp\.settings\org.eclipse.core.runtime.prefs
     文件         364  2018-06-13 17:38  HRAPP\hrmapp\.settings\org.eclipse.jdt.core.prefs
     文件         470  2017-05-30 17:33  HRAPP\hrmapp\.settings\org.eclipse.wst.common.component
     文件         305  2018-06-13 21:21  HRAPP\hrmapp\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件         305  2018-06-13 20:48  HRAPP\hrmapp\.settings\org.eclipse.wst.common.project.facet.core.xml.bak
     文件          49  2017-05-30 17:33  HRAPP\hrmapp\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2017-05-30 17:33  HRAPP\hrmapp\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-06-13 21:59  HRAPP\hrmapp\build\
     目录           0  2018-06-13 21:59  HRAPP\hrmapp\build\classes\
     文件         315  2018-06-13 21:50  HRAPP\hrmapp\build\classes\db.properties
     文件         640  2017-06-06 10:41  HRAPP\hrmapp\build\classes\log4j.properties
     目录           0  2018-06-13 21:59  HRAPP\hrmapp\build\classes\top\
     目录           0  2018-06-13 21:59  HRAPP\hrmapp\build\classes\top\dreamyy\
     目录           0  2018-06-13 21:59  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\
     目录           0  2018-06-13 21:59  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\controller\
     文件        4452  2018-06-13 21:42  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\controller\DeptController.class
     文件        6912  2018-06-13 21:42  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\controller\DocumentController.class
     文件        5575  2018-06-13 21:42  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\controller\EmployeeController.class
     文件         910  2018-06-13 21:42  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\controller\FormController.class
     文件        4076  2018-06-13 21:42  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\controller\JobController.class
     文件        4544  2018-06-13 21:42  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\controller\NoticeController.class
     文件        4975  2018-06-13 21:42  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\controller\UserController.class
     目录           0  2018-06-13 21:59  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\dao\
     文件        1251  2018-06-13 21:42  HRAPP\hrmapp\build\classes\top\dreamyy\hrm\dao\DeptDao.class
............此处省略1479个文件信息

评论

共有 条评论