資源簡介
該項目基于spring mv c+spring+mybaits框架技術來實現的,該項目環境為jdk1.8,tomcat8.0,使用了數據源c3p0數據源
代碼片段和文件信息
package?org.fkit.hrm.controller;
import?java.util.List;
import?org.fkit.hrm.domain.Dept;
import?org.fkit.hrm.service.HrmService;
import?org.fkit.hrm.util.tag.PageModel;
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;
/**???
?*?@Description:?處理部門請求控制器
?*?
網站:瘋狂Java?
?*?@author?肖文吉 36750064@qq.com???
?*?@version?V1.0???
?*/
@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
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????845??2016-07-09?17:11??hrmapp\.classpath
?????文件???????1039??2016-07-09?17:11??hrmapp\.project
?????文件????????503??2016-07-09?17:11??hrmapp\.settings\.jsdtscope
?????文件????????364??2016-07-09?17:11??hrmapp\.settings\org.eclipse.jdt.core.prefs
?????文件????????470??2016-07-09?17:11??hrmapp\.settings\org.eclipse.wst.common.component
?????文件????????345??2016-07-09?17:11??hrmapp\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2016-07-09?17:11??hrmapp\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2016-07-09?17:11??hrmapp\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件????????261??2016-07-10?07:46??hrmapp\build\classes\db.properties
?????文件????????622??2016-07-17?15:14??hrmapp\build\classes\log4j.properties
?????文件???????4407??2016-07-28?16:24??hrmapp\build\classes\org\fkit\hrm\controller\DeptController.class
?????文件???????6855??2016-07-28?22:47??hrmapp\build\classes\org\fkit\hrm\controller\DocumentController.class
?????文件???????5503??2016-07-28?16:23??hrmapp\build\classes\org\fkit\hrm\controller\EmployeeController.class
?????文件????????762??2016-07-28?13:28??hrmapp\build\classes\org\fkit\hrm\controller\FormController.class
?????文件???????4031??2016-07-28?16:24??hrmapp\build\classes\org\fkit\hrm\controller\JobController.class
?????文件???????4490??2016-07-28?16:27??hrmapp\build\classes\org\fkit\hrm\controller\NoticeController.class
?????文件???????4927??2016-07-28?20:51??hrmapp\build\classes\org\fkit\hrm\controller\UserController.class
?????文件???????1233??2016-07-28?13:28??hrmapp\build\classes\org\fkit\hrm\dao\DeptDao.class
?????文件???????1546??2016-07-28?13:37??hrmapp\build\classes\org\fkit\hrm\dao\DocumentDao.class
?????文件???????1978??2016-07-28?13:28??hrmapp\build\classes\org\fkit\hrm\dao\EmployeeDao.class
?????文件???????1220??2016-07-28?13:28??hrmapp\build\classes\org\fkit\hrm\dao\JobDao.class
?????文件???????1526??2016-07-28?13:34??hrmapp\build\classes\org\fkit\hrm\dao\NoticeDao.class
?????文件???????1233??2016-07-28?13:28??hrmapp\build\classes\org\fkit\hrm\dao\provider\DeptDynaSqlProvider$1.class
?????文件???????1230??2016-07-28?13:28??hrmapp\build\classes\org\fkit\hrm\dao\provider\DeptDynaSqlProvider$2.class
?????文件???????1187??2016-07-28?13:28??hrmapp\build\classes\org\fkit\hrm\dao\provider\DeptDynaSqlProvider$3.class
?????文件???????1066??2016-07-28?13:28??hrmapp\build\classes\org\fkit\hrm\dao\provider\DeptDynaSqlProvider$4.class
?????文件???????2096??2016-07-28?13:28??hrmapp\build\classes\org\fkit\hrm\dao\provider\DeptDynaSqlProvider.class
?????文件???????1280??2016-07-28?13:37??hrmapp\build\classes\org\fkit\hrm\dao\provider\DocumentDynaSqlProvider$1.class
?????文件???????1277??2016-07-28?13:37??hrmapp\build\classes\org\fkit\hrm\dao\provider\DocumentDynaSqlProvider$2.class
?????文件???????1513??2016-07-28?13:37??hrmapp\build\classes\org\fkit\hrm\dao\provider\DocumentDynaSqlProvider$3.class
............此處省略1449個文件信息
評論
共有 條評論