rgb 6 лет назад
Родитель
Сommit
8f332c0547

+ 1 - 1
knowledgeman-service/src/main/java/com/diagbot/facade/LibraryDetailFacade.java

@@ -120,7 +120,7 @@ public class LibraryDetailFacade extends LibraryDetailServiceImpl {
 		
 		if(libraryDetail!=null&&libraryDetail.getIsDeleted().equals("N")){
 			if(addLibraryDetailVO.getIsTip()==1){
-				throw new CommonException(CommonErrorCode.RPC_ERROR,"根据(术语、术语来源、标题名称)该静态知识已经建立是否覆盖该内容?是,覆盖内容,否,不覆盖。");
+				throw new CommonException(CommonErrorCode.RPC_ERROR,"根据(术语、术语来源、标题名称)该静态知识已经建立,确定要覆盖该内容吗?确定,覆盖内容,取消,不覆盖。");
 			}
 		}
 		

+ 13 - 4
knowledgeman-service/src/main/java/com/diagbot/facade/RelationFacade.java

@@ -183,10 +183,11 @@ public class RelationFacade extends RelationServiceImpl {
 			throw new CommonException(CommonErrorCode.RPC_ERROR,message.toString());
 		}
 		
-		if(ckMap.get("relation")!=null){
-			return saveOrUpdate((Relation)(ckMap.get("relation")));
+		if(ckMap.get("relation")==null){
+			throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已存在");
 		}
-		return true;
+		
+		return saveOrUpdate((Relation)(ckMap.get("relation")));
     }
 	
 	/**
@@ -347,6 +348,10 @@ public class RelationFacade extends RelationServiceImpl {
         	throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
         }
         
+        if(addRelationInfoVOList.size()==0){
+        	throw new CommonException(CommonErrorCode.RPC_ERROR,"导入数据不能为空");
+        }
+        
         /****************excel文件中数据存在重复提示---数据一模一样即重复***********************/
         Map<String,List<AddRelationInfoVO>> addRelationInfoVOListMap = addRelationInfoVOList.stream().collect(Collectors.groupingBy(i->{
         	AddRelationInfoVO addRelationInfoVO = (AddRelationInfoVO)i;
@@ -381,9 +386,13 @@ public class RelationFacade extends RelationServiceImpl {
         	throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
         }
         
+        if(saveOrUpdateRelationList.size()==0){
+        	return true;
+        }
+        
         return relationService.saveOrUpdateBatch(saveOrUpdateRelationList);
     }
-    
+	
     @SuppressWarnings("deprecation")
     private String getValue(Cell cell) {
         try {