test:temp

dev_2.1.0
xueqingkun 1 year ago
parent 288274469b
commit 0c00c70f4a

@ -62,6 +62,12 @@
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>

@ -0,0 +1,82 @@
package com.supervision.manage;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Pair;
import cn.hutool.core.util.StrUtil;
import com.supervision.manage.service.AskQuestionLibraryManageService;
import com.supervision.manage.service.DiseasePhysicalManageService;
import com.supervision.model.AskPatientAnswer;
import com.supervision.model.AskTemplateQuestionLibrary;
import com.supervision.service.AskPatientAnswerService;
import com.supervision.service.AskTemplateQuestionLibraryService;
import com.supervision.util.MinioUtil;
import com.supervision.vo.manage.DiseasePhysicalLocationNodeVo;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.io.File;
import java.util.*;
import java.util.stream.Collectors;
@SpringBootTest
class VirtualPatientManageApplicationTests {
@Autowired
private AskPatientAnswerService askPatientAnswerService;;
@Autowired
private AskTemplateQuestionLibraryService askTemplateQuestionLibraryService;
@Test
void generateVideo() throws Exception {
String medicalId = "";
// 获取视频文件,及视频内容
List<Pair<String, File>> videoFileAndContent = getVideoFileAndContent(null);
//填充数据库中的资源id
Map<String, AskPatientAnswer> patientAnserMap = askPatientAnswerService.lambdaQuery().eq(AskPatientAnswer::getMedicalId, medicalId).list()
.stream().collect(Collectors.toMap(answer -> StrUtil.trim(answer.getAnswer()), answer -> answer));
List<AskTemplateQuestionLibrary> askTemplateQuestionLibraryList = askTemplateQuestionLibraryService.lambdaQuery().list();
for (Pair<String, File> pair : videoFileAndContent) {
AskPatientAnswer askPatientAnswer = patientAnserMap.get(pair.getKey());
if (Objects.isNull(askPatientAnswer)){
AskPatientAnswer answer = new AskPatientAnswer();
answer.setCode(null);
answer.setAnswer(pair.getKey());
answer.setMedicalId(medicalId);
String resourceId = MinioUtil.uploadFile(null);
answer.setAnswerResourceId(resourceId);
}
}
}
/**
*
* @param videoPath
* @return pair.getKey(): pair.getValue()
*/
List<Pair<String, File>> getVideoFileAndContent(String videoPath) {
Pair<String, File> pair = Pair.of("", new File(""));
return CollUtil.newArrayList(pair);
}
}
Loading…
Cancel
Save