Просмотр исходного кода

SyncJobConfigField改名为SynchroAssociation,connectorsService synchronizersService socialsProviderService accountsService 增加instId控制

shimingxy 2 недель назад
Родитель
Сommit
b9916cde8f
29 измененных файлов с 349 добавлено и 457 удалено
  1. 2 0
      maxkey-entity/src/main/java/org/dromara/maxkey/entity/Accounts.java
  2. 2 0
      maxkey-entity/src/main/java/org/dromara/maxkey/entity/Connectors.java
  3. 26 11
      maxkey-entity/src/main/java/org/dromara/maxkey/entity/SynchroAssociation.java
  4. 2 0
      maxkey-entity/src/main/java/org/dromara/maxkey/entity/Synchronizers.java
  5. 6 6
      maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/mapper/SynchroAssociationMapper.java
  6. 7 6
      maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/service/SynchroAssociationService.java
  7. 62 0
      maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/service/impl/SynchroAssociationServiceImpl.java
  8. 0 127
      maxkey-persistence/src/main/resources/org/dromara/maxkey/persistence/mapper/xml/mysql/SyncJobConfigFieldMapper.xml
  9. 61 0
      maxkey-persistence/src/main/resources/org/dromara/maxkey/persistence/mapper/xml/mysql/SynchroAssociationMapper.xml
  10. 4 14
      maxkey-synchronizers/maxkey-synchronizer-activedirectory/src/main/java/org/dromara/maxkey/synchronizer/activedirectory/ActiveDirectoryOrganizationService.java
  11. 4 14
      maxkey-synchronizers/maxkey-synchronizer-activedirectory/src/main/java/org/dromara/maxkey/synchronizer/activedirectory/ActiveDirectoryUsersService.java
  12. 4 15
      maxkey-synchronizers/maxkey-synchronizer-dingtalk/src/main/java/org/dromara/maxkey/synchronizer/dingtalk/DingtalkOrganizationService.java
  13. 3 18
      maxkey-synchronizers/maxkey-synchronizer-dingtalk/src/main/java/org/dromara/maxkey/synchronizer/dingtalk/DingtalkUsersService.java
  14. 3 17
      maxkey-synchronizers/maxkey-synchronizer-feishu/src/main/java/org/dromara/maxkey/synchronizer/feishu/FeishuOrganizationService.java
  15. 4 15
      maxkey-synchronizers/maxkey-synchronizer-feishu/src/main/java/org/dromara/maxkey/synchronizer/feishu/FeishuUsersService.java
  16. 3 15
      maxkey-synchronizers/maxkey-synchronizer-jdbc/src/main/java/org/dromara/maxkey/synchronizer/jdbc/JdbcOrganizationService.java
  17. 3 16
      maxkey-synchronizers/maxkey-synchronizer-jdbc/src/main/java/org/dromara/maxkey/synchronizer/jdbc/JdbcUsersService.java
  18. 4 14
      maxkey-synchronizers/maxkey-synchronizer-ldap/src/main/java/org/dromara/maxkey/synchronizer/ldap/LdapOrganizationService.java
  19. 4 13
      maxkey-synchronizers/maxkey-synchronizer-ldap/src/main/java/org/dromara/maxkey/synchronizer/ldap/LdapUsersService.java
  20. 5 13
      maxkey-synchronizers/maxkey-synchronizer-workweixin/src/main/java/org/dromara/maxkey/synchronizer/workweixin/WorkweixinOrganizationService.java
  21. 4 14
      maxkey-synchronizers/maxkey-synchronizer-workweixin/src/main/java/org/dromara/maxkey/synchronizer/workweixin/WorkweixinUsersService.java
  22. 25 3
      maxkey-synchronizers/maxkey-synchronizer/src/main/java/org/dromara/maxkey/synchronizer/AbstractSynchronizerService.java
  23. 0 54
      maxkey-synchronizers/maxkey-synchronizer/src/main/java/org/dromara/maxkey/synchronizer/service/impl/SyncJobConfigFieldServiceImpl.java
  24. 1 0
      maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/autoconfigure/MaxKeyMgtMvcConfig.java
  25. 3 3
      maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/controller/ConnectorsController.java
  26. 3 3
      maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/controller/SocialsProviderController.java
  27. 94 0
      maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/controller/SynchroAssociationController.java
  28. 6 62
      maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/controller/SynchronizersController.java
  29. 4 4
      maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/idm/controller/AccountsController.java

+ 2 - 0
maxkey-entity/src/main/java/org/dromara/maxkey/entity/Accounts.java

@@ -22,6 +22,7 @@ import java.util.HashMap;
 import java.util.List;
 
 import org.dromara.maxkey.entity.idm.UserInfo;
+import org.dromara.mybatis.jpa.annotations.PartitionKey;
 import org.dromara.mybatis.jpa.entity.JpaEntity;
 import org.hibernate.validator.constraints.Length;
 
@@ -70,6 +71,7 @@ public class Accounts extends JpaEntity implements Serializable {
     private int status;
     
     @Column
+    @PartitionKey
     private String instId;
     
     private String instName;

+ 2 - 0
maxkey-entity/src/main/java/org/dromara/maxkey/entity/Connectors.java

@@ -20,6 +20,7 @@ import java.io.Serializable;
 import java.util.Date;
 
 import org.dromara.maxkey.pretty.impl.JsonPretty;
+import org.dromara.mybatis.jpa.annotations.PartitionKey;
 import org.dromara.mybatis.jpa.entity.JpaEntity;
 
 import jakarta.persistence.Column;
@@ -65,6 +66,7 @@ public class Connectors extends JpaEntity implements Serializable {
     String status;
 
     @Column
+    @PartitionKey
     private String instId;
 
     private String instName;

+ 26 - 11
maxkey-entity/src/main/java/org/dromara/maxkey/entity/SyncJobConfigField.java → maxkey-entity/src/main/java/org/dromara/maxkey/entity/SynchroAssociation.java

@@ -21,6 +21,8 @@ import jakarta.persistence.Column;
 import jakarta.persistence.Entity;
 import jakarta.persistence.Id;
 import jakarta.persistence.Table;
+
+import org.dromara.mybatis.jpa.annotations.PartitionKey;
 import org.dromara.mybatis.jpa.entity.JpaEntity;
 
 import java.io.Serializable;
@@ -33,8 +35,8 @@ import java.util.Date;
  */
 
 @Entity
-@Table(name = "SYNC_JOB_CONFIG_FIELD")
-public class SyncJobConfigField extends JpaEntity implements Serializable {
+@Table(name = "MXK_SYNCHRO_ASSOCIATION")
+public class SynchroAssociation extends JpaEntity implements Serializable {
 
     private static final long serialVersionUID =  6784822536779144306L;
 
@@ -50,7 +52,7 @@ public class SyncJobConfigField extends JpaEntity implements Serializable {
      * 同步任务ID
      */
     @Column
-    private Long jobId;
+    private Long syncId;
 
     /**
      * 规则名
@@ -117,6 +119,10 @@ public class SyncJobConfigField extends JpaEntity implements Serializable {
      */
        @Column
     private Date updateTime;
+       
+   @Column
+   @PartitionKey
+   String instId;
 
     public Long getId() {
         return id;
@@ -126,15 +132,15 @@ public class SyncJobConfigField extends JpaEntity implements Serializable {
         this.id = id;
     }
 
-    public Long getJobId() {
-        return jobId;
-    }
-
-    public void setJobId(Long jobId) {
-        this.jobId = jobId;
-    }
+	public Long getSyncId() {
+		return syncId;
+	}
+	
+    public void setSyncId(Long syncId) {
+		this.syncId = syncId;
+	}
 
-    public String getName() {
+	public String getName() {
         return name;
     }
 
@@ -221,5 +227,14 @@ public class SyncJobConfigField extends JpaEntity implements Serializable {
     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
+
+	public String getInstId() {
+		return instId;
+	}
+
+	public void setInstId(String instId) {
+		this.instId = instId;
+	}
+    
 }
 

+ 2 - 0
maxkey-entity/src/main/java/org/dromara/maxkey/entity/Synchronizers.java

@@ -19,6 +19,7 @@ package org.dromara.maxkey.entity;
 import java.io.Serializable;
 import java.util.Date;
 
+import org.dromara.mybatis.jpa.annotations.PartitionKey;
 import org.dromara.mybatis.jpa.entity.JpaEntity;
 
 import jakarta.persistence.Column;
@@ -96,6 +97,7 @@ public class Synchronizers extends JpaEntity implements Serializable {
     String service;
 
     @Column
+    @PartitionKey
     private String instId;
 
     private String instName;

+ 6 - 6
maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/mapper/SyncJobConfigFieldMapper.java → maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/mapper/SynchroAssociationMapper.java

@@ -18,24 +18,24 @@
 package org.dromara.maxkey.persistence.mapper;
 
 import org.apache.ibatis.annotations.Param;
-import org.dromara.maxkey.entity.SyncJobConfigField;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.dromara.mybatis.jpa.IJpaMapper;
 
 import java.util.List;
 
 
-public interface SyncJobConfigFieldMapper extends IJpaMapper<SyncJobConfigField,String> {
+public interface SynchroAssociationMapper extends IJpaMapper<SynchroAssociation,String> {
     /*@Select("SELECT * FROM sync_job_config_field WHERE job_id = #{jobId} AND object_type = #{objectType}")*/
-    public List<SyncJobConfigField> findByJobIdAndObjectType(@Param("jobId") Long jobId, @Param("objectType") String objectType);
+    public List<SynchroAssociation> findBySyncIdAndObjectType(@Param("syncId") Long jobId, @Param("objectType") String objectType);
 
-    public List<SyncJobConfigField> findByJobId(Long jobId);
+    public List<SynchroAssociation> findBySyncId(Long syncId);
 
 
     void deleteFieldMapById(Long id);
 
-    void deleteFiledMapByjobId(Long jobId);
+    void deleteFiledMapBySyncId(Long syncId);
 
-    void deleteByJobIdAndObjectType(@Param("jobId") Long jobId, @Param("objectType") String objectType);
+    void deleteBySyncIdAndObjectType(@Param("syncId") Long syncId, @Param("objectType") String objectType);
 }
 
 

+ 7 - 6
maxkey-synchronizers/maxkey-synchronizer/src/main/java/org/dromara/maxkey/synchronizer/service/SyncJobConfigFieldService.java → maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/service/SynchroAssociationService.java

@@ -15,20 +15,21 @@
  */
  
 
-package org.dromara.maxkey.synchronizer.service;
+package org.dromara.maxkey.persistence.service;
 
-import org.dromara.maxkey.entity.SyncJobConfigField;
+import org.dromara.maxkey.entity.SynchroAssociation;
 
 import org.dromara.mybatis.jpa.service.IJpaService;
 import java.util.List;
 
-public interface SyncJobConfigFieldService extends IJpaService<SyncJobConfigField,String> {
+public interface SynchroAssociationService extends IJpaService<SynchroAssociation,String> {
 
-    public List<SyncJobConfigField> findByJobIdAndObjectType(Long jobId, String objectType) ;
+    public List<SynchroAssociation> findBySyncIdAndObjectType(Long syncId, String objectType) ;
 
     public void deleteFieldMapById(Long id);
 
-    public List<SyncJobConfigField> findByJobId(Long jobId) ;
-
+    public List<SynchroAssociation> findBySyncId(Long syncId) ;
+    
+    public List<SynchroAssociation> findBySyncId(Long syncId,String instId) ;
 
 }

+ 62 - 0
maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/service/impl/SynchroAssociationServiceImpl.java

@@ -0,0 +1,62 @@
+/*
+ * Copyright [2025] [MaxKey of copyright http://www.maxkey.top]
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+
+package org.dromara.maxkey.persistence.service.impl;
+
+import org.dromara.maxkey.entity.SynchroAssociation;
+
+import org.dromara.maxkey.persistence.mapper.SynchroAssociationMapper;
+import org.dromara.maxkey.persistence.service.SynchroAssociationService;
+import org.dromara.mybatis.jpa.service.impl.JpaServiceImpl;
+import org.springframework.stereotype.Repository;
+
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.List;
+
+@Repository
+public class SynchroAssociationServiceImpl extends JpaServiceImpl<SynchroAssociationMapper,SynchroAssociation,String>  implements SynchroAssociationService {
+
+    public List<SynchroAssociation> findBySyncIdAndObjectType(Long syncId, String objectType) {
+
+        return getMapper().findBySyncIdAndObjectType(syncId,objectType);
+    }
+
+    public void deleteFieldMapById(Long id){
+        ArrayList<String> ids = new ArrayList<>();
+        ids.add(String.valueOf(id));
+        super.deleteBatch(ids);
+    }
+
+    public List<SynchroAssociation> findBySyncId(Long syncId) {
+        List<SynchroAssociation> list = find(" syncId = ? ",
+                new Object[]{syncId},
+                new int[]{Types.BIGINT,Types.VARCHAR});
+        return list;
+
+    }
+    
+    public List<SynchroAssociation> findBySyncId(Long syncId,String instId) {
+        List<SynchroAssociation> list = find(" syncId = ? and instId = ? ",
+                new Object[]{syncId,instId},
+                new int[]{Types.BIGINT,Types.VARCHAR});
+        return list;
+
+    }
+
+
+}

+ 0 - 127
maxkey-persistence/src/main/resources/org/dromara/maxkey/persistence/mapper/xml/mysql/SyncJobConfigFieldMapper.xml

@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<!--namespace对应接口全类名-->
-<!--
-多行注释快捷键:ctrl + shift + /
--->
-<mapper namespace="org.dromara.maxkey.persistence.mapper.SyncJobConfigFieldMapper">
-
-    <!--    id要和方法名相同-->
-    <insert id="insertUser">
-
-    </insert>
-
-    <update id="updateUser">
-
-    </update>
-
-
-    <delete id="deleteUser">
-
-    </delete>
-    <delete id="deleteFieldMapById">
-        DELETE FROM sync_job_config_field s WHERE s.id = #{id}
-    </delete>
-
-    <delete id="deleteFiledMapByjobId">
-        DELETE FROM sync_job_config_field s WHERE s.job_id = #{jobId}
-    </delete>
-    <delete id="deleteByJobIdAndObjectType">
-        DELETE FROM sync_job_config_field WHERE job_id = #{jobId} AND object_type = #{objectType}
-    </delete>
-
-
-    <!--多对一映射-->
-    <!--
-    type:处理映射关系的实体类的类型常用的标签
-    id:处理主键和实体类中属性的映射关系
-    result: 处理普通字段和实体类中属性的映射关系
-    column: 设置映射关系中的字段名,必须是sql查询出的某个字段
-    property: 设置映射关系中的属性的属性名,必须是处理的实体类类型中的属性名
-    -->
-    <!--
-    resultMap + association 处理多对一映射
-    association: 处理多对一的映射关系(处理实体类类型的属性)
-    property: 设置需要处理映射关系的属性的属性名
-    javaType:设置要处理的属性的类型
-    -->
-    <resultMap id="FieldMap" type="org.dromara.maxkey.entity.SyncJobConfigField">
-        <id column="id" property="id"></id>
-        <result column="jobid" property="jobId"></result>
-        <result column="name" property="name"></result>
-        <result column="objecttype" property="objectType"></result>
-        <result column="targetfield" property="targetField"></result>
-        <result column="targetfield_name" property="targetFieldName"></result>
-        <result column="sourcefield" property="sourceField"></result>
-        <result column="sourcefieldname" property="sourceFieldName"></result>
-        <result column="description" property="description"></result>
-        <result column="createuser" property="createUser"></result>
-        <result column="createtime" property="createTime"></result>
-        <result column="updateuser" property="updateUser"></result>
-        <result column="updatetime" property="updateTime"></result>
-    </resultMap>
-
-    <select id="findByJobIdAndObjectType" resultMap="FieldMap" parameterType="map">
-        SELECT * FROM sync_job_config_field WHERE jobid = #{jobId} AND objecttype = #{objectType}
-    </select>
-
-    <select id="findByJobId" resultMap="FieldMap" parameterType="map">
-        SELECT * FROM sync_job_config_field WHERE job_id = #{jobId}
-    </select>
-
-<!--    &lt;!&ndash;
-    resultMap + 分步查询实现一对多映射
-    property: 设置需要处理映射关系的属性的属性名
-    select: 设置分步查询的sgl的唯一标识
-    column:将查询出的某个字段作为分步查询的sql的条件
-    &ndash;&gt;
-    <resultMap id="" type="">
-        <id column="" property=""></id>
-        <result column="" property=""></result>
-        <result column="" property=""></result>
-        <result column="" property=""></result>
-        <association property=""
-                     select=""
-                     column="">
-        </association>
-    </resultMap>
-    <select id="" resultMap="">
-
-    </select>
-
-
-    &lt;!&ndash;处理一对多映射&ndash;&gt;
-    &lt;!&ndash;
-    方法一:resultMap + collection
-    &ndash;&gt;
-    <resultMap id="" type="">
-        <id column="" property=""></id>
-        <result column="" property=""></result>
-        <collection property="" ofType="">
-            <id column="" property=""></id>
-            <result column="" property=""></result>
-            <result column="" property=""></result>
-            <result column="" property=""></result>
-        </collection>
-    </resultMap>
-    <select id="" resultMap="">
-
-    </select>
-
-    &lt;!&ndash;
-    方法二:collection分步查询
-    &ndash;&gt;
-    <resultMap id="" type="">
-        <id column="" property=""></id>
-        <result column="" property=""></result>
-        <collection property=""
-                    select=""
-                    column="">
-        </collection>
-    </resultMap>
-    <select id="" resultMap="">
-
-    </select>-->
-</mapper>

+ 61 - 0
maxkey-persistence/src/main/resources/org/dromara/maxkey/persistence/mapper/xml/mysql/SynchroAssociationMapper.xml

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--namespace对应接口全类名-->
+<!--
+多行注释快捷键:ctrl + shift + /
+-->
+<mapper namespace="org.dromara.maxkey.persistence.mapper.SynchroAssociationMapper">
+
+    <delete id="deleteFieldMapById">
+        DELETE FROM mxk_synchro_field_map s WHERE s.id = #{id}
+    </delete>
+
+    <delete id="deleteFiledMapBySyncId">
+        DELETE FROM mxk_synchro_field_map s WHERE s.syncId = #{syncId}
+    </delete>
+    <delete id="deleteBySyncIdAndObjectType">
+        DELETE FROM mxk_synchro_field_map WHERE syncId = #{syncId} AND object_type = #{objectType}
+    </delete>
+
+
+    <!--多对一映射-->
+    <!--
+    type:处理映射关系的实体类的类型常用的标签
+    id:处理主键和实体类中属性的映射关系
+    result: 处理普通字段和实体类中属性的映射关系
+    column: 设置映射关系中的字段名,必须是sql查询出的某个字段
+    property: 设置映射关系中的属性的属性名,必须是处理的实体类类型中的属性名
+    -->
+    <!--
+    resultMap + association 处理多对一映射
+    association: 处理多对一的映射关系(处理实体类类型的属性)
+    property: 设置需要处理映射关系的属性的属性名
+    javaType:设置要处理的属性的类型
+    -->
+    <resultMap id="FieldMap" type="org.dromara.maxkey.entity.SynchroAssociation">
+        <id column="id" property="id"></id>
+        <result column="syncId" property="syncId"></result>
+        <result column="name" property="name"></result>
+        <result column="objecttype" property="objectType"></result>
+        <result column="targetfield" property="targetField"></result>
+        <result column="targetfield_name" property="targetFieldName"></result>
+        <result column="sourcefield" property="sourceField"></result>
+        <result column="sourcefieldname" property="sourceFieldName"></result>
+        <result column="description" property="description"></result>
+        <result column="createuser" property="createUser"></result>
+        <result column="createtime" property="createTime"></result>
+        <result column="updateuser" property="updateUser"></result>
+        <result column="updatetime" property="updateTime"></result>
+        <result column="instid" property="instId"></result>
+    </resultMap>
+
+    <select id="findBySyncIdAndObjectType" resultMap="FieldMap" parameterType="map">
+        SELECT * FROM mxk_synchro_field_map WHERE syncId = #{syncId} AND objecttype = #{objectType}
+    </select>
+
+    <select id="findBySyncId" resultMap="FieldMap" parameterType="map">
+        SELECT * FROM mxk_synchro_field_map WHERE syncId = #{syncId}
+    </select>
+</mapper>

+ 4 - 14
maxkey-synchronizers/maxkey-synchronizer-activedirectory/src/main/java/org/dromara/maxkey/synchronizer/activedirectory/ActiveDirectoryOrganizationService.java

@@ -38,11 +38,9 @@ import org.dromara.maxkey.ldap.activedirectory.ActiveDirectoryUtils;
 import org.dromara.maxkey.ldap.constants.OrganizationalUnit;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.entity.SyncJobConfigField;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import static org.dromara.maxkey.synchronizer.utils.FieldUtil.getFieldValue;
@@ -52,8 +50,6 @@ import static org.dromara.maxkey.synchronizer.utils.FieldUtil.setFieldValue;
 public class ActiveDirectoryOrganizationService  extends AbstractSynchronizerService  implements ISynchronizerService{
     static final  Logger _logger = LoggerFactory.getLogger(ActiveDirectoryOrganizationService.class);
 
-    @Autowired
-    private SyncJobConfigFieldService syncJobConfigFieldService;
     private static final Integer ORG_TYPE = 2;
     ActiveDirectoryUtils ldapUtils;
     
@@ -276,9 +272,9 @@ public class ActiveDirectoryOrganizationService  extends AbstractSynchronizerSer
     public Map<String,String> getFiledMap(Long jobId){
         Map<String,String> filedMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取用户属性映射
-        for(SyncJobConfigField element:syncJobConfigFieldList){
+        for(SynchroAssociation element:syncJobConfigFieldList){
             if(Integer.parseInt(element.getObjectType()) == ORG_TYPE.intValue()){
                 filedMap.put(element.getTargetField(),element.getSourceField());
             }
@@ -296,11 +292,5 @@ public class ActiveDirectoryOrganizationService  extends AbstractSynchronizerSer
         this.ldapUtils = ldapUtils;
     }
 
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
+ 
 }

+ 4 - 14
maxkey-synchronizers/maxkey-synchronizer-activedirectory/src/main/java/org/dromara/maxkey/synchronizer/activedirectory/ActiveDirectoryUsersService.java

@@ -37,10 +37,10 @@ import org.dromara.maxkey.entity.idm.UserInfo;
 import org.dromara.maxkey.ldap.LdapUtils;
 import org.dromara.maxkey.ldap.activedirectory.ActiveDirectoryUtils;
 import org.dromara.maxkey.ldap.activedirectory.constants.ActiveDirectoryUser;
+import org.dromara.maxkey.persistence.service.SynchroAssociationService;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.entity.SyncJobConfigField;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -51,8 +51,6 @@ import static org.dromara.maxkey.synchronizer.utils.FieldUtil.setFieldValue;
 @Service
 public class ActiveDirectoryUsersService extends AbstractSynchronizerService    implements ISynchronizerService{
     final static Logger _logger = LoggerFactory.getLogger(ActiveDirectoryUsersService.class);
-    @Autowired
-    private SyncJobConfigFieldService syncJobConfigFieldService;
 
     private static final Integer USER_TYPE = 1;
     ActiveDirectoryUtils ldapUtils;
@@ -301,9 +299,9 @@ public class ActiveDirectoryUsersService extends AbstractSynchronizerService
     public Map<String,String> getFieldMap(Long jobId){
         Map<String,String> fieldMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取用户属性映射
-        for(SyncJobConfigField element:syncJobConfigFieldList){
+        for(SynchroAssociation element:syncJobConfigFieldList){
             if(Integer.parseInt(element.getObjectType()) == USER_TYPE.intValue()){
                 fieldMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -318,12 +316,4 @@ public class ActiveDirectoryUsersService extends AbstractSynchronizerService
     public void setLdapUtils(ActiveDirectoryUtils ldapUtils) {
         this.ldapUtils = ldapUtils;
     }
-
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
 }

+ 4 - 15
maxkey-synchronizers/maxkey-synchronizer-dingtalk/src/main/java/org/dromara/maxkey/synchronizer/dingtalk/DingtalkOrganizationService.java

@@ -27,10 +27,10 @@ import java.util.concurrent.LinkedBlockingQueue;
 import org.dromara.maxkey.constants.ConstsStatus;
 import org.dromara.maxkey.entity.SynchroRelated;
 import org.dromara.maxkey.entity.idm.Organizations;
+import org.dromara.maxkey.persistence.service.SynchroAssociationService;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.entity.SyncJobConfigField;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,8 +50,6 @@ import static org.dromara.maxkey.synchronizer.utils.FieldUtil.*;
 public class DingtalkOrganizationService  extends AbstractSynchronizerService implements ISynchronizerService{
     final static Logger _logger = LoggerFactory.getLogger(DingtalkOrganizationService.class);
 
-    @Autowired
-    private SyncJobConfigFieldService syncJobConfigFieldService;
     private static final Integer ORG_TYPE = 2;
     
     static Long ROOT_DEPT_ID = 1L;
@@ -215,9 +213,9 @@ public class DingtalkOrganizationService  extends AbstractSynchronizerService im
     public Map<String,String> getFieldMap(Long jobId){
         Map<String,String> FieldMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取用户属性映射
-        for(SyncJobConfigField element:syncJobConfigFieldList){
+        for(SynchroAssociation element:syncJobConfigFieldList){
             if(Integer.parseInt(element.getObjectType()) == ORG_TYPE.intValue()){
                 FieldMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -234,13 +232,4 @@ public class DingtalkOrganizationService  extends AbstractSynchronizerService im
     public void setAccess_token(String access_token) {
         this.access_token = access_token;
     }
-
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
-    
 }

+ 3 - 18
maxkey-synchronizers/maxkey-synchronizer-dingtalk/src/main/java/org/dromara/maxkey/synchronizer/dingtalk/DingtalkUsersService.java

@@ -28,13 +28,11 @@ import org.dromara.maxkey.entity.SynchroRelated;
 import org.dromara.maxkey.entity.idm.UserInfo;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.entity.SyncJobConfigField;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.joda.time.DateTime;
 import org.joda.time.format.DateTimeFormat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.dingtalk.api.DefaultDingTalkClient;
 import com.dingtalk.api.DingTalkClient;
@@ -52,11 +50,6 @@ public class DingtalkUsersService  extends AbstractSynchronizerService implement
 
     private static final Integer USER_TYPE = 1;
 
-
-
-    @Autowired
-    private SyncJobConfigFieldService syncJobConfigFieldService;
-
     
     public void sync() {
         _logger.info("Sync Dingtalk Users...");
@@ -197,9 +190,9 @@ public class DingtalkUsersService  extends AbstractSynchronizerService implement
     public Map<String,String> getFieldMap(Long jobId){
         Map<String,String> userFieldMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取用户属性映射
-        for(SyncJobConfigField element:syncJobConfigFieldList){
+        for(SynchroAssociation element:syncJobConfigFieldList){
             if(Integer.parseInt(element.getObjectType()) == USER_TYPE.intValue()){
                 userFieldMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -213,12 +206,4 @@ public class DingtalkUsersService  extends AbstractSynchronizerService implement
         this.access_token = access_token;
     }
 
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
-
 }

+ 3 - 17
maxkey-synchronizers/maxkey-synchronizer-feishu/src/main/java/org/dromara/maxkey/synchronizer/feishu/FeishuOrganizationService.java

@@ -31,14 +31,12 @@ import org.dromara.maxkey.http.AuthorizationHeaderUtils;
 import org.dromara.maxkey.http.HttpRequestAdapter;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.entity.SyncJobConfigField;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.dromara.maxkey.synchronizer.feishu.entity.FeishuDepts;
 import org.dromara.maxkey.synchronizer.feishu.entity.FeishuDeptsResponse;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
 import org.dromara.maxkey.util.JsonUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import static org.dromara.maxkey.synchronizer.utils.FieldUtil.*;
@@ -49,11 +47,6 @@ public class FeishuOrganizationService extends AbstractSynchronizerService imple
     
     String access_token;
     private static final Integer ORG_TYPE = 2;
-
-
-
-    @Autowired
-    private SyncJobConfigFieldService syncJobConfigFieldService;
     
     static String DEPTS_URL = "https://open.feishu.cn/open-apis/contact/v3/departments/%s/children?page_size=50";
     static String ROOT_DEPT_URL = "https://open.feishu.cn/open-apis/contact/v3/departments/%s";
@@ -215,9 +208,9 @@ public class FeishuOrganizationService extends AbstractSynchronizerService imple
         //key是maxkey的属性,value是其他应用的属性
         Map<String,String> filedMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取组织属性映射
-        for(SyncJobConfigField element:syncJobConfigFieldList){
+        for(SynchroAssociation element:syncJobConfigFieldList){
             if(Integer.parseInt(element.getObjectType()) == ORG_TYPE.intValue()){
                 filedMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -233,12 +226,5 @@ public class FeishuOrganizationService extends AbstractSynchronizerService imple
         this.access_token = access_token;
     }
 
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
 
 }

+ 4 - 15
maxkey-synchronizers/maxkey-synchronizer-feishu/src/main/java/org/dromara/maxkey/synchronizer/feishu/FeishuUsersService.java

@@ -29,14 +29,12 @@ import org.dromara.maxkey.http.AuthorizationHeaderUtils;
 import org.dromara.maxkey.http.HttpRequestAdapter;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.entity.SyncJobConfigField;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.dromara.maxkey.synchronizer.feishu.entity.FeishuUsers;
 import org.dromara.maxkey.synchronizer.feishu.entity.FeishuUsersResponse;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
 import org.dromara.maxkey.util.JsonUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 
@@ -45,8 +43,7 @@ import static org.dromara.maxkey.synchronizer.utils.FieldUtil.*;
 @Service
 public class FeishuUsersService extends AbstractSynchronizerService implements ISynchronizerService{
     final static Logger _logger = LoggerFactory.getLogger(FeishuUsersService.class);
-    @Autowired
-    private SyncJobConfigFieldService syncJobConfigFieldService;
+
     String access_token;
     private static final Integer USER_TYPE = 1;
     
@@ -190,9 +187,9 @@ public class FeishuUsersService extends AbstractSynchronizerService implements I
     public Map<String,String> getFiledMap(Long jobId){
         Map<String,String> fieldMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取用户属性映射
-        for(SyncJobConfigField element:syncJobConfigFieldList){
+        for(SynchroAssociation element:syncJobConfigFieldList){
             if(Integer.parseInt(element.getObjectType()) == USER_TYPE.intValue()){
                 fieldMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -203,13 +200,5 @@ public class FeishuUsersService extends AbstractSynchronizerService implements I
     public void setAccess_token(String access_token) {
         this.access_token = access_token;
     }
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
-
 
 }

+ 3 - 15
maxkey-synchronizers/maxkey-synchronizer-jdbc/src/main/java/org/dromara/maxkey/synchronizer/jdbc/JdbcOrganizationService.java

@@ -25,12 +25,10 @@ import org.dromara.maxkey.entity.history.HistorySynchronizer;
 import org.dromara.maxkey.entity.idm.Organizations;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.entity.SyncJobConfigField;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.dromara.maxkey.util.JdbcUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.sql.Connection;
@@ -48,8 +46,6 @@ import static org.dromara.maxkey.synchronizer.utils.FieldUtil.setFieldValue;
 public class JdbcOrganizationService extends AbstractSynchronizerService implements ISynchronizerService {
     static final  Logger _logger = LoggerFactory.getLogger(JdbcOrganizationService.class);
     static ArrayList<ColumnFieldMapper> mapperList = new ArrayList<>();
-    @Autowired
-    private SyncJobConfigFieldService syncJobConfigFieldService;
 
     private static final Integer ORG_TYPE = 2;
 
@@ -177,9 +173,9 @@ public class JdbcOrganizationService extends AbstractSynchronizerService impleme
     public Map<String,String> getFieldMap(Long jobId){
         Map<String,String> filedMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取用户属性映射
-        for(SyncJobConfigField element:syncJobConfigFieldList){
+        for(SynchroAssociation element:syncJobConfigFieldList){
             if(Integer.parseInt(element.getObjectType()) == ORG_TYPE.intValue()){
                 filedMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -187,14 +183,6 @@ public class JdbcOrganizationService extends AbstractSynchronizerService impleme
         return filedMap;
     }
 
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
-
     static {
         mapperList.add(new ColumnFieldMapper("id", "id", "String"));
         mapperList.add(new ColumnFieldMapper("orgcode", "orgCode", "String"));

+ 3 - 16
maxkey-synchronizers/maxkey-synchronizer-jdbc/src/main/java/org/dromara/maxkey/synchronizer/jdbc/JdbcUsersService.java

@@ -25,12 +25,10 @@ import org.dromara.maxkey.entity.history.HistorySynchronizer;
 import org.dromara.maxkey.entity.idm.UserInfo;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.entity.SyncJobConfigField;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.dromara.maxkey.util.JdbcUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.lang.reflect.InvocationTargetException;
@@ -48,9 +46,6 @@ import static org.dromara.maxkey.synchronizer.utils.FieldUtil.setFieldValue;
 @Service
 public class JdbcUsersService extends AbstractSynchronizerService implements ISynchronizerService {
     static final  Logger _logger = LoggerFactory.getLogger(JdbcUsersService.class);
-    
-    @Autowired
-    public SyncJobConfigFieldService syncJobConfigFieldService;
 
     private static final Integer USER_TYPE = 1;
     static ArrayList<ColumnFieldMapper> mapperList = new ArrayList<>();
@@ -229,9 +224,9 @@ public class JdbcUsersService extends AbstractSynchronizerService implements ISy
     public Map<String,String> getFieldMap(Long jobId){
         Map<String,String> fieldMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取用户属性映射
-        for(SyncJobConfigField element:syncJobConfigFieldList){
+        for(SynchroAssociation element:syncJobConfigFieldList){
             if(Integer.parseInt(element.getObjectType()) == USER_TYPE.intValue()){
                 fieldMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -239,14 +234,6 @@ public class JdbcUsersService extends AbstractSynchronizerService implements ISy
         return fieldMap;
     }
 
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
-
     static {
         mapperList.add(new ColumnFieldMapper("id", "id", "String"));
         mapperList.add(new ColumnFieldMapper("username", "username", "String"));

+ 4 - 14
maxkey-synchronizers/maxkey-synchronizer-ldap/src/main/java/org/dromara/maxkey/synchronizer/ldap/LdapOrganizationService.java

@@ -36,10 +36,10 @@ import org.dromara.maxkey.entity.history.HistorySynchronizer;
 import org.dromara.maxkey.entity.idm.Organizations;
 import org.dromara.maxkey.ldap.LdapUtils;
 import org.dromara.maxkey.ldap.constants.OrganizationalUnit;
+import org.dromara.maxkey.persistence.service.SynchroAssociationService;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.entity.SyncJobConfigField;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -51,8 +51,6 @@ import static org.dromara.maxkey.synchronizer.utils.FieldUtil.setFieldValue;
 @Service
 public class LdapOrganizationService extends AbstractSynchronizerService  implements ISynchronizerService{
     final static Logger _logger = LoggerFactory.getLogger(LdapOrganizationService.class);
-    @Autowired
-    private SyncJobConfigFieldService syncJobConfigFieldService;
 
     private static final Integer ORG_TYPE = 2;
     LdapUtils ldapUtils;
@@ -279,9 +277,9 @@ public class LdapOrganizationService extends AbstractSynchronizerService  implem
     public Map<String,String> getFieldMap(Long jobId){
         Map<String,String> userFiledMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取用户属性映射
-        for(SyncJobConfigField element:syncJobConfigFieldList){
+        for(SynchroAssociation element:syncJobConfigFieldList){
             if(Integer.parseInt(element.getObjectType()) == ORG_TYPE.intValue()){
                 userFiledMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -297,12 +295,4 @@ public class LdapOrganizationService extends AbstractSynchronizerService  implem
     public void setLdapUtils(LdapUtils ldapUtils) {
         this.ldapUtils = ldapUtils;
     }
-
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
 }

+ 4 - 13
maxkey-synchronizers/maxkey-synchronizer-ldap/src/main/java/org/dromara/maxkey/synchronizer/ldap/LdapUsersService.java

@@ -35,10 +35,10 @@ import org.dromara.maxkey.entity.idm.Organizations;
 import org.dromara.maxkey.entity.idm.UserInfo;
 import org.dromara.maxkey.ldap.LdapUtils;
 import org.dromara.maxkey.ldap.constants.InetOrgPerson;
+import org.dromara.maxkey.persistence.service.SynchroAssociationService;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.entity.SyncJobConfigField;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,8 +50,6 @@ import static org.dromara.maxkey.synchronizer.utils.FieldUtil.setFieldValue;
 @Service
 public class LdapUsersService extends AbstractSynchronizerService  implements ISynchronizerService{
     final static Logger _logger = LoggerFactory.getLogger(LdapUsersService.class);
-    @Autowired
-    public SyncJobConfigFieldService syncJobConfigFieldService;
 
     private static final Integer USER_TYPE = 1;
     LdapUtils ldapUtils;
@@ -327,9 +325,9 @@ public class LdapUsersService extends AbstractSynchronizerService  implements IS
     public Map<String,String> getFieldMap(Long jobId){
         Map<String,String> userFieldMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取用户属性映射
-        for(SyncJobConfigField element:syncJobConfigFieldList){
+        for(SynchroAssociation element:syncJobConfigFieldList){
             if(Integer.parseInt(element.getObjectType()) == USER_TYPE.intValue()){
                 userFieldMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -346,11 +344,4 @@ public class LdapUsersService extends AbstractSynchronizerService  implements IS
         this.ldapUtils = ldapUtils;
     }
 
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
 }

+ 5 - 13
maxkey-synchronizers/maxkey-synchronizer-workweixin/src/main/java/org/dromara/maxkey/synchronizer/workweixin/WorkweixinOrganizationService.java

@@ -18,13 +18,13 @@
 package org.dromara.maxkey.synchronizer.workweixin;
 
 import org.dromara.maxkey.constants.ConstsStatus;
-import org.dromara.maxkey.entity.SyncJobConfigField;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.dromara.maxkey.entity.SynchroRelated;
 import org.dromara.maxkey.entity.idm.Organizations;
 import org.dromara.maxkey.http.HttpRequestAdapter;
+import org.dromara.maxkey.persistence.service.SynchroAssociationService;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
 import org.dromara.maxkey.synchronizer.workweixin.entity.WorkWeixinDepts;
 import org.dromara.maxkey.synchronizer.workweixin.entity.WorkWeixinDeptsResponse;
 import org.dromara.maxkey.util.JsonUtils;
@@ -48,8 +48,7 @@ public class WorkweixinOrganizationService extends AbstractSynchronizerService i
     static final Logger _logger = LoggerFactory.getLogger(WorkweixinOrganizationService.class);
 
     String access_token;
-    @Autowired
-    private SyncJobConfigFieldService syncJobConfigFieldService;
+    
     private static final Integer ORG_TYPE = 2;
     static String DEPTS_URL = "https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token=%s";
     static long ROOT_DEPT_ID = 1;
@@ -261,9 +260,9 @@ public class WorkweixinOrganizationService extends AbstractSynchronizerService i
     public Map<String, String> getFieldMap(Long jobId) {
         Map<String, String> filedMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取组织属性映射
-        for (SyncJobConfigField element : syncJobConfigFieldList) {
+        for (SynchroAssociation element : syncJobConfigFieldList) {
             if (Integer.parseInt(element.getObjectType()) == ORG_TYPE) {
                 filedMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -370,11 +369,4 @@ public class WorkweixinOrganizationService extends AbstractSynchronizerService i
         this.access_token = access_token;
     }
 
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
 }

+ 4 - 14
maxkey-synchronizers/maxkey-synchronizer-workweixin/src/main/java/org/dromara/maxkey/synchronizer/workweixin/WorkweixinUsersService.java

@@ -19,13 +19,13 @@ package org.dromara.maxkey.synchronizer.workweixin;
 
 import org.apache.commons.lang3.StringUtils;
 import org.dromara.maxkey.constants.ConstsStatus;
-import org.dromara.maxkey.entity.SyncJobConfigField;
+import org.dromara.maxkey.entity.SynchroAssociation;
 import org.dromara.maxkey.entity.SynchroRelated;
 import org.dromara.maxkey.entity.idm.UserInfo;
 import org.dromara.maxkey.http.HttpRequestAdapter;
+import org.dromara.maxkey.persistence.service.SynchroAssociationService;
 import org.dromara.maxkey.synchronizer.AbstractSynchronizerService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
 import org.dromara.maxkey.synchronizer.workweixin.entity.WorkWeixinUsers;
 import org.dromara.maxkey.synchronizer.workweixin.entity.WorkWeixinUsersResponse;
 import org.dromara.maxkey.util.JsonUtils;
@@ -46,8 +46,6 @@ import static org.dromara.maxkey.synchronizer.utils.FieldUtil.*;
 public class WorkweixinUsersService extends AbstractSynchronizerService implements ISynchronizerService {
     final static Logger _logger = LoggerFactory.getLogger(WorkweixinUsersService.class);
 
-    @Autowired
-    public SyncJobConfigFieldService syncJobConfigFieldService;
     private static final Integer USER_TYPE = 1;
     String access_token;
 
@@ -262,9 +260,9 @@ public class WorkweixinUsersService extends AbstractSynchronizerService implemen
     public Map<String, String> getFieldMap(Long jobId) {
         Map<String, String> userFieldMap = new HashMap<>();
         //根据job id查询属性映射表
-        List<SyncJobConfigField> syncJobConfigFieldList = syncJobConfigFieldService.findByJobId(jobId);
+        List<SynchroAssociation> syncJobConfigFieldList = synchroAssociationService.findBySyncId(jobId);
         //获取用户属性映射
-        for (SyncJobConfigField element : syncJobConfigFieldList) {
+        for (SynchroAssociation element : syncJobConfigFieldList) {
             if (Integer.parseInt(element.getObjectType()) == USER_TYPE.intValue()) {
                 userFieldMap.put(element.getTargetField(), element.getSourceField());
             }
@@ -357,12 +355,4 @@ public class WorkweixinUsersService extends AbstractSynchronizerService implemen
             _logger.info("[同步微信用户] 用户 {} (originId={}) 已标记为禁用,userState=WITHDRAWN。", localUser.getUsername(), orphanRelation.getOriginId());
         }
     }
-
-    public SyncJobConfigFieldService getSyncJobConfigFieldService() {
-        return syncJobConfigFieldService;
-    }
-
-    public void setSyncJobConfigFieldService(SyncJobConfigFieldService syncJobConfigFieldService) {
-        this.syncJobConfigFieldService = syncJobConfigFieldService;
-    }
 }

+ 25 - 3
maxkey-synchronizers/maxkey-synchronizer/src/main/java/org/dromara/maxkey/synchronizer/AbstractSynchronizerService.java

@@ -28,6 +28,7 @@ import org.dromara.maxkey.entity.idm.Organizations;
 import org.dromara.maxkey.persistence.service.HistorySynchronizerService;
 import org.dromara.maxkey.persistence.service.OrganizationsService;
 import org.dromara.maxkey.persistence.service.SocialsAssociatesService;
+import org.dromara.maxkey.persistence.service.SynchroAssociationService;
 import org.dromara.maxkey.persistence.service.SynchroRelatedService;
 import org.dromara.maxkey.persistence.service.UserInfoService;
 import org.slf4j.Logger;
@@ -35,17 +36,23 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 
 public abstract class AbstractSynchronizerService {
-    private static final Logger _logger = 
-            LoggerFactory.getLogger(AbstractSynchronizerService.class);
+    private static final Logger _logger = LoggerFactory.getLogger(AbstractSynchronizerService.class);
     
     @Autowired
     protected OrganizationsService organizationsService;
+    
     @Autowired
     protected UserInfoService userInfoService;
+    
     @Autowired
     protected SynchroRelatedService synchroRelatedService;
+    
     @Autowired
     protected SocialsAssociatesService socialsAssociatesService;
+    
+    @Autowired
+    public SynchroAssociationService synchroAssociationService;
+    
     @Autowired
     protected HistorySynchronizerService historySynchronizerService;
     
@@ -176,6 +183,21 @@ public abstract class AbstractSynchronizerService {
     public void setSynchroRelatedService(SynchroRelatedService synchroRelatedService) {
         this.synchroRelatedService = synchroRelatedService;
     }
-    
+
+	public SocialsAssociatesService getSocialsAssociatesService() {
+		return socialsAssociatesService;
+	}
+
+	public void setSocialsAssociatesService(SocialsAssociatesService socialsAssociatesService) {
+		this.socialsAssociatesService = socialsAssociatesService;
+	}
+
+	public SynchroAssociationService getSynchroAssociationService() {
+		return synchroAssociationService;
+	}
+
+	public void setSynchroAssociationService(SynchroAssociationService synchroAssociationService) {
+		this.synchroAssociationService = synchroAssociationService;
+	}
     
 }

+ 0 - 54
maxkey-synchronizers/maxkey-synchronizer/src/main/java/org/dromara/maxkey/synchronizer/service/impl/SyncJobConfigFieldServiceImpl.java

@@ -1,54 +0,0 @@
-/*
- * Copyright [2025] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.dromara.maxkey.synchronizer.service.impl;
-
-import org.dromara.maxkey.entity.SyncJobConfigField;
-
-import org.dromara.maxkey.persistence.mapper.SyncJobConfigFieldMapper;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
-import org.dromara.mybatis.jpa.service.impl.JpaServiceImpl;
-import org.springframework.stereotype.Repository;
-
-import java.sql.Types;
-import java.util.ArrayList;
-import java.util.List;
-
-@Repository
-public class SyncJobConfigFieldServiceImpl extends JpaServiceImpl<SyncJobConfigFieldMapper,SyncJobConfigField,String>  implements SyncJobConfigFieldService {
-
-    public List<SyncJobConfigField> findByJobIdAndObjectType(Long jobId, String objectType) {
-
-        return getMapper().findByJobIdAndObjectType(jobId,objectType);
-    }
-
-    public void deleteFieldMapById(Long id){
-        ArrayList<String> ids = new ArrayList<>();
-        ids.add(String.valueOf(id));
-        super.deleteBatch(ids);
-    }
-
-    public List<SyncJobConfigField> findByJobId(Long jobId) {
-        List<SyncJobConfigField> list = find(" jobid = ?",
-                new Object[]{jobId},
-                new int[]{Types.BIGINT});
-        return list;
-
-    }
-
-
-}

+ 1 - 0
maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/autoconfigure/MaxKeyMgtMvcConfig.java

@@ -67,6 +67,7 @@ public class MaxKeyMgtMvcConfig implements WebMvcConfigurer {
                 
                 .addPathPatterns("/config/**")
                 .addPathPatterns("/config/**/**")
+                .addPathPatterns("/config/**/**/**")
                 
                 .addPathPatterns("/historys/**")
                 .addPathPatterns("/historys/**/**")

+ 3 - 3
maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/controller/ConnectorsController.java

@@ -49,8 +49,8 @@ public class ConnectorsController {
     }
     
     @GetMapping(value = { "/get/{id}" }, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<Connectors> get(@PathVariable String id) {
-        Connectors connector = connectorsService.get(id);
+    public Message<Connectors> get(@PathVariable String id,@CurrentUser UserInfo currentUser) {
+        Connectors connector = connectorsService.get(id,currentUser.getInstId());
         if(StringUtils.isNotBlank(connector.getCredentials())) {
             connector.setCredentials(PasswordReciprocal.getInstance().decoder(connector.getCredentials()));
         }
@@ -86,7 +86,7 @@ public class ConnectorsController {
     @DeleteMapping(value={"/delete"}, produces = {MediaType.APPLICATION_JSON_VALUE})
     public Message<Connectors> delete(@RequestParam List<String> ids,@CurrentUser UserInfo currentUser) {
         logger.debug("-delete  ids : {} " , ids);
-        if (connectorsService.deleteBatch(ids)) {
+        if (connectorsService.deleteBatch(ids,currentUser.getInstId())) {
              return new Message<>(Message.SUCCESS);
         } else {
             return new Message<>(Message.FAIL);

+ 3 - 3
maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/controller/SocialsProviderController.java

@@ -69,8 +69,8 @@ public class SocialsProviderController {
     }
     
     @RequestMapping(value = { "/get/{id}" }, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<?> get(@PathVariable String id) {
-        SocialsProvider socialsProvider=socialsProviderService.get(id);
+    public Message<?> get(@PathVariable String id, @CurrentUser UserInfo currentUser) {
+        SocialsProvider socialsProvider=socialsProviderService.get(id,currentUser.getInstId());
         socialsProvider.setClientSecret(PasswordReciprocal.getInstance().decoder(socialsProvider.getClientSecret()));
         return new Message<SocialsProvider>(socialsProvider);
     }
@@ -106,7 +106,7 @@ public class SocialsProviderController {
     @RequestMapping(value={"/delete"}, produces = {MediaType.APPLICATION_JSON_VALUE})
     public Message<?> delete(@RequestParam List<String> ids,@CurrentUser UserInfo currentUser) {
         logger.debug("-delete  ids : {} " , ids);
-        if (socialsProviderService.deleteBatch(ids)) {
+        if (socialsProviderService.deleteBatch(ids,currentUser.getInstId())) {
              return new Message<SocialsProvider>(Message.SUCCESS);
         } else {
             return new Message<SocialsProvider>(Message.FAIL);

+ 94 - 0
maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/controller/SynchroAssociationController.java

@@ -0,0 +1,94 @@
+/*
+ * Copyright [2021] [MaxKey of copyright http://www.maxkey.top]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.dromara.maxkey.web.config.controller;
+
+import org.dromara.maxkey.authn.annotation.CurrentUser;
+import org.dromara.maxkey.entity.*;
+import org.dromara.maxkey.persistence.service.SynchroAssociationService;
+import org.dromara.maxkey.entity.Message;
+import org.dromara.maxkey.entity.Synchronizers;
+import org.dromara.maxkey.entity.idm.UserInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+@RestController
+@RequestMapping(value = {"/config/synchronizers"})
+public class SynchroAssociationController {
+    static final Logger logger = LoggerFactory.getLogger(SynchroAssociationController.class);
+
+    @Autowired
+    SynchroAssociationService synchroAssociationService;
+
+    @RequestMapping(value = {"/mapping-list/{syncId}"}, produces = {MediaType.APPLICATION_JSON_VALUE})
+    @ResponseBody
+    public ResponseEntity<?> mapping(@PathVariable Long syncId,@CurrentUser UserInfo currentUser) {
+        logger.debug("mapping {}", syncId);
+        List<SynchroAssociation> synchroAssociation = synchroAssociationService.findBySyncId(syncId,currentUser.getInstId());
+        return new Message<>(synchroAssociation).buildResponse();
+    }
+
+    @RequestMapping(value = {"/mapping-get/{id}"}, produces = {MediaType.APPLICATION_JSON_VALUE})
+    @ResponseBody
+    public ResponseEntity<?> mappingGet(@PathVariable Long id, @CurrentUser UserInfo currentUser) {
+        logger.debug("mapping get {}", id);
+        SynchroAssociation synchroFieldMap = synchroAssociationService.get(String.valueOf(id),currentUser.getInstId());
+        return new Message<>(synchroFieldMap).buildResponse();
+    }
+
+    @RequestMapping(value = {"/mapping-delete/{id}"}, produces = {MediaType.APPLICATION_JSON_VALUE})
+    @ResponseBody
+    public ResponseEntity<?> mappingDelete(@PathVariable Long id, @CurrentUser UserInfo currentUser) {
+        logger.debug("mappingDelete {}", id);
+        synchroAssociationService.delete(String.valueOf(id),currentUser.getInstId());
+        return new Message<SynchroAssociation>(Message.SUCCESS).buildResponse();
+    }
+
+    @ResponseBody
+    @PostMapping(value = {"/mapping-add"}, produces = {MediaType.APPLICATION_JSON_VALUE})
+    public ResponseEntity<?> mappingadd(@RequestBody SynchroAssociation synchroAssociation, @CurrentUser UserInfo currentUser) {
+        logger.debug("-mapping add  : {}", synchroAssociation);
+        synchroAssociation.setCreateTime(new Date());
+        synchroAssociation.setInstId(currentUser.getInstId());
+        if (synchroAssociationService.insert(synchroAssociation)) {
+            return new Message<Synchronizers>(Message.SUCCESS).buildResponse();
+        } else {
+            return new Message<Synchronizers>(Message.FAIL).buildResponse();
+        }
+    }
+
+    @ResponseBody
+    @PutMapping(value = {"/mapping-update"}, produces = {MediaType.APPLICATION_JSON_VALUE})
+    public ResponseEntity<?> mappingupdate(@RequestBody SynchroAssociation synchroAssociation, @CurrentUser UserInfo currentUser) {
+        logger.debug("-mapping update  : {}", synchroAssociation);
+        synchroAssociation.setUpdateTime(new Date());
+        synchroAssociation.setInstId(currentUser.getInstId());
+        if (synchroAssociationService.update(synchroAssociation)) {
+            return new Message<Synchronizers>(Message.SUCCESS).buildResponse();
+        } else {
+            return new Message<Synchronizers>(Message.FAIL).buildResponse();
+        }
+    }
+
+}

+ 6 - 62
maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/controller/SynchronizersController.java

@@ -20,10 +20,8 @@ package org.dromara.maxkey.web.config.controller;
 import org.apache.commons.lang3.StringUtils;
 import org.dromara.maxkey.authn.annotation.CurrentUser;
 import org.dromara.maxkey.crypto.password.PasswordReciprocal;
-import org.dromara.maxkey.entity.*;
 import org.dromara.maxkey.persistence.service.SynchronizersService;
 import org.dromara.maxkey.synchronizer.ISynchronizerService;
-import org.dromara.maxkey.synchronizer.service.SyncJobConfigFieldService;
 import org.dromara.maxkey.entity.Connectors;
 import org.dromara.maxkey.entity.Message;
 import org.dromara.maxkey.entity.Synchronizers;
@@ -32,12 +30,10 @@ import org.dromara.maxkey.util.StrUtils;
 import org.dromara.maxkey.web.WebContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.http.ResponseEntity;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Date;
 import java.util.List;
 
 @RestController
@@ -48,9 +44,6 @@ public class SynchronizersController {
     @Autowired
     SynchronizersService synchronizersService;
 
-    @Autowired
-    SyncJobConfigFieldService syncJobConfigFieldService;
-
     @RequestMapping(value = {"/fetch"}, produces = {MediaType.APPLICATION_JSON_VALUE})
     @ResponseBody
     public Message<?> fetch(Synchronizers synchronizers, @CurrentUser UserInfo currentUser) {
@@ -61,8 +54,8 @@ public class SynchronizersController {
     }
 
     @RequestMapping(value = {"/get/{id}"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<?> get(@PathVariable String id) {
-        Synchronizers synchronizers = synchronizersService.get(id);
+    public Message<?> get(@PathVariable String id, @CurrentUser UserInfo currentUser) {
+        Synchronizers synchronizers = synchronizersService.get(id,currentUser.getInstId());
         synchronizers.setCredentials(PasswordReciprocal.getInstance().decoder(synchronizers.getCredentials()));
         return new Message<>(synchronizers);
     }
@@ -97,9 +90,9 @@ public class SynchronizersController {
 
     @ResponseBody
     @RequestMapping(value = {"/delete"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<?> delete(@RequestParam List<String> ids) {
+    public Message<?> delete(@RequestParam List<String> ids, @CurrentUser UserInfo currentUser) {
         logger.debug("-delete  ids : {} ", ids);
-        if (synchronizersService.deleteBatch(ids)) {
+        if (synchronizersService.deleteBatch(ids,currentUser.getInstId())) {
             return new Message<Connectors>(Message.SUCCESS);
         } else {
             return new Message<Connectors>(Message.FAIL);
@@ -108,13 +101,13 @@ public class SynchronizersController {
 
     @ResponseBody
     @RequestMapping(value = {"/synchr"})
-    public Message<?> synchr(@RequestParam String id) {
+    public Message<?> synchr(@RequestParam String id, @CurrentUser UserInfo currentUser) {
         logger.debug("-sync ids : {}", id);
 
         List<String> ids = StrUtils.string2List(id, ",");
         try {
             for (String sysId : ids) {
-                Synchronizers synchronizer = synchronizersService.get(sysId);
+                Synchronizers synchronizer = synchronizersService.get(sysId,currentUser.getInstId());
                 synchronizer.setCredentials(PasswordReciprocal.getInstance().decoder(synchronizer.getCredentials()));
                 logger.debug("synchronizer {}", synchronizer);
                 ISynchronizerService synchronizerService = WebContext.getBean(synchronizer.getService(), ISynchronizerService.class);
@@ -133,53 +126,4 @@ public class SynchronizersController {
         return new Message<Synchronizers>(Message.SUCCESS);
     }
 
-
-    @RequestMapping(value = {"/mapping-list/{jobId}"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    @ResponseBody
-    public ResponseEntity<?> mapping(@PathVariable Long jobId) {
-        logger.debug("mapping {}", jobId);
-        List<SyncJobConfigField> syncJobConfigFields = syncJobConfigFieldService.findByJobId(jobId);
-        return new Message<>(syncJobConfigFields).buildResponse();
-    }
-
-    @RequestMapping(value = {"/mapping-get/{id}"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    @ResponseBody
-    public ResponseEntity<?> mappingGet(@PathVariable Long id) {
-        logger.debug("mapping get {}", id);
-        SyncJobConfigField syncJobConfigFields = syncJobConfigFieldService.get(String.valueOf(id));
-        return new Message<>(syncJobConfigFields).buildResponse();
-    }
-
-    @RequestMapping(value = {"/mapping-delete/{id}"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    @ResponseBody
-    public ResponseEntity<?> mappingDelete(@PathVariable Long id) {
-        logger.debug("mappingDelete {}", id);
-        syncJobConfigFieldService.deleteFieldMapById(id);
-        return new Message<SyncJobConfigField>(Message.SUCCESS).buildResponse();
-    }
-
-    @ResponseBody
-    @PostMapping(value = {"/mapping-add"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public ResponseEntity<?> mappingadd(@RequestBody SyncJobConfigField syncJobConfigField, @CurrentUser UserInfo currentUser) {
-        logger.debug("-mapping add  : {}", syncJobConfigField);
-        syncJobConfigField.setCreateTime(new Date());
-        if (syncJobConfigFieldService.insert(syncJobConfigField)) {
-            return new Message<Synchronizers>(Message.SUCCESS).buildResponse();
-        } else {
-            return new Message<Synchronizers>(Message.FAIL).buildResponse();
-        }
-    }
-
-    @ResponseBody
-    @PutMapping(value = {"/mapping-update"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public ResponseEntity<?> mappingupdate(@RequestBody SyncJobConfigField syncJobConfigField, @CurrentUser UserInfo currentUser) {
-        logger.debug("-mapping update  : {}", syncJobConfigField);
-        syncJobConfigField.setUpdateTime(new Date());
-        if (syncJobConfigFieldService.update(syncJobConfigField)) {
-            return new Message<Synchronizers>(Message.SUCCESS).buildResponse();
-        } else {
-            return new Message<Synchronizers>(Message.FAIL).buildResponse();
-        }
-    }
-
 }

+ 4 - 4
maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/controller/AccountsController.java → maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/idm/controller/AccountsController.java

@@ -15,7 +15,7 @@
  */
  
 
-package org.dromara.maxkey.web.controller;
+package org.dromara.maxkey.web.idm.controller;
 
 import java.util.List;
 
@@ -86,8 +86,8 @@ public class AccountsController {
     }
 
     @GetMapping(value = { "/get/{id}" }, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<Accounts> get(@PathVariable String id) {
-        Accounts account=accountsService.get(id);
+    public Message<Accounts> get(@PathVariable String id,@CurrentUser UserInfo currentUser) {
+        Accounts account=accountsService.get(id,currentUser.getInstId());
         account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(account.getRelatedPassword()));
         return new Message<>(account);
     }
@@ -157,7 +157,7 @@ public class AccountsController {
     public Message<Accounts> delete(@RequestParam List<String> ids,@CurrentUser UserInfo currentUser) {
         _logger.debug("-delete ids : {} " , ids);
         
-        if (accountsService.deleteBatch(ids)) {
+        if (accountsService.deleteBatch(ids,currentUser.getInstId())) {
             systemLog.insert(
                     ConstsEntryType.ACCOUNT, 
                     ids,