package oa.action; import java.util.List; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import com.opensymphony.xwork2.ActionContext; import oa.Utils.DepartmentUtils; import oa.domain.Department; @Controller @Scope("prototype") public class DepartmentAction extends ModelDrivenBaseAction<Department>{ private Long parentId; public String list(){ List<Department> departmentList=null; if(parentId==null){ departmentList=departmentService.findTopList(); } else{ departmentList=departmentService.findChildren(parentId); Department parent = departmentService.findById(parentId); ActionContext.getContext().put("parent", parent); } ActionContext.getContext().put("departmentList", departmentList); return "list"; } public String save(){ model.setParent(departmentService.findById(parentId)); departmentService.save(model); return "tolist"; } public String saveUI(){ List<Department> topList=departmentService.findTopList(); List<Department> departmentList=DepartmentUtils.getAllDepartments(topList); ActionContext.getContext().put("departmentList", departmentList); return "saveUI"; } public String editUI(){ List<Department> topList=departmentService.findTopList(); List<Department> departmentList=DepartmentUtils.getAllDepartments(topList); ActionContext.getContext().put("departmentList", departmentList); Department department=departmentService.findById(model.getId()); ActionContext.getContext().getValueStack().push(department); if (department.getParent() != null) { parentId = department.getParent().getId(); } return "editUI"; } public String delete(){ departmentService.delete(model.getId()); return "tolist"; } public String update(){ model.setParent(departmentService.findById(parentId)); departmentService.update(model); return "tolist"; } public Long getParentId() { return parentId; } public void setParentId(Long parentId) { this.parentId = parentId; } }

lironggang LV38
2023年11月30日
朱俪的邮件及存储 LV8
2023年1月28日
微信网友_6115804675756032 LV7
2022年12月3日
wanglinddad LV55
2022年3月9日
and123456 LV11
2022年2月19日
xiaohe229 LV8
2021年8月9日
Demo1111 LV30
2021年3月15日
有糖吃的面面 LV3
2021年2月25日
aaa5849310 LV25
2020年9月4日
ASDZXZCDGSDFHUJD LV9
2020年5月13日

xianyu091012 LV5
2024年12月24日
zuizhonghuanxiang16
2024年7月2日
暂无贡献等级
1941549176 LV4
2024年4月29日
m5433661 LV2
2024年3月28日
123456wadff LV3
2024年1月15日
lironggang LV38
2023年11月30日
2036495585 LV9
2023年9月25日
微信网友_6472019461951488
2023年5月12日
暂无贡献等级
微信网友_6467077197238272 LV1
2023年5月8日
uni-code_0123 LV1
2023年3月31日