diff --git a/virtual-patient-web/pom.xml b/virtual-patient-web/pom.xml
index 36b2ffbe..52f744b5 100644
--- a/virtual-patient-web/pom.xml
+++ b/virtual-patient-web/pom.xml
@@ -24,6 +24,8 @@
${project.version}
+
+
com.supervision
virtual-patient-common
@@ -57,21 +59,7 @@
org.springframework.boot
spring-boot-starter-websocket
-
- org.springframework.boot
- spring-boot-test
- test
-
-
- junit
- junit
- test
-
-
- org.springframework
- spring-test
- test
-
+
org.springframework.boot
spring-boot-test
diff --git a/virtual-patient-web/src/main/resources/application.yml b/virtual-patient-web/src/main/resources/application.yml
index caf4dfcd..ef46c2ad 100644
--- a/virtual-patient-web/src/main/resources/application.yml
+++ b/virtual-patient-web/src/main/resources/application.yml
@@ -1,3 +1,3 @@
spring:
profiles:
- active: dev
\ No newline at end of file
+ active: local
\ No newline at end of file
diff --git a/virtual-patient-web/src/test/java/com/supervision/AskTemplateIdTest.java b/virtual-patient-web/src/test/java/com/supervision/AskTemplateIdTest.java
new file mode 100644
index 00000000..b6bb1eec
--- /dev/null
+++ b/virtual-patient-web/src/test/java/com/supervision/AskTemplateIdTest.java
@@ -0,0 +1,122 @@
+package com.supervision;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.ReUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSON;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import cn.hutool.poi.excel.ExcelReader;
+import cn.hutool.poi.excel.ExcelUtil;
+import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
+import com.supervision.model.AskPatientAnswer;
+import com.supervision.model.AskTemplateQuestionLibrary;
+import com.supervision.model.CommonDic;
+import com.supervision.service.AskPatientAnswerService;
+import com.supervision.service.AskTemplateQuestionLibraryService;
+import com.supervision.service.CommonDicService;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@RunWith(SpringJUnit4ClassRunner.class)
+public class AskTemplateIdTest {
+
+ @Autowired
+ private AskTemplateQuestionLibraryService askTemplateQuestionLibraryService;
+
+ @Autowired
+ private AskPatientAnswerService askPatientAnswerService;
+
+ @Autowired
+ private CommonDicService commonDicService;
+
+ @Test
+ public void creatAskId() {
+ Object o = new Object();
+ DefaultIdentifierGenerator defaultIdentifierGenerator = new DefaultIdentifierGenerator();
+
+ List list = askTemplateQuestionLibraryService.list();
+ for (AskTemplateQuestionLibrary askTemplateQuestionLibrary : list) {
+ askTemplateQuestionLibraryService.lambdaUpdate()
+ .set(AskTemplateQuestionLibrary::getId, String.valueOf(defaultIdentifierGenerator.nextId(o)))
+ .eq(AskTemplateQuestionLibrary::getId, askTemplateQuestionLibrary.getId()).update();
+ }
+ }
+
+ @Test
+ public void creatAnswerId() {
+ Object o = new Object();
+ DefaultIdentifierGenerator defaultIdentifierGenerator = new DefaultIdentifierGenerator();
+
+ List list = askPatientAnswerService.list();
+ for (AskPatientAnswer answer : list) {
+ askPatientAnswerService.lambdaUpdate()
+ .set(AskPatientAnswer::getId, String.valueOf(defaultIdentifierGenerator.nextId(o)))
+ .eq(AskPatientAnswer::getId, answer.getId()).update();
+ }
+ }
+
+ @Test
+ public void insertDict() {
+ ExcelReader reader = ExcelUtil.getReader("/Users/flevance/Desktop/虚拟病人/语料库/标准病人语料1226-2.xlsx");
+ List> read = reader.read(1, 86);
+ for (List