bug修复
This commit is contained in:
@@ -3,7 +3,7 @@ package com.roomroot.jwgl.dto.kcb;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 今日 / 本周 / 班次课表查询条件。
|
||||
* 班次课表查询条件。
|
||||
* <p>未传年度、学期时按当前时间取本学期。</p>
|
||||
*/
|
||||
@Data
|
||||
|
||||
@@ -43,4 +43,24 @@ public interface SSDKSQMapper extends BaseMapper<SSDKSQ> {
|
||||
* 查询可供调课的课次(学员队任务表 + 课表 + 课程表)。
|
||||
*/
|
||||
List<AdjustableLessonVO> selectAdjustableLessons(@Param("jybh") String jybh, @Param("nd") Integer nd);
|
||||
|
||||
/**
|
||||
* 按课次编号批量查询教室,用于回填调课提交默认值。
|
||||
*/
|
||||
List<AdjustableLessonVO.ChildRow> selectLessonRooms(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 按课次编号批量查询辅助教员,用于回填调课提交默认值。
|
||||
*/
|
||||
List<AdjustableLessonVO.ChildRow> selectLessonTeachers(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 按课次编号批量查询学员队,用于回填调课提交默认值。
|
||||
*/
|
||||
List<AdjustableLessonVO.ChildRow> selectLessonTeams(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* 按课次编号批量查询保障明细,用于回填调课提交默认值。
|
||||
*/
|
||||
List<AdjustableLessonVO.ChildRow> selectLessonSupports(@Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
@@ -63,17 +63,36 @@
|
||||
<result column="实施_课程表编号" property="sskcbbh"/>
|
||||
<result column="上课日期" property="rq"/>
|
||||
<result column="节次" property="jc"/>
|
||||
<result column="年度" property="nd"/>
|
||||
<result column="申请教员编号" property="sqjybh"/>
|
||||
<result column="学员队任务编号" property="xydrwbh"/>
|
||||
<result column="课编号" property="kbh"/>
|
||||
<result column="课程表编号" property="kcbbh"/>
|
||||
<result column="新教室编号" property="xjsbh"/>
|
||||
<result column="教学内容" property="jxnr"/>
|
||||
<result column="教学要点" property="jxyd"/>
|
||||
<result column="教学方法" property="jxff"/>
|
||||
<result column="教学保障备注" property="jxbzbz"/>
|
||||
<result column="用车信息" property="ycxx"/>
|
||||
<result column="原教室编号" property="yjsbh"/>
|
||||
<result column="课程名称" property="kcmc"/>
|
||||
<result column="学员队编号" property="xydbh"/>
|
||||
<result column="学员队名称" property="xydmc"/>
|
||||
<result column="教员编号" property="jybh"/>
|
||||
<result column="课次序号" property="kcxh"/>
|
||||
<result column="教室编号" property="jsbh"/>
|
||||
<result column="年度" property="nd"/>
|
||||
<result column="教研室代号" property="jysdh"/>
|
||||
<result column="课程表编号" property="kcbbh"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="AdjustableLessonChildMap" type="com.roomroot.jwgl.vo.courserunning.AdjustableLessonVO$ChildRow">
|
||||
<result column="实施_课程表编号" property="sskcbbh"/>
|
||||
<result column="教室编号" property="jsbh"/>
|
||||
<result column="备注" property="bz"/>
|
||||
<result column="辅助教员编号" property="fzjybh"/>
|
||||
<result column="主教员" property="zjy"/>
|
||||
<result column="学员队编号" property="xydbh"/>
|
||||
<result column="保障提供明细编号" property="bztgmxbh"/>
|
||||
<result column="数量" property="sl"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 以实施_调课申请为主表,经实施_课程表关联课表、课程表、学员队任务表 -->
|
||||
@@ -193,12 +212,14 @@
|
||||
WHERE a.编号 = #{ssdksqbh}
|
||||
</select>
|
||||
|
||||
<!-- 教员可选课次:实施_课程表 + 课表 + 课程表 + 学员队任务表 -->
|
||||
<!-- 教员可选课次:实施_课程表 + 课表 + 课程表 + 学员队任务表,字段对齐调课提交默认值 -->
|
||||
<select id="selectAdjustableLessons" resultMap="AdjustableLessonMap">
|
||||
SELECT
|
||||
b.编号 AS 实施_课程表编号,
|
||||
b.日期 AS 上课日期,
|
||||
b.节次,
|
||||
b.年度,
|
||||
e.教员编号 AS 申请教员编号,
|
||||
(
|
||||
SELECT MAX(rw.编号)
|
||||
FROM "学员队任务表" rw
|
||||
@@ -208,6 +229,28 @@
|
||||
AND COALESCE(rw.DEL_FLAG, 0) = 0
|
||||
) AS 学员队任务编号,
|
||||
e.科目编号 AS 课编号,
|
||||
(
|
||||
SELECT MAX(kcb.编号)
|
||||
FROM "课程表" kcb
|
||||
WHERE kcb.教员编号 = e.教员编号
|
||||
AND kcb.课次序号 = e.教员课次序号
|
||||
AND kcb.年度 = e.年度
|
||||
) AS 课程表编号,
|
||||
COALESCE(e.教室编号, (
|
||||
SELECT MAX(js.教室编号)
|
||||
FROM "实施_课程表_教室" js
|
||||
WHERE js.实施_课程表编号 = b.编号
|
||||
)) AS 新教室编号,
|
||||
b.教学内容,
|
||||
b.教学要点,
|
||||
b.教学方法,
|
||||
b.教学保障备注,
|
||||
b.用车信息,
|
||||
COALESCE(e.教室编号, (
|
||||
SELECT MAX(js.教室编号)
|
||||
FROM "实施_课程表_教室" js
|
||||
WHERE js.实施_课程表编号 = b.编号
|
||||
)) AS 原教室编号,
|
||||
COALESCE(kb.课名称, (
|
||||
SELECT MAX(k2.课名称) FROM "课表" k2 WHERE k2.科目代码 = e.科目编号
|
||||
)) AS 课程名称,
|
||||
@@ -229,15 +272,7 @@
|
||||
FROM "实施_课程表_教室" js
|
||||
WHERE js.实施_课程表编号 = b.编号
|
||||
)) AS 教室编号,
|
||||
b.年度,
|
||||
jy.教研室代号,
|
||||
(
|
||||
SELECT MAX(kcb.编号)
|
||||
FROM "课程表" kcb
|
||||
WHERE kcb.教员编号 = e.教员编号
|
||||
AND kcb.课次序号 = e.教员课次序号
|
||||
AND kcb.年度 = e.年度
|
||||
) AS 课程表编号
|
||||
jy.教研室代号
|
||||
FROM "实施_课程表" b
|
||||
JOIN "实施_课程" e ON LOWER(RAWTOHEX(e."编号")) = LOWER(REPLACE(TRIM(b.实施_课程编号), '-', ''))
|
||||
LEFT JOIN "课表" kb ON kb.课编号 = e.科目编号
|
||||
@@ -252,4 +287,40 @@
|
||||
ORDER BY b.年度 DESC, b.日期 DESC, b.节次 ASC
|
||||
</select>
|
||||
|
||||
<select id="selectLessonRooms" resultMap="AdjustableLessonChildMap">
|
||||
SELECT "实施_课程表编号", "教室编号", "备注"
|
||||
FROM "实施_课程表_教室"
|
||||
WHERE "实施_课程表编号" IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectLessonTeachers" resultMap="AdjustableLessonChildMap">
|
||||
SELECT "实施_课程表编号", "辅助教员编号", "主教员", "备注"
|
||||
FROM "实施_课程表_辅助教员"
|
||||
WHERE "实施_课程表编号" IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectLessonTeams" resultMap="AdjustableLessonChildMap">
|
||||
SELECT "实施_课程表编号", "学员队编号"
|
||||
FROM "实施_课程表_学员队"
|
||||
WHERE "实施_课程表编号" IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectLessonSupports" resultMap="AdjustableLessonChildMap">
|
||||
SELECT a."课程表编号" AS "实施_课程表编号", a."保障提供明细编号", a."数量", a."备注"
|
||||
FROM "课程表_保障明细" a
|
||||
WHERE a."课程表编号" IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
+1
-1
@@ -178,7 +178,7 @@ public interface CourseRunningImportService {
|
||||
PageResult<ScheduleAdjustApplyVO> queryScheduleAdjustList(ScheduleAdjustQueryDTO query);
|
||||
|
||||
/**
|
||||
* 查询当前教员可供调课的课次,关联学员队任务表、课表、课程表。
|
||||
* 查询当前教员可供调课的课次,字段对齐调课提交默认值。
|
||||
*
|
||||
* @param nd 年度,可空
|
||||
* @return 可选课次列表
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.roomroot.jwgl.entity.KCB;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
import com.roomroot.jwgl.unit.PageResult;
|
||||
import com.roomroot.jwgl.vo.kcb.ClassTimetableVO;
|
||||
import com.roomroot.jwgl.vo.kcb.DailyWeeklyTimetableVO;
|
||||
import com.roomroot.jwgl.vo.kcb.DailyWeeklyTimetableRangeVO;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.util.List;
|
||||
@@ -59,14 +59,14 @@ public interface KCBService {
|
||||
List<KCB> list();
|
||||
|
||||
/**
|
||||
* 今日课表。未传年度时按当前时间取本学期。
|
||||
* 今日课表。rq 为当前查看日期,offset 为相对天数,可连续切换。
|
||||
*/
|
||||
List<DailyWeeklyTimetableVO> listToday(TimetableQuery cond);
|
||||
DailyWeeklyTimetableRangeVO listToday(String rq, Integer offset);
|
||||
|
||||
/**
|
||||
* 本周课表(周一至周日)。未传年度时按当前时间取本学期。
|
||||
* 本周课表(周一至周日)。rq 为当前查看日期,offset 为相对周数,可连续切换。
|
||||
*/
|
||||
List<DailyWeeklyTimetableVO> listWeek(TimetableQuery cond);
|
||||
DailyWeeklyTimetableRangeVO listWeek(String rq, Integer offset);
|
||||
|
||||
/**
|
||||
* 班次课表。未传年度时按当前时间取本学期,可按队别班次筛选。
|
||||
|
||||
+158
-22
@@ -898,7 +898,9 @@ public class CourseRunningImportServiceImpl implements CourseRunningImportServic
|
||||
|
||||
@Override
|
||||
public List<AdjustableLessonVO> listAdjustableLessons(Integer nd) {
|
||||
return ssdksqMapper.selectAdjustableLessons(jwglRoleHelper.requireTeacherId(), nd);
|
||||
List<AdjustableLessonVO> lessons = ssdksqMapper.selectAdjustableLessons(jwglRoleHelper.requireTeacherId(), nd);
|
||||
fillAdjustableLessonSubmitDefaults(lessons);
|
||||
return lessons;
|
||||
}
|
||||
|
||||
private void applyScheduleAdjustDataScope(ScheduleAdjustQueryDTO query) {
|
||||
@@ -973,6 +975,7 @@ public class CourseRunningImportServiceImpl implements CourseRunningImportServic
|
||||
|
||||
AdjustableLessonVO picked = null;
|
||||
List<AdjustableLessonVO> mine = ssdksqMapper.selectAdjustableLessons(teacherId, lesson.getNd());
|
||||
fillAdjustableLessonSubmitDefaults(mine);
|
||||
if (mine != null) {
|
||||
for (AdjustableLessonVO item : mine) {
|
||||
if (lesson.getBh().equals(item.getSskcbbh())) {
|
||||
@@ -992,23 +995,23 @@ public class CourseRunningImportServiceImpl implements CourseRunningImportServic
|
||||
apply.setYdsjap(resolveYdsjap(lesson));
|
||||
apply.setZxzt(0);
|
||||
apply.setYszt(0);
|
||||
apply.setXydrwbh(cut(StringUtils.isNotEmpty(dto.getXydrwbh()) ? dto.getXydrwbh() : picked.getXydrwbh(), 50));
|
||||
apply.setKbh(cut(StringUtils.isNotEmpty(dto.getKbh()) ? dto.getKbh() : picked.getKbh(), 50));
|
||||
apply.setKcbbh(cut(StringUtils.isNotEmpty(dto.getKcbbh()) ? dto.getKcbbh() : picked.getKcbbh(), 50));
|
||||
apply.setXydrwbh(cut(firstNonEmpty(dto.getXydrwbh(), picked.getXydrwbh()), 50));
|
||||
apply.setKbh(cut(firstNonEmpty(dto.getKbh(), picked.getKbh()), 50));
|
||||
apply.setKcbbh(cut(firstNonEmpty(dto.getKcbbh(), picked.getKcbbh()), 50));
|
||||
apply.setJysdh(cut(picked.getJysdh(), 50));
|
||||
apply.setYjsbh(cut(picked.getJsbh(), 50));
|
||||
apply.setXjsbh(cut(resolveNewClassroom(dto), 50));
|
||||
apply.setYjsbh(cut(firstNonEmpty(picked.getYjsbh(), picked.getJsbh()), 50));
|
||||
apply.setXjsbh(cut(resolveNewClassroom(dto, picked), 50));
|
||||
apply.setSqjybh(cut(teacherId, 50));
|
||||
apply.setSy(cut(dto.getSy(), 200));
|
||||
apply.setRq(dto.getRq());
|
||||
apply.setJc(dto.getJc() != null ? dto.getJc() : 0);
|
||||
apply.setNd(dto.getNd() != null ? dto.getNd() : (lesson.getNd() != null ? lesson.getNd() : 0));
|
||||
apply.setJxnr(cut(dto.getJxnr(), 500));
|
||||
apply.setJxyd(dto.getJxyd());
|
||||
String jxff = cut(dto.getJxff(), 50);
|
||||
apply.setJxnr(cut(firstNonEmpty(dto.getJxnr(), picked.getJxnr()), 500));
|
||||
apply.setJxyd(firstNonEmpty(dto.getJxyd(), picked.getJxyd()));
|
||||
String jxff = cut(firstNonEmpty(dto.getJxff(), picked.getJxff()), 50);
|
||||
apply.setJxff(jxff == null ? "" : jxff);
|
||||
apply.setJxbzbz(dto.getJxbzbz());
|
||||
apply.setYcxx(dto.getYcxx());
|
||||
apply.setJxbzbz(firstNonEmpty(dto.getJxbzbz(), picked.getJxbzbz()));
|
||||
apply.setYcxx(firstNonEmpty(dto.getYcxx(), picked.getYcxx()));
|
||||
apply.setBz(cut(dto.getBz(), 50));
|
||||
apply.setJyspzzt(0);
|
||||
apply.setJyscszt(0);
|
||||
@@ -1018,8 +1021,9 @@ public class CourseRunningImportServiceImpl implements CourseRunningImportServic
|
||||
apply.setCjsj(LocalDateTime.now());
|
||||
ssdksqMapper.insert(apply);
|
||||
|
||||
if (dto.getRoomList() != null && !dto.getRoomList().isEmpty()) {
|
||||
for (AdjustRoomDTO roomDto : dto.getRoomList()) {
|
||||
List<AdjustRoomDTO> roomList = dto.getRoomList() != null ? dto.getRoomList() : picked.getRoomList();
|
||||
if (roomList != null && !roomList.isEmpty()) {
|
||||
for (AdjustRoomDTO roomDto : roomList) {
|
||||
if (StringUtils.isEmpty(roomDto.getJsbh())) {
|
||||
continue;
|
||||
}
|
||||
@@ -1043,8 +1047,9 @@ public class CourseRunningImportServiceImpl implements CourseRunningImportServic
|
||||
roomEntity.setJc(apply.getJc());
|
||||
dksqjsMapper.insert(roomEntity);
|
||||
}
|
||||
if (dto.getTeacherList() != null && !dto.getTeacherList().isEmpty()) {
|
||||
for (AdjustTeacherDTO teacherDto : dto.getTeacherList()) {
|
||||
List<AdjustTeacherDTO> teacherList = dto.getTeacherList() != null ? dto.getTeacherList() : picked.getTeacherList();
|
||||
if (teacherList != null && !teacherList.isEmpty()) {
|
||||
for (AdjustTeacherDTO teacherDto : teacherList) {
|
||||
if (StringUtils.isEmpty(teacherDto.getFzjybh())) {
|
||||
continue;
|
||||
}
|
||||
@@ -1060,8 +1065,9 @@ public class CourseRunningImportServiceImpl implements CourseRunningImportServic
|
||||
dksqfzjyMapper.insert(teacherEntity);
|
||||
}
|
||||
}
|
||||
if (dto.getTeamList() != null && !dto.getTeamList().isEmpty()) {
|
||||
for (AdjustTeamDTO teamDto : dto.getTeamList()) {
|
||||
List<AdjustTeamDTO> teamList = dto.getTeamList() != null ? dto.getTeamList() : picked.getTeamList();
|
||||
if (teamList != null && !teamList.isEmpty()) {
|
||||
for (AdjustTeamDTO teamDto : teamList) {
|
||||
if (StringUtils.isEmpty(teamDto.getXydbh())) {
|
||||
continue;
|
||||
}
|
||||
@@ -1075,8 +1081,9 @@ public class CourseRunningImportServiceImpl implements CourseRunningImportServic
|
||||
dksqxydMapper.insert(teamEntity);
|
||||
}
|
||||
}
|
||||
if (dto.getSupportList() != null && !dto.getSupportList().isEmpty()) {
|
||||
for (AdjustSupportDTO supportDto : dto.getSupportList()) {
|
||||
List<AdjustSupportDTO> supportList = dto.getSupportList() != null ? dto.getSupportList() : picked.getSupportList();
|
||||
if (supportList != null && !supportList.isEmpty()) {
|
||||
for (AdjustSupportDTO supportDto : supportList) {
|
||||
if (StringUtils.isEmpty(supportDto.getBztgmxbh()) || supportDto.getSl() == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -1152,17 +1159,146 @@ public class CourseRunningImportServiceImpl implements CourseRunningImportServic
|
||||
return text.length() <= max ? text : text.substring(0, max);
|
||||
}
|
||||
|
||||
private String resolveNewClassroom(ScheduleAdjustApplyDTO dto) {
|
||||
if (StringUtils.isNotEmpty(dto.getXjsbh())) {
|
||||
private String firstNonEmpty(String... values) {
|
||||
if (values == null) {
|
||||
return null;
|
||||
}
|
||||
for (String value : values) {
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String resolveNewClassroom(ScheduleAdjustApplyDTO dto, AdjustableLessonVO picked) {
|
||||
if (dto != null && StringUtils.isNotEmpty(dto.getXjsbh())) {
|
||||
return dto.getXjsbh().trim();
|
||||
}
|
||||
if (dto.getRoomList() != null && !dto.getRoomList().isEmpty()
|
||||
if (dto != null && dto.getRoomList() != null && !dto.getRoomList().isEmpty()
|
||||
&& StringUtils.isNotEmpty(dto.getRoomList().get(0).getJsbh())) {
|
||||
return dto.getRoomList().get(0).getJsbh().trim();
|
||||
}
|
||||
if (picked != null && StringUtils.isNotEmpty(picked.getXjsbh())) {
|
||||
return picked.getXjsbh().trim();
|
||||
}
|
||||
if (picked != null && picked.getRoomList() != null && !picked.getRoomList().isEmpty()
|
||||
&& StringUtils.isNotEmpty(picked.getRoomList().get(0).getJsbh())) {
|
||||
return picked.getRoomList().get(0).getJsbh().trim();
|
||||
}
|
||||
if (picked != null && StringUtils.isNotEmpty(picked.getJsbh())) {
|
||||
return picked.getJsbh().trim();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 把当前课次的教室、辅助教员、学员队、保障明细回填到可选课次上,供提交调课直接使用。
|
||||
*/
|
||||
private void fillAdjustableLessonSubmitDefaults(List<AdjustableLessonVO> lessons) {
|
||||
if (lessons == null || lessons.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<String> ids = new ArrayList<>();
|
||||
Map<String, AdjustableLessonVO> byId = new HashMap<>();
|
||||
for (AdjustableLessonVO lesson : lessons) {
|
||||
if (lesson == null || StringUtils.isEmpty(lesson.getSskcbbh())) {
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.isEmpty(lesson.getSqjybh())) {
|
||||
lesson.setSqjybh(lesson.getJybh());
|
||||
}
|
||||
if (StringUtils.isEmpty(lesson.getYjsbh())) {
|
||||
lesson.setYjsbh(lesson.getJsbh());
|
||||
}
|
||||
if (StringUtils.isEmpty(lesson.getXjsbh())) {
|
||||
lesson.setXjsbh(lesson.getJsbh());
|
||||
}
|
||||
if (lesson.getJxff() == null) {
|
||||
lesson.setJxff("");
|
||||
}
|
||||
lesson.setRoomList(new ArrayList<>());
|
||||
lesson.setTeacherList(new ArrayList<>());
|
||||
lesson.setTeamList(new ArrayList<>());
|
||||
lesson.setSupportList(new ArrayList<>());
|
||||
ids.add(lesson.getSskcbbh());
|
||||
byId.put(lesson.getSskcbbh(), lesson);
|
||||
}
|
||||
if (ids.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<AdjustableLessonVO.ChildRow> rooms = ssdksqMapper.selectLessonRooms(ids);
|
||||
if (rooms != null) {
|
||||
for (AdjustableLessonVO.ChildRow row : rooms) {
|
||||
AdjustableLessonVO lesson = byId.get(row.getSskcbbh());
|
||||
if (lesson == null || StringUtils.isEmpty(row.getJsbh())) {
|
||||
continue;
|
||||
}
|
||||
AdjustRoomDTO dto = new AdjustRoomDTO();
|
||||
dto.setJsbh(row.getJsbh());
|
||||
dto.setBz(row.getBz());
|
||||
lesson.getRoomList().add(dto);
|
||||
}
|
||||
}
|
||||
List<AdjustableLessonVO.ChildRow> teachers = ssdksqMapper.selectLessonTeachers(ids);
|
||||
if (teachers != null) {
|
||||
for (AdjustableLessonVO.ChildRow row : teachers) {
|
||||
AdjustableLessonVO lesson = byId.get(row.getSskcbbh());
|
||||
if (lesson == null || StringUtils.isEmpty(row.getFzjybh())) {
|
||||
continue;
|
||||
}
|
||||
AdjustTeacherDTO dto = new AdjustTeacherDTO();
|
||||
dto.setFzjybh(row.getFzjybh());
|
||||
dto.setZjy(row.getZjy() == null ? 0 : row.getZjy());
|
||||
dto.setBz(row.getBz());
|
||||
lesson.getTeacherList().add(dto);
|
||||
}
|
||||
}
|
||||
List<AdjustableLessonVO.ChildRow> teams = ssdksqMapper.selectLessonTeams(ids);
|
||||
if (teams != null) {
|
||||
for (AdjustableLessonVO.ChildRow row : teams) {
|
||||
AdjustableLessonVO lesson = byId.get(row.getSskcbbh());
|
||||
if (lesson == null || StringUtils.isEmpty(row.getXydbh())) {
|
||||
continue;
|
||||
}
|
||||
AdjustTeamDTO dto = new AdjustTeamDTO();
|
||||
dto.setXydbh(row.getXydbh());
|
||||
lesson.getTeamList().add(dto);
|
||||
}
|
||||
}
|
||||
List<AdjustableLessonVO.ChildRow> supports = ssdksqMapper.selectLessonSupports(ids);
|
||||
if (supports != null) {
|
||||
for (AdjustableLessonVO.ChildRow row : supports) {
|
||||
AdjustableLessonVO lesson = byId.get(row.getSskcbbh());
|
||||
if (lesson == null || StringUtils.isEmpty(row.getBztgmxbh()) || row.getSl() == null) {
|
||||
continue;
|
||||
}
|
||||
AdjustSupportDTO dto = new AdjustSupportDTO();
|
||||
dto.setBztgmxbh(row.getBztgmxbh());
|
||||
dto.setSl(row.getSl());
|
||||
dto.setBz(row.getBz());
|
||||
lesson.getSupportList().add(dto);
|
||||
}
|
||||
}
|
||||
for (AdjustableLessonVO lesson : lessons) {
|
||||
if (lesson.getRoomList() != null && !lesson.getRoomList().isEmpty()) {
|
||||
if (StringUtils.isEmpty(lesson.getXjsbh())) {
|
||||
lesson.setXjsbh(lesson.getRoomList().get(0).getJsbh());
|
||||
}
|
||||
if (StringUtils.isEmpty(lesson.getYjsbh())) {
|
||||
lesson.setYjsbh(lesson.getRoomList().get(0).getJsbh());
|
||||
}
|
||||
if (StringUtils.isEmpty(lesson.getJsbh())) {
|
||||
lesson.setJsbh(lesson.getRoomList().get(0).getJsbh());
|
||||
}
|
||||
} else if (StringUtils.isNotEmpty(lesson.getJsbh())) {
|
||||
AdjustRoomDTO dto = new AdjustRoomDTO();
|
||||
dto.setJsbh(lesson.getJsbh());
|
||||
lesson.getRoomList().add(dto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 教研室审批调课申请。
|
||||
* <p>
|
||||
|
||||
+35
-11
@@ -9,11 +9,14 @@ import com.roomroot.jwgl.mapper.KCBMapper;
|
||||
import com.roomroot.jwgl.mapper.KcbTimetableMapper;
|
||||
import com.roomroot.jwgl.mapper.SystemInitializationMapper;
|
||||
import com.roomroot.jwgl.service.KCBService;
|
||||
import com.roomroot.jwgl.unit.BusinessException;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
import com.roomroot.jwgl.unit.PageResult;
|
||||
import com.roomroot.jwgl.utils.UuidUtil;
|
||||
import com.roomroot.jwgl.utils.BasicManagementConstants;
|
||||
import com.roomroot.jwgl.utils.JwglRoleHelper;
|
||||
import com.roomroot.jwgl.vo.kcb.ClassTimetableVO;
|
||||
import com.roomroot.jwgl.vo.kcb.DailyWeeklyTimetableRangeVO;
|
||||
import com.roomroot.jwgl.vo.kcb.DailyWeeklyTimetableVO;
|
||||
import com.roomroot.jwgl.vo.kcb.SemesterGradeExportVO;
|
||||
import com.roomroot.jwgl.vo.systeminitialization.SemesterInitializationVO;
|
||||
@@ -25,6 +28,7 @@ import java.time.DayOfWeek;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -85,20 +89,19 @@ public class KCBServiceImpl implements KCBService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DailyWeeklyTimetableVO> listToday(TimetableQuery cond) {
|
||||
TimetableQuery filter = prepareFilter(cond);
|
||||
String today = LocalDate.now().format(DATE_FORMAT);
|
||||
return kcbTimetableMapper.selectLessonTimetable(filter, today, today);
|
||||
public DailyWeeklyTimetableRangeVO listToday(String rq, Integer offset) {
|
||||
int dayOffset = offset == null ? 0 : offset;
|
||||
LocalDate day = parseViewDate(rq).plusDays(dayOffset);
|
||||
return buildRangeResult(day, day, day);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DailyWeeklyTimetableVO> listWeek(TimetableQuery cond) {
|
||||
TimetableQuery filter = prepareFilter(cond);
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDate monday = today.with(DayOfWeek.MONDAY);
|
||||
LocalDate sunday = today.with(DayOfWeek.SUNDAY);
|
||||
return kcbTimetableMapper.selectLessonTimetable(filter,
|
||||
monday.format(DATE_FORMAT), sunday.format(DATE_FORMAT));
|
||||
public DailyWeeklyTimetableRangeVO listWeek(String rq, Integer offset) {
|
||||
int weekOffset = offset == null ? 0 : offset;
|
||||
LocalDate day = parseViewDate(rq).plusWeeks(weekOffset);
|
||||
LocalDate monday = day.with(DayOfWeek.MONDAY);
|
||||
LocalDate sunday = day.with(DayOfWeek.SUNDAY);
|
||||
return buildRangeResult(monday, monday, sunday);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -136,6 +139,27 @@ public class KCBServiceImpl implements KCBService {
|
||||
util.exportExcel(response, list, "班次课程列表");
|
||||
}
|
||||
|
||||
private LocalDate parseViewDate(String rq) {
|
||||
if (StringUtils.isEmpty(rq)) {
|
||||
return LocalDate.now();
|
||||
}
|
||||
try {
|
||||
return LocalDate.parse(rq.trim(), DATE_FORMAT);
|
||||
} catch (DateTimeParseException e) {
|
||||
throw new BusinessException(BasicManagementConstants.BAD_REQUEST, "日期格式应为 yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
|
||||
private DailyWeeklyTimetableRangeVO buildRangeResult(LocalDate viewDate, LocalDate start, LocalDate end) {
|
||||
DailyWeeklyTimetableRangeVO result = new DailyWeeklyTimetableRangeVO();
|
||||
result.setRq(viewDate.format(DATE_FORMAT));
|
||||
result.setStartDate(start.format(DATE_FORMAT));
|
||||
result.setEndDate(end.format(DATE_FORMAT));
|
||||
result.setList(kcbTimetableMapper.selectLessonTimetable(
|
||||
null, result.getStartDate(), result.getEndDate()));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 未传年度时按当前学期填充;队别班次名称去空白。
|
||||
* 学员强制只看本人所在学员队课表。
|
||||
|
||||
+80
-18
@@ -1,52 +1,114 @@
|
||||
package com.roomroot.jwgl.vo.courserunning;
|
||||
|
||||
import com.roomroot.jwgl.dto.courserunning.AdjustRoomDTO;
|
||||
import com.roomroot.jwgl.dto.courserunning.AdjustSupportDTO;
|
||||
import com.roomroot.jwgl.dto.courserunning.AdjustTeacherDTO;
|
||||
import com.roomroot.jwgl.dto.courserunning.AdjustTeamDTO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 可供调课的课次,来自学员队任务表,并关联课表、课程表。
|
||||
* 可供调课的课次。
|
||||
* <p>
|
||||
* 字段与 {@code /adjust/submit} 入参对齐:除事由、备注等需用户填写的项外,
|
||||
* 其余提交字段均带出当前课次默认值,前端可直接用于新增调课申请。
|
||||
* </p>
|
||||
*/
|
||||
@Data
|
||||
public class AdjustableLessonVO {
|
||||
|
||||
/** 实施_课程表编号(实施_调课申请主关联) */
|
||||
/** 实施_课程表编号,对应提交参数 sskcbbh */
|
||||
private String sskcbbh;
|
||||
|
||||
/** 原上课日期 */
|
||||
private java.time.LocalDateTime rq;
|
||||
/** 当前上课日期,作为提交参数 rq 的默认值 */
|
||||
private LocalDateTime rq;
|
||||
|
||||
/** 原节次 */
|
||||
/** 当前节次,作为提交参数 jc 的默认值 */
|
||||
private Integer jc;
|
||||
|
||||
/** 学员队任务表编号 */
|
||||
/** 年度,对应提交参数 nd */
|
||||
private Integer nd;
|
||||
|
||||
/** 申请教员编号,对应提交参数 sqjybh */
|
||||
private String sqjybh;
|
||||
|
||||
/** 学员队任务表编号,对应提交参数 xydrwbh */
|
||||
private String xydrwbh;
|
||||
|
||||
/** 课表.课编号 */
|
||||
/** 课表.课编号,对应提交参数 kbh */
|
||||
private String kbh;
|
||||
|
||||
/** 课程名称 */
|
||||
/** 课程表编号,对应提交参数 kcbbh */
|
||||
private String kcbbh;
|
||||
|
||||
/** 拟调整教室编号,默认当前教室,对应提交参数 xjsbh */
|
||||
private String xjsbh;
|
||||
|
||||
/** 当前教学内容,对应提交参数 jxnr */
|
||||
private String jxnr;
|
||||
|
||||
/** 当前教学要点,对应提交参数 jxyd */
|
||||
private String jxyd;
|
||||
|
||||
/** 当前教学方法,对应提交参数 jxff */
|
||||
private String jxff;
|
||||
|
||||
/** 当前教学保障备注,对应提交参数 jxbzbz */
|
||||
private String jxbzbz;
|
||||
|
||||
/** 当前用车信息,对应提交参数 ycxx */
|
||||
private String ycxx;
|
||||
|
||||
/** 当前教室列表,对应提交参数 roomList */
|
||||
private List<AdjustRoomDTO> roomList;
|
||||
|
||||
/** 当前辅助教员列表,对应提交参数 teacherList */
|
||||
private List<AdjustTeacherDTO> teacherList;
|
||||
|
||||
/** 当前学员队列表,对应提交参数 teamList */
|
||||
private List<AdjustTeamDTO> teamList;
|
||||
|
||||
/** 当前保障明细列表,对应提交参数 supportList */
|
||||
private List<AdjustSupportDTO> supportList;
|
||||
|
||||
/** 原教室编号 */
|
||||
private String yjsbh;
|
||||
|
||||
/** 课程名称(展示用) */
|
||||
private String kcmc;
|
||||
|
||||
/** 学员队编号 */
|
||||
/** 学员队编号(展示用) */
|
||||
private String xydbh;
|
||||
|
||||
/** 学员队名称 */
|
||||
/** 学员队名称(展示用) */
|
||||
private String xydmc;
|
||||
|
||||
/** 教员编号 */
|
||||
/** 教员编号(展示用) */
|
||||
private String jybh;
|
||||
|
||||
/** 课次序号 */
|
||||
/** 课次序号(展示用) */
|
||||
private Integer kcxh;
|
||||
|
||||
/** 教室编号 */
|
||||
/** 当前教室编号(展示用,与 xjsbh 同值) */
|
||||
private String jsbh;
|
||||
|
||||
/** 年度 */
|
||||
private Integer nd;
|
||||
|
||||
/** 教研室代号 */
|
||||
private String jysdh;
|
||||
|
||||
/** 课程表编号 */
|
||||
private String kcbbh;
|
||||
/**
|
||||
* 课次关联子表明细行,仅用于批量回填,不对外返回。
|
||||
*/
|
||||
@Data
|
||||
public static class ChildRow {
|
||||
private String sskcbbh;
|
||||
private String jsbh;
|
||||
private String bz;
|
||||
private String fzjybh;
|
||||
private Integer zjy;
|
||||
private String xydbh;
|
||||
private String bztgmxbh;
|
||||
private Integer sl;
|
||||
}
|
||||
}
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.roomroot.jwgl.vo.kcb;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 今日课表、本周课表查询结果。
|
||||
* <p>
|
||||
* {@code rq} 为当前查看日期,连续点上一天/下一天/上一周/下一周时把该值回传,并带 offset。
|
||||
* </p>
|
||||
*/
|
||||
@Data
|
||||
public class DailyWeeklyTimetableRangeVO {
|
||||
|
||||
/** 当前查看日期(yyyy-MM-dd),下次切换时回传 */
|
||||
private String rq;
|
||||
|
||||
/** 查询起始日期 */
|
||||
private String startDate;
|
||||
|
||||
/** 查询结束日期 */
|
||||
private String endDate;
|
||||
|
||||
/** 课表行 */
|
||||
private List<DailyWeeklyTimetableVO> list;
|
||||
}
|
||||
Reference in New Issue
Block a user