yuhongqi преди 3 седмици
родител
ревизия
c6e34e4a05

+ 15 - 0
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java

@@ -1924,6 +1924,21 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     setting.setContentType("14");
                     break;
                 case "15": //app文本
+                    String appTxt = StringUtil.strIsNullOrEmpty(welcomeText) ? "" : welcomeText;
+                    String defaultCustomerName = "同学";
+                    if (contact != null && StringUtils.isNotEmpty(contact.getName()) && !"待同步客户".equals(contact.getName())) {
+                        defaultCustomerName = contact.getName();
+                    }
+                    String customerName = contact == null || StringUtil.strIsNullOrEmpty(contact.getStageStatus()) || "0".equals(contact.getStageStatus())
+                            ? defaultCustomerName : contact.getStageStatus();
+                    if (StringUtils.isNotEmpty(setting.getValue())) {
+                        setting.setValue(setting.getValue()
+                                .replaceAll("#客服称呼#", appTxt)
+                                .replaceAll("#销售称呼#", appTxt)
+                                .replaceAll("#客户称呼#", customerName));
+                    }
+                    sopLogs.setAppSendStatus(0);
+                    break;
                 case "16": //app语音
                     sopLogs.setAppSendStatus(0);
                     break;

+ 18 - 5
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -945,6 +945,17 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                     log.error("APP直播模板解析失败:" + e);
                                 }
                                 break;
+                            //app文本
+                            case "15":
+                                String txtAppGroup = StringUtil.strIsNullOrEmpty(qwUser.getWelcomeText()) ? "" : qwUser.getWelcomeText();
+                                st.setValue(st.getValue().replaceAll("#客服称呼#", txtAppGroup).replaceAll("#销售称呼#", txtAppGroup));
+                                try {
+                                    replaceContent(st.getContentType(), st.getValue(), st::setValue, words);
+                                } catch (Exception e) {
+                                    throw new RuntimeException(e);
+                                }
+                                sopLogs.setAppSendStatus(0);
+                                break;
                             //群公告
                             case "11":
                                 sopLogs.setSendType(21); // 设置为群公告类型
@@ -2426,15 +2437,17 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     break;
                 case "15":
                     //app文本
+                    String txtApp = StringUtil.strIsNullOrEmpty(qwUser.getWelcomeText()) ? "" : qwUser.getWelcomeText();
+                    st.setValue(st.getValue()
+                            .replaceAll("#客服称呼#", txtApp)
+                            .replaceAll("#销售称呼#", txtApp)
+                            .replaceAll("#客户称呼#", contact == null || StringUtil.strIsNullOrEmpty(contact.getStageStatus()) || "0".equals(contact.getStageStatus()) ? "同学" : contact.getStageStatus()));
+                    sopLogs.setAppSendStatus(0);
                     try {
-                        createVoiceUrl(st, companyUserId);
-                        if (qwUser.getCompanyUserId() != null) {
-                            createVoiceUrlToIm(st, String.valueOf(qwUser.getCompanyUserId()));
-                        }
+                        replaceContent(st.getContentType(), st.getValue(), st::setValue, words);
                     } catch (Exception e) {
                         throw new RuntimeException(e);
                     }
-                    sopLogs.setAppSendStatus(0);
                     break;
                 case "16":
                     //app语音

+ 10 - 0
fs-service/src/main/resources/db/changelog/dictData/dict_data_update.sql

@@ -31,3 +31,13 @@ VALUES
     (1, '关闭', '0', 'store_order_create_status_check', '', 'info', 'Y', '0', 'admin', NOW(), '', NULL, '关闭订单创建商品状态校验');
 --rollback DELETE FROM sys_dict_data WHERE dict_type = 'store_order_create_status_check';
 --rollback DELETE FROM sys_dict_type WHERE dict_type = 'store_order_create_status_check';
+
+--changeset yhq:20260629-sop-app-text-content-type-dict
+--preconditions onFail:MARK_RAN
+--precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM sys_dict_data WHERE dict_type = 'sys_qwSopAi_contentType' AND dict_value = '15'
+INSERT INTO `sys_dict_data`
+(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES
+    (10, 'APP文本', '15', 'sys_qwSopAi_contentType', NULL, 'default', 'N', '0', 'admin', NOW(), '', NULL, NULL);
+--rollback DELETE FROM sys_dict_data WHERE dict_type = 'sys_qwSopAi_contentType' AND dict_value = '15';
+