|
|
|
@ -403,10 +403,11 @@ public class ModelRecordTypeServiceImpl extends ServiceImpl<ModelRecordTypeMappe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String addNeo4j(List<String> ids) {
|
|
|
|
|
if (CollUtil.isEmpty(ids)) {
|
|
|
|
|
return "成功插入0条信息";
|
|
|
|
|
public String addNeo4j(List<String> ids, String recordId) {
|
|
|
|
|
if (StrUtil.isBlank(recordId)){
|
|
|
|
|
throw new BusinessException("记录ID不能为空");
|
|
|
|
|
}
|
|
|
|
|
if (CollUtil.isNotEmpty(ids)) {
|
|
|
|
|
List<TripleInfo> tripleInfos = tripleInfoService.listByIds(ids);
|
|
|
|
|
int i = 0;
|
|
|
|
|
for (TripleInfo tripleInfo : tripleInfos) {
|
|
|
|
@ -446,11 +447,8 @@ public class ModelRecordTypeServiceImpl extends ServiceImpl<ModelRecordTypeMappe
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 删除的要进行移除
|
|
|
|
|
Optional<TripleInfo> any = tripleInfos.stream().findAny();
|
|
|
|
|
if (any.isPresent()) {
|
|
|
|
|
TripleInfo anyTripleInfo = any.get();
|
|
|
|
|
String recordId = anyTripleInfo.getRecordId();
|
|
|
|
|
List<TripleInfo> existNeoList = tripleInfoService.lambdaQuery().eq(TripleInfo::getRecordId, recordId).eq(TripleInfo::getAddNeo4j, "1").list();
|
|
|
|
|
Map<String, TripleInfo> existNeoMap = existNeoList.stream().collect(Collectors.toMap(TripleInfo::getId, Function.identity()));
|
|
|
|
|
// 去掉已经添加的
|
|
|
|
@ -483,10 +481,8 @@ public class ModelRecordTypeServiceImpl extends ServiceImpl<ModelRecordTypeMappe
|
|
|
|
|
.set(TripleInfo::getRelGraphId, null)
|
|
|
|
|
.set(TripleInfo::getStartNodeGraphId, null)
|
|
|
|
|
.eq(TripleInfo::getId, needDeleteId).update();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ("成功插入" + i + "条信息");
|
|
|
|
|
return "保存三元组成功";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|