Selaa lähdekoodia

同步问题修改

mazq 1 vuosi sitten
vanhempi
sitoutus
78813d8f21

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 231 - 218
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/sub/business/impl/SubSyncBusinessImpl.java


+ 1 - 0
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/sub/service/impl/AuthOrgInfoService.java

@@ -116,6 +116,7 @@ public class AuthOrgInfoService implements IAuthOrgInfoService {
             //删除机构信息
             if(BooleanEnum.TRUE.value.equals(e.getDeleted()) && exist != null) {
                 orgInfoRepository.deleteById(exist.getId());
+                exist.setDeleted(BooleanEnum.TRUE.value);
                 list.add(exist);
                 continue ;
             }

+ 5 - 3
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/sub/service/impl/AuthOrgTreeServiceImpl.java

@@ -95,17 +95,19 @@ public class AuthOrgTreeServiceImpl implements IAuthOrgTreeService {
         }
     }
     private void updateTask(List<String> updateOrgCodes, List<AuthOrgInfo> delOrgInfos) {
+        // 被删除的上机构(如果上级机构没有一起被删除的话)也需要加入更新的机构集合中
+        ArrayList<String> cpUpdateOrgCodes = new ArrayList<>(updateOrgCodes);
         // 被删除的上机构(如果上级机构没有一起被删除的话)也需要加入更新的机构集合中
         List<String> delUpOrgCodes = delOrgInfos.stream()
                 .map(AuthOrgInfo::getUpGovCode)
                 .distinct()
                 .collect(Collectors.toList());
-        updateOrgCodes.addAll(delUpOrgCodes);
-        List<AuthOrgInfo> updateOrgInfos = authOrgInfoService.getOrgByCodes(updateOrgCodes);
+        cpUpdateOrgCodes.addAll(delUpOrgCodes);
+        List<AuthOrgInfo> updateOrgInfos = authOrgInfoService.getOrgByCodes(cpUpdateOrgCodes);
         //构建需要更新的树节点
         List<OrgTreeNodeDTO> treeNods = getTreeNods(updateOrgInfos);
 
-        List<AuthOrgInfo> childInfos = authOrgInfoService.getChildByCodes(updateOrgCodes);
+        List<AuthOrgInfo> childInfos = authOrgInfoService.getChildByCodes(cpUpdateOrgCodes);
         Map<String, List<AuthOrgInfo>> childIdGroup = childInfos
                 .stream()
                 .collect(Collectors.groupingBy(AuthOrgInfo::getUpGovId));

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä