@ -75,9 +75,6 @@ public class ModelIndexServiceImpl extends ServiceImpl<ModelIndexMapper, ModelIn
@Value ( "${case.evidence.table}" )
private List < String > allowedTables ;
@Value ( "${case.atomic.query}" )
private String queryTemplate ;
@Override
@Transactional ( transactionManager = "dataSourceTransactionManager" , rollbackFor = Exception . class )
public R < ? > selectAll ( ModelIndexReqVO modelIndex , Integer page , Integer size ) {
@ -234,11 +231,11 @@ public class ModelIndexServiceImpl extends ServiceImpl<ModelIndexMapper, ModelIn
Assert . notEmpty ( notePrompt . getEvidenceCategoryId ( ) , "提示词分类为空" ) ;
modelAtomicIndex . setCategoryId ( notePrompt . getEvidenceCategoryId ( ) ) ;
} else if ( StringUtils . equals ( IndexRuleConstants . OPERAND_TYPE_GRAPH , modelAtomicIndex . getIndexSource ( ) ) ) {
Assert . notEmpty ( modelAtomicIndex . get PromptId( ) , "提示词id 不能为空") ;
NotePrompt notePrompt = notePromptService . getBaseMapper ( ) . selectById ( modelAtomicIndex . getPromptId ( ) ) ;
Assert . notNull ( notePrompt , "提示词信息不存在" ) ;
String query = promptGenerateGraphQuery ( notePrompt , queryTemplate ) ;
modelAtomicIndex . setQueryLang ( query ) ;
Assert . notEmpty ( modelAtomicIndex . get QueryLang( ) , "查询语句 不能为空") ;
// NotePrompt notePrompt = notePromptService.getBaseMapper().selectById(modelAtomicIndex.getPromptId());
// Assert.notNull(notePrompt, "提示词信息不存在");
// String query = promptGenerateGraphQuery(notePrompt, queryTemplate);
// modelAtomicIndex.setQueryLang(query);
}
}
@ -256,19 +253,6 @@ public class ModelIndexServiceImpl extends ServiceImpl<ModelIndexMapper, ModelIn
}
}
private String promptGenerateGraphQuery ( NotePrompt prompt , String queryTemplate ) {
if ( null = = prompt | | ! StrUtil . equals ( "2" , prompt . getType ( ) ) ) {
return null ;
}
return StrUtil . format ( queryTemplate ,
new HashMap < String , Object > ( ) { {
put ( "startEntityType" , prompt . getStartEntityType ( ) ) ;
put ( "relType" , prompt . getRelType ( ) ) ;
put ( "endEntityType" , prompt . getEndEntityType ( ) ) ;
} } ) ;
}
@Override
@Transactional ( transactionManager = "dataSourceTransactionManager" , rollbackFor = Exception . class )
public List < CaseAtomicIndexDTO > listCaseAtomicIndex ( String caseId , String indexSource ) {