Procházet zdrojové kódy

Merge remote-tracking branch 'origin/fanzhicheng' into fanzhicheng

范志成 před 4 měsíci
rodič
revize
6fb0b70c6e

+ 1 - 0
smsb-admin/src/main/resources/application.yml

@@ -15,6 +15,7 @@ sc:
     secretKey: ExperienceCenterKey01
     publicKey: 0430e45e154b4e73278b0e05d81c530377d4fbade470aefdba484542bb49a04b15aae372084fd7f0792df40d3b6caabccac585027091321b034e1ab0dee258341b
     interfaceId: ZT49DigitalHuman
+    # tenantId: 000000
 
 
 captcha:

+ 16 - 7
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/service/impl/SmsbAppointmentInfoServiceImpl.java

@@ -79,6 +79,8 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
     private String scApiInterfaceId;
     @Value("${sc.api.appId}")
     private String scApiAppId;
+    // @Value("${sc.api.tenantId}")
+    private static final String scTenantId = "000000";
     @Value("${dify.url}")
     private String difyBaseUrl;
     @Value("${dify.sc_agent.apiKey}")
@@ -243,11 +245,15 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
             SmsbDeviceChatScScene scScene = new SmsbDeviceChatScScene();
             JSONObject interaction = JSONUtil.parseObj(item);
             scScene.setInteractionName(interaction.getStr("interactionName"));
-            StringBuilder builder = new StringBuilder();
-            interaction.getJSONArray("photo").forEach(
-                photo -> builder.append(photo).append(",")
-            );
-            scScene.setPhoto(builder.toString());
+            JSONArray photoList = interaction.getJSONArray("photo");
+            if (photoList != null && photoList.size() > 0) {
+                StringBuilder builder = new StringBuilder();
+                for (int i = 0; i < photoList.size(); i++) {
+                    builder.append("https://ndtpc.com").append(photoList.get(i)).append(",");
+                }
+                // 去掉结尾的,逗号
+                scScene.setPhoto(builder.toString().substring(0, builder.length() - 1));
+            }
             scScene.setSupplierName(interaction.getStr("supplierName"));
             scScene.setApplicationValue(interaction.getStr("applicationValue"));
             scScene.setDescription(interaction.getStr("description"));
@@ -637,7 +643,7 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
                 // 同步四个知识库为公共知识库
                 List<SmsbDifyDatasetsQuestionVo> questionVoList = smsbDifyDatasetsQuestionMapper
                     .selectVoList(new LambdaQueryWrapper<SmsbDifyDatasetsQuestion>()
-                        .eq(SmsbDifyDatasetsQuestion::getTenantId, appointmentInfo.getTenantId()));
+                        .eq(SmsbDifyDatasetsQuestion::getTenantId, scTenantId));
                 List<String> qaList = questionVoList.stream()
                     .map(questionVo -> questionVo.getQuestion() + ":" + questionVo.getAnswer())
                     .toList();
@@ -749,7 +755,10 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
                     for (SmsbDeviceChatScSceneVo sceneItem : sceneVoList) {
                         SmsbScDeviceStartProductVO productVO = new SmsbScDeviceStartProductVO();
                         productVO.setName(sceneItem.getInteractionName());
-                        productVO.setPhoto(sceneItem.getPhoto());
+                        String photos = sceneItem.getPhoto();
+                        if (!StringUtils.isEmpty(photos)) {
+                            productVO.setPhoto(photos.split(",")[0]);
+                        }
                         productVOList.add(productVO);
                     }
                     if (productVOList.size() > 3) {