123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- /**
- *
- */
- package com.sinosoft.am.org.dept.indept.busi;
- import java.util.ArrayList;
- import net.sf.json.JSONObject;
- import org.apache.log4j.Logger;
- import com.sinosoft.am.org.dept.indept.dao.PlanGlOrgDao;
- import com.sinosoft.am.org.dept.indept.vo.PlanGlOrgVo;
- import com.sinosoft.lz.system.right.role.busi.RoleBean;
- /**
- * @author 徐威
- * 2015-09-19
- * tel:13811395647
- */
- public class PlanGlOrgBean{
- private Logger log = Logger.getLogger(RoleBean.class);
- private PlanGlOrgDao dao = new PlanGlOrgDao();
- /**
- *
- * @param sql
- * 查询语句
- * @return
- * @throws ClassNotFoundException
- */
- public ArrayList<PlanGlOrgVo> getInDeptVo(String sql) throws ClassNotFoundException {
- return dao.getDeptList(sql);
- }
- public ArrayList<PlanGlOrgVo> getInDeptVoById(String id) throws ClassNotFoundException {
- return dao.getDeptTreeNodesById(id);
- }
- public ArrayList<PlanGlOrgVo> getInDeptVoByIdAsync(String id) throws ClassNotFoundException {
- return dao.getNextLevelTreeById(id);
- }
- public PlanGlOrgVo getDeptRootById(String id) throws ClassNotFoundException {
- return dao.getInDeptVoById(id);
- }
- public boolean shamDeleteOrgInDept(String deptId){
-
- return dao.shamDeleteOrgInDept(deptId);
- }
- public boolean updateOrgInDeptName(String deptId, String deptName){
-
- return dao.updateOrgInDeptName(deptId, deptName);
- }
- public boolean addOrgInDept(String deptId, String parentId, String deptName){
-
- return dao .addOrgInDept(deptId, parentId, deptName);
-
- }
- /**
- * @param comp_id
- * @return
- */
- @SuppressWarnings("unused")
- public String getInOrgDoubleTreeRoot(String comp_id) {
- StringBuffer json = new StringBuffer();
-
- PlanGlOrgVo vo1 = new PlanGlOrgVo();
- vo1 = dao.getInOrgDoubleTreeRoot(comp_id);
- String deptId = vo1.getID();
- String deptName = vo1.getNAME();
- String parentId = vo1.getPARENT_ID();
- json.append("{\"fromList\":[");
- json.append("{");
- json.append(" id:'"+deptId+"', parentId:'0', ");
- json.append(" objectId:'000', ");
- json.append(" name:'"+deptName+"', ");
- json.append(" type:'unit',menuType:'nonLeafMenu',");
- json.append(" drag:'false', ");
- json.append(" open:true, ");
- json.append(" icon:'/nwyj/scripts/qui/libs/icons/home.gif'");
- json.append("},");
- if(dao.hasChildNode(comp_id)){
-
- };
- if(dao.hasStaff(comp_id)){
-
- }
- if (json.lastIndexOf(",") > -1) {
- json.deleteCharAt(json.lastIndexOf(","));
- }
- json.append("],\"toList\":[]}");
- log.info("json==="+json);
- return JSONObject.fromObject(json.toString()).toString();
-
- }
- }
|