|
@@ -6,6 +6,7 @@ import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.fs.common.exception.CustomException;
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
|
|
|
+import com.fs.doctor.service.IFsDoctorOnlineService;
|
|
|
import com.fs.fastGpt.domain.FastgptChatVoiceHomo;
|
|
import com.fs.fastGpt.domain.FastgptChatVoiceHomo;
|
|
|
import com.fs.fastGpt.mapper.FastgptChatVoiceHomoMapper;
|
|
import com.fs.fastGpt.mapper.FastgptChatVoiceHomoMapper;
|
|
|
import com.fs.fastgptApi.util.AudioUtils;
|
|
import com.fs.fastgptApi.util.AudioUtils;
|
|
@@ -96,6 +97,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
|
@@ -275,6 +277,9 @@ public class Task {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private QwExternalContactMapper qwExternalContactMapper;
|
|
private QwExternalContactMapper qwExternalContactMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsDoctorOnlineService doctorOnlineService;
|
|
|
|
|
+
|
|
|
public static final String SOP_TEMP_VOICE_KEY = "sop:tempVoice";
|
|
public static final String SOP_TEMP_VOICE_KEY = "sop:tempVoice";
|
|
|
|
|
|
|
|
// sop升单客户类型
|
|
// sop升单客户类型
|
|
@@ -2473,4 +2478,19 @@ public class Task {
|
|
|
return sopCompanyUserTaskMapper.insertFsSopCompanyUserTask(fsSopCompanyUserTask);
|
|
return sopCompanyUserTaskMapper.insertFsSopCompanyUserTask(fsSopCompanyUserTask);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 医生在线状态兜底任务
|
|
|
|
|
+ * */
|
|
|
|
|
+ public void updateOfflineDoctors() {
|
|
|
|
|
+ //log.warn("医生在线状态兜底任务执行中...");
|
|
|
|
|
+ //如果某个医生最后心跳时间早于当前时间 90 秒前,就认为他已离线。
|
|
|
|
|
+ LocalDateTime timeout = LocalDateTime.now().minusSeconds(90);
|
|
|
|
|
+ int updated = doctorOnlineService.setOfflineByTimeout(timeout);
|
|
|
|
|
+
|
|
|
|
|
+ if (updated > 0) {
|
|
|
|
|
+ log.info("自动下线 {} 名医生", updated);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|