use of com.cas.sim.tis.message.ExamMessage in project TeachingInSimulation by ScOrPiOzzy.
the class ExamingMenuItem method showDialog.
private void showDialog() {
Dialog<Boolean> dialog = new Dialog<>();
dialog.setDialogPane(new ExamingDialog(publish));
dialog.setTitle(MsgUtil.getMessage("class.dialog.modify"));
dialog.setPrefSize(640, 380);
dialog.showAndWait().ifPresent(finish -> {
if (finish) {
ExamMessage message = new ExamMessage();
message.setPid(publish.getId());
message.setType(ExamMessage.EXAM_OVER);
SocketUtil.INSTENCE.send(message);
ExamingMenuItem.this.setVisible(false);
rotateTransition.stop();
Session.set(Session.KEY_LIBRARY_PUBLISH_ID, null);
}
});
}
use of com.cas.sim.tis.message.ExamMessage in project TeachingInSimulation by ScOrPiOzzy.
the class LibraryPublishServiceImpl method publishLibraryToClass.
@Override
public Integer publishLibraryToClass(LibraryPublish publish) {
// 记录考核发布记录
saveUseGeneratedKeys(publish);
// 广播开始考核
ExamMessage message = new ExamMessage();
message.setPid(publish.getId());
message.setType(ExamMessage.EXAM_START);
// 筛选当前登陆人员
List<HostedConnection> collection = new ArrayList<>();
for (HostedConnection hostedConnection : serverConfig.getClients()) {
if (publish.getClassId().equals(hostedConnection.getAttribute(Session.KEY_LOGIN_CLASSID.name()))) {
collection.add(hostedConnection);
}
}
serverConfig.getServer().broadcast(Filters.in(collection), message);
return publish.getId();
}
Aggregations