forked from liweijie/education
AI测试反馈的报错调整
This commit is contained in:
+1
-1
@@ -198,7 +198,7 @@ public class LogController {
|
||||
@GetMapping("/teaching-log/download-template")
|
||||
public void downloadTemplate(HttpServletResponse response) {
|
||||
try {
|
||||
java.io.InputStream is = getClass().getClassLoader().getResourceAsStream("template/导入教学日志模板.xls");
|
||||
java.io.InputStream is = getClass().getClassLoader().getResourceAsStream("file/导入教学日志模板.xls");
|
||||
if (is == null) {
|
||||
response.setStatus(404);
|
||||
return;
|
||||
|
||||
+3
-6
@@ -92,11 +92,8 @@ public class TeachingPlanController {
|
||||
* 下载教学实施计划导入模板
|
||||
*/
|
||||
@GetMapping("/template")
|
||||
public ResponseEntity<org.springframework.core.io.Resource> downloadTemplate() throws IOException {
|
||||
ClassPathResource resource = new ClassPathResource("template/教学实施计划导入模板.xlsx");
|
||||
if (!resource.exists()) {
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
public ResponseEntity<byte[]> downloadTemplate() throws Exception {
|
||||
byte[] bytes = teachingPlanService.buildImportTemplate();
|
||||
String fileName = URLEncoder.encode("教学实施计划导入模板.xlsx", "UTF-8");
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
@@ -105,6 +102,6 @@ public class TeachingPlanController {
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.headers(headers)
|
||||
.body(resource);
|
||||
.body(bytes);
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class XYXJYDSQB {
|
||||
private String xydgbbh;
|
||||
|
||||
/** 学员队干部审核时间 */
|
||||
@TableField("学员队干部审核时间")
|
||||
@TableField("学员队审核时间")
|
||||
private LocalDateTime xydshsj;
|
||||
|
||||
/** 管理员审核时间 */
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
a.停用,
|
||||
a.备注
|
||||
FROM "保障提供明细" a
|
||||
LEFT JOIN "保障类别" l ON a.保障类别编号 = l.编号
|
||||
LEFT JOIN "保障类别" l ON a.保障类别编号 = l."BH"
|
||||
WHERE a.停用 = 0
|
||||
<if test="bzlbbh != null and bzlbbh != ''">
|
||||
AND a.保障类别编号 = #{bzlbbh}
|
||||
|
||||
@@ -31,6 +31,7 @@ public interface JYBMapper extends BaseMapper<JYB> {
|
||||
|
||||
@Select("SELECT TRIM(b.\"教员编号\") FROM \"教员登录表\" b "
|
||||
+ "JOIN \"登录信息表\" a ON TRIM(a.\"编号\") = TRIM(b.\"登录信息编号\") "
|
||||
+ "WHERE TRIM(a.\"账号\") = #{username}")
|
||||
+ "WHERE LOWER(TRIM(a.\"账号\")) = LOWER(TRIM(#{username})) "
|
||||
+ "OR LOWER(TRIM(a.\"统一账号\")) = LOWER(TRIM(#{username}))")
|
||||
String selectTeacherIdByAccount(@Param("username") String username);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ public interface JYSDLBMapper extends BaseMapper<JYSDLB> {
|
||||
|
||||
@Select("SELECT TRIM(b.\"教研室代号\") FROM \"教研室登录表\" b "
|
||||
+ "JOIN \"登录信息表\" a ON TRIM(a.\"编号\") = TRIM(b.\"登录信息编号\") "
|
||||
+ "WHERE TRIM(a.\"账号\") = #{username}")
|
||||
+ "WHERE LOWER(TRIM(a.\"账号\")) = LOWER(TRIM(#{username})) "
|
||||
+ "OR LOWER(TRIM(a.\"统一账号\")) = LOWER(TRIM(#{username}))")
|
||||
String selectResearchOfficeIdByAccount(@Param("username") String username);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
FROM "课程表_保障明细" a
|
||||
INNER JOIN "实施_课程表" b ON a.课程表编号 = b.编号
|
||||
LEFT JOIN "保障提供明细" m ON a.保障提供明细编号 = m.编号
|
||||
LEFT JOIN "保障类别" l ON m.保障类别编号 = l.编号
|
||||
LEFT JOIN "保障类别" l ON m.保障类别编号 = l."BH"
|
||||
WHERE b.实施_课程编号 = #{sskcbh}
|
||||
AND a.课程表编号 != #{sskcbbh}
|
||||
GROUP BY
|
||||
@@ -96,7 +96,7 @@
|
||||
a.日期 AS 创建时间
|
||||
FROM "课程表_保障明细" a
|
||||
LEFT JOIN "保障提供明细" m ON a.保障提供明细编号 = m.编号
|
||||
LEFT JOIN "保障类别" l ON m.保障类别编号 = l.编号
|
||||
LEFT JOIN "保障类别" l ON m.保障类别编号 = l."BH"
|
||||
LEFT JOIN "教员表" t ON (
|
||||
CASE
|
||||
WHEN a.备注 LIKE '%"confirmed":true%' THEN
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
b.变动时间
|
||||
FROM "实施_课程表" b
|
||||
LEFT JOIN "实施_课程" a ON LOWER(RAWTOHEX(a."编号")) = LOWER(REPLACE(TRIM(b.实施_课程编号), '-', ''))
|
||||
LEFT JOIN "课程表" c ON a.课编号 = c.课编号
|
||||
LEFT JOIN "课表" c ON a.科目编号 = c.课编号
|
||||
WHERE b.删除状态 = 0
|
||||
<if test="sskcbh != null and sskcbh != ''">
|
||||
AND b.实施_课程编号 = #{sskcbh}
|
||||
@@ -117,7 +117,7 @@
|
||||
b.变动时间
|
||||
FROM "实施_课程表" b
|
||||
LEFT JOIN "实施_课程" a ON LOWER(RAWTOHEX(a."编号")) = LOWER(REPLACE(TRIM(b.实施_课程编号), '-', ''))
|
||||
LEFT JOIN "课程表" c ON a.课编号 = c.课编号
|
||||
LEFT JOIN "课表" c ON a.科目编号 = c.课编号
|
||||
WHERE b.编号 = #{sskcbbh}
|
||||
AND b.删除状态 = 0
|
||||
</select>
|
||||
|
||||
@@ -67,4 +67,11 @@ public interface TeachingPlanService {
|
||||
* @throws Exception 解析或导入异常
|
||||
*/
|
||||
int importFromExcel(MultipartFile file) throws Exception;
|
||||
|
||||
/**
|
||||
* 生成导入模板 Excel(列序与 {@link #importFromExcel} 解析一致)。
|
||||
*
|
||||
* @return xlsx 字节
|
||||
*/
|
||||
byte[] buildImportTemplate() throws Exception;
|
||||
}
|
||||
+45
@@ -11,10 +11,15 @@ import com.roomroot.jwgl.unit.PageResult;
|
||||
import com.roomroot.jwgl.utils.ExcelParseUtil;
|
||||
import com.roomroot.jwgl.utils.UuidUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -104,4 +109,44 @@ public class TeachingPlanServiceImpl implements TeachingPlanService {
|
||||
}
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] buildImportTemplate() throws Exception {
|
||||
String[] headers = {
|
||||
"序号", "年度", "原序号", "日期", "原节次", "节次", "课程名称", "班次",
|
||||
"责任单位", "授课教员", "教学场地", "教学内容", "教学方法",
|
||||
"教员备注", "教务备注", "检查结果", "课程表编号"
|
||||
};
|
||||
String[] example = {
|
||||
"1", "2026", "", "2026-03-02 08:00:00", "", "1", "高等数学", "1班",
|
||||
"基础教研室", "张三", "教学楼A-101", "函数与极限", "讲授",
|
||||
"", "", "", ""
|
||||
};
|
||||
try (Workbook wb = new XSSFWorkbook(); ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
|
||||
Sheet sheet = wb.createSheet("教学实施计划");
|
||||
Row header = sheet.createRow(0);
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
header.createCell(i).setCellValue(headers[i]);
|
||||
sheet.setColumnWidth(i, 14 * 256);
|
||||
}
|
||||
Row row = sheet.createRow(1);
|
||||
for (int i = 0; i < example.length; i++) {
|
||||
row.createCell(i).setCellValue(example[i]);
|
||||
}
|
||||
Sheet help = wb.createSheet("填写说明");
|
||||
String[] notes = {
|
||||
"1. 数据从第2行开始填写,第1行表头请勿修改,列顺序固定不可调整。",
|
||||
"2. 「课程名称」必填,课程名称为空的行将被跳过;其余列可留空。",
|
||||
"3. 「序号」「年度」「节次」为整数;「日期」支持 yyyy-MM-dd 或 yyyy-MM-dd HH:mm:ss。",
|
||||
"4. 第2行为示例数据,导入前请删除。",
|
||||
"5. 标识号、登录编号由系统自动生成,无需填写。"
|
||||
};
|
||||
for (int i = 0; i < notes.length; i++) {
|
||||
help.createRow(i).createCell(0).setCellValue(notes[i]);
|
||||
}
|
||||
help.setColumnWidth(0, 100 * 256);
|
||||
wb.write(bos);
|
||||
return bos.toByteArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ service.interceptors.response.use(res => {
|
||||
return Promise.reject('error')
|
||||
} else if (code !== 200) {
|
||||
Notification.error({ title: msg })
|
||||
return Promise.reject('error')
|
||||
return Promise.reject(new Error(msg))
|
||||
} else {
|
||||
return res.data
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@
|
||||
<div v-loading="loading" class="course-list">
|
||||
<div v-if="!courses.length" class="empty-tip">该班次学期暂无可排课程</div>
|
||||
<div
|
||||
v-for="c in courses"
|
||||
:key="c.sskcbh"
|
||||
v-for="(c, i) in courses"
|
||||
:key="c.sskcbh + '#' + i"
|
||||
class="course-item"
|
||||
:class="{ 'is-active': currentCourse && currentCourse.sskcbh === c.sskcbh, 'is-full': c.full, 'is-readonly': !c.editable }"
|
||||
@click="selectCourse(c)"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="dimLabel">
|
||||
<el-select v-model="targetId" :placeholder="'请选择' + dimLabel" clearable filterable :loading="optionsLoading" style="width: 240px">
|
||||
<el-option v-for="o in targetOptions" :key="o.value" :label="o.label" :value="o.value" />
|
||||
<el-option v-for="(o, i) in targetOptions" :key="(o.value || '') + '_' + i" :label="o.label" :value="o.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期范围">
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/>
|
||||
<el-button size="small" @click="shiftDay(1)">下一天<i class="el-icon-arrow-right" /></el-button>
|
||||
</div>
|
||||
<el-table v-loading="todayLoading" :data="todayRows" border stripe size="small" max-height="560">
|
||||
<el-table v-loading="todayLoading" :data="todayRows" border stripe size="small" max-height="560" :empty-text="todayError || '暂无数据'">
|
||||
<el-table-column prop="sksj" label="上课时间" width="170" align="center" />
|
||||
<el-table-column prop="kc" label="课程" min-width="150" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="bc" label="班次" min-width="130" align="center" show-overflow-tooltip />
|
||||
@@ -39,7 +39,7 @@
|
||||
<el-button type="primary" icon="el-icon-search" @click="loadCourses">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="courseLoading" :data="courseRows" border stripe size="small" max-height="560">
|
||||
<el-table v-loading="courseLoading" :data="courseRows" border stripe size="small" max-height="560" :empty-text="courseError || '暂无数据'">
|
||||
<el-table-column prop="kcmcksxs" label="课程名称/课时系数" min-width="180" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="zrjykc" label="责任教员/课次" min-width="140" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="jhxs" label="计划学时" width="80" align="center" />
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<!-- ==================== 本室教员 ==================== -->
|
||||
<el-tab-pane label="本室教员" name="teachers">
|
||||
<el-table v-loading="teacherLoading" :data="teacherRows" border stripe size="small" max-height="560">
|
||||
<el-table v-loading="teacherLoading" :data="teacherRows" border stripe size="small" max-height="560" :empty-text="teacherError || '暂无数据'">
|
||||
<el-table-column prop="jybh" label="教员编号" width="140" align="center" />
|
||||
<el-table-column prop="jyxm" label="姓名" min-width="140" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
@@ -76,11 +76,14 @@ export default {
|
||||
day: '',
|
||||
todayRows: [],
|
||||
todayLoading: false,
|
||||
todayError: '',
|
||||
courseQuery: { nd: null, xqdc: null },
|
||||
courseRows: [],
|
||||
courseLoading: false,
|
||||
courseError: '',
|
||||
teacherRows: [],
|
||||
teacherLoading: false
|
||||
teacherLoading: false,
|
||||
teacherError: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -103,20 +106,26 @@ export default {
|
||||
},
|
||||
loadToday() {
|
||||
this.todayLoading = true
|
||||
this.todayError = ''
|
||||
myOfficeToday({ rq: this.day })
|
||||
.then(res => { this.todayRows = res.data || [] })
|
||||
.catch(err => { this.todayRows = []; this.todayError = (err && err.message) || '加载失败' })
|
||||
.finally(() => { this.todayLoading = false })
|
||||
},
|
||||
loadCourses() {
|
||||
this.courseLoading = true
|
||||
this.courseError = ''
|
||||
myOfficeCourses(this.courseQuery)
|
||||
.then(res => { this.courseRows = res.data || [] })
|
||||
.catch(err => { this.courseRows = []; this.courseError = (err && err.message) || '加载失败' })
|
||||
.finally(() => { this.courseLoading = false })
|
||||
},
|
||||
loadTeachers() {
|
||||
this.teacherLoading = true
|
||||
this.teacherError = ''
|
||||
myOfficeTeachers()
|
||||
.then(res => { this.teacherRows = res.data || [] })
|
||||
.catch(err => { this.teacherRows = []; this.teacherError = (err && err.message) || '加载失败' })
|
||||
.finally(() => { this.teacherLoading = false })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,6 +385,10 @@ export default {
|
||||
eventCalendarVisible: false,
|
||||
eventCalendarSemester: null,
|
||||
|
||||
// ==================== 教学配当 ====================
|
||||
allocationVisible: false,
|
||||
allocationSemester: null,
|
||||
|
||||
// ==================== 批量创建班次学期 ====================
|
||||
batchAddVisible: false,
|
||||
batchAddForm: { nd: undefined, xqdc: undefined, startTime: '', endTime: '' },
|
||||
|
||||
@@ -1330,8 +1330,9 @@ export default {
|
||||
this.roleLoading = true
|
||||
listRole({ pageNum: 1, pageSize: 200, status: '0' }).then(res => {
|
||||
this.roleOptions = res.rows || res.data || []
|
||||
}).catch(e => {
|
||||
console.error('加载角色列表失败', e)
|
||||
}).catch(() => {
|
||||
// 无角色管理权限(如教研室账号)时只保留默认教员角色,不影响新增
|
||||
this.roleOptions = [{ roleId: 101, roleName: '教员' }]
|
||||
}).finally(() => {
|
||||
this.roleLoading = false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user