|
|
@@ -380,7 +380,7 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
|
|
|
}
|
|
|
conversationLimitResponse = isConversationAllowed(userToken, chatgptUser.getLimitNum(), chatgptUser.getLimitTime());
|
|
|
//车队次数记录
|
|
|
- TASK_EXECUTOR.execute(()->{
|
|
|
+ TASK_EXECUTOR.execute(() -> {
|
|
|
cardConversationRecord(carId);
|
|
|
});
|
|
|
}
|
|
|
@@ -546,12 +546,12 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
|
|
|
chatgptCarInfoView.setIsHistory(true);
|
|
|
chatgptCarInfoView.setScore(redisService.zScore(RedisService.key.CHATGPT_CAR_SCORES.getName(), historyView.getCarId()));
|
|
|
String sessionVar = redisService.getStr(RedisService.key.CHATGPT_CAR_SEESSION.getName() + historyView.getCarId());
|
|
|
- if(JSONUtil.isJson(sessionVar)){
|
|
|
+ if (JSONUtil.isJson(sessionVar)) {
|
|
|
JSONObject sessionJson = new JSONObject(sessionVar);
|
|
|
JSONArray models = sessionJson.getJSONArray("models");
|
|
|
- if(models.size() > 1){
|
|
|
+ if (models.size() > 1) {
|
|
|
chatgptCarInfoView.setType("plus");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
chatgptCarInfoView.setType("3.5");
|
|
|
}
|
|
|
}
|
|
|
@@ -660,11 +660,11 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
|
|
|
view.setScore(score);
|
|
|
view.setStatus(score >= 50 ? "繁忙" : "空闲"); // 或“繁忙”
|
|
|
String sessionVar = redisService.getStr(RedisService.key.CHATGPT_CAR_SEESSION.getName() + carId);
|
|
|
- if(JSONUtil.isJson(sessionVar)){
|
|
|
+ if (JSONUtil.isJson(sessionVar)) {
|
|
|
JSONArray models = new JSONObject(sessionVar).getJSONArray("models");
|
|
|
- if(models!= null && models.size() > 1){
|
|
|
+ if (models != null && models.size() > 1) {
|
|
|
view.setType("plus");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
view.setType("3.5");
|
|
|
}
|
|
|
}
|
|
|
@@ -702,15 +702,14 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
|
|
|
@Override
|
|
|
public void genTitleSync(String messageId, String carid, String userToken) {
|
|
|
//同步对话
|
|
|
- ChatgptUserConversationRecord chatgptUserConversationRecord = chatgptUserConversationRecordMapper.selectOne(Wrappers.lambdaQuery(ChatgptUserConversationRecord.class).eq(ChatgptUserConversationRecord::getMessageId, messageId));
|
|
|
- if (chatgptUserConversationRecord != null) {
|
|
|
- if (StringUtils.isBlank(chatgptUserConversationRecord.getConversationId())) {
|
|
|
- ChatgptUserConversation conversation = chatgptUserConversationMapper.selectOne(Wrappers.lambdaQuery(ChatgptUserConversation.class).eq(ChatgptUserConversation::getMessageId, messageId).last(" limit 1"));
|
|
|
- if (conversation != null) {
|
|
|
- chatgptUserConversationRecord.setConversationId(conversation.getConversationId());
|
|
|
- chatgptUserConversationRecordMapper.updateById(chatgptUserConversationRecord);
|
|
|
- }
|
|
|
- }
|
|
|
+ if (!StringUtils.isAnyBlank(messageId, carid, userToken)) {
|
|
|
+ ChatgptUserConversation conversation = chatgptUserConversationMapper.selectOne(Wrappers.lambdaQuery(ChatgptUserConversation.class).eq(ChatgptUserConversation::getMessageId, messageId).last(" limit 1"));
|
|
|
+
|
|
|
+ chatgptUserConversationRecordMapper.update(null, Wrappers.lambdaUpdate(ChatgptUserConversationRecord.class)
|
|
|
+ .set(ChatgptUserConversationRecord::getConversationId, conversation.getConversationId())
|
|
|
+ .eq(ChatgptUserConversationRecord::getMessageId, messageId)
|
|
|
+ .eq(ChatgptUserConversationRecord::getCarId, carid)
|
|
|
+ .eq(ChatgptUserConversationRecord::getUserToken, userToken));
|
|
|
}
|
|
|
}
|
|
|
|