資源簡(jiǎn)介
該項(xiàng)目基于spring mv c+spring+mybaits框架技術(shù)來(lái)實(shí)現(xiàn)的,該項(xiàng)目環(huán)境為jdk1.8,tomcat8.0,使用了數(shù)據(jù)源c3p0數(shù)據(jù)源
代碼片段和文件信息
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:?處理部門(mén)請(qǐng)求控制器
?*?
網(wǎng)站:瘋狂Java?
?*?@author?肖文吉 36750064@qq.com???
?*?@version?V1.0???
?*/
@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);
}
/**?查詢(xún)用戶(hù)信息?????*/
List?depts?=?hrmService.findDept(dept?pageModel);
model.addAttribute(“depts“?depts);
model.addAttribute(“pageModel“?pageModel);
return?“dept/dept“;
}
/**
?*?處理刪除部門(mén)請(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刪除部門(mén)
hrmService.removeDeptById(Integer.parseInt(id));
}
//?設(shè)置客戶(hù)端跳轉(zhuǎn)到查詢(xú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??要添加的部門(mén)對(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è)置客戶(hù)端跳轉(zhuǎn)到查詢(xún)請(qǐng)求
mv.setViewName(“redirect:/dept/selectDept“);
}
//?返回
return?mv;
}
/**
?*?處理修改部門(mén)請(qǐng)求
?*?@param?String?flag?標(biāo)記,?1表示跳轉(zhuǎn)到修改頁(yè)面,2表示執(zhí)行修改操作
?*?@param?Dept?dept?要修改部門(mén)的對(duì)象
?*?@param?ModelAndView?mv
?*?*/
@RequestMapping(value=“/dept/updateDept“)
?public?ModelAndView?updateDpet(
?String?flag
?@ModelAttribute?Dept?dept
?ModelAndView?mv){
if(flag.equals
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件????????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個(gè)文件信息
評(píng)論
共有 條評(píng)論