Merge remote-tracking branch 'origin/main'

main
xueqingkun 11 months ago
commit da855006a9

@ -1,13 +1,15 @@
package com.supervision.controller;
import cn.hutool.core.util.StrUtil;
import com.supervision.exception.BusinessException;
import com.supervision.service.AskService;
import com.supervision.vo.RoundTalkReqVO;
import com.supervision.vo.RoundTalkResVO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.C;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
@ -17,9 +19,12 @@ public class AskController {
private final AskService askService;
@ApiOperation("开启一个文化")
@GetMapping("ask")
public void ask(String sessionId,String question){
askService.ask(sessionId, question);
@ApiOperation("多轮对话")
@PostMapping("roundTalk")
public RoundTalkResVO roundTalk(@RequestBody RoundTalkReqVO roundTalkReqVO) {
if (StrUtil.isBlank(roundTalkReqVO.getSessionId())) {
throw new BusinessException("会话ID不能为空");
}
return askService.roundTalk(roundTalkReqVO);
}
}

@ -0,0 +1,13 @@
package com.supervision.dto.roundAsk;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class EntityQuestionDTO {
private String currentEntityType;
private String currentQuestion;
}

@ -1,10 +1,12 @@
package com.supervision.dto.roundAsk;
import com.supervision.ngbatis.domain.tag.Condition;
import com.supervision.ngbatis.domain.tag.ItemLeaf;
import lombok.Data;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Data
public class SessionParamDTO {
@ -25,9 +27,9 @@ public class SessionParamDTO {
private String intent;
/**
* ,
* ,,
*/
private String entityValueByExtract;
private List<String> entityValueByExtract;
/**
*
@ -41,5 +43,25 @@ public class SessionParamDTO {
*/
private Map<String, ItemLeaf> waitMatchItemLeafMap;
/**
*
*/
private Set<String> alreadyMatchEntitySet;
/**
* (,key,,)
*/
private Map<String, List<List<Condition>>> conditionPathMap;
/**
* ,key,value
*/
private Map<String, Integer> entityCountMap;
/**
* ()
*/
private EntityQuestionDTO currentEntity;
}

@ -0,0 +1,38 @@
package com.supervision.enums;
/**
* map
*/
public enum EntityQuestionEnum {
("户口所在地","请问户口所在地是哪里?"),
("缴费年限","请问缴费年限多少年?"),
退("退休类型","请问您社保类型是城乡居民还是企业职工?"),
("年龄","您现在年龄是多少岁?"),
("异地社保转入情况","您的异地社保是否已经转入?");
private String entityType;
private String question;
EntityQuestionEnum(String entityType, String question) {
this.entityType = entityType;
this.question = question;
}
public String getEntityType() {
return entityType;
}
public String getQuestion() {
return question;
}
public static String getQuestionByEntityType(String entityType) {
for (EntityQuestionEnum entityQuestionEnum : EntityQuestionEnum.values()) {
if (entityQuestionEnum.getEntityType().equals(entityType)) {
return entityQuestionEnum.getQuestion();
}
}
return null;
}
}

@ -20,13 +20,13 @@ public class ConditionJudgeHandler {
public String conditionJudge(String question, Collection<String> candidateAnswerList, String userAnswer) {
List<MessageDTO> messageList = new ArrayList<>();
messageList.add(new MessageDTO("system", "你是一个条件判断模型且精通政务事项,我现在给你一个问题,给你候选答案,请你根据用户的实际回答,从候选答案中给我选择一个对应的候选答案.除了候选答案,什么其他的都不要说"));
messageList.add(new MessageDTO("system", "你是一个条件判断模型且精通政务事项,我现在给你一个问题,给你候选答案,请你根据用户的实际回答,从候选答案中给我选择一个对应的候选答案.除了候选答案,什么其他的都不要说."));
messageList.add(new MessageDTO("assistant", "好的"));
messageList.add(new MessageDTO("user", StrUtil.format("问题:[{}]", question)));
messageList.add(new MessageDTO("assistant", "继续"));
messageList.add(new MessageDTO("user", StrUtil.format("候选答案:[{};未找到匹配答案]", StrUtil.join(";", candidateAnswerList))));
messageList.add(new MessageDTO("assistant", "继续"));
messageList.add(new MessageDTO("user", StrUtil.format("用户答案:[{}],现在请给我匹配的候选答案,其他什么都不要说.", userAnswer)));
messageList.add(new MessageDTO("user", StrUtil.format("用户答案:[{}],现在请给我匹配的候选答案,其他什么都不要说.如果有多个候选答案,用;号分割", userAnswer)));
return AiUtil.chatByMessage(messageList);
}
}

@ -1,14 +1,15 @@
package com.supervision.handler.gpt;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.supervision.ai.AiUtil;
import com.supervision.ai.dto.MessageDTO;
import com.supervision.exception.ItemExtractException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
/**
* Handler
@ -17,17 +18,50 @@ import java.util.List;
@Component
public class ItemExtractHandler {
/**
*
*
* @param question
* @return
*/
public String itemExtract(String question) {
List<MessageDTO> messageList = new ArrayList<>();
messageList.add(new MessageDTO("system", "假设你是一个命名实体识别模型且精通社保实体识别." +
"现在我会给你一个句子,请根据我的要求识别出句子中的实体数据在社保业务中属于哪一类业务事项,并给我事项名称,如果未找到事项,就回复:未找到;其他什么都不要说!"));
messageList.add(new MessageDTO("assistant", "好的"));
messageList.add(new MessageDTO("user", "句子是:" + question + ";请识别这句话中的社保业务事项"));
messageList.add(new MessageDTO("user", "句子是:" + question + ";请识别这句话中的社保业务事项.除了识别到的业务事项,其他什么都不要说"));
String item = AiUtil.chatByMessage(messageList);
if (StrUtil.equals("未找到", item)) {
throw new ItemExtractException("未从问题中找到事项");
}
return item;
}
/**
* ,
*
* @param question
* @return
*/
public List<String> itemExtractByPossibleItem(String question, Collection<String> possible) {
// TODO 这里暂时没办法,暂时先当做是退休
// List<MessageDTO> messageList = new ArrayList<>();
// messageList.add(new MessageDTO("system", "假设你是一个命名实体识别模型且精通社保实体识别." +
// "现在我会给你一个句子,请根据我的要求识别出句子中的实体数据在社保业务中属于哪一类业务事项,并给我事项名称,同时,我会给你一些事项可供参考,尽量从这些事项中进行匹配.如果未找到事项,就回复:未找到;其他什么都不要说!"));
// messageList.add(new MessageDTO("assistant", "好的"));
// messageList.add(new MessageDTO("user", StrUtil.format("可能的事项有:[{}]", CollUtil.join(possible, ";"))));
// messageList.add(new MessageDTO("user", "句子是:" + question + ";请识别这句话中的社保业务事项,如果识别出多个,请用;分隔.除了识别到的业务事项,其他什么都不要说"));
// log.info("itemExtractByPossibleItem查询语句为:{}", JSONUtil.toJsonStr(messageList));
// String item = AiUtil.chatByMessage(messageList);
// if (StrUtil.equals("未找到", item)) {
// throw new ItemExtractException("未从问题中找到事项");
// }
// if (StrUtil.contains(item, ";")){
// return Arrays.asList(item.split(";"));
// }
// return Collections.singletonList(item);
return Collections.singletonList("退休");
}
}

@ -73,7 +73,7 @@ public class FindConditionPathHandler {
if (CollUtil.isNotEmpty(nextVertxList)) {
for (Condition nextVertex : nextVertxList) {
jGraph.addVertex(nextVertex);
jGraph.addEdge(nextVertex, nextVertex);
jGraph.addEdge(source, nextVertex);
}
recursionFindNext(nextVertxList, jGraph, finalVertexSet, recursionCount);
} else {

@ -11,6 +11,8 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* ,
@ -22,28 +24,55 @@ public class FindItemNodeHandler {
@Resource
private CommonQueryDao commonQueryDao;
public List<ItemLeaf> findAllMatchLeafNode(String itemName) {
log.info("根据事项名称{}寻找可能匹配的节点", itemName);
// 首先查询叶子节点的数据,如果有,就直接按照叶子节点的数据来匹配
List<ItemLeaf> leafList = commonQueryDao.findItemLeafNodeVertexByItemName(itemName);
if (CollUtil.isEmpty(leafList)) {
List<ItemBranch> itemBranchNodeVertexByItemName = commonQueryDao.findItemBranchNodeVertexByItemName(itemName);
// 如果分支节点不为空,那么就从分支节点去找叶子节点
if (CollUtil.isNotEmpty(itemBranchNodeVertexByItemName)) {
List<ItemLeaf> leafListTemp = new ArrayList<>();
// 遍历分支节点,找到叶子节点
for (ItemBranch itemBranch : itemBranchNodeVertexByItemName) {
List<ItemLeaf> itemLeafByBranchId = commonQueryDao.findItemLeafByBranchId(itemBranch.getVid());
if (CollUtil.isNotEmpty(itemLeafByBranchId)) {
leafListTemp.addAll(itemLeafByBranchId);
/**
*
*
* @param itemNameList
* @return
*/
public List<ItemLeaf> findAllMatchLeafNode(List<String> itemNameList) {
log.info("根据事项名称{}寻找可能匹配的节点", CollUtil.join(itemNameList, ";"));
List<ItemLeaf> matchLeafNodeList = new ArrayList<>();
for (String itemName : itemNameList) {
// 首先查询叶子节点的数据,如果有,就直接按照叶子节点的数据来匹配
List<ItemLeaf> leafList = commonQueryDao.findItemLeafNodeVertexByItemName(itemName);
if (CollUtil.isEmpty(leafList)) {
List<ItemBranch> itemBranchNodeVertexByItemName = commonQueryDao.findItemBranchNodeVertexByItemName(itemName);
// 如果分支节点不为空,那么就从分支节点去找叶子节点
if (CollUtil.isNotEmpty(itemBranchNodeVertexByItemName)) {
List<ItemLeaf> leafListTemp = new ArrayList<>();
// 遍历分支节点,找到叶子节点
for (ItemBranch itemBranch : itemBranchNodeVertexByItemName) {
List<ItemLeaf> itemLeafByBranchId = commonQueryDao.findItemLeafByBranchId(itemBranch.getVid());
if (CollUtil.isNotEmpty(itemLeafByBranchId)) {
leafListTemp.addAll(itemLeafByBranchId);
}
}
leafList.addAll(leafListTemp);
}
leafList.addAll(leafListTemp);
}
matchLeafNodeList.addAll(leafList);
}
if (CollUtil.isEmpty(leafList)) {
if (CollUtil.isEmpty(matchLeafNodeList)) {
throw new ItemNotFoundException("未找到与事项匹配的节点");
}
return leafList;
return matchLeafNodeList;
}
/**
* ,
*
* @return
*/
public List<String> findAllItemNode() {
log.info("寻找可能匹配的节点");
// 首先查询叶子节点的数据,如果有,就直接按照叶子节点的数据来匹配
List<ItemLeaf> leafList = commonQueryDao.findAllItemLeafNodeVertex();
List<ItemBranch> allItemBranchNodeVertex = commonQueryDao.findAllItemBranchNodeVertex();
List<String> itemNameList = leafList.stream().map(ItemLeaf::getItemName).distinct().collect(Collectors.toList());
Set<String> branchNodeName = allItemBranchNodeVertex.stream().map(ItemBranch::getItemName).collect(Collectors.toSet());
itemNameList.addAll(branchNodeName);
return itemNameList;
}
}

@ -44,6 +44,13 @@ public interface CommonQueryDao {
*/
List<ItemLeaf> findItemLeafNodeVertexByItemName(@Param("itemName") String itemName);
/**
*
*
* @return
*/
List<ItemLeaf> findAllItemLeafNodeVertex();
/**
* ,
*
@ -52,6 +59,13 @@ public interface CommonQueryDao {
*/
List<ItemBranch> findItemBranchNodeVertexByItemName(@Param("itemName") String itemName);
/**
*
*
* @return
*/
List<ItemBranch> findAllItemBranchNodeVertex();
/**
* ,
*

@ -1,6 +1,10 @@
package com.supervision.service;
import com.supervision.vo.RoundTalkReqVO;
import com.supervision.vo.RoundTalkResVO;
import org.springframework.web.bind.annotation.RequestBody;
public interface AskService {
void ask(String sessionId,String question);
RoundTalkResVO roundTalk(RoundTalkReqVO roundTalkReqVO);
}

@ -4,8 +4,12 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.supervision.dto.roundAsk.EntityQuestionDTO;
import com.supervision.dto.roundAsk.ItemNodeDTO;
import com.supervision.dto.roundAsk.SessionParamDTO;
import com.supervision.enums.EntityQuestionEnum;
import com.supervision.exception.BusinessException;
import com.supervision.handler.gpt.ConditionJudgeHandler;
import com.supervision.handler.gpt.IdentifyIntentHandler;
import com.supervision.handler.gpt.ItemExtractHandler;
import com.supervision.handler.graph.FindConditionPathHandler;
@ -13,10 +17,13 @@ import com.supervision.handler.graph.FindItemNodeHandler;
import com.supervision.ngbatis.domain.tag.Condition;
import com.supervision.ngbatis.domain.tag.ItemLeaf;
import com.supervision.service.AskService;
import com.supervision.vo.RoundTalkReqVO;
import com.supervision.vo.RoundTalkResVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.*;
import java.util.function.Function;
@ -37,32 +44,38 @@ public class AskServiceImpl implements AskService {
private final FindConditionPathHandler findConditionPathHandler;
private final ConditionJudgeHandler conditionJudgeHandler;
private static final String SESSION_PARAM = "KBQA:ASK:SESSION_PARAM:";
@Override
public void ask(String sessionId, String question) {
public RoundTalkResVO roundTalk(RoundTalkReqVO roundTalkReqVO) {
String sessionId = roundTalkReqVO.getSessionId();
// 去Redis中,首先判断session处在哪个阶段,是否有识别的意图
Object cache = redisTemplate.opsForValue().get(SESSION_PARAM + sessionId);
SessionParamDTO sessionParamDTO;
if (ObjectUtil.isEmpty(cache)) {
sessionParamDTO = new SessionParamDTO();
sessionParamDTO.setOriginalQuestion(question);
sessionParamDTO.setOriginalQuestion(roundTalkReqVO.getUserTalk());
sessionParamDTO.setSessionId(sessionId);
sessionParamDTO.setAlreadyMatchEntitySet(new HashSet<>());
redisTemplate.opsForValue().set(SESSION_PARAM + sessionId, sessionParamDTO);
} else {
sessionParamDTO = BeanUtil.toBean(cache, SessionParamDTO.class);
}
// 判断意图是否为空,如果意图为空,进行识别意图
if (StrUtil.isBlank(sessionParamDTO.getIntent())) {
String intent = identifyIntentHandler.identifyIntent(question);
String intent = identifyIntentHandler.identifyIntent(roundTalkReqVO.getUserTalk());
sessionParamDTO.setIntent(intent);
redisTemplate.opsForValue().set(SESSION_PARAM + sessionId, sessionParamDTO);
}
// 识别出来意图之后,再去判断是否识别过实体
if (StrUtil.isBlank(sessionParamDTO.getEntityValueByExtract())) {
// 识别实体
String extractValue = itemExtractHandler.itemExtract(sessionParamDTO.getOriginalQuestion());
if (CollUtil.isEmpty(sessionParamDTO.getEntityValueByExtract())) {
// 识别实体(先从图中获取所有的节点名称,然后识别)
List<String> allItemNode = findItemNodeHandler.findAllItemNode();
List<String> extractValue = itemExtractHandler.itemExtractByPossibleItem(sessionParamDTO.getOriginalQuestion(), allItemNode);
sessionParamDTO.setEntityValueByExtract(extractValue);
// 根据提取的内容,开始在知识图谱中寻找节点(首先找叶子节点,如果叶子节点有数据,直接返回,如果叶子节点没数据,再去找分支节点)
List<ItemLeaf> allMatchLeafNode = findItemNodeHandler.findAllMatchLeafNode(extractValue);
@ -74,18 +87,21 @@ public class AskServiceImpl implements AskService {
} else {
// 如果不等于1,说明可能有不确定的节点,这时就要开始找节点
Map<String, ItemLeaf> waitMatchItemLeafMap = allMatchLeafNode.stream().collect(Collectors.toMap(ItemLeaf::getVid, Function.identity(), (k1, k2) -> k1));
sessionParamDTO.setWaitMatchItemLeafMap(waitMatchItemLeafMap);
// 开始寻找条件路径
Set<String> itemLeafIdSet = waitMatchItemLeafMap.keySet();
// 所有的实体类型以及出现次数计数
Map<String, Integer> entityCountMap = new HashMap<>();
// 用来存放所有的节点以及节点路径(key是节点ID,value是节点路径)
Map<String, List<List<Condition>>> conditionPathMap = new HashMap<>();
for (String leafId : itemLeafIdSet) {
// 进行遍历.寻找所有的路径
for (String leafId : waitMatchItemLeafMap.keySet()) {
List<List<Condition>> conditionPath = findConditionPathHandler.findConditionPath(leafId);
if (CollUtil.isEmpty(conditionPath)) {
waitMatchItemLeafMap.remove(leafId);
} else {
// 如果路径不为空,则放到缓存中去
conditionPathMap.put(leafId, conditionPath);
// 然后根据条件进行计数
for (List<Condition> conditions : conditionPath) {
for (Condition condition : conditions) {
// 如果不存在,就添加进计数.如果存在,就+1
@ -94,7 +110,121 @@ public class AskServiceImpl implements AskService {
}
}
}
// 缓存到Redis中
sessionParamDTO.setWaitMatchItemLeafMap(waitMatchItemLeafMap);
sessionParamDTO.setConditionPathMap(conditionPathMap);
sessionParamDTO.setEntityCountMap(entityCountMap);
redisTemplate.opsForValue().set(SESSION_PARAM + sessionId, sessionParamDTO);
}
}
// 如果判断过实体,这时就要判断是否已经确认了节点,如果没有确认,在这里进行确认
match:
if (ObjectUtil.isEmpty(sessionParamDTO.getMatchItemLeaf())) {
// 如果没有确定节点,且没有路径可供匹配,抛出异常
if (CollUtil.isEmpty(sessionParamDTO.getConditionPathMap())) {
throw new BusinessException("未找到条件判断路径");
}
// 判断待匹配的节点是不是只有一个了,如果有多个,就从路径中选择一个问题问前端
if (sessionParamDTO.getWaitMatchItemLeafMap().size() != 1) {
if (ObjectUtil.isNotEmpty(sessionParamDTO.getCurrentEntity())) {
// 如果当前对话实体不为空,说明当前问答就是上一个问题的回复,这个时候,就去GPT中进行匹配
// 遍历所有的path,找到回答
Map<String, List<List<Condition>>> conditionPathMap = sessionParamDTO.getConditionPathMap();
Set<String> possibleAnswerSet = new HashSet<>();
for (Map.Entry<String, List<List<Condition>>> entry : conditionPathMap.entrySet()) {
List<List<Condition>> conditionPath = entry.getValue();
// 遍历所有的路径,找到回答
for (List<Condition> conditions : conditionPath) {
// 遍历所有的条件,找到回答
for (Condition condition : conditions) {
// 如果当前对话实体和条件中的实体类型相同,就添加到possibleAnswerSet中
if (sessionParamDTO.getCurrentEntity().getCurrentEntityType().equals(condition.getEntityType())) {
possibleAnswerSet.add(condition.getCondition());
}
}
}
}
String judgeResult = conditionJudgeHandler.conditionJudge(sessionParamDTO.getCurrentEntity().getCurrentQuestion(), possibleAnswerSet, roundTalkReqVO.getUserTalk());
Set<String> judgeResultSet = new HashSet<>(Arrays.asList(judgeResult.split(";")));
// 筛选路径,如果某个路径的结果不在比较结果中,说明这个结果不对,排除这个路径
pathFilterByJudgeResult(sessionParamDTO.getCurrentEntity().getCurrentEntityType(), judgeResultSet, sessionParamDTO);
filterNotMatchNode(sessionParamDTO);
// 加到已匹配的项目
sessionParamDTO.getAlreadyMatchEntitySet().add(sessionParamDTO.getCurrentEntity().getCurrentEntityType());
// 如果排除后只剩一个了,这时跳出多轮问答
if (sessionParamDTO.getWaitMatchItemLeafMap().size() == 1) {
sessionParamDTO.setMatchItemLeaf(sessionParamDTO.getWaitMatchItemLeafMap().values().iterator().next());
break match;
}
}
// 首先获取出现次数最多的实体类型
String mostFrequentType = sessionParamDTO.getEntityCountMap().entrySet().stream()
.filter(entry -> !sessionParamDTO.getAlreadyMatchEntitySet().contains(entry.getKey()))
.max(Map.Entry.comparingByValue(Integer::compareTo))
.map(Map.Entry::getKey).orElseThrow(() -> new BusinessException("未找到条件判断路径"));
// 获取这个类型对应的问题
String question = EntityQuestionEnum.getQuestionByEntityType(mostFrequentType);
Optional.ofNullable(question).orElseThrow(() -> new BusinessException("未找到条件判断路径"));
sessionParamDTO.setCurrentEntity(EntityQuestionDTO.builder().currentEntityType(mostFrequentType).currentQuestion(question).build());
redisTemplate.opsForValue().set(SESSION_PARAM + sessionId, sessionParamDTO);
// 返回这个问题给前端
return RoundTalkResVO.builder().sessionId(sessionId).replyQuestion(question).build();
} else {
// 获取到唯一节点
ItemLeaf itemLeaf = sessionParamDTO.getWaitMatchItemLeafMap().values().stream().findFirst().orElseThrow(() -> new BusinessException("未找到条件判断路径"));
sessionParamDTO.setMatchItemLeaf(itemLeaf);
}
}
// 走到这里,说明就只有一个节点了,那么就可以进行下一步了
log.info("走到这里,说明找到了匹配的节点");
return null;
}
/**
* ,
*/
private void pathFilterByJudgeResult(String entityType, Set<String> judgeResultSet, SessionParamDTO sessionParamDTO) {
Map<String, List<List<Condition>>> conditionPathMap = sessionParamDTO.getConditionPathMap();
for (Map.Entry<String, List<List<Condition>>> entry : conditionPathMap.entrySet()) {
List<List<Condition>> conditionPath = entry.getValue();
// 遍历所有的路径,找到回答
for (int i = 0; i < conditionPath.size(); i++) {
List<Condition> conditions = conditionPath.get(i);
// 遍历所有的条件,找到回答
for (Condition condition : conditions) {
// 如果当前对话实体和条件中的实体类型相同,且不在比较结果中,说明这个结果不对,排除这个路径
if (entityType.equals(condition.getEntityType()) && !judgeResultSet.contains(condition.getCondition())) {
conditionPath.remove(i);
}
}
}
}
}
/**
*
*/
private void filterNotMatchNode(SessionParamDTO sessionParamDTO) {
Set<String> emptyPathNodeIdSet = new HashSet<>();
Map<String, List<List<Condition>>> conditionPathMap = sessionParamDTO.getConditionPathMap();
for (Map.Entry<String, List<List<Condition>>> entry : conditionPathMap.entrySet()) {
if (CollUtil.isEmpty(entry.getValue())) {
emptyPathNodeIdSet.add(entry.getKey());
}
}
Map<String, ItemLeaf> waitMatchItemLeafMap = sessionParamDTO.getWaitMatchItemLeafMap();
for (String nodeId : emptyPathNodeIdSet) {
if (emptyPathNodeIdSet.contains(nodeId)) {
waitMatchItemLeafMap.remove(nodeId);
}
}
}
/**
*
*/
private void conditionJudge(String question, Collection<String> candidateAnswerList, String userAnswer) {
}
}

@ -0,0 +1,11 @@
package com.supervision.vo;
import lombok.Data;
@Data
public class RoundTalkReqVO {
private String sessionId;
private String userTalk;
}

@ -0,0 +1,15 @@
package com.supervision.vo;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class RoundTalkResVO {
private String sessionId;
private String replyQuestion;
private String answerText;
}

@ -5,7 +5,8 @@
</select>
<select id="findNextConditionByConditionEdge" resultType="com.supervision.ngbatis.domain.tag.Condition">
GO FROM "${vid}" OVER condition_edge YIELD properties($$).entity_type AS entity_type, properties($$).condition AS condition, id($$) AS id;
GO FROM "${vid}" OVER condition_edge YIELD properties($$).entity_type AS entity_type, properties($$).condition
AS condition, id($$) AS id;
</select>
<select id="findConditionVertexByLeafVertex" resultType="com.supervision.ngbatis.domain.tag.ProcessCondition">
@ -20,6 +21,14 @@
MATCH (v:item_leaf) WHERE v.item_leaf.item_name == "${itemName}" RETURN v;
</select>
<select id="findAllItemLeafNodeVertex" resultType="com.supervision.ngbatis.domain.tag.ItemLeaf">
MATCH (v:item_leaf) RETURN v;
</select>
<select id="findAllItemBranchNodeVertex" resultType="com.supervision.ngbatis.domain.tag.ItemBranch">
MATCH (v:item_branch) RETURN v;
</select>
<select id="findItemLeafByBranchId" resultType="com.supervision.ngbatis.domain.tag.ItemLeaf">
MATCH (b:item_branch)-[r:dependence_edge*]->(v:item_leaf) WHERE id(b) == "${branchVId}" RETURN DISTINCT v;
</select>"

Loading…
Cancel
Save