|
|
@@ -20,6 +20,7 @@ import okhttp3.sse.EventSource;
|
|
|
import okhttp3.sse.EventSourceListener;
|
|
|
import okhttp3.sse.EventSources;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -74,6 +75,9 @@ public class BigModelServiceImpl implements IBigModelService
|
|
|
@Autowired
|
|
|
private QuestionMapper questionMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FileInfoMapper fileInfoMapper;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public List<BmMediaReplacement> selectMediaList(BmMediaReplacement mData) {
|
|
|
@@ -592,6 +596,19 @@ public class BigModelServiceImpl implements IBigModelService
|
|
|
//dto.setId(dto.getId());
|
|
|
dialogMapper.insertDialogDetail(dto);
|
|
|
}
|
|
|
+
|
|
|
+ if(dto.getDocument() != null && !"".equals(dto.getDocument().getId())){
|
|
|
+ FileInfo fileInfo = fileInfoMapper.getFileInfoById(dto.getDocument().getId(), dialogId, dto.getId());
|
|
|
+ if(fileInfo == null && "user".equals(dto.getRole())) {
|
|
|
+ FileInfo params = new FileInfo();
|
|
|
+ params.setId(dto.getDocument().getId());
|
|
|
+ params.setName(dto.getDocument().getName());
|
|
|
+ params.setUrl(dto.getDocument().getUrl());
|
|
|
+ params.setDialogId(dialogId);
|
|
|
+ params.setDialogDid(dto.getId());
|
|
|
+ fileInfoMapper.insertFileInfo(params);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -627,6 +644,16 @@ public class BigModelServiceImpl implements IBigModelService
|
|
|
@Override
|
|
|
public List<DialogRespDTO> getDialogDetail(String dialogId) {
|
|
|
List<DialogRespDTO> detail = dialogMapper.selectDialogDetail(dialogId);
|
|
|
+ if(detail != null && detail.size() != 0){
|
|
|
+ for(DialogRespDTO dto : detail){
|
|
|
+ FileInfo fileInfo = fileInfoMapper.getFileInfoById(null, dto.getDialog_id(), dto.getDid());
|
|
|
+ if(fileInfo != null){
|
|
|
+ DocumentDTO fileInfoDTO = new DocumentDTO();
|
|
|
+ BeanUtils.copyProperties(fileInfo, fileInfoDTO);
|
|
|
+ dto.setDocument(fileInfoDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return detail;
|
|
|
}
|
|
|
|