|
@@ -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 {
|