-
大小: 48.35MB文件類型: .zip金幣: 1下載: 0 次發(fā)布日期: 2023-06-16
- 語(yǔ)言: 數(shù)據(jù)庫(kù)
- 標(biāo)簽: SSM??spring??springmvc??mybatis??
資源簡(jiǎn)介
采用了注解的方式開(kāi)發(fā),一個(gè)簡(jiǎn)單的人事管理系統(tǒng),包括文件下載上傳,公告管理以及用戶/職位/部門的增刪改查等基本,頁(yè)面圖片請(qǐng)瀏覽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?{
/**
?*?自動(dòng)注入U(xiǎn)serService
?*?*/
@Autowired
@Qualifier(“hrmService“)
private?HrmService?hrmService;
/**
?*?處理/login請(qǐng)求
?*?*/
@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“;
}
/**
?*?處理刪除部門請(qǐng)求
?*?@param?String?ids?需要?jiǎng)h除的id字符串
?*?@param?ModelAndView?mv
?*?*/
@RequestMapping(value=“/dept/removeDept“)
?public?ModelAndView?removeDept(String?idsModelAndView?mv){
//?分解id字符串
String[]?idArray?=?ids.split(““);
for(String?id?:?idArray){
//?根據(jù)id刪除部門
hrmService.removeDeptById(Integer.parseInt(id));
}
//?設(shè)置客戶端跳轉(zhuǎn)到查詢請(qǐng)求
mv.setViewName(“redirect:/dept/selectDept“);
//?返回ModelAndView
return?mv;
}
/**
?*?處理添加請(qǐng)求
?*?@param?String?flag?標(biāo)記,?1表示跳轉(zhuǎn)到添加頁(yè)面,2表示執(zhí)行添加操作
?*?@param?Dept??dept??要添加的部門對(duì)象
?*?@param?ModelAndView?mv
?*?*/
@RequestMapping(value=“/dept/addDept“)
?public?ModelAndView?addDept(
?String?flag
?@ModelAttribute?Dept?dept
?ModelAndView?mv){
if(flag.equals(“1“)){
//?設(shè)置跳轉(zhuǎn)到添加頁(yè)面
mv.setViewName(“dept/showAddDept“);
}else{
//?執(zhí)行添加操作
hrmService.addDept(dept);
//?設(shè)置客戶端跳轉(zhuǎn)到查詢請(qǐng)求
mv.setViewName(“redirect:/dept/selectDept“);
}
//?返回
return?mv;
}
/**
?*?處理修改部門請(qǐng)求
?*?@param?String?flag?標(biāo)記,?1表示跳轉(zhuǎn)到修改頁(yè)面,2表示執(zhí)行修改操作
?*?@param?Dept?dept?要修改部門的對(duì)象
?*?@param?ModelAndView?mv
?*?*/
@RequestMapping(value=“/dept/updateDept“)
?public?ModelAndView?updateDpet(
?String?flag
?@ModelAttribute?Dept?dept
?ModelAndView?mv){
if(flag.equals(“1“)){
//?根據(jù)id查詢部門
Dept?target?=?hrmService.findDeptById(dept.getId());
//?設(shè)置Model數(shù)據(jù)
mv.addobject(“dept“?target);
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-06-06?21:00??hrmapp\
?????文件?????????834??2017-05-30?17:33??hrmapp\.classpath
?????文件?????????906??2017-05-30?17:33??hrmapp\.project
?????目錄???????????0??2017-06-06?21:00??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-06-06?21:00??hrmapp\build\
?????目錄???????????0??2017-06-06?10:41??hrmapp\build\classes\
?????文件?????????300??2017-06-03?16:54??hrmapp\build\classes\db.properties
?????文件?????????640??2017-06-06?10:41??hrmapp\build\classes\log4j.properties
?????目錄???????????0??2017-06-06?10:03??hrmapp\build\classes\top\
?????目錄???????????0??2017-06-06?10:03??hrmapp\build\classes\top\dreamyy\
?????目錄???????????0??2017-06-06?10:03??hrmapp\build\classes\top\dreamyy\hrm\
?????目錄???????????0??2017-06-06?10:03??hrmapp\build\classes\top\dreamyy\hrm\controller\
?????文件????????4452??2017-06-06?10:38??hrmapp\build\classes\top\dreamyy\hrm\controller\DeptController.class
?????文件????????6912??2017-06-06?10:38??hrmapp\build\classes\top\dreamyy\hrm\controller\DocumentController.class
?????文件????????5575??2017-06-06?10:37??hrmapp\build\classes\top\dreamyy\hrm\controller\EmployeeController.class
?????文件?????????910??2017-06-06?10:37??hrmapp\build\classes\top\dreamyy\hrm\controller\FormController.class
?????文件????????4076??2017-06-06?10:38??hrmapp\build\classes\top\dreamyy\hrm\controller\JobController.class
?????文件????????4544??2017-06-06?10:38??hrmapp\build\classes\top\dreamyy\hrm\controller\NoticeController.class
?????文件????????4975??2017-06-06?10:03??hrmapp\build\classes\top\dreamyy\hrm\controller\UserController.class
?????目錄???????????0??2017-06-06?10:03??hrmapp\build\classes\top\dreamyy\hrm\dao\
?????文件????????1251??2017-06-06?10:38??hrmapp\build\classes\top\dreamyy\hrm\dao\DeptDao.class
?????文件????????1564??2017-06-06?10:38??hrmapp\build\classes\top\dreamyy\hrm\dao\DocumentDao.class
?????文件????????1999??2017-06-06?10:38??hrmapp\build\classes\top\dreamyy\hrm\dao\EmployeeDao.class
?????文件????????1238??2017-06-06?10:38??hrmapp\build\classes\top\dreamyy\hrm\dao\JobDao.class
?????文件????????1544??2017-06-06?10:38??hrmapp\build\classes\top\dreamyy\hrm\dao\NoticeDao.class
............此處省略1474個(gè)文件信息
評(píng)論
共有 條評(píng)論