|
|
@@ -58,6 +58,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
import javax.annotation.PreDestroy;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.LocalTime;
|
|
|
@@ -844,7 +845,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
if (StringUtils.isNotEmpty(logVo.getChatId())) {
|
|
|
QwGroupChat groupChat = groupChatMap.get(logVo.getChatId());
|
|
|
if (groupChat.getChatUserList() != null && !groupChat.getChatUserList().isEmpty()) {
|
|
|
-
|
|
|
+
|
|
|
// 检查是否有群公告类型,如果有则设置sendType=21
|
|
|
boolean hasGroupNotice = content.getSetting() != null && content.getSetting().stream()
|
|
|
.anyMatch(st -> "11".equals(st.getContentType()));
|
|
|
@@ -854,7 +855,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
} else {
|
|
|
ruleTimeVO.setSendType(6);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
ruleTimeVO.setType(2);
|
|
|
QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, groupChat.getChatId(), groupChat.getName(), null, isOfficial, null,null);
|
|
|
handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
|
|
|
@@ -1516,6 +1517,47 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
log.error("赋值-小程序封面地址失败-" + e);
|
|
|
}
|
|
|
|
|
|
+ break;
|
|
|
+ case "13":
|
|
|
+ log.info("处理订阅号文章 - sopId:{}, articleUrl:{}", logVo.getSopId(), setting.getArticleUrl());
|
|
|
+
|
|
|
+ // 获取小程序配置
|
|
|
+ String articleConfigJson = configService.selectConfigByKey("his.config");
|
|
|
+ FSSysConfig articleSysConfig = JSON.parseObject(articleConfigJson, FSSysConfig.class);
|
|
|
+
|
|
|
+ if(sopLogs.getSendType()==1){
|
|
|
+ setting.setMiniprogramAppid(miniAppId);
|
|
|
+ }else {
|
|
|
+ int miniType = getLevel(grade);
|
|
|
+ String finalAppId = getAppIdFromMiniMap(miniMap, companyId, sendMsgType, grade);
|
|
|
+
|
|
|
+ if (StringUtil.strIsNullOrEmpty(finalAppId)) {
|
|
|
+ finalAppId = articleSysConfig.getAppId();
|
|
|
+ }
|
|
|
+
|
|
|
+ setting.setMiniType(miniType);
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(finalAppId)) {
|
|
|
+ setting.setMiniprogramAppid(finalAppId);
|
|
|
+ } else {
|
|
|
+ log.error("公司的小程序id为空:采用了his.config配置的固定值, sopId:" + sopLogs.getSopId());
|
|
|
+ setting.setMiniprogramAppid(articleSysConfig.getAppId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtil.strIsNullOrEmpty(setting.getMiniprogramPage()) && !StringUtil.strIsNullOrEmpty(setting.getArticleUrl())) {
|
|
|
+ String articleUrlJson = "{\"articleUrl\":\"" + setting.getArticleUrl() + "\"}";
|
|
|
+ setting.setMiniprogramPage("/pages_course/webArticle.html?url=" + articleUrlJson);
|
|
|
+ log.info("订阅号文章类型,使用articleUrl生成miniprogramPage: {}", setting.getMiniprogramPage());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtil.strIsNullOrEmpty(setting.getMiniprogramPicUrl())) {
|
|
|
+ setting.setMiniprogramPicUrl("https://cos.his.cdwjyyh.com/fs/20250331/ec2b4e73be8048afbd526124a655ad56.png");
|
|
|
+ }
|
|
|
+
|
|
|
+ log.info("订阅号文章消息体构造完成 - sopId:{}, contentType:{}, miniType:{}, appid:{}, page:{}, title:{}, picUrl:{}, articleUrl:{}",
|
|
|
+ logVo.getSopId(), setting.getContentType(), setting.getMiniType(), setting.getMiniprogramAppid(), setting.getMiniprogramPage(),
|
|
|
+ setting.getMiniprogramTitle(), setting.getMiniprogramPicUrl(), setting.getArticleUrl());
|
|
|
+
|
|
|
break;
|
|
|
default:
|
|
|
break;
|