fix: 连续语料添加排序字段,流程调用时按照字段排序
This commit is contained in:
parent
9ec26e7ac5
commit
e769336616
@ -41,23 +41,23 @@ public class ViPlayOperateService implements VIOperateService {
|
|||||||
String audioPath = inputParams.getString("audioPath");
|
String audioPath = inputParams.getString("audioPath");
|
||||||
String terminalId = message.getTerminalId();
|
String terminalId = message.getTerminalId();
|
||||||
// log.info("播放语料成功,deviceId={},audioPath={},terminalId={}", deviceId, audioPath, terminalId);
|
// log.info("播放语料成功,deviceId={},audioPath={},terminalId={}", deviceId, audioPath, terminalId);
|
||||||
edgeSpeakerService.playAudio(terminalId, deviceId, audioPath);
|
// edgeSpeakerService.playAudio(terminalId, deviceId, audioPath);
|
||||||
// 等待播放完成
|
// // 等待播放完成
|
||||||
while (true) {
|
// while (true) {
|
||||||
try {
|
// try {
|
||||||
Thread.sleep(1000);
|
// Thread.sleep(1000);
|
||||||
} catch (InterruptedException e) {
|
// } catch (InterruptedException e) {
|
||||||
throw new RuntimeException(e);
|
// throw new RuntimeException(e);
|
||||||
}
|
// }
|
||||||
SpeakerCommand.GetSpeakerStateCommand.Feedback status = edgeSpeakerService.getStatus(terminalId, deviceId);
|
// SpeakerCommand.GetSpeakerStateCommand.Feedback status = edgeSpeakerService.getStatus(terminalId, deviceId);
|
||||||
boolean isRunning = status.getState().getIsRunning();
|
// boolean isRunning = status.getState().getIsRunning();
|
||||||
if (!isRunning) {
|
// if (!isRunning) {
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// todo 本机测试播放
|
// todo 本机测试播放
|
||||||
// playAudio(audioPath);
|
playAudio(audioPath);
|
||||||
return TaskNodeExecuteResult.success();
|
return TaskNodeExecuteResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,8 +73,17 @@ public class ViSchemeOperateService implements VIOperateService {
|
|||||||
obj -> obj.getString("parentId")
|
obj -> obj.getString("parentId")
|
||||||
));
|
));
|
||||||
|
|
||||||
// 转成 List<List<JSONObject>>
|
// 转成 List<List<JSONObject>> 并排序
|
||||||
List<List<JSONObject>> continuousCorpusGroup = new ArrayList<>(grouped.values());
|
List<List<JSONObject>> continuousCorpusGroup = new ArrayList<>(grouped.values());
|
||||||
|
continuousCorpusGroup.sort((group1, group2) -> {
|
||||||
|
Integer sort1 = group1.get(0).getInteger("sortParent");
|
||||||
|
Integer sort2 = group2.get(0).getInteger("sortParent");
|
||||||
|
|
||||||
|
if (sort1 == null && sort2 == null) return 0;
|
||||||
|
if (sort1 == null) return 1; // null 排后面
|
||||||
|
if (sort2 == null) return -1; // null 排后面
|
||||||
|
return Integer.compare(sort1, sort2);
|
||||||
|
});
|
||||||
|
|
||||||
output.put("testCorpus", continuousCorpusGroup);
|
output.put("testCorpus", continuousCorpusGroup);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -49,6 +49,10 @@ public class ViCorpus extends BaseEntity {
|
|||||||
@ApiModelProperty("预期结果(预留)")
|
@ApiModelProperty("预期结果(预留)")
|
||||||
private String expectedResult;
|
private String expectedResult;
|
||||||
|
|
||||||
|
@Excel(name = "连续语料的顺序")
|
||||||
|
@ApiModelProperty("连续语料的顺序")
|
||||||
|
private Integer sortParent;
|
||||||
|
|
||||||
@Excel(name = "同一父语料下的顺序")
|
@Excel(name = "同一父语料下的顺序")
|
||||||
@ApiModelProperty("同一父语料下的顺序")
|
@ApiModelProperty("同一父语料下的顺序")
|
||||||
private Integer sortOrder;
|
private Integer sortOrder;
|
||||||
|
|||||||
@ -23,6 +23,9 @@ public class ViContinuousCorpusVO {
|
|||||||
@ApiModelProperty("方言")
|
@ApiModelProperty("方言")
|
||||||
private String dialect;
|
private String dialect;
|
||||||
|
|
||||||
|
@ApiModelProperty("连续语料的顺序")
|
||||||
|
private Integer sortParent;
|
||||||
|
|
||||||
@ApiModelProperty("子语料列表")
|
@ApiModelProperty("子语料列表")
|
||||||
private List<ViCorpus> children;
|
private List<ViCorpus> children;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,6 +98,10 @@ public class IViCorpusServiceImpl extends ServiceImpl<ViCorpusMapper, ViCorpus>
|
|||||||
.orderByAsc(ViCorpus::getSortOrder)
|
.orderByAsc(ViCorpus::getSortOrder)
|
||||||
);
|
);
|
||||||
vo.setChildren(children);
|
vo.setChildren(children);
|
||||||
|
if (CollUtil.isNotEmpty(children)) {
|
||||||
|
Integer sortParent = children.get(0).getSortParent();
|
||||||
|
vo.setSortParent(sortParent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user