From 7ed9db16f96532a6521da0244c2d044a72166032 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 7 Aug 2024 13:39:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E7=A7=91=E8=AE=AF=E9=80=9A=E8=AE=AF?= =?UTF-8?q?=E5=BD=95=E5=9C=A8=E8=81=8C=E4=BA=BA=E6=95=B0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- .../api/hrm/service/HrmTreeService.java | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) rename src/com/{com => }/api/hrm/service/HrmTreeService.java (99%) 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{ } } } + }