use of com.cas.sim.tis.entity.Class in project TeachingInSimulation by ScOrPiOzzy.
the class ClassList method reload.
private void reload(Integer pageIndex) {
int pageSize = 10;
PageInfo<Class> pageInfo = SpringUtil.getBean(ClassAction.class).findClasses(pageIndex + 1, pageSize);
if (pageInfo == null) {
pagination.setPageCount(0);
table.setItems(null);
table.build();
} else {
pagination.setPageCount((int) pageInfo.getPages());
JSONArray array = new JSONArray();
array.addAll(pageInfo.getList());
table.setItems(array);
table.build();
}
}
use of com.cas.sim.tis.entity.Class in project TeachingInSimulation by ScOrPiOzzy.
the class ClassList method modify.
private void modify(int id) {
Class clazz = SpringUtil.getBean(ClassAction.class).findClass(id);
Dialog<Class> dialog = new Dialog<>();
dialog.setDialogPane(new ClassModifyDialog(clazz));
dialog.setTitle(MsgUtil.getMessage("class.dialog.modify"));
dialog.setPrefSize(635, 320);
dialog.showAndWait().ifPresent(obj -> {
if (obj == null) {
return;
}
try {
SpringUtil.getBean(ClassAction.class).modifyClass(obj);
AlertUtil.showAlert(AlertType.INFORMATION, MsgUtil.getMessage("alert.information.data.update.success"));
pagination.reload();
} catch (Exception e) {
e.printStackTrace();
AlertUtil.showAlert(AlertType.ERROR, e.getMessage());
LOG.error("修改Class对象失败,Class编号{}:{}", obj.getId(), e.getMessage());
}
});
}
use of com.cas.sim.tis.entity.Class in project TeachingInSimulation by ScOrPiOzzy.
the class PreviewQuestionPaper method publish.
@FXML
private void publish() {
// 判断当前是否有考核正在进行
if (Session.get(Session.KEY_LIBRARY_PUBLISH_ID) != null) {
AlertUtil.showAlert(AlertType.WARNING, MsgUtil.getMessage("alert.warning.examing"));
return;
}
// 创建考核记录
List<Class> classes = SpringUtil.getBean(ClassAction.class).findClassesByTeacher(Session.get(Session.KEY_LOGIN_ID));
Dialog<Integer> dialog = new Dialog<>();
dialog.setDialogPane(new ClassSelectDialog(classes));
dialog.setTitle(MsgUtil.getMessage("class.dialog.select"));
dialog.setPrefSize(652, 420);
dialog.showAndWait().ifPresent(cid -> {
if (cid == null) {
return;
}
try {
Integer publishId = SpringUtil.getBean(LibraryPublishAction.class).publishLibraryToClass(rid, cid);
// 记录当前考核发布编号
Session.set(Session.KEY_LIBRARY_PUBLISH_ID, publishId);
// 添加考核进行时菜单
PageController controller = SpringUtil.getBean(PageController.class);
ILeftContent content = controller.getLeftMenu();
if (content instanceof IPublish) {
((IPublish) content).publish(publishId);
}
} catch (Exception e) {
e.printStackTrace();
AlertUtil.showAlert(AlertType.ERROR, e.getMessage());
}
});
}
use of com.cas.sim.tis.entity.Class in project TeachingInSimulation by ScOrPiOzzy.
the class ClassServiceImpl method findClasses.
@Override
public PageInfo<Class> findClasses(int pageIndex, int pageSize) {
ClassMapper classMapper = (ClassMapper) mapper;
PageHelper.startPage(pageIndex, pageSize);
List<Class> result = classMapper.findClasses();
PageInfo<Class> page = new PageInfo<>(result);
LOG.info("成功查找到{}条资源,当前页码{},每页{}条资源,共{}页", page.getTotal(), pageIndex, pageSize, page.getPages());
return page;
}
use of com.cas.sim.tis.entity.Class in project TeachingInSimulation by ScOrPiOzzy.
the class ClassAction method deleteClass.
public void deleteClass(int id) {
ClassService service = getService();
Class clazz = service.findById(id);
clazz.setDel(1);
clazz.setUpdater(Session.get(Session.KEY_LOGIN_ID));
service.update(clazz);
}
Aggregations