ソースを参照

调整同步用户逻辑

zhulu 1 年間 前
コミット
f75a6eca93

+ 11 - 11
soc-modules/soc-modules-sync/src/main/java/com/xunmei/sync/service/impl/FJNXSyncServiceImpl.java

@@ -881,23 +881,23 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
 
             final Integer syncUserOrgLevel = getSyncUserOrgLevel(fjnxOrgOptional.get().getOrgPath(), specialOrgList);
 
-            //省联社下级机关部门下的人,迁移到顶级机构下
-//            if(ObjectUtil.equal(syncUserOrgLevel,1))
-//            {
-//                final Optional<SysOrg> topOrg = existOrgList.stream().filter(x -> x.getParentId().equals(-1L)).findFirst();
-//                if(topOrg.isPresent())
-//                {
-//                    return topOrg.get();
-//                }
-//                return null;
-//            }
+            //省联社下级机关部门下的人,迁移到省联社机构下
+            if(ObjectUtil.equal(syncUserOrgLevel,1))
+            {
+                final Optional<SysOrg> topOrg = existOrgList.stream().filter(x -> ObjectUtil.equal(thirdPartySystemConfig.getFjnxSyncOrgTopOrgCode(),x.getCode())).findFirst();
+                if(topOrg.isPresent())
+                {
+                    return topOrg.get();
+                }
+                return null;
+            }
 
             //办事处机构下,人员迁移到地区行社下
             if(ObjectUtil.equal(syncUserOrgLevel,2))
             {
 //                final String dqhsOrgCode = getUserOwnerBscOrgMapperDqhsOrgCode(fjnxOrgOptional.get().getOrgPath(), specialOrgList);
                 final String dqhsOrgCode = getUserOwnerBscOrgCode(fjnxOrgOptional.get().getOrgPath(), specialOrgList);
-                if(StringUtil.isNullOrEmpty(dqhsOrgCode))
+                if(!StringUtil.isNullOrEmpty(dqhsOrgCode))
                 {
                     return getSysOrgByOrgCode(existOrgList,dqhsOrgCode);
                 }