|
|
@@ -622,8 +622,10 @@ public class IpadSendServer {
|
|
|
}
|
|
|
|
|
|
boolean noSop = qwSopLogs.getSendType() != 3 && qwSopLogs.getSendType() != 7;
|
|
|
+ // 一键群发直播(20)允许无 expiryTime,默认 12 小时,避免误判删除后连带作废 APP 待发
|
|
|
+ boolean oneClickLive = qwSopLogs.getSendType() != null && qwSopLogs.getSendType() == 20;
|
|
|
|
|
|
- if (qwSopLogs.getExpiryTime() == null && noSop) {
|
|
|
+ if (qwSopLogs.getExpiryTime() == null && noSop && !oneClickLive) {
|
|
|
// 作废消息
|
|
|
log.warn("直播SOP_LOG_ID:{}, 直播SOP任务被删除", qwSopLogs.getId());
|
|
|
qwSopLogsService.updateQwSopLogsByWatchLogType(qwSopLogs.getId(), "直播SOP任务被删除");
|
|
|
@@ -634,7 +636,7 @@ public class IpadSendServer {
|
|
|
LocalDateTime expiryDateTime;
|
|
|
|
|
|
// 判断是否过期
|
|
|
- if(qwSopLogs.getSendType() == 3 || qwSopLogs.getSendType() == 7){
|
|
|
+ if(qwSopLogs.getSendType() == 3 || qwSopLogs.getSendType() == 7 || (oneClickLive && qwSopLogs.getExpiryTime() == null)){
|
|
|
expiryDateTime = sendTime.plusHours(12);
|
|
|
}else{
|
|
|
expiryDateTime = sendTime.plusHours(qwSopLogs.getExpiryTime());
|
|
|
@@ -647,7 +649,11 @@ public class IpadSendServer {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- if (setting.getCourseType() == null && noSop && setting.getType() == 2) {
|
|
|
+ // 纯直播内容(含APP直播24/25)不强制要求课程消息类型
|
|
|
+ boolean hasLiveContent = setting.getSetting() != null && setting.getSetting().stream().anyMatch(s ->
|
|
|
+ "12".equals(s.getContentType()) || "18".equals(s.getContentType()) || "19".equals(s.getContentType())
|
|
|
+ || "20".equals(s.getContentType()) || "24".equals(s.getContentType()) || "25".equals(s.getContentType()));
|
|
|
+ if (setting.getCourseType() == null && noSop && setting.getType() == 2 && !hasLiveContent) {
|
|
|
log.warn("直播SOP_LOG_ID:{}, 模板未选消息类型,不发送", qwSopLogs.getId());
|
|
|
qwSopLogsService.updateQwSopLogsByWatchLogType(qwSopLogs.getId(), "直播模板未选消息类型,不发送");
|
|
|
return false;
|
|
|
@@ -681,7 +687,7 @@ public class IpadSendServer {
|
|
|
);
|
|
|
Integer courseType = setting.getCourseType();
|
|
|
String logId = qwSopLogs.getId();
|
|
|
- if (liveWatchLog != null
|
|
|
+ if (liveWatchLog != null && courseType != null && courseType != 0
|
|
|
&& !QwSopLogsServiceImpl.isCourseTypeValid(courseType, liveWatchLog.getLogType())) {
|
|
|
log.warn("SOP_LOG_ID:{}, 看课状态未满足,不发送", qwSopLogs.getId());
|
|
|
qwSopLogsService.updateQwSopLogsByWatchLogType(logId, "看课状态未满足,不发送");
|
|
|
@@ -794,14 +800,21 @@ public class IpadSendServer {
|
|
|
case "23":
|
|
|
sendAppShortLink(vo, content, miniMap);
|
|
|
break;
|
|
|
+ case "24":
|
|
|
+ // APP直播短链:已标记APP则交 SendAppMsg;未标记则兼容旧数据走企微短链
|
|
|
+ if (qwSopLogs.getIsHaveApp() == 1) {
|
|
|
+ content.setSendStatus(0);
|
|
|
+ content.setSendRemarks("APP待发送");
|
|
|
+ } else {
|
|
|
+ sendAppShortLink(vo, content, miniMap);
|
|
|
+ }
|
|
|
+ break;
|
|
|
case "9":
|
|
|
// APP看课链接
|
|
|
case "15":
|
|
|
// APP文本
|
|
|
case "16":
|
|
|
// APP语音
|
|
|
- case "24":
|
|
|
- // APP直播短链走 OpenIM IM 发送,企微侧跳过,交给 SendAppMsg
|
|
|
case "25":
|
|
|
// APP直播卡片走 OpenIM IM 发送,企微侧跳过,交给 SendAppMsg
|
|
|
content.setSendStatus(0);
|
|
|
@@ -1297,8 +1310,13 @@ public class IpadSendServer {
|
|
|
}
|
|
|
|
|
|
boolean noSop = qwSopLogs.getSendType() != 3 && qwSopLogs.getSendType() != 7;
|
|
|
+ // 一键群发(5/12/20)允许无 expiryTime,默认 12 小时有效,避免被误判为「SOP任务被删除」
|
|
|
+ boolean oneClickSend = qwSopLogs.getSendType() != null
|
|
|
+ && (qwSopLogs.getSendType() == 5 || qwSopLogs.getSendType() == 12 || qwSopLogs.getSendType() == 20);
|
|
|
+ boolean hasAppLiveContent = setting.getSetting() != null
|
|
|
+ && setting.getSetting().stream().anyMatch(s -> "24".equals(s.getContentType()) || "25".equals(s.getContentType()));
|
|
|
|
|
|
- if (qwSopLogs.getExpiryTime() == null && noSop) {
|
|
|
+ if (qwSopLogs.getExpiryTime() == null && noSop && !oneClickSend) {
|
|
|
// 作废消息
|
|
|
log.info("SOP_LOG_ID:{}, SOP任务被删除", qwSopLogs.getId());
|
|
|
qwSopLogsService.updateQwSopLogsByWatchLogType(qwSopLogs.getId(), "SOP任务被删除");
|
|
|
@@ -1309,7 +1327,7 @@ public class IpadSendServer {
|
|
|
LocalDateTime expiryDateTime;
|
|
|
|
|
|
// 判断是否过期
|
|
|
- if(qwSopLogs.getSendType() == 3 || qwSopLogs.getSendType() == 7){
|
|
|
+ if(qwSopLogs.getSendType() == 3 || qwSopLogs.getSendType() == 7 || (oneClickSend && qwSopLogs.getExpiryTime() == null)){
|
|
|
expiryDateTime = sendTime.plusHours(12);
|
|
|
}else{
|
|
|
expiryDateTime = sendTime.plusHours(qwSopLogs.getExpiryTime());
|
|
|
@@ -1322,25 +1340,7 @@ public class IpadSendServer {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- if (setting.getCourseType() == null && noSop && setting.getType() == 2) {
|
|
|
- log.info("SOP_LOG_ID:{}, 模板未选消息类型,不发送", qwSopLogs.getId());
|
|
|
- qwSopLogsService.updateQwSopLogsByWatchLogType(qwSopLogs.getId(), "模板未选消息类型,不发送");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (setting.getVideoId() != null) {
|
|
|
- Integer cacheValue = redisCache.getCacheObject("sopCourse:video:isPause:" + setting.getVideoId());
|
|
|
- int isPause = (cacheValue != null) ? cacheValue : 0;
|
|
|
- log.info("SOP_LOG_ID:{},判断课程({})当前状态:{}", qwSopLogs.getId(), setting.getVideoId(), isPause);
|
|
|
- if (isPause == 1){
|
|
|
- log.info("SOP_LOG_ID:{}, 课程暂停,不发送", qwSopLogs.getId());
|
|
|
- qwSopLogsService.updateQwSopLogsByWatchLogType(qwSopLogs.getId(), "课程暂停,AI不发送");
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // APP直播短链(24)/卡片(25)走直播看课状态校验,避免落入课程看课逻辑
|
|
|
- boolean hasAppLiveContent = setting.getSetting() != null
|
|
|
- && setting.getSetting().stream().anyMatch(s -> "24".equals(s.getContentType()) || "25".equals(s.getContentType()));
|
|
|
+ // APP直播短链/卡片:不要求课程消息类型,走直播看课校验
|
|
|
if (hasAppLiveContent) {
|
|
|
Long queryLiveId = setting.getLiveId();
|
|
|
if (queryLiveId == null && setting.getSetting() != null) {
|
|
|
@@ -1362,6 +1362,22 @@ public class IpadSendServer {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ if (setting.getCourseType() == null && noSop && setting.getType() == 2) {
|
|
|
+ log.info("SOP_LOG_ID:{}, 模板未选消息类型,不发送", qwSopLogs.getId());
|
|
|
+ qwSopLogsService.updateQwSopLogsByWatchLogType(qwSopLogs.getId(), "模板未选消息类型,不发送");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (setting.getVideoId() != null) {
|
|
|
+ Integer cacheValue = redisCache.getCacheObject("sopCourse:video:isPause:" + setting.getVideoId());
|
|
|
+ int isPause = (cacheValue != null) ? cacheValue : 0;
|
|
|
+ log.info("SOP_LOG_ID:{},判断课程({})当前状态:{}", qwSopLogs.getId(), setting.getVideoId(), isPause);
|
|
|
+ if (isPause == 1){
|
|
|
+ log.info("SOP_LOG_ID:{}, 课程暂停,不发送", qwSopLogs.getId());
|
|
|
+ qwSopLogsService.updateQwSopLogsByWatchLogType(qwSopLogs.getId(), "课程暂停,AI不发送");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (qwSopLogs.getSendType() != 12 && noSop) {
|
|
|
// 客户的信息
|
|
|
// QwExternalContactHParam contactHParam = new QwExternalContactHParam();
|