AI测试反馈的报错调整

This commit is contained in:
2026-09-18 18:12:59 +08:00
parent 68b02ea58e
commit f36b1f4701
16 changed files with 90 additions and 25 deletions
@@ -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;
}
@@ -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();
}
}
}