forked from liweijie/education
添加排课功能
This commit is contained in:
+7
@@ -6,6 +6,7 @@ import com.roomroot.jwgl.service.SchedulingWindowService;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.vo.scheduling.SchedulingViewVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -32,6 +33,7 @@ public class SchedulingWindowController {
|
||||
/**
|
||||
* 排课窗组合视图:班次头 + 课程列表(排满标绿)+ 周次×星期×节次格子。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:schedulingWindow:list')")
|
||||
@GetMapping("/view")
|
||||
public Result<SchedulingViewVO> view(@RequestParam("xydxqbh") String xydxqbh) {
|
||||
return Result.success(schedulingWindowService.view(xydxqbh));
|
||||
@@ -40,6 +42,7 @@ public class SchedulingWindowController {
|
||||
/**
|
||||
* 安排所选节次。硬冲突格忽略并列出,软提示格照常安排并给出提示。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:schedulingWindow:edit')")
|
||||
@PostMapping("/arrange")
|
||||
public Result<Map<String, Object>> arrange(@RequestBody SchedulingArrangeRequest request) {
|
||||
return Result.success(schedulingWindowService.arrange(request));
|
||||
@@ -48,6 +51,7 @@ public class SchedulingWindowController {
|
||||
/**
|
||||
* 删除所选节次:仅删除该课程在这些格上的课次;已提交实施计划的课次拒绝。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:schedulingWindow:edit')")
|
||||
@PostMapping("/deleteCells")
|
||||
public Result<Integer> deleteCells(@RequestBody SchedulingCellOpRequest request) {
|
||||
return Result.success(schedulingWindowService.deleteCells(request));
|
||||
@@ -56,6 +60,7 @@ public class SchedulingWindowController {
|
||||
/**
|
||||
* 删除课程全部节次(课程仍留在列表)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:schedulingWindow:edit')")
|
||||
@PostMapping("/clearCourse")
|
||||
public Result<Integer> clearCourse(@RequestParam("sskcbh") String sskcbh) {
|
||||
return Result.success(schedulingWindowService.clearCourse(sskcbh));
|
||||
@@ -64,6 +69,7 @@ public class SchedulingWindowController {
|
||||
/**
|
||||
* 彻底删除运行课程:课次与列表项一起删,编制侧任务保留(教员不可用)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:schedulingWindow:edit')")
|
||||
@PostMapping("/deleteCourse")
|
||||
public Result<Integer> deleteCourse(@RequestParam("sskcbh") String sskcbh) {
|
||||
return Result.success(schedulingWindowService.deleteCourse(sskcbh));
|
||||
@@ -72,6 +78,7 @@ public class SchedulingWindowController {
|
||||
/**
|
||||
* 排课日志查询:按课程(可叠加操作类型)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:schedulingWindow:list')")
|
||||
@GetMapping("/logs")
|
||||
public Result<List<Map<String, Object>>> logs(@RequestParam("sskcbh") String sskcbh,
|
||||
@RequestParam(value = "czlx", required = false) String czlx) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.roomroot.jwgl.entity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -24,36 +25,43 @@ public class JYL {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField("名称")
|
||||
private String mc;
|
||||
|
||||
/**
|
||||
* 可排课
|
||||
*/
|
||||
@TableField("可排课")
|
||||
private Integer kpk;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@TableField("日期")
|
||||
private LocalDateTime rq;
|
||||
|
||||
/**
|
||||
* 节次
|
||||
*/
|
||||
@TableField("节次")
|
||||
private Integer jc;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("创建时间")
|
||||
private LocalDateTime cjsj;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("备注")
|
||||
private String bz;
|
||||
|
||||
/**
|
||||
* 教员编号
|
||||
*/
|
||||
@TableField("教员编号")
|
||||
private String jybh;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.roomroot.jwgl.entity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -24,46 +25,55 @@ public class SSKCBFZJY {
|
||||
/**
|
||||
* 实施_课程表编号
|
||||
*/
|
||||
@TableField("实施_课程表编号")
|
||||
private String sskcbbh;
|
||||
|
||||
/**
|
||||
* 辅助教员编号
|
||||
*/
|
||||
@TableField("辅助教员编号")
|
||||
private String fzjybh;
|
||||
|
||||
/**
|
||||
* 主教员
|
||||
*/
|
||||
@TableField("主教员")
|
||||
private Integer zjy;
|
||||
|
||||
/**
|
||||
* 年度
|
||||
*/
|
||||
@TableField("年度")
|
||||
private Integer nd;
|
||||
|
||||
/**
|
||||
* 参与学员测评
|
||||
*/
|
||||
@TableField("参与学员测评")
|
||||
private Integer cyxycp;
|
||||
|
||||
/**
|
||||
* 学员测评平均分
|
||||
*/
|
||||
@TableField("学员测评平均分")
|
||||
private Float xycppjf;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("备注")
|
||||
private String bz;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@TableField("日期")
|
||||
private LocalDateTime rq;
|
||||
|
||||
/**
|
||||
* 节次
|
||||
*/
|
||||
@TableField("节次")
|
||||
private Integer jc;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.roomroot.jwgl.entity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -24,36 +25,43 @@ public class SSKCBXYD {
|
||||
/**
|
||||
* 实施_课程表编号
|
||||
*/
|
||||
@TableField("实施_课程表编号")
|
||||
private String sskcbbh;
|
||||
|
||||
/**
|
||||
* 学员队编号
|
||||
*/
|
||||
@TableField("学员队编号")
|
||||
private String xydbh;
|
||||
|
||||
/**
|
||||
* 人数
|
||||
*/
|
||||
@TableField("人数")
|
||||
private Integer rs;
|
||||
|
||||
/**
|
||||
* 简称
|
||||
*/
|
||||
@TableField("简称")
|
||||
private String jc;
|
||||
|
||||
/**
|
||||
* 年度
|
||||
*/
|
||||
@TableField("年度")
|
||||
private Integer nd;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@TableField("日期")
|
||||
private LocalDateTime rq;
|
||||
|
||||
/**
|
||||
* 节次
|
||||
*/
|
||||
@TableField("节次")
|
||||
private Integer jc2;
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -399,6 +399,7 @@ public class SchedulingWindowServiceImpl implements SchedulingWindowService {
|
||||
lesson.setBh(UuidUtil.getUUID());
|
||||
lesson.setSskcbh(course.getBh());
|
||||
lesson.setJhsjap(0);
|
||||
lesson.setSjsjap(0);
|
||||
lesson.setJxnr(request.getJxnr());
|
||||
lesson.setJxyd(request.getJxyd());
|
||||
lesson.setJxff(request.getJxff() == null || request.getJxff().isEmpty() ? "理论讲授" : request.getJxff());
|
||||
@@ -406,10 +407,11 @@ public class SchedulingWindowServiceImpl implements SchedulingWindowService {
|
||||
lesson.setJc(cell.getJc());
|
||||
lesson.setNd(ctx.ndCode);
|
||||
lesson.setSczt(0);
|
||||
lesson.setXycpzt("未开始");
|
||||
lesson.setJcdj(request.getJcdj() == null ? 0 : request.getJcdj());
|
||||
lesson.setJxbzbz(request.getJxbzbz());
|
||||
lesson.setYcxx(request.getYcxx());
|
||||
lesson.setBzms(request.getBzms());
|
||||
lesson.setBzms(request.getBzms() == null || request.getBzms().isEmpty() ? "行政班" : request.getBzms());
|
||||
lesson.setCjsj(now);
|
||||
lesson.setBdsj(now);
|
||||
sskcbMapper.insert(lesson);
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 实施排课窗口:班次头 + 课程列表 + 周次×星期×节次格子。
|
||||
* 后端:SchedulingWindowController /schedulingWindow
|
||||
*/
|
||||
|
||||
// 排课窗组合视图
|
||||
export function getSchedulingView(xydxqbh) {
|
||||
return request({
|
||||
url: '/schedulingWindow/view',
|
||||
method: 'get',
|
||||
params: { xydxqbh }
|
||||
})
|
||||
}
|
||||
|
||||
// 安排所选节次(硬冲突格忽略并返回原因;软提示格照常安排)
|
||||
export function arrangeLessons(data) {
|
||||
return request({
|
||||
url: '/schedulingWindow/arrange',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除所选节次(仅删除该课程在这些格上的课次;已提交实施计划的课次会被拒绝)
|
||||
export function deleteLessonCells(data) {
|
||||
return request({
|
||||
url: '/schedulingWindow/deleteCells',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除该课程的全部节次(课程仍保留在列表)
|
||||
export function clearCourseLessons(sskcbh) {
|
||||
return request({
|
||||
url: '/schedulingWindow/clearCourse',
|
||||
method: 'post',
|
||||
params: { sskcbh }
|
||||
})
|
||||
}
|
||||
|
||||
// 彻底删除运行课程(课次与列表项一起删,编制侧任务保留)
|
||||
export function deleteRunningCourse(sskcbh) {
|
||||
return request({
|
||||
url: '/schedulingWindow/deleteCourse',
|
||||
method: 'post',
|
||||
params: { sskcbh }
|
||||
})
|
||||
}
|
||||
|
||||
// 排课日志(按课程,可叠加操作类型)
|
||||
export function listSchedulingLogs(sskcbh, czlx) {
|
||||
return request({
|
||||
url: '/schedulingWindow/logs',
|
||||
method: 'get',
|
||||
params: { sskcbh, czlx }
|
||||
})
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -121,11 +121,12 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bz" label="备注" min-width="120" align="left" header-align="center" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="250" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="310" align="center" fixed="right">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button type="text" size="small" @click="handleEdit(row)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="handleEditEventCalendar(row)">班历</el-button>
|
||||
<el-button type="text" size="small" @click="handleEditCalendar(row)">教学任务</el-button>
|
||||
<el-button type="text" size="small" @click="handleSchedule(row)">排课</el-button>
|
||||
<el-button type="text" size="small" class="text-danger" @click="handleDeleteRow(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -637,6 +638,21 @@ export default {
|
||||
this.eventCalendarVisible = true
|
||||
},
|
||||
|
||||
// 跳转到排课窗口,并带上当前班次学期编号
|
||||
handleSchedule(row) {
|
||||
const target = row || this.currentRow
|
||||
if (!target) {
|
||||
this.$message.warning('请先在列表中选择一条班次学期信息')
|
||||
return
|
||||
}
|
||||
const bh = target.bh || target.xydxqbh
|
||||
if (!bh) {
|
||||
this.$message.warning('该班次学期缺少编号,无法进入排课窗口')
|
||||
return
|
||||
}
|
||||
this.$router.push({ path: '/schedule/schedulingWindow', query: { xydxqbh: bh } })
|
||||
},
|
||||
|
||||
handleAllocation(row) {
|
||||
const target = row || this.currentRow
|
||||
if (!target) {
|
||||
|
||||
Reference in New Issue
Block a user