資源簡介
基于現如今流行的SSM(spring springMVC mybatis mysql)框架的hrm人事管理系統后臺實例 sql代碼與詳解:http://blog.csdn.net/csdn___lyy/article/details/72887390
代碼片段和文件信息
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);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-05-30?17:33??hrmapp\
?????文件?????????834??2017-05-30?17:33??hrmapp\.classpath
?????文件?????????906??2017-05-30?17:33??hrmapp\.project
?????目錄???????????0??2017-05-30?17:33??hrmapp\.settings\
?????文件?????????567??2017-05-30?17:33??hrmapp\.settings\.jsdtscope
?????文件?????????364??2017-05-30?17:33??hrmapp\.settings\org.eclipse.jdt.core.prefs
?????文件?????????470??2017-05-30?17:33??hrmapp\.settings\org.eclipse.wst.common.component
?????文件?????????345??2017-05-30?17:33??hrmapp\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件??????????49??2017-05-30?17:33??hrmapp\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2017-05-30?17:33??hrmapp\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2017-05-30?17:33??hrmapp\build\
?????目錄???????????0??2017-07-09?21:27??hrmapp\build\classes\
?????文件?????????314??2017-07-09?21:27??hrmapp\build\classes\db.properties
?????文件?????????640??2017-06-06?10:41??hrmapp\build\classes\log4j.properties
?????目錄???????????0??2017-06-19?09:16??hrmapp\build\classes\top\
?????目錄???????????0??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\
?????目錄???????????0??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\
?????目錄???????????0??2017-07-06?13:42??hrmapp\build\classes\top\dreamyy\hrm\controller\
?????文件????????4452??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\controller\DeptController.class
?????文件????????6912??2017-06-22?08:10??hrmapp\build\classes\top\dreamyy\hrm\controller\DocumentController.class
?????文件????????5575??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\controller\EmployeeController.class
?????文件?????????910??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\controller\FormController.class
?????文件????????4076??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\controller\JobController.class
?????文件????????4544??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\controller\NoticeController.class
?????文件????????4975??2017-07-06?13:43??hrmapp\build\classes\top\dreamyy\hrm\controller\UserController.class
?????目錄???????????0??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\dao\
?????文件????????1251??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\dao\DeptDao.class
?????文件????????1564??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\dao\DocumentDao.class
?????文件????????1999??2017-06-27?10:39??hrmapp\build\classes\top\dreamyy\hrm\dao\EmployeeDao.class
?????文件????????1238??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\dao\JobDao.class
?????文件????????1544??2017-06-19?09:16??hrmapp\build\classes\top\dreamyy\hrm\dao\NoticeDao.class
............此處省略1475個文件信息
評論
共有 條評論