根据排课ID删除一些关联表。

beetlsql3-dev
Mlxa0324 2 years ago
parent 3c4f9c8250
commit 3aa01d9d42

@ -22,6 +22,13 @@ public interface TeacherOpenCourseMergeScheduleSessionDao extends BaseMapper<Tea
PageQuery<TeacherOpenCourseMergeScheduleSession> queryByConditionQuery(PageQuery query); PageQuery<TeacherOpenCourseMergeScheduleSession> queryByConditionQuery(PageQuery query);
@Update @Update
void deleteTeacherOpenCourseMergeScheduleSessionByIds(String ids); void deleteTeacherOpenCourseMergeScheduleSessionByIds(String ids);
/**
* ID
* @param ids
*/
@Update
void deleteTeacherOpenCourseMergeScheduleSessionByMasterIds(String ids);
@Update @Update
int updateGivenByIds(TeacherOpenCourseMergeScheduleSessionQuery teacherOpenCourseMergeScheduleSessionQuery); int updateGivenByIds(TeacherOpenCourseMergeScheduleSessionQuery teacherOpenCourseMergeScheduleSessionQuery);
List<TeacherOpenCourseMergeScheduleSession> getByIds(String ids); List<TeacherOpenCourseMergeScheduleSession> getByIds(String ids);

@ -35,8 +35,10 @@ interface TeacherOpenCourseScheduleSessionDao extends BaseMapper<TeacherOpenCour
/** /**
* *
*
* @param teacherOpenCourseId * @param teacherOpenCourseId
* @param teacherId
* @return * @return
*/ */
List<Map> getSessionNameList(Long teacherOpenCourseId); List<Map> getSessionNameList(Long teacherOpenCourseId, Long teacherId);
} }

@ -317,7 +317,7 @@ public class TeacherOpenCourseMergeScheduleSessionService extends CoreBaseServic
for (String id : teacherOpenCourseScheduleSessionIds.split(",")) { for (String id : teacherOpenCourseScheduleSessionIds.split(",")) {
Long teacherOpenCourseScheduleSessionId = Long.valueOf(id); Long teacherOpenCourseScheduleSessionId = Long.valueOf(id);
TeacherOpenCourseScheduleSession info = teacherOpenCourseScheduleSessionService.getInfo(teacherOpenCourseScheduleSessionId); TeacherOpenCourseScheduleSession info = teacherOpenCourseScheduleSessionService.getInfo(teacherOpenCourseScheduleSessionId);
query.setTeacherOpenCourseMergeScheduleSessionId(teacherOpenCourseScheduleSessionId); query.setTeacherOpenCourseScheduleSessionId(teacherOpenCourseScheduleSessionId);
query.setTeacherOpenCourseMergeScheduleSessionStatus(1); query.setTeacherOpenCourseMergeScheduleSessionStatus(1);
query.setTeacherOpenCourseId(info.getTeacherOpenCourseId()); query.setTeacherOpenCourseId(info.getTeacherOpenCourseId());
long count = teacherOpenCourseMergeScheduleSessionDao.templateCount(query); long count = teacherOpenCourseMergeScheduleSessionDao.templateCount(query);

@ -20,10 +20,7 @@ import com.ibeetl.admin.core.util.holidays.Holidays;
import com.ibeetl.admin.core.util.holidays.HolidaysUtils; import com.ibeetl.admin.core.util.holidays.HolidaysUtils;
import com.ibeetl.admin.core.web.JsonResult; import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode; import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.TeacherOpenCourseScheduleSessionClassDao; import com.ibeetl.jlw.dao.*;
import com.ibeetl.jlw.dao.TeacherOpenCourseScheduleSessionDao;
import com.ibeetl.jlw.dao.TeacherOpenCourseScheduleSessionSnapDao;
import com.ibeetl.jlw.dao.TeacherOpenCourseScheduleSessionTagDao;
import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSession; import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSession;
import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionClass; import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionClass;
import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionOptions; import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionOptions;
@ -67,6 +64,7 @@ import static java.util.stream.Collectors.toMap;
public class TeacherOpenCourseScheduleSessionService extends CoreBaseService<TeacherOpenCourseScheduleSession> implements DeleteResourcesBy{ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService<TeacherOpenCourseScheduleSession> implements DeleteResourcesBy{
@Autowired private TeacherOpenCourseScheduleSessionDao teacherOpenCourseScheduleSessionDao; @Autowired private TeacherOpenCourseScheduleSessionDao teacherOpenCourseScheduleSessionDao;
@Autowired private TeacherOpenCourseMergeScheduleSessionDao teacherOpenCourseMergeScheduleSessionDao;
@Lazy @Lazy
@Autowired TeacherOpenCourseScheduleSessionService teacherOpenCourseScheduleSessionService; @Autowired TeacherOpenCourseScheduleSessionService teacherOpenCourseScheduleSessionService;
@ -132,6 +130,7 @@ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService<Tea
try { try {
teacherOpenCourseScheduleSessionDao.deleteByIds(ids); teacherOpenCourseScheduleSessionDao.deleteByIds(ids);
teacherOpenCourseScheduleSessionSnapDao.deleteTeacherOpenCourseScheduleSessionBySessionIds(ids); teacherOpenCourseScheduleSessionSnapDao.deleteTeacherOpenCourseScheduleSessionBySessionIds(ids);
teacherOpenCourseMergeScheduleSessionDao.deleteTeacherOpenCourseMergeScheduleSessionByMasterIds(ids);
} catch (Exception e) { } catch (Exception e) {
throw new PlatformException("批量删除新增排课失败", e); throw new PlatformException("批量删除新增排课失败", e);
} }
@ -307,8 +306,8 @@ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService<Tea
* @param teacherOpenCourseId * @param teacherOpenCourseId
* @return * @return
*/ */
public List<Map> getSessionNameList(@NotNull(message = "开课ID不能为空") Long teacherOpenCourseId) { public List<Map> getSessionNameList(Long teacherOpenCourseId, Long teacherId) {
return teacherOpenCourseScheduleSessionDao.getSessionNameList(teacherOpenCourseId); return teacherOpenCourseScheduleSessionDao.getSessionNameList(teacherOpenCourseId, teacherId);
} }

@ -1,11 +1,14 @@
package com.ibeetl.jlw.web; package com.ibeetl.jlw.web;
import cn.hutool.core.util.ObjectUtil;
import cn.jlw.Interceptor.SCoreUser; import cn.jlw.Interceptor.SCoreUser;
import cn.jlw.Interceptor.TTeacher;
import cn.jlw.validate.ValidateConfig; import cn.jlw.validate.ValidateConfig;
import com.ibeetl.admin.core.annotation.Function; import com.ibeetl.admin.core.annotation.Function;
import com.ibeetl.admin.core.entity.CoreUser; import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.file.FileService; import com.ibeetl.admin.core.file.FileService;
import com.ibeetl.admin.core.web.JsonResult; import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.jlw.entity.Teacher;
import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSession; import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSession;
import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionClass; import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionClass;
import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionOptions; import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionOptions;
@ -101,11 +104,12 @@ public class TeacherOpenCourseScheduleSessionController{
*/ */
@GetMapping(API + "/getSessionNameList.do") @GetMapping(API + "/getSessionNameList.do")
@ResponseBody @ResponseBody
public JsonResult<List<Map>> getSessionNameList(Long teacherOpenCourseId, @SCoreUser CoreUser coreUser) { public JsonResult<List<Map>> getSessionNameList(Long teacherOpenCourseId, @SCoreUser CoreUser coreUser, @TTeacher Teacher teacher) {
if(null == coreUser){ if(null == coreUser){
return JsonResult.failMessage("请登录后再操作"); return JsonResult.failMessage("请登录后再操作");
}else{ }else{
List<Map> list = teacherOpenCourseScheduleSessionService.getSessionNameList(teacherOpenCourseId); List<Map> list = teacherOpenCourseScheduleSessionService
.getSessionNameList(teacherOpenCourseId, ObjectUtil.defaultIfNull(teacher, new Teacher()).getTeacherId());
return JsonResult.success(list); return JsonResult.success(list);
} }
} }

@ -99,6 +99,13 @@ deleteTeacherOpenCourseMergeScheduleSessionByIds
delete from teacher_open_course_merge_schedule_session where find_in_set(teacher_open_course_merge_schedule_session_id,#ids#) delete from teacher_open_course_merge_schedule_session where find_in_set(teacher_open_course_merge_schedule_session_id,#ids#)
deleteTeacherOpenCourseMergeScheduleSessionByMasterIds
===
* 批量删除根据主表的排课ID
delete from teacher_open_course_merge_schedule_session where find_in_set(teacher_open_course_schedule_session_id,#ids#)
getByIds getByIds

@ -518,4 +518,7 @@ getSessionNameList
AND t.teacher_open_course_schedule_session_status = 1 AND t.teacher_open_course_schedule_session_status = 1
@if(!isEmpty(teacherOpenCourseId)){ @if(!isEmpty(teacherOpenCourseId)){
and t.teacher_open_course_id =#teacherOpenCourseId# and t.teacher_open_course_id =#teacherOpenCourseId#
@}
@if(!isEmpty(teacherId)){
and t.teacher_id =#teacherId#
@} @}

@ -78,7 +78,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">开课节次</label> <label class="layui-form-label">开课节次</label>
<div class="layui-inline" style="width: 50%;"> <div class="layui-inline" style="width: 50%;">
<!-- <input id="kkJieciTableCheckBoxIds" value='${mapUtil.getPath(teacherOpenCourseScheduleSession.teacherOpenCourseScheduleSessionClassList, "$..teacherOpenCourseScheduleSessionTagId")}'/>--> <!-- mapUtil.getPath(teacherOpenCourseScheduleSession.teacherOpenCourseScheduleSessionClassList, "$..teacherOpenCourseScheduleSessionTagId") -->
<table id="kkJieciTable" class="layui-table" name="sessionTagList" lay-filter="kkJieciTable" <table id="kkJieciTable" class="layui-table" name="sessionTagList" lay-filter="kkJieciTable"
data-value='${teacherOpenCourseScheduleSession.teacherOpenCourseScheduleSessionClassList}'></table> data-value='${teacherOpenCourseScheduleSession.teacherOpenCourseScheduleSessionClassList}'></table>
</div> </div>

Loading…
Cancel
Save