|
|
@@ -1,6 +1,7 @@
|
|
|
package com.fs.app.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
@@ -204,6 +205,52 @@ public class IpadSendServer {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 个微 SOP 的 contentJson 中每条消息可能来自 {@link com.fs.sop.domain.QwSopTempContent},
|
|
|
+ * 业务字段在 {@code content} 嵌套 JSON 里;未合并时 fileUrl/fileName 为空,
|
|
|
+ * 发送文件会退回用 URL 路径名(如 1775377962733.xlsx)作为展示名。
|
|
|
+ */
|
|
|
+ private void applyNestedContentIfPresent(QwSopCourseFinishTempSetting.Setting content) {
|
|
|
+ if (content == null || StringUtils.isEmpty(content.getContent())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ JSONObject inner = JSON.parseObject(content.getContent());
|
|
|
+ if (inner == null || inner.isEmpty()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(content.getFileUrl()) && StringUtils.isNotEmpty(inner.getString("fileUrl"))) {
|
|
|
+ content.setFileUrl(inner.getString("fileUrl"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(content.getFileName())) {
|
|
|
+ String fn = inner.getString("fileName");
|
|
|
+ if (StringUtils.isEmpty(fn)) {
|
|
|
+ fn = inner.getString("value");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(fn)) {
|
|
|
+ content.setFileName(fn);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(content.getImgUrl()) && StringUtils.isNotEmpty(inner.getString("imgUrl"))) {
|
|
|
+ content.setImgUrl(inner.getString("imgUrl"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(content.getVideoUrl()) && StringUtils.isNotEmpty(inner.getString("videoUrl"))) {
|
|
|
+ content.setVideoUrl(inner.getString("videoUrl"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(content.getVoiceUrl()) && StringUtils.isNotEmpty(inner.getString("voiceUrl"))) {
|
|
|
+ content.setVoiceUrl(inner.getString("voiceUrl"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(content.getValue()) && StringUtils.isNotEmpty(inner.getString("value"))) {
|
|
|
+ content.setValue(inner.getString("value"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(content.getContentType()) && inner.get("contentType") != null) {
|
|
|
+ content.setContentType(String.valueOf(inner.get("contentType")));
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.warn("applyNestedContentIfPresent parse failed: {}", e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void sendFile(BaseVo vo, QwSopCourseFinishTempSetting.Setting content) {
|
|
|
FileVo fileVo = FileVo.builder()
|
|
|
.url(content.getFileUrl())
|
|
|
@@ -685,6 +732,7 @@ public class IpadSendServer {
|
|
|
vo.setQwUserId(qwUser.getId());
|
|
|
try {
|
|
|
content.setSendStatus(1);
|
|
|
+ applyNestedContentIfPresent(content);
|
|
|
// 如果是群公告,使用SendNotice接口
|
|
|
if (qwSopLogs.getSendType() == 21 && "11".equals(content.getContentType())) {
|
|
|
sendNotice(vo, content);
|