|
@@ -37,7 +37,8 @@ public class HKImplClient implements HKClient {
|
|
if (UtilEnv.getActiveProfile().equals(UtilEnv.ENV_PROD)) {
|
|
if (UtilEnv.getActiveProfile().equals(UtilEnv.ENV_PROD)) {
|
|
return "http://172.16.20.13:10002/api/public" + path;
|
|
return "http://172.16.20.13:10002/api/public" + path;
|
|
}
|
|
}
|
|
- return "http://116.228.113.106:10001/api/public" + path;
|
|
|
|
|
|
+ return "http://116.228.113.106:10002/api/public" + path;
|
|
|
|
+// return "http://116.228.113.106:10001/api/public" + path;
|
|
}
|
|
}
|
|
|
|
|
|
// monitor 考勤同步:001_1.1 测试环境;001.1 生产环境
|
|
// monitor 考勤同步:001_1.1 测试环境;001.1 生产环境
|
|
@@ -197,11 +198,17 @@ public class HKImplClient implements HKClient {
|
|
public List<String> syncContact(boolean isAttendance) {
|
|
public List<String> syncContact(boolean isAttendance) {
|
|
|
|
|
|
List<String> uIds = new ArrayList<>();
|
|
List<String> uIds = new ArrayList<>();
|
|
|
|
+ List<Long> deptList;
|
|
|
|
|
|
// prd: 非全量同步: 总部\哈克\负责人
|
|
// prd: 非全量同步: 总部\哈克\负责人
|
|
- List<Long> deptList = UtilList.asList(DDConf.TOP_DEPARTMENT);
|
|
|
|
- deptList.addAll(ddClient_contacts.getDepartmentId_all(ddClient.getAccessToken(), true, 129113277L)); // 总部
|
|
|
|
- deptList.addAll(ddClient_contacts.getDepartmentId_all(ddClient.getAccessToken(), true, 128984162L)); // 哈克
|
|
|
|
|
|
+ if (!isAttendance) {
|
|
|
|
+ deptList = UtilList.asList(DDConf.TOP_DEPARTMENT);
|
|
|
|
+ deptList.addAll(ddClient_contacts.getDepartmentId_all(ddClient.getAccessToken(), true, 129113277L)); // 总部
|
|
|
|
+ deptList.addAll(ddClient_contacts.getDepartmentId_all(ddClient.getAccessToken(), true, 128984162L)); // 哈克
|
|
|
|
+ } else {
|
|
|
|
+ // prd 0529 上海考勤同步, 只需要生产车间人员
|
|
|
|
+ deptList = ddClient_contacts.getDepartmentId_all(ddClient.getAccessToken(), true, 369113480L);
|
|
|
|
+ }
|
|
for (long deptId : deptList) {
|
|
for (long deptId : deptList) {
|
|
List<String> userIds = ddClient_contacts.listDepartmentUserId(ddClient.getAccessToken(), deptId);
|
|
List<String> userIds = ddClient_contacts.listDepartmentUserId(ddClient.getAccessToken(), deptId);
|
|
if (userIds.size() == 0) {
|
|
if (userIds.size() == 0) {
|
|
@@ -228,7 +235,9 @@ public class HKImplClient implements HKClient {
|
|
if (userInfo.containsKey("org_email")) {
|
|
if (userInfo.containsKey("org_email")) {
|
|
data.put("email", userInfo.get("org_email"));
|
|
data.put("email", userInfo.get("org_email"));
|
|
}
|
|
}
|
|
- data.put("employeeStartDate", UtilDateTime.formatDate(new Date(UtilMap.getLong(userInfo, "hired_date"))));
|
|
|
|
|
|
+ if (userInfo.containsKey("hired_date")) {
|
|
|
|
+ data.put("employeeStartDate", UtilDateTime.formatDate(new Date(UtilMap.getLong(userInfo, "hired_date"))));
|
|
|
|
+ }
|
|
data.put("employeeDept", deptName);
|
|
data.put("employeeDept", deptName);
|
|
data.put("dtDepts", dpetCascade);
|
|
data.put("dtDepts", dpetCascade);
|
|
data.put("dtPersonGroup", "");
|
|
data.put("dtPersonGroup", "");
|
|
@@ -253,7 +262,7 @@ public class HKImplClient implements HKClient {
|
|
}
|
|
}
|
|
|
|
|
|
userIdReflect = null;
|
|
userIdReflect = null;
|
|
- log.info("重新同步人员映射表", getUserIdReflect().size());
|
|
|
|
|
|
+ log.info("同步完成::重新同步人员映射表", getUserIdReflect().size());
|
|
return uIds;
|
|
return uIds;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -344,7 +353,7 @@ public class HKImplClient implements HKClient {
|
|
// ppExt: 基于 OkHttp 库实现, https带ip请求兼容性, 忽略证书校验 OkHttpUtil 类 [ 使用 HttpUtil 报异常 ]
|
|
// ppExt: 基于 OkHttp 库实现, https带ip请求兼容性, 忽略证书校验 OkHttpUtil 类 [ 使用 HttpUtil 报异常 ]
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
private Map okRequest(String url, String sessionId, Map data) {
|
|
private Map okRequest(String url, String sessionId, Map data) {
|
|
- log.info("ok request, {}, {}", url, data);
|
|
|
|
|
|
+ log.debug("ok request, {}, {}", url, data);
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
.sslSocketFactory(OkHttpUtil.getIgnoreInitedSslContext().getSocketFactory(), OkHttpUtil.IGNORE_SSL_TRUST_MANAGER_X509)
|
|
.sslSocketFactory(OkHttpUtil.getIgnoreInitedSslContext().getSocketFactory(), OkHttpUtil.IGNORE_SSL_TRUST_MANAGER_X509)
|
|
.hostnameVerifier(OkHttpUtil.getIgnoreSslHostnameVerifier())
|
|
.hostnameVerifier(OkHttpUtil.getIgnoreSslHostnameVerifier())
|
|
@@ -359,9 +368,12 @@ public class HKImplClient implements HKClient {
|
|
|
|
|
|
Response response = client.newCall(request).execute();
|
|
Response response = client.newCall(request).execute();
|
|
String rsp = response.body().string();
|
|
String rsp = response.body().string();
|
|
- log.info("ok response, {}", rsp);
|
|
|
|
|
|
+ log.debug("ok response, {}", rsp);
|
|
try {
|
|
try {
|
|
- return JSON.parseObject(rsp);
|
|
|
|
|
|
+ // prd 25.06.25 monitor接口升级, 考勤认证取值从body移到header
|
|
|
|
+ Map result = JSON.parseObject(rsp);
|
|
|
|
+ result.put("SessionId", response.headers().get("X-Monitor-SessionId"));
|
|
|
|
+ return result;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
McException.exceptionAccess(rsp);
|
|
McException.exceptionAccess(rsp);
|
|
}
|
|
}
|
|
@@ -561,5 +573,14 @@ public class HKImplClient implements HKClient {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void test() {
|
|
|
|
+
|
|
|
|
+// String sId = _getAuthSessionId();
|
|
|
|
+// _syncCheckingRecord(true, "2025-05-07 09:04:45", "1082855734708073203");
|
|
|
|
+// log.info("xxx, {}", sId);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|