Commit c185bde7 authored by wujipeng's avatar wujipeng
Browse files

优化项

parent ca71e3af
......@@ -12,6 +12,6 @@ public class CourseAdminScheduleSwapDTO {
/** 产品规定的必填调课原因。 */
private String reason;
/** 可选调课说明,服务端限制最多60字。 */
/** 可选调课说明,不限制业务字符数。 */
private String note;
}
......@@ -77,7 +77,7 @@ public class ClassSubjectEntity {
/** 最近一次调课原因。 */
private String adjustmentReason;
/** 最近一次调课说明,产品限制最多60字。 */
/** 最近一次调课说明,使用TEXT字段完整保存。 */
private String adjustmentNote;
/** 记录创建时间,由管理端新增接口维护。 */
......
......@@ -737,7 +737,8 @@ public class CourseAdminServiceImpl implements CourseAdminService {
String targetGroupId = requireScheduleGroupId(request.getTargetScheduleGroupId());
if (sourceGroupId.equals(targetGroupId)) throw new BusinessException("不能与当前课次对调");
String reason = requireText(request.getReason(), "调课原因", 32);
String note = optionalText(request.getNote(), "调课说明", 60);
// 调课说明按产品要求不限制业务字符数,仅清理首尾空白和纯空白输入。
String note = trimToNull(request.getNote());
List<ClassSubjectEntity> sourceSnapshot = classSubjectMapper
.selectAdminCourseGroupEntities(sourceGroupId);
......
......@@ -56,8 +56,14 @@ begin
end if;
if not exists (select 1 from information_schema.columns where table_schema = database()
and table_name = 'class_subject' and column_name = 'adjustment_note') then
alter table class_subject add column adjustment_note varchar(60) null
alter table class_subject add column adjustment_note text null
comment '最近一次调课说明' after adjustment_reason;
elseif exists (select 1 from information_schema.columns where table_schema = database()
and table_name = 'class_subject' and column_name = 'adjustment_note'
and data_type <> 'text') then
-- 旧环境为varchar(60),升级为TEXT后才能真正取消调课说明字数限制。
alter table class_subject modify column adjustment_note text null
comment '最近一次调课说明';
end if;
-- 编辑弹窗仅携带全局唯一的排课组ID,组ID前导索引避免首次定位班级时扫描全表。
......
......@@ -47,7 +47,8 @@ class CourseMigrationSqlTest {
assertTrue(sql.contains("adjusted tinyint(1) not null default 0"));
assertTrue(sql.contains("adjustment_counterpart_group_id varchar(32)"));
assertTrue(sql.contains("adjustment_reason varchar(32)"));
assertTrue(sql.contains("adjustment_note varchar(60)"));
assertTrue(sql.contains("adjustment_note text"));
assertTrue(sql.contains("modify column adjustment_note text"));
}
private static String resource(String path) throws Exception {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment