|
@@ -635,7 +635,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
|
|
|
insertSopUserLogs(sopUserLogsInfos, logVo, sendTime, ruleTimeVO, content, qwUserId,
|
|
|
companyUserId, companyId, qwUserByRedis.getWelcomeText(),qwUserByRedis.getQwUserName(),
|
|
|
- groupChatMap, miniAppId);
|
|
|
+ groupChatMap, miniAppId,config);
|
|
|
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -678,7 +678,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
private void insertSopUserLogs(List<SopUserLogsInfo> sopUserLogsInfos, SopUserLogsVo logVo, Date sendTime,
|
|
|
QwSopRuleTimeVO ruleTimeVO, QwSopTempSetting.Content content,
|
|
|
String qwUserId,String companyUserId,String companyId,String welcomeText,String qwUserName,
|
|
|
- Map<String, QwGroupChat> groupChatMap,String miniAppId) {
|
|
|
+ Map<String, QwGroupChat> groupChatMap,String miniAppId,CourseConfig config) {
|
|
|
String formattedSendTime = sendTime.toInstant()
|
|
|
.atZone(ZoneId.systemDefault())
|
|
|
.format(DATE_TIME_FORMATTER);
|
|
@@ -704,7 +704,8 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
if (content.getIndex() == 0) {
|
|
|
QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, groupChat.getChatId(), groupChat.getName(), null, isOfficial, null);
|
|
|
handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
|
|
|
- type, qwUserId, companyUserId, companyId, groupChat.getChatId(), welcomeText, qwUserName, null, true, miniAppId, groupChat);
|
|
|
+ type, qwUserId, companyUserId, companyId, groupChat.getChatId(), welcomeText, qwUserName,
|
|
|
+ null, true, miniAppId, groupChat,config);
|
|
|
} else {
|
|
|
if(groupChat.getChatUserList() != null && !groupChat.getChatUserList().isEmpty()){
|
|
|
groupChat.getChatUserList().forEach(user -> {
|
|
@@ -712,7 +713,8 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
ruleTimeVO.setRemark("客户群催课");
|
|
|
QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, user.getUserId(), user.getName(), null, isOfficial, null);
|
|
|
handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
|
|
|
- type, qwUserId, companyUserId, companyId, user.getId().toString(), welcomeText, qwUserName, null, false, miniAppId, groupChat);
|
|
|
+ type, qwUserId, companyUserId, companyId, user.getId().toString(), welcomeText, qwUserName,
|
|
|
+ null, false, miniAppId, groupChat,config);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -725,7 +727,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
Long fsUserId = contactId.getFsUserId();
|
|
|
QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, contactId.getExternalContactId(), externalUserName, fsUserId, isOfficial, contactId.getExternalId());
|
|
|
handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
|
|
|
- type, qwUserId, companyUserId, companyId, externalId, welcomeText, qwUserName, fsUserId, false, miniAppId, null);
|
|
|
+ type, qwUserId, companyUserId, companyId, externalId, welcomeText, qwUserName, fsUserId, false, miniAppId, null,config);
|
|
|
} catch (Exception e) {
|
|
|
log.error("处理 externalContactId {} 时发生异常: {}", contactId, e.getMessage(), e);
|
|
|
}
|
|
@@ -833,14 +835,16 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
SopUserLogsVo logVo, Date sendTime, Long courseId,
|
|
|
Long videoId, int type, String qwUserId,
|
|
|
String companyUserId, String companyId, String externalId, String welcomeText,
|
|
|
- String qwUserName, Long fsUserId, boolean isGroupChat, String miniAppId, QwGroupChat groupChat) {
|
|
|
+ String qwUserName, Long fsUserId, boolean isGroupChat, String miniAppId,
|
|
|
+ QwGroupChat groupChat,CourseConfig config) {
|
|
|
switch (type) {
|
|
|
case 1:
|
|
|
handleNormalMessage(sopLogs, content,companyUserId);
|
|
|
break;
|
|
|
case 2:
|
|
|
handleCourseMessage(sopLogs, content, logVo, sendTime, courseId, videoId,
|
|
|
- qwUserId, companyUserId, companyId, externalId, welcomeText,qwUserName, fsUserId, isGroupChat, miniAppId, groupChat);
|
|
|
+ qwUserId, companyUserId, companyId, externalId, welcomeText,qwUserName, fsUserId,
|
|
|
+ isGroupChat, miniAppId, groupChat,config);
|
|
|
break;
|
|
|
case 3:
|
|
|
handleOrderMessage(sopLogs, content);
|
|
@@ -873,7 +877,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
SopUserLogsVo logVo, Date sendTime, Long courseId,
|
|
|
Long videoId, String qwUserId, String companyUserId,
|
|
|
String companyId, String externalId, String welcomeText, String qwUserName,
|
|
|
- Long fsUserId, boolean isGroupChat, String miniAppId, QwGroupChat groupChat) {
|
|
|
+ Long fsUserId, boolean isGroupChat, String miniAppId, QwGroupChat groupChat,CourseConfig config) {
|
|
|
// 深拷贝 Content 对象,避免使用 JSON
|
|
|
QwSopTempSetting.Content clonedContent = deepCopyContent(content);
|
|
|
if (clonedContent == null) {
|
|
@@ -974,7 +978,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
setting.setMiniprogramPage(sortLink.replaceAll("^[\\s\\u2005]+", ""));
|
|
|
|
|
|
try {
|
|
|
- setting.setMiniprogramPicUrl(StringUtil.strIsNullOrEmpty(setting.getMiniprogramPicUrl())?"https://cos.his.cdwjyyh.com/fs/20250331/ec2b4e73be8048afbd526124a655ad56.png":setting.getMiniprogramPicUrl());
|
|
|
+ setting.setMiniprogramPicUrl(StringUtil.strIsNullOrEmpty(setting.getMiniprogramPicUrl())? config.getSidebarImageUrl():setting.getMiniprogramPicUrl());
|
|
|
} catch (Exception e) {
|
|
|
log.error("赋值-小程序封面地址失败-" + e);
|
|
|
}
|
|
@@ -1241,6 +1245,8 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
log.error("CourseConfig is not loaded.");
|
|
|
return "";
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
// if (StringUtils.isEmpty(config.getMiniprogramPage())){
|
|
|
// log.error("miniprogramPage is not loaded.");
|
|
|
// return "";
|