資源簡(jiǎn)介
基于java ssh的基本的oa管理系統(tǒng),包括簡(jiǎn)單詳細(xì)的增刪改查,可供初學(xué)者學(xué)習(xí)參考
代碼片段和文件信息
package?com.workit.action;
import?java.util.List;
import?org.springframework.context.annotation.Scope;
import?org.springframework.stereotype.Controller;
import?com.opensymphony.xwork2.ActionContext;
import?com.workit.base.baseAction;
import?com.workit.bean.Department;
import?com.workit.util.DepartmentUtils;
@Controller
@Scope(“prototype“)
@SuppressWarnings(“serial“)
public?class?DepartmentAction?extends?baseAction{
private?Long?parentId;?
private?Long?id;
List?departmentList??=null;
?/**?列表?*/
?public?String?list()?throws?Exception?{
?if(parentId?==?null){
???departmentList?=?departmentService.findTopList();?
?}else{?
??departmentList?=?departmentService.findChildren(parentId);
??Department?parent?=?departmentService.getbyid(parentId);
??ActionContext.getContext().put(“parent“?parent);
?}
?ActionContext.getContext().put(“departmentList“?departmentList);
?????return?“l(fā)ist“;
?}
?/**?刪除?*/
?public?String?delete()?throws?Exception?{
?departmentService.delete(model.getId());
??return?“toList“;
?}
?/**?添加頁(yè)面?*/
?public?String?addUI()?throws?Exception?{
List?topList?=?departmentService.findTopList();
List?departmentList?=?DepartmentUtils.getAllDepartments(topList);
ActionContext.getContext().put(“departmentList“?departmentList);
??return?“saveUI“;
?}
?/**?添加?*/
public?String?add()?throws?Exception?{
//?封裝信息到對(duì)象中
//?Department?department?=?new?Department();
//?department.setName(name);
//?department.setDescription(description)
Department?parent?=?departmentService.getbyid(parentId);
model.setParent(parent);
//?保存
departmentService.add(model);
return?“toList“;
}
?/**?修改頁(yè)面?*/
?public?String?editUI()?throws?Exception?{
//?準(zhǔn)備數(shù)據(jù)?departmentList
List?topList?=?departmentService.findTopList();
List?departmentList?=?DepartmentUtils.getAllDepartments(topList);
ActionContext.getContext().put(“departmentList“?departmentList);
//?準(zhǔn)備回顯的數(shù)據(jù)
Department?department?=?departmentService.getbyid(model.getId());
ActionContext.getContext().getValueStack().push(department);
if?(department.getParent()?!=?null)?{
parentId?=?department.getParent().getId();
}
??return?“saveUI“;
?}
?/**?修改?*/
?public?String?edit()?throws?Exception?{
?Department?department?=?departmentService.getbyid(model.getId());
?
?department.setName(model.getName());
?department.setDescription(model.getDescription());
?department.setParent(departmentService.getbyid(parentId));
??return?“toList“;
?}
public?Long?getParentId()?{
return?parentId;
}
public?void?setParentId(Long?parentId)?{
this.parentId?=?parentId;
}
public?Long?getId()?{
return?id;
}
public?void?setId(Long?id)?{
this.id?=?id;
}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-11-17?09:57??itcastOA\
?????文件????????2351??2015-11-04?15:18??itcastOA\.classpath
?????目錄???????????0??2015-11-03?10:12??itcastOA\.myeclipse\
?????文件?????????297??2015-11-12?17:33??itcastOA\.myme
?????文件????????1281??2015-11-03?13:02??itcastOA\.project
?????目錄???????????0??2015-11-17?09:57??itcastOA\.settings\
?????文件?????????330??2015-11-03?10:12??itcastOA\.settings\org.eclipse.jdt.core.prefs
?????目錄???????????0??2015-11-17?09:57??itcastOA\config\
?????文件????????5124??2015-11-09?14:18??itcastOA\config\.struts.mex
?????文件????????3064??2015-11-03?12:46??itcastOA\config\applicationContext.xm
?????文件????????1273??2015-11-04?15:11??itcastOA\config\hibernate.cfg.xm
?????文件?????????152??2015-11-05?14:26??itcastOA\config\jdbc.properties
?????文件?????????756??2015-11-03?11:41??itcastOA\config\log4j.properties
?????文件????????4048??2015-11-09?14:18??itcastOA\config\struts.xm
?????目錄???????????0??2015-11-03?11:36??itcastOA\src\
?????目錄???????????0??2015-11-03?10:13??itcastOA\src\com\
?????目錄???????????0??2015-11-04?16:43??itcastOA\src\com\workit\
?????目錄???????????0??2015-11-17?09:57??itcastOA\src\com\workit\action\
?????文件????????2982??2015-11-06?16:49??itcastOA\src\com\workit\action\DepartmentAction.java
?????文件????????1913??2015-11-09?11:38??itcastOA\src\com\workit\action\ForumAction.java
?????文件????????1785??2015-11-09?09:47??itcastOA\src\com\workit\action\ForumManageAction.java
?????文件?????????644??2015-11-04?15:46??itcastOA\src\com\workit\action\HomeAction.java
?????文件?????????338??2015-11-05?15:19??itcastOA\src\com\workit\action\PrivilegeAction.java
?????文件????????1497??2015-11-09?18:04??itcastOA\src\com\workit\action\ReplyAction.java
?????文件????????3022??2015-11-07?18:37??itcastOA\src\com\workit\action\RoleAction.java
?????文件????????1859??2015-11-09?14:17??itcastOA\src\com\workit\action\TopicAction.java
?????文件????????4849??2015-11-07?18:30??itcastOA\src\com\workit\action\UserAction.java
?????目錄???????????0??2015-11-17?09:57??itcastOA\src\com\workit\ba
?????文件????????2123??2015-11-09?10:35??itcastOA\src\com\workit\ba
?????文件?????????716??2015-11-09?10:35??itcastOA\src\com\workit\ba
?????文件????????2867??2015-11-09?10:35??itcastOA\src\com\workit\ba
............此處省略1424個(gè)文件信息
- 上一篇:jsp1訪客管理系統(tǒng)
- 下一篇:Java制作簡(jiǎn)單RPG游戲
評(píng)論
共有 條評(píng)論