Browse Source

sop发送直播间

lmx 10 hours ago
parent
commit
6da3b8ebb2

+ 17 - 0
fs-service/src/main/java/com/fs/live/domain/LiveWatchLog.java

@@ -1,6 +1,8 @@
 package com.fs.live.domain;
 
 import java.util.Date;
+import java.util.Objects;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
@@ -86,4 +88,19 @@ public class LiveWatchLog extends BaseEntity{
      */
     private Integer replayBuy;
 
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        LiveWatchLog that = (LiveWatchLog) obj;
+        return Objects.equals(liveId, that.liveId) &&
+                Objects.equals(externalContactId, that.externalContactId) &&
+                Objects.equals(qwUserId, that.qwUserId);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(liveId, externalContactId, qwUserId);
+    }
+
 }

+ 5 - 0
fs-service/src/main/java/com/fs/sop/params/SendUserLogsInfoMsgParam.java

@@ -36,4 +36,9 @@ public class SendUserLogsInfoMsgParam {
 
     private List<String> qwUserIds; //当isMine为1 需要查询该主体下该员工的营期
 
+    /**
+     * 直播间id
+     */
+    private Long liveId;
+
 }

+ 23 - 1
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -489,6 +489,11 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
     }
     @Override
     public R sendUserLogsInfoMsg(SendUserLogsInfoMsgParam param) {
+        Boolean sendLiveMsg = Boolean.FALSE;
+        if(null != param.getLiveId()){
+            sendLiveMsg = Boolean.TRUE;
+        }
+        Boolean sendLiveMsgFinal = sendLiveMsg;
         QwSop qwSop = qwSopMapper.selectQwSopById(param.getSopId());
         List<FastGptChatReplaceWords> words = fastGptChatReplaceWordsMapper.selectAllFastGptChatReplaceWords();
         String json = configService.selectConfigByKey("course.config");
@@ -578,6 +583,9 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     sopLogs.setCorpId(qwGroupChat.getCorpId());
                     sopLogs.setSort(30000001);
                     sopLogs.setSendType(2);
+                    if(sendLiveMsgFinal){
+                        sopLogs.setSendType(20);
+                    }
                     sopLogs.setExternalUserName(groupUser.getName());
                     sopLogs.setQwUserKey(qwUser.getId());
 
@@ -754,6 +762,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     setting.setVideoId(param.getVideoId());
                     setting.setCourseId(param.getCourseId());
                     setting.setCourseType(param.getCourseType());
+                    setting.setLiveId(param.getLiveId());
                     sopLogs.setContentJson(JSON.toJSONString(setting));
                     return sopLogs;
                 }).filter(Objects::nonNull).collect(Collectors.toList());
@@ -780,6 +789,9 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     sopLogs.setCorpId(groupChat.getCorpId());
                     sopLogs.setSort(2);
                     sopLogs.setSendType(6);
+                    if(sendLiveMsgFinal){
+                        sopLogs.setSendType(20);
+                    }
                     sopLogs.setExternalUserName(groupChat.getName());
                     sopLogs.setQwUserKey(qwUser.getId());
                     // 设置实际发送人
@@ -968,6 +980,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     setting.setVideoId(param.getVideoId());
                     setting.setCourseId(param.getCourseId());
                     setting.setCourseType(param.getCourseType());
+                    setting.setLiveId(param.getLiveId());
                     sopLogs.setContentJson(JSON.toJSONString(setting));
                     return sopLogs;
                 }).collect(Collectors.toList());
@@ -1027,6 +1040,9 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                 sopLogs.setSort(30000000);
                 sopLogs.setSendType(5);
                 sopLogs.setExternalUserName(item.getExternalUserName());
+                   if(sendLiveMsgFinal){
+                       sopLogs.setSendType(20);
+                   }
 
                 QwExternalContact contact = qwExternalContactMapper.selectQwExternalContactByIdForStageStatus(item.getExternalId());
 
@@ -1164,7 +1180,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             st.setContentType("4");
                             String js = configService.selectConfigByKey("his.config");
                             FSSysConfig sysConfig= JSON.parseObject(js,FSSysConfig.class);
-                            //todo 发个人看课记录处理
+                            //发个人看课记录处理
                             try {
                                     createLiveWatchLogAndInsert(qwUser.getCompanyId().toString(), qwUser.getCompanyUserId().toString(),item.getExternalId().toString(),Long.valueOf(st.getLiveId()),sysConfig.getAppId(),2, qwUserId,param.getCorpId());
 
@@ -1299,6 +1315,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                 setting.setVideoId(param.getVideoId());
                 setting.setCourseId(param.getCourseId());
                 setting.setCourseType(param.getCourseType());
+                setting.setLiveId(param.getLiveId());
 
                 try {
                     sopLogs.setQwUserKey(Long.valueOf(qwUserId));
@@ -1458,6 +1475,9 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
 
         // 遍历分组
         int finalSort = sort;
+        if(null != param.getLiveId()){
+            sendType = 20;
+        }
         int finalSendType = sendType;
         groupedLogs.forEach((key, logs) -> {
 
@@ -1546,6 +1566,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
 
             switch (finalSendType){
                 case 5:
+                case 20:
                     List<QwSopCourseFinishTempSetting.Setting> list = processSetting(item,qwUser, param, words, config, qwCompany,companyUserId,companyId,
                             contact,dataTime, finalDomainName,miniMap,companies,sopLogs);
                     setting.setSetting(list);
@@ -1574,6 +1595,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
             setting.setVideoId(param.getVideoId());
             setting.setCourseId(param.getCourseId());
             setting.setCourseType(param.getCourseType());
+            setting.setLiveId(param.getLiveId());
             try {
                 sopLogs.setQwUserKey(qwUser.getId());
             }catch (Exception e){