|
|
@@ -209,6 +209,8 @@ public class AsyncQwAiChatSopService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ fillFileNameForFileSetting(setting);
|
|
|
+
|
|
|
settingList.add(setting);
|
|
|
|
|
|
QwSopTempSetting.Content clonedContent=new QwSopTempSetting.Content();
|
|
|
@@ -253,6 +255,28 @@ public class AsyncQwAiChatSopService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /** contentType=5 时若没有 fileName,则从 fileUrl 取最后一段文件名,使 content_json 与完课福利等场景字段一致 */
|
|
|
+ private void fillFileNameForFileSetting(QwSopTempSetting.Content.Setting setting) {
|
|
|
+ if (setting == null || !"5".equals(setting.getContentType())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(setting.getFileName()) || StringUtils.isBlank(setting.getFileUrl())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String fileUrl = setting.getFileUrl();
|
|
|
+ int slash = fileUrl.lastIndexOf('/');
|
|
|
+ if (slash < 0 || slash >= fileUrl.length() - 1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String name = fileUrl.substring(slash + 1);
|
|
|
+ int q = name.indexOf('?');
|
|
|
+ if (q >= 0) {
|
|
|
+ name = name.substring(0, q);
|
|
|
+ }
|
|
|
+ setting.setFileName(name);
|
|
|
+ }
|
|
|
+
|
|
|
//插入观看记录
|
|
|
private Long addWatchLogIfNeededByNewChat(String sopId, Integer videoId, Integer courseId,
|
|
|
Long fsUserId, Long qwUserId, Long companyUserId,
|