|
|
@@ -187,14 +187,14 @@ public class WebSocketServer {
|
|
|
LiveUserFirstEntry liveUserFirstEntry = liveUserFirstEntryService.selectEntityByLiveIdUserId(liveId, userId);
|
|
|
// 如果用户连上了 socket,并且公司ID和销售ID大于0,更新 LiveWatchLog 的 logType
|
|
|
|
|
|
- if ((companyId > 0 && companyUserId > 0) || (liveUserFirstEntry != null && liveUserFirstEntry.getCompanyId() > 0 && liveUserFirstEntry.getCompanyUserId() > 0 )) {
|
|
|
+ if ((qwUserId > 0 && externalContactId > 0) || (liveUserFirstEntry != null && liveUserFirstEntry.getCompanyId() > 0 && liveUserFirstEntry.getCompanyUserId() > 0 )) {
|
|
|
// 获取当前直播/回放状态
|
|
|
Map<String, Integer> flagMap = liveWatchUserService.getLiveFlagWithCache(liveId);
|
|
|
Integer currentLiveFlag = flagMap.get("liveFlag");
|
|
|
|
|
|
// 如果当前是直播状态(liveFlag = 1),更新 logType
|
|
|
if (currentLiveFlag != null && currentLiveFlag == 1) {
|
|
|
- updateLiveWatchLogTypeOnConnect(liveId, userId, companyId, companyUserId);
|
|
|
+ updateLiveWatchLogTypeOnConnect(liveId, userId, qwUserId, externalContactId);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1144,13 +1144,13 @@ public class WebSocketServer {
|
|
|
* 在连接时更新 LiveWatchLog 的 logType
|
|
|
* 如果 logType 类型不是 2,修改 logType 类型为 1(看课中)
|
|
|
*/
|
|
|
- private void updateLiveWatchLogTypeOnConnect(Long liveId, Long userId, Long companyId, Long companyUserId) {
|
|
|
+ private void updateLiveWatchLogTypeOnConnect(Long liveId, Long userId, Long qwUserId, Long externalContactId) {
|
|
|
try {
|
|
|
LiveWatchLog queryLog = new LiveWatchLog();
|
|
|
queryLog.setLiveId(liveId);
|
|
|
queryLog.setUserId(userId);
|
|
|
- queryLog.setCompanyId(companyId);
|
|
|
- queryLog.setCompanyUserId(companyUserId);
|
|
|
+ queryLog.setQwUserId(String.valueOf(qwUserId));
|
|
|
+ queryLog.setExternalContactId(externalContactId);
|
|
|
|
|
|
List<LiveWatchLog> logs = liveWatchLogService.selectLiveWatchLogList(queryLog);
|
|
|
if (logs != null && !logs.isEmpty()) {
|