|
@@ -79,6 +79,8 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
|
|
|
private String scApiInterfaceId;
|
|
private String scApiInterfaceId;
|
|
|
@Value("${sc.api.appId}")
|
|
@Value("${sc.api.appId}")
|
|
|
private String scApiAppId;
|
|
private String scApiAppId;
|
|
|
|
|
+ // @Value("${sc.api.tenantId}")
|
|
|
|
|
+ private static final String scTenantId = "000000";
|
|
|
@Value("${dify.url}")
|
|
@Value("${dify.url}")
|
|
|
private String difyBaseUrl;
|
|
private String difyBaseUrl;
|
|
|
@Value("${dify.sc_agent.apiKey}")
|
|
@Value("${dify.sc_agent.apiKey}")
|
|
@@ -243,11 +245,15 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
|
|
|
SmsbDeviceChatScScene scScene = new SmsbDeviceChatScScene();
|
|
SmsbDeviceChatScScene scScene = new SmsbDeviceChatScScene();
|
|
|
JSONObject interaction = JSONUtil.parseObj(item);
|
|
JSONObject interaction = JSONUtil.parseObj(item);
|
|
|
scScene.setInteractionName(interaction.getStr("interactionName"));
|
|
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.setSupplierName(interaction.getStr("supplierName"));
|
|
|
scScene.setApplicationValue(interaction.getStr("applicationValue"));
|
|
scScene.setApplicationValue(interaction.getStr("applicationValue"));
|
|
|
scScene.setDescription(interaction.getStr("description"));
|
|
scScene.setDescription(interaction.getStr("description"));
|
|
@@ -637,7 +643,7 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
|
|
|
// 同步四个知识库为公共知识库
|
|
// 同步四个知识库为公共知识库
|
|
|
List<SmsbDifyDatasetsQuestionVo> questionVoList = smsbDifyDatasetsQuestionMapper
|
|
List<SmsbDifyDatasetsQuestionVo> questionVoList = smsbDifyDatasetsQuestionMapper
|
|
|
.selectVoList(new LambdaQueryWrapper<SmsbDifyDatasetsQuestion>()
|
|
.selectVoList(new LambdaQueryWrapper<SmsbDifyDatasetsQuestion>()
|
|
|
- .eq(SmsbDifyDatasetsQuestion::getTenantId, appointmentInfo.getTenantId()));
|
|
|
|
|
|
|
+ .eq(SmsbDifyDatasetsQuestion::getTenantId, scTenantId));
|
|
|
List<String> qaList = questionVoList.stream()
|
|
List<String> qaList = questionVoList.stream()
|
|
|
.map(questionVo -> questionVo.getQuestion() + ":" + questionVo.getAnswer())
|
|
.map(questionVo -> questionVo.getQuestion() + ":" + questionVo.getAnswer())
|
|
|
.toList();
|
|
.toList();
|
|
@@ -749,7 +755,10 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
|
|
|
for (SmsbDeviceChatScSceneVo sceneItem : sceneVoList) {
|
|
for (SmsbDeviceChatScSceneVo sceneItem : sceneVoList) {
|
|
|
SmsbScDeviceStartProductVO productVO = new SmsbScDeviceStartProductVO();
|
|
SmsbScDeviceStartProductVO productVO = new SmsbScDeviceStartProductVO();
|
|
|
productVO.setName(sceneItem.getInteractionName());
|
|
productVO.setName(sceneItem.getInteractionName());
|
|
|
- productVO.setPhoto(sceneItem.getPhoto());
|
|
|
|
|
|
|
+ String photos = sceneItem.getPhoto();
|
|
|
|
|
+ if (!StringUtils.isEmpty(photos)) {
|
|
|
|
|
+ productVO.setPhoto(photos.split(",")[0]);
|
|
|
|
|
+ }
|
|
|
productVOList.add(productVO);
|
|
productVOList.add(productVO);
|
|
|
}
|
|
}
|
|
|
if (productVOList.size() > 3) {
|
|
if (productVOList.size() > 3) {
|