manipulate slots

This commit is contained in:
Jottyfan
2023-11-18 19:29:35 +01:00
parent 0c18b2df56
commit 48525b7e20
20 changed files with 331 additions and 558 deletions

View File

@ -2,19 +2,16 @@ package de.jottyfan.bico.modules.sheet;
import static de.jottyfan.bico.db.Tables.V_CALENDAR;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jooq.DSLContext;
import org.jooq.SelectSeekStep1;
import org.jooq.SelectWhereStep;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import de.jottyfan.bico.db.tables.records.VCalendarRecord;
import de.jottyfan.bico.modules.sheet.model.SheetBean;
/**
*
@ -29,28 +26,9 @@ public class SheetRepository {
@Autowired
private DSLContext jooq;
public List<SheetBean> getList() {
SelectSeekStep1<VCalendarRecord, LocalDate> sql = jooq.selectFrom(V_CALENDAR).orderBy(V_CALENDAR.SLOT_DAY);
LOGGER.trace(sql.toString());
List<SheetBean> list = new ArrayList<>();
for (VCalendarRecord r : sql.fetch()) {
SheetBean bean = new SheetBean();
bean.setPkSlot(r.getPkSlot());
bean.setPkSubject(r.getPkSubject());
bean.setAbbreviation(r.getAbbreviation());
bean.setBibleverse(r.getBibleverse());
bean.setBookPages(r.getBookPages());
bean.setFullname(r.getFullname());
bean.setLessonNotes(r.getLessonNotes());
bean.setSlotDay(r.getSlotDay());
bean.setSlotNotes(r.getSlotNotes());
bean.setSourceName(r.getSourceName());
bean.setSubjectNotes(r.getSubjectNotes());
bean.setSubtheme(r.getSubtheme());
bean.setTheme(r.getTheme());
bean.setWorksheets(r.getWorksheets());
list.add(bean);
}
return list;
public List<VCalendarRecord> getList() {
SelectWhereStep<VCalendarRecord> sql = jooq.selectFrom(V_CALENDAR);
LOGGER.trace(sql);
return sql.fetch().stream().toList();
}
}

View File

@ -5,7 +5,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import de.jottyfan.bico.modules.sheet.model.SheetBean;
import de.jottyfan.bico.db.tables.records.VCalendarRecord;
/**
*
@ -18,7 +18,7 @@ public class SheetService {
@Autowired
private SheetRepository repository;
public List<SheetBean> getList() {
public List<VCalendarRecord> getList() {
return repository.getList();
}

View File

@ -1,224 +0,0 @@
package de.jottyfan.bico.modules.sheet.model;
import java.io.Serializable;
import java.time.LocalDate;
/**
*
* @author jotty
*
*/
public class SheetBean implements Serializable {
private static final long serialVersionUID = 1L;
private LocalDate slotDay;
private String fullname;
private String abbreviation;
private String sourceName;
private String theme;
private String subtheme;
private String bookPages;
private String worksheets;
private String bibleverse;
private String subjectNotes;
private String lessonNotes;
private String slotNotes;
private Integer pkSlot;
private Integer pkSubject;
/**
* @return the slotDay
*/
public LocalDate getSlotDay() {
return slotDay;
}
/**
* @param slotDay the slotDay to set
*/
public void setSlotDay(LocalDate slotDay) {
this.slotDay = slotDay;
}
/**
* @return the fullname
*/
public String getFullname() {
return fullname;
}
/**
* @param fullname the fullname to set
*/
public void setFullname(String fullname) {
this.fullname = fullname;
}
/**
* @return the abbreviation
*/
public String getAbbreviation() {
return abbreviation;
}
/**
* @param abbreviation the abbreviation to set
*/
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
/**
* @return the sourceName
*/
public String getSourceName() {
return sourceName;
}
/**
* @param sourceName the sourceName to set
*/
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
/**
* @return the theme
*/
public String getTheme() {
return theme;
}
/**
* @param theme the theme to set
*/
public void setTheme(String theme) {
this.theme = theme;
}
/**
* @return the subtheme
*/
public String getSubtheme() {
return subtheme;
}
/**
* @param subtheme the subtheme to set
*/
public void setSubtheme(String subtheme) {
this.subtheme = subtheme;
}
/**
* @return the bookPages
*/
public String getBookPages() {
return bookPages;
}
/**
* @param bookPages the bookPages to set
*/
public void setBookPages(String bookPages) {
this.bookPages = bookPages;
}
/**
* @return the worksheets
*/
public String getWorksheets() {
return worksheets;
}
/**
* @param worksheets the worksheets to set
*/
public void setWorksheets(String worksheets) {
this.worksheets = worksheets;
}
/**
* @return the bibleverse
*/
public String getBibleverse() {
return bibleverse;
}
/**
* @param bibleverse the bibleverse to set
*/
public void setBibleverse(String bibleverse) {
this.bibleverse = bibleverse;
}
/**
* @return the subjectNotes
*/
public String getSubjectNotes() {
return subjectNotes;
}
/**
* @param subjectNotes the subjectNotes to set
*/
public void setSubjectNotes(String subjectNotes) {
this.subjectNotes = subjectNotes;
}
/**
* @return the lessonNotes
*/
public String getLessonNotes() {
return lessonNotes;
}
/**
* @param lessonNotes the lessonNotes to set
*/
public void setLessonNotes(String lessonNotes) {
this.lessonNotes = lessonNotes;
}
/**
* @return the slotNotes
*/
public String getSlotNotes() {
return slotNotes;
}
/**
* @param slotNotes the slotNotes to set
*/
public void setSlotNotes(String slotNotes) {
this.slotNotes = slotNotes;
}
/**
* @return the pkSlot
*/
public Integer getPkSlot() {
return pkSlot;
}
/**
* @param pkSlot the pkSlot to set
*/
public void setPkSlot(Integer pkSlot) {
this.pkSlot = pkSlot;
}
/**
* @return the pkSubject
*/
public Integer getPkSubject() {
return pkSubject;
}
/**
* @param pkSubject the pkSubject to set
*/
public void setPkSubject(Integer pkSubject) {
this.pkSubject = pkSubject;
}
}