Fix Bug #432: 门诊手术安排:新增手术安排保存时报错
根因:op_schedule 表的 surgery_nature 和 surgery_site 列为 NOT NULL 但无默认值, 后端 addSurgerySchedule() 未为这两个字段设置默认值。当前端提交的数据中这些字段为 null 时,MyBatis-Plus 跳过 null 字段导致 INSERT SQL 不包含这些列,数据库 NOT NULL 约束失败。 修复:在默认值处理块中增加 surgeryNature(默认"1"=择期手术) 和 surgerySite(默认"") Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -183,6 +183,12 @@ public class SurgicalScheduleAppServiceImpl implements ISurgicalScheduleAppServi
|
||||
if (opSchedule.getSurgeonCode() == null) {
|
||||
opSchedule.setSurgeonCode("");
|
||||
}
|
||||
if (opSchedule.getSurgeryNature() == null) {
|
||||
opSchedule.setSurgeryNature("1");
|
||||
}
|
||||
if (opSchedule.getSurgerySite() == null) {
|
||||
opSchedule.setSurgerySite("");
|
||||
}
|
||||
|
||||
// 设置创建者ID
|
||||
opSchedule.setCreatorId(userId);
|
||||
|
||||
Reference in New Issue
Block a user