|
|
@@ -5,6 +5,7 @@ import cn.hutool.http.HttpResponse;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.dromara.common.core.config.DefaultConfig;
|
|
|
import org.dromara.common.core.exception.ServiceException;
|
|
|
import org.dromara.server.base.service.dept.strategy.SyncDeptStrategyContent;
|
|
|
import org.dromara.server.base.service.user.strategy.SyncUserStrategyContent;
|
|
|
@@ -35,6 +36,7 @@ import java.util.List;
|
|
|
public class SyncHrService {
|
|
|
private final SyncDeptStrategyContent syncDeptStrategyContent;
|
|
|
private final SyncUserStrategyContent syncUserStrategyContent;
|
|
|
+ private final DefaultConfig defaultConfig;
|
|
|
|
|
|
/**
|
|
|
* 同步教职工部门数据,该方法将提供给定时任务调用
|
|
|
@@ -61,7 +63,7 @@ public class SyncHrService {
|
|
|
dept.setDept_id("001003000000");
|
|
|
dept.setDept_name("服务企业");
|
|
|
dept.setOperatorId(DefaultConstants.FULL_SYNC_ADMIN);
|
|
|
- dept.setTenantId(DefaultConstants.TENANT_ID);
|
|
|
+ dept.setTenantId(defaultConfig.getTenantId());
|
|
|
resourceDeptlist.add(dept);
|
|
|
syncDeptStrategyContent.syncDept(resourceDeptlist, SyncResourceConstants.HR_DEPT);
|
|
|
return true;
|
|
|
@@ -98,6 +100,7 @@ public class SyncHrService {
|
|
|
// person.setCategory("1");
|
|
|
// person.setRemark("");
|
|
|
// person.setUserState("on");
|
|
|
+ // person.setTenantId(defaultConfig.getTenantId());
|
|
|
// resourcePersonList.add(person);
|
|
|
// syncUserStrategyContent.syncUser(resourcePersonList, SyncResourceConstants.TEACHER);
|
|
|
// endregion
|
|
|
@@ -112,7 +115,7 @@ public class SyncHrService {
|
|
|
*/
|
|
|
|
|
|
@NotNull
|
|
|
- private static List<ResourceDept> getResourceDeptList(SyncFullDataBo dataBo) {
|
|
|
+ private List<ResourceDept> getResourceDeptList(SyncFullDataBo dataBo) {
|
|
|
List<ResourceDept> resourceDeptlist = new ArrayList<>();
|
|
|
for (List<String> list : dataBo.getResponseParam().getResourceInfos().get(0).getDataInfo()) {
|
|
|
ResourceDept dept = new ResourceDept();
|
|
|
@@ -120,7 +123,7 @@ public class SyncHrService {
|
|
|
dept.setDept_id(list.get(1));
|
|
|
dept.setDept_name(list.get(2));
|
|
|
dept.setOperatorId(DefaultConstants.FULL_SYNC_ADMIN);
|
|
|
- dept.setTenantId(DefaultConstants.TENANT_ID);
|
|
|
+ dept.setTenantId(defaultConfig.getTenantId());
|
|
|
resourceDeptlist.add(dept);
|
|
|
}
|
|
|
return resourceDeptlist;
|
|
|
@@ -133,7 +136,7 @@ public class SyncHrService {
|
|
|
* @return 转换结果
|
|
|
*/
|
|
|
@NotNull
|
|
|
- private static List<ResourcePerson> getResourcePeopleList(SyncFullDataBo dataBo) {
|
|
|
+ private List<ResourcePerson> getResourcePeopleList(SyncFullDataBo dataBo) {
|
|
|
List<ResourcePerson> resourcePersonList = new ArrayList<>();
|
|
|
for (List<String> list : dataBo.getResponseParam().getResourceInfos().get(0).getDataInfo()) {
|
|
|
ResourcePerson person = new ResourcePerson();
|
|
|
@@ -148,7 +151,7 @@ public class SyncHrService {
|
|
|
person.setRemark("");
|
|
|
person.setUserState(list.get(16));
|
|
|
person.setOperatorId(DefaultConstants.FULL_SYNC_ADMIN);
|
|
|
- person.setTenantId(DefaultConstants.TENANT_ID);
|
|
|
+ person.setTenantId(defaultConfig.getTenantId());
|
|
|
resourcePersonList.add(person);
|
|
|
}
|
|
|
return resourcePersonList;
|