|
@@ -18,6 +18,7 @@ import com.diagbot.service.KlLibraryInfoService;
|
|
|
import com.diagbot.service.KlRelationService;
|
|
|
import com.diagbot.util.Cn2SpellUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -143,7 +144,8 @@ public class ExportFacade {
|
|
|
List<KlLibraryInfo> libraryInfos = new ArrayList<>();
|
|
|
List<String> names = new ArrayList<>();
|
|
|
for (ExportNode exportNode : nodes) {
|
|
|
- if (!names.contains(exportNode.getName())) {
|
|
|
+ if (StringUtil.isNotBlank(exportNode.getName())
|
|
|
+ && !names.contains(exportNode.getName())) {
|
|
|
KlLibraryInfo klLibraryInfo = new KlLibraryInfo();
|
|
|
klLibraryInfo.setName(exportNode.getName());
|
|
|
klLibraryInfo.setIsConcept(1);
|
|
@@ -239,11 +241,14 @@ public class ExportFacade {
|
|
|
private void import2MySqlR(List<ExportRelation> exportRelations, Integer stype, Integer etype, Map<String, KlConcept> map) {
|
|
|
List<KlRelation> klRelations = new ArrayList<>();
|
|
|
for (ExportRelation exportRelation : exportRelations) {
|
|
|
- KlRelation klRelation = new KlRelation();
|
|
|
- klRelation.setStartId(map.get(exportRelation.getSname() + "_" + stype).getId());
|
|
|
- klRelation.setEndId(map.get(exportRelation.getEname() + "_" + etype).getId());
|
|
|
- klRelation.setRelationId(600);
|
|
|
- klRelations.add(klRelation);
|
|
|
+ if (null != map.get(exportRelation.getSname() + "_" + stype)
|
|
|
+ && null != map.get(exportRelation.getEname() + "_" + etype)) {
|
|
|
+ KlRelation klRelation = new KlRelation();
|
|
|
+ klRelation.setStartId(map.get(exportRelation.getSname() + "_" + stype).getId());
|
|
|
+ klRelation.setEndId(map.get(exportRelation.getEname() + "_" + etype).getId());
|
|
|
+ klRelation.setRelationId(600);
|
|
|
+ klRelations.add(klRelation);
|
|
|
+ }
|
|
|
}
|
|
|
klRelationService.saveBatch(klRelations);
|
|
|
}
|