diff --git a/.gitignore b/.gitignore index ab78418..71a7a3f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ target/ /test /src/rebel.xml -/META-INF +/src/META-INF /WEB-INF/config /log \ No newline at end of file diff --git a/src/com/com/api/hrm/service/HrmTreeService.java b/src/com/api/hrm/service/HrmTreeService.java similarity index 99% rename from src/com/com/api/hrm/service/HrmTreeService.java rename to src/com/api/hrm/service/HrmTreeService.java index 98b40c3..f671f22 100644 --- a/src/com/com/api/hrm/service/HrmTreeService.java +++ b/src/com/api/hrm/service/HrmTreeService.java @@ -1,4 +1,4 @@ -package com.com.api.hrm.service; +package com.api.hrm.service; import java.util.ArrayList; import java.util.HashMap; @@ -13,6 +13,7 @@ import com.api.hrm.bean.TreeNode; import com.engine.common.service.HrmCommonService; import com.engine.common.service.impl.HrmCommonServiceImpl; +import com.engine.hrm.util.HrmUtil; import weaver.conn.RecordSet; import weaver.file.Prop; import weaver.general.BaseBean; @@ -59,6 +60,7 @@ public class HrmTreeService extends BaseBean{ private String[] allChildDeptIds = null;//人员所属部门的下级部门 private Boolean sysadmin = false;//系统管理员--为了解决mysql环境系统管理员微博分权左侧树,查询速度超过7分钟。 private Boolean isOrgTree = true; + public Map getCompanyTree(HttpServletRequest request, HttpServletResponse response) { User user = HrmUserVarify.getUser(request, response); String id = Util.null2String(request.getParameter("id")); @@ -153,7 +155,14 @@ public class HrmTreeService extends BaseBean{ // 加载虚拟组织列表 if(companyVirtualComInfo.getCompanyNum() > 0) { companyVirtualComInfo.setTofirstRow(); + while (companyVirtualComInfo.next()) { + // -20001=公文交换维度 -10000=客户维度 + if(HrmUtil.isHideDefaultDimension(Util.null2String(companyVirtualComInfo.getCompanyid()))){ + continue; + } + + // 只控制默认2个维度,自定义维度不控制 companyInfo = new OrgBean(); companyInfo.setCompanyid(companyVirtualComInfo.getCompanyid()); companyInfo.setName(companyVirtualComInfo.getVirtualType()); @@ -161,6 +170,7 @@ public class HrmTreeService extends BaseBean{ companyInfo.setIcon("icon-coms-LargeArea"); companys.add(companyInfo); } + } Map resultDatas = new HashMap(); apidatas.put("companys", companys); @@ -1039,7 +1049,7 @@ public class HrmTreeService extends BaseBean{ String sql = ""; String sqlShowCanceled = this.showCanceled?"":"and (canceled is null or canceled !='1')"; if(this.isLoadSubDepartment){ - if(rs.getDBType().equalsIgnoreCase("oracle") || DialectUtil.isMySql(rs.getDBType())){ + if(rs.getDBType().equalsIgnoreCase("oracle") || DialectUtil.isMySql(rs.getDBType())||rs.getDBType().equalsIgnoreCase("postgresql")){ sql = "select id,subcompanyid1 from hrmdepartmentallview where 1=1 "+sqlShowCanceled+" and lower(convtomultilang(departmentmark,"+user.getLanguage()+")) like '%"+keyword+"%'"; }else{ sql = "select id,subcompanyid1 from hrmdepartmentallview where 1=1 "+sqlShowCanceled+" and lower(dbo.convtomultilang(departmentmark,"+user.getLanguage()+")) like '%"+keyword+"%'"; @@ -1067,7 +1077,7 @@ public class HrmTreeService extends BaseBean{ } } - if(rs.getDBType().equalsIgnoreCase("oracle") || DialectUtil.isMySql(rs.getDBType())){ + if(rs.getDBType().equalsIgnoreCase("oracle") || DialectUtil.isMySql(rs.getDBType())||rs.getDBType().equalsIgnoreCase("postgresql")){ sql = "select id from hrmsubcompanyallview where 1=1 "+sqlShowCanceled+" and lower(convtomultilang(subcompanyname,"+user.getLanguage()+")) like '%"+keyword+"%'"; }else{ sql = "select id from hrmsubcompanyallview where 1=1 "+sqlShowCanceled+" and lower(dbo.convtomultilang(subcompanyname,"+user.getLanguage()+")) like '%"+keyword+"%'"; @@ -1537,4 +1547,5 @@ public class HrmTreeService extends BaseBean{ } } } + }