|
|
@@ -4,7 +4,6 @@ import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.crm.domain.CrmCustomerChatSession;
|
|
|
import com.fs.crm.mapper.CrmCustomerChatSessionMapper;
|
|
|
import com.fs.crm.service.ICrmCustomerChatSessionService;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -17,7 +16,6 @@ import java.util.List;
|
|
|
* @author ylrz
|
|
|
* @date 2026-03-30
|
|
|
*/
|
|
|
-@Slf4j
|
|
|
@Service
|
|
|
public class CrmCustomerChatSessionServiceImpl implements ICrmCustomerChatSessionService {
|
|
|
|
|
|
@@ -64,9 +62,7 @@ public class CrmCustomerChatSessionServiceImpl implements ICrmCustomerChatSessio
|
|
|
if (chatSession.getIsPinned() == null) {
|
|
|
chatSession.setIsPinned(0);
|
|
|
}
|
|
|
- int result = chatSessionMapper.insertChatSession(chatSession);
|
|
|
- log.info("新增会话成功,sessionId: {}", chatSession.getSessionId());
|
|
|
- return result;
|
|
|
+ return chatSessionMapper.insertChatSession(chatSession);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -78,9 +74,7 @@ public class CrmCustomerChatSessionServiceImpl implements ICrmCustomerChatSessio
|
|
|
@Override
|
|
|
public int updateChatSession(CrmCustomerChatSession chatSession) {
|
|
|
chatSession.setUpdateTime(DateUtils.getNowDate());
|
|
|
- int result = chatSessionMapper.updateChatSession(chatSession);
|
|
|
- log.info("更新会话成功,sessionId: {}", chatSession.getSessionId());
|
|
|
- return result;
|
|
|
+ return chatSessionMapper.updateChatSession(chatSession);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -94,11 +88,8 @@ public class CrmCustomerChatSessionServiceImpl implements ICrmCustomerChatSessio
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public int updateChatSessionTitle(Long sessionId, String title) {
|
|
|
try {
|
|
|
- int result = chatSessionMapper.updateChatSessionTitle(sessionId, title);
|
|
|
- log.info("更新会话标题成功,sessionId: {}, title: {}", sessionId, title);
|
|
|
- return result;
|
|
|
+ return chatSessionMapper.updateChatSessionTitle(sessionId, title);
|
|
|
} catch (Exception e) {
|
|
|
- log.error("更新会话标题失败", e);
|
|
|
throw new RuntimeException("更新会话标题失败:" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
@@ -138,9 +129,7 @@ public class CrmCustomerChatSessionServiceImpl implements ICrmCustomerChatSessio
|
|
|
if (sessionIds == null || sessionIds.length == 0) {
|
|
|
return 0;
|
|
|
}
|
|
|
- int result = chatSessionMapper.deleteChatSessionByIds(sessionIds);
|
|
|
- log.info("批量删除会话成功,删除数量:{}", sessionIds.length);
|
|
|
- return result;
|
|
|
+ return chatSessionMapper.deleteChatSessionByIds(sessionIds);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -151,9 +140,7 @@ public class CrmCustomerChatSessionServiceImpl implements ICrmCustomerChatSessio
|
|
|
*/
|
|
|
@Override
|
|
|
public int deleteChatSessionById(Long sessionId) {
|
|
|
- int result = chatSessionMapper.deleteChatSessionById(sessionId);
|
|
|
- log.info("删除会话成功,sessionId: {}", sessionId);
|
|
|
- return result;
|
|
|
+ return chatSessionMapper.deleteChatSessionById(sessionId);
|
|
|
}
|
|
|
|
|
|
@Override
|