Pārlūkot izejas kodu

术语命名维护用户信息修改

rgb 6 gadi atpakaļ
vecāks
revīzija
1907b7b803

+ 11 - 9
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -142,15 +142,17 @@ public class ConceptFacade extends ConceptServiceImpl {
      */
     public IPage<GetAllInformationDTO> getAllInformation(GetAllInformationVO getAllInformationVO) {
     	IPage<GetAllInformationDTO> ipage = libraryinfoFacade.getAllInformation(getAllInformationVO);
-    	List<String> ids = ipage.getRecords().stream().map(i->i.getOperName()).distinct().collect(Collectors.toList());
-    	RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
-    	if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "获取用户信息失败");
-        }
-    	ipage.getRecords().forEach(i->{
-    		i.setOperName(respDTO.data.get(i.getOperName()));
-    	});
+    	if(ipage.getRecords().size()>0){
+    		List<String> ids = ipage.getRecords().stream().map(i->i.getOperName()).distinct().collect(Collectors.toList());
+    		RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
+        	if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
+                throw new CommonException(CommonErrorCode.RPC_ERROR,
+                        "获取用户信息失败");
+            }
+        	ipage.getRecords().forEach(i->{
+        		i.setOperName(respDTO.data.get(i.getOperName()));
+        	});
+    	}
         return ipage;
     }
     

+ 11 - 9
knowledgeman-service/src/main/java/com/diagbot/facade/LexiconFacade.java

@@ -59,15 +59,17 @@ public class LexiconFacade extends LexiconServiceImpl {
      */
     public IPage<GetLexiconListDTO> getLexiconList(GetLexiconListVO getLexiconListVO) {
     	IPage<GetLexiconListDTO> ipage = this.baseMapper.getLexiconList(getLexiconListVO);
-    	List<String> ids = ipage.getRecords().stream().map(i->i.getModifier()).distinct().collect(Collectors.toList());
-    	RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
-    	if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "获取用户信息失败");
-        }
-    	ipage.getRecords().forEach(i->{
-    		i.setModifier(respDTO.data.get(i.getModifier()));
-    	});
+    	if(ipage.getRecords().size()>0){
+    		List<String> ids = ipage.getRecords().stream().map(i->i.getModifier()).distinct().collect(Collectors.toList());
+        	RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
+        	if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
+                throw new CommonException(CommonErrorCode.RPC_ERROR,
+                        "获取用户信息失败");
+            }
+        	ipage.getRecords().forEach(i->{
+        		i.setModifier(respDTO.data.get(i.getModifier()));
+        	});	
+    	}
         return ipage;
     }