|
|
|
@ -54,9 +54,9 @@ class LiveDigitalAvatarManageApplicationTests {
|
|
|
|
|
groupMap.put(scriptType, list1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<List<Map<String, String>>> result = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
|
|
|
List<Map<String, String>> objects = new ArrayList<>();
|
|
|
|
|
List<List<List<Map<String, String>>>> result = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
|
|
|
List<List<Map<String, String>>> objects = new ArrayList<>();
|
|
|
|
|
for (String scriptType : scriptTypes) {
|
|
|
|
|
List<List<Map<String, String>>> lists = groupMap.get(scriptType);
|
|
|
|
|
if (null == lists) {
|
|
|
|
@ -64,35 +64,48 @@ class LiveDigitalAvatarManageApplicationTests {
|
|
|
|
|
}
|
|
|
|
|
int i1 = RandomUtil.randomInt(0, lists.size());
|
|
|
|
|
List<Map<String, String>> maps = lists.get(i1);
|
|
|
|
|
objects.addAll(maps);
|
|
|
|
|
objects.add(maps);
|
|
|
|
|
}
|
|
|
|
|
result.add(objects);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (List<Map<String, String>> mapList : result) {
|
|
|
|
|
for (List<List<Map<String, String>>> mapList : result) {
|
|
|
|
|
String scriptId = StrUtil.uuid();
|
|
|
|
|
int i = 0;
|
|
|
|
|
int index = 0;
|
|
|
|
|
String current = "";
|
|
|
|
|
for (Map<String, String> mao : mapList) {
|
|
|
|
|
String scriptKeyPoint = mao.get("scriptKeyPoint");
|
|
|
|
|
String exampleTemplate = mao.get("exampleTemplate");
|
|
|
|
|
String scriptType = mao.get("scriptType");
|
|
|
|
|
if (StrUtil.equals(scriptKeyPoint, current)){
|
|
|
|
|
index ++;
|
|
|
|
|
}else {
|
|
|
|
|
current = scriptKeyPoint;
|
|
|
|
|
index = 0;
|
|
|
|
|
int scriptTypeNum = -1;
|
|
|
|
|
for (List<Map<String, String>> maos : mapList) {
|
|
|
|
|
int scriptKeyPointNum = 0;
|
|
|
|
|
|
|
|
|
|
String currentScriptType = "";
|
|
|
|
|
for (int i1 = 0; i1 < maos.size(); i1++) {
|
|
|
|
|
Map<String, String> mao = maos.get(i1);
|
|
|
|
|
String scriptKeyPoint = mao.get("scriptKeyPoint");
|
|
|
|
|
String exampleTemplate = mao.get("exampleTemplate");
|
|
|
|
|
String scriptType = mao.get("scriptType");
|
|
|
|
|
|
|
|
|
|
// 合并相同的关键点
|
|
|
|
|
if (i1 < maos.size() - 1){
|
|
|
|
|
String nextScriptKeyPoint = maos.get(i1 + 1).get("scriptKeyPoint");
|
|
|
|
|
if (StrUtil.equals(scriptKeyPoint, nextScriptKeyPoint)){
|
|
|
|
|
maos.get(i1 + 1).put("exampleTemplate", exampleTemplate + " " + maos.get(i1 + 1).get("exampleTemplate"));
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.equals(scriptType, currentScriptType)){
|
|
|
|
|
scriptKeyPointNum ++;
|
|
|
|
|
}else {
|
|
|
|
|
currentScriptType = scriptType;
|
|
|
|
|
scriptKeyPointNum = 0;
|
|
|
|
|
scriptTypeNum ++;
|
|
|
|
|
}
|
|
|
|
|
ScriptKeypoints keypoints = new ScriptKeypoints();
|
|
|
|
|
keypoints.setScriptType(scriptType);
|
|
|
|
|
keypoints.setKeyPoint(scriptKeyPoint);
|
|
|
|
|
keypoints.setScriptId(scriptId);
|
|
|
|
|
keypoints.setScriptTypeOrderNum(scriptTypeNum);
|
|
|
|
|
keypoints.setKeyPointOrderNum(scriptKeyPointNum);
|
|
|
|
|
keypoints.setKeyPointExample(exampleTemplate);
|
|
|
|
|
scriptKeypointsService.save(keypoints);
|
|
|
|
|
}
|
|
|
|
|
ScriptKeypoints keypoints = new ScriptKeypoints();
|
|
|
|
|
keypoints.setScriptType(scriptType);
|
|
|
|
|
keypoints.setKeyPoint(scriptKeyPoint);
|
|
|
|
|
keypoints.setScriptId(scriptId);
|
|
|
|
|
keypoints.setScriptTypeOrderNum(i);
|
|
|
|
|
keypoints.setKeyPointOrderNum(index);
|
|
|
|
|
keypoints.setKeyPointExample(exampleTemplate);
|
|
|
|
|
scriptKeypointsService.save(keypoints);
|
|
|
|
|
i ++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|