corrected subject notes manipulation
This commit is contained in:
		| @@ -26,6 +26,7 @@ public class ThemeController extends CommonController { | ||||
| 	@GetMapping("/theme") | ||||
| 	public String getThemeManipulationBySlotId(@RequestParam("slotId") Integer slotId, Model model) { | ||||
| 		model.addAttribute("slotId", slotId); | ||||
| 		model.addAttribute("day", service.getSlotDay(slotId)); | ||||
| 		model.addAttribute("list", service.getThemeManipulation(slotId)); | ||||
| 		model.addAttribute("themes", service.getAllThemes()); | ||||
| 		model.addAttribute("lesson", service.getLesson(slotId)); | ||||
| @@ -49,6 +50,6 @@ public class ThemeController extends CommonController { | ||||
| 	@PostMapping("/theme/update") | ||||
| 	public String updateLesson(@RequestParam("slotId") Integer slotId, @ModelAttribute("lesson") TLessonRecord bean) { | ||||
| 		service.updateLesson(bean); | ||||
| 		return "redirect:/theme?slotId=" + bean.getFkSlot(); | ||||
| 		return "redirect:/theme?slotId=" + slotId; | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -2,9 +2,11 @@ package de.jottyfan.bico.modules.theme; | ||||
|  | ||||
| import static de.jottyfan.bico.db.Tables.T_LESSON; | ||||
| import static de.jottyfan.bico.db.Tables.T_LESSON_SUBJECT; | ||||
| import static de.jottyfan.bico.db.Tables.T_SLOT; | ||||
| import static de.jottyfan.bico.db.Tables.T_SOURCE; | ||||
| import static de.jottyfan.bico.db.Tables.T_SUBJECT; | ||||
|  | ||||
| import java.time.LocalDate; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Iterator; | ||||
| import java.util.List; | ||||
| @@ -13,6 +15,7 @@ import org.jboss.logging.Logger; | ||||
| import org.jooq.DSLContext; | ||||
| import org.jooq.DeleteConditionStep; | ||||
| import org.jooq.InsertOnDuplicateStep; | ||||
| import org.jooq.Record1; | ||||
| import org.jooq.Record10; | ||||
| import org.jooq.Record4; | ||||
| import org.jooq.SelectConditionStep; | ||||
| @@ -138,4 +141,15 @@ public class ThemeRepository { | ||||
| 		sql.execute(); | ||||
| 	} | ||||
|  | ||||
| 	public LocalDate getSlotDay(Integer slotId) { | ||||
| 		SelectConditionStep<Record1<LocalDate>> sql = jooq | ||||
| 		// @formatter:off | ||||
| 			.select(T_SLOT.SLOT_DAY) | ||||
| 			.from(T_SLOT) | ||||
| 			.where(T_SLOT.PK_SLOT.eq(slotId)); | ||||
| 		// @formatter:on | ||||
| 		LOGGER.trace(sql); | ||||
| 		return sql.fetchOne().get(T_SLOT.SLOT_DAY); | ||||
| 	} | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| package de.jottyfan.bico.modules.theme; | ||||
|  | ||||
| import java.time.LocalDate; | ||||
| import java.util.List; | ||||
|  | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -44,4 +45,7 @@ public class ThemeService { | ||||
| 		repository.updateLesson(bean); | ||||
| 	} | ||||
|  | ||||
| 	public LocalDate getSlotDay(Integer slotId) { | ||||
| 		return repository.getSlotDay(slotId); | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user