|
@@ -74,6 +74,7 @@ public class ChatServiceImpl implements ChatService {
|
|
} else {
|
|
} else {
|
|
// 查询历史对话是否存在
|
|
// 查询历史对话是否存在
|
|
LambdaQueryWrapper<ChatHistory> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ChatHistory> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(ChatHistory::getDel_flag, -1);
|
|
wrapper.eq(ChatHistory::getHistory_code, history_code);
|
|
wrapper.eq(ChatHistory::getHistory_code, history_code);
|
|
ChatHistory historyDetail = chatHistoryDao.selectOne(wrapper);
|
|
ChatHistory historyDetail = chatHistoryDao.selectOne(wrapper);
|
|
if (historyDetail == null) throw new CustException("history_code 不存在,请重新创建");
|
|
if (historyDetail == null) throw new CustException("history_code 不存在,请重新创建");
|
|
@@ -97,6 +98,7 @@ public class ChatServiceImpl implements ChatService {
|
|
|
|
|
|
// [DB] 查询对话历史记录 (按时间升序排序,最新的在最后面) (用于对话上下文)
|
|
// [DB] 查询对话历史记录 (按时间升序排序,最新的在最后面) (用于对话上下文)
|
|
LambdaQueryWrapper<Chat> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Chat> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(Chat::getDel_flag, -1);
|
|
wrapper.eq(Chat::getHistory_code, finalHistory_code);
|
|
wrapper.eq(Chat::getHistory_code, finalHistory_code);
|
|
wrapper.orderByDesc(Chat::getCreate_time);
|
|
wrapper.orderByDesc(Chat::getCreate_time);
|
|
List<Chat> chatList = chatDao.selectList(wrapper);
|
|
List<Chat> chatList = chatDao.selectList(wrapper);
|
|
@@ -156,12 +158,15 @@ public class ChatServiceImpl implements ChatService {
|
|
@Override
|
|
@Override
|
|
public PageEntity selectChatList(String history_code) {
|
|
public PageEntity selectChatList(String history_code) {
|
|
|
|
|
|
- ChatHistory chatHistory = chatHistoryDao.selectOne(new LambdaQueryWrapper<ChatHistory>().eq(ChatHistory::getHistory_code, history_code));
|
|
|
|
|
|
+ ChatHistory chatHistory = chatHistoryDao.selectOne(new LambdaQueryWrapper<ChatHistory>()
|
|
|
|
+ .eq(ChatHistory::getDel_flag, -1)
|
|
|
|
+ .eq(ChatHistory::getHistory_code, history_code));
|
|
if (chatHistory == null) throw new CustException("history_code 不存在");
|
|
if (chatHistory == null) throw new CustException("history_code 不存在");
|
|
|
|
|
|
PageUtils.startPage(); // 分页
|
|
PageUtils.startPage(); // 分页
|
|
LambdaQueryWrapper<Chat> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Chat> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(Chat::getHistory_code, history_code);
|
|
wrapper.eq(Chat::getHistory_code, history_code);
|
|
|
|
+ wrapper.eq(Chat::getDel_flag, -1);
|
|
wrapper.orderByAsc(Chat::getCreate_time);
|
|
wrapper.orderByAsc(Chat::getCreate_time);
|
|
List<Chat> list = chatDao.selectList(wrapper);
|
|
List<Chat> list = chatDao.selectList(wrapper);
|
|
|
|
|