|
@@ -46,10 +46,11 @@ public class GroupOrPositionUtil {
|
46
|
46
|
Map<String, String> userMap = organization.getUserById(userId, HorizonCore.TENANT_IDENTIFIER.value());
|
47
|
47
|
String deptId = userMap.get("dept_id");
|
48
|
48
|
String fDeptId = GroupOrPositionUtil.queryFDept(deptId);
|
49
|
|
-
|
|
49
|
+ LOGGER.info("deptId:{}_fDeptId:{}", deptId, fDeptId);
|
50
|
50
|
// 对比用户所属部门,如果相同,则添加到userIds中
|
51
|
51
|
for (Map<String, String> user : userByIDs) {
|
52
|
52
|
String fDeptIdTmp = GroupOrPositionUtil.queryFDept(user.get("dept_id"));
|
|
53
|
+ LOGGER.info("deptId:{}_fDeptIdTmp:{}_fDeptIdTmp:{}", user.get("dept_id"), fDeptIdTmp, fDeptId);
|
53
|
54
|
if (fDeptIdTmp.equals(fDeptId)) {
|
54
|
55
|
userIds += user.get("id") + "/" + orgId + ";";
|
55
|
56
|
LOGGER.info("获取到{}里同步人员id:{}", orgId, user.get("id"));
|
|
@@ -101,9 +102,6 @@ public class GroupOrPositionUtil {
|
101
|
102
|
|
102
|
103
|
public static String queryFDept(String deptId){
|
103
|
104
|
// 机关部门,不取父ID,直接返回
|
104
|
|
- if(deptId.startsWith("D0101")){
|
105
|
|
- return deptId;
|
106
|
|
- }
|
107
|
105
|
//D0110 D011003 质计中心
|
108
|
106
|
//D0101 D010101机关
|
109
|
107
|
String dbIdentifier = "jl_sgiip";
|
|
@@ -116,9 +114,15 @@ public class GroupOrPositionUtil {
|
116
|
114
|
|
117
|
115
|
|
118
|
116
|
String fDeptId = (String) resmap.get("f_id");
|
|
117
|
+ String deptCode= (String) resmap.get("dept_code");
|
119
|
118
|
|
120
|
119
|
if(fDeptId.length() > 4){
|
121
|
120
|
fDeptId = fDeptId.substring(0, 5); // 截取前5位
|
|
121
|
+ } else {
|
|
122
|
+ fDeptId = deptCode;
|
|
123
|
+ }
|
|
124
|
+ if(deptCode.startsWith("D0101")){
|
|
125
|
+ return deptCode;
|
122
|
126
|
}
|
123
|
127
|
return fDeptId;
|
124
|
128
|
}
|