diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/controller/DoctorScheduleController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/controller/DoctorScheduleController.java index 77ab066a..2a7e8bf6 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/controller/DoctorScheduleController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointmentmanage/controller/DoctorScheduleController.java @@ -89,4 +89,13 @@ public class DoctorScheduleController { return R.ok(doctorScheduleAppService.getTodayDoctorScheduleList()); } + /* + * 获取当前登录医生今日排班List + * + * */ + @GetMapping("/today-my-schedule") + public R getTodayMySchedule() { + return doctorScheduleAppService.getTodayMySchedule(); + } + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraseAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraseAppServiceImpl.java index 64ba8ae2..ff763be5 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraseAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorPhraseAppServiceImpl.java @@ -27,6 +27,8 @@ public List getDoctorPhraseList() { log.debug("orgId: {}", orgId); } LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + // 添加启用状态过滤,只查询未被逻辑删除的记录 + wrapper.eq(DoctorPhrase::getEnableFlag, 1); // 1. 获取当前登录用户信息 Long userId = SecurityUtils.getUserId(); @@ -68,6 +70,8 @@ public List getDoctorPhraseList() { } String finalDeptCode = deptCode; LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + // 添加启用状态过滤,只查询未被逻辑删除的记录 + wrapper.eq(DoctorPhrase::getEnableFlag, 1); if (phraseName !=null && ObjectUtil.isNotEmpty(phraseName)) { wrapper.like(DoctorPhrase::getPhraseName, phraseName); } @@ -202,6 +206,8 @@ public List getDoctorPhraseList() { throw new SecurityException("无权操作:您只能删除自己创建的常用语"); } } + + // 使用MyBatis-Plus的内置逻辑删除功能 return doctorPhraseService.removeById(doctorPhraseId); } diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java index 0a15e4fe..ba303d11 100644 --- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/template/domain/DoctorPhrase.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.core.common.core.domain.HisBaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -14,8 +15,8 @@ import java.time.LocalDateTime; @Data @Accessors(chain = true) @TableName("adm_doctor_phrases") -@EqualsAndHashCode(callSuper = false) -public class DoctorPhrase { +@EqualsAndHashCode(callSuper = true) +public class DoctorPhrase extends HisBaseEntity { /** id */ @TableId(value = "id", type = IdType.AUTO) private Integer id; @@ -61,9 +62,4 @@ public class DoctorPhrase { /** 审核时间 */ private LocalDateTime auditTime; - /** 创建时间 */ - private LocalDateTime createTime; - - /** 更新时间 */ - private LocalDateTime updateTime; } diff --git a/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue b/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue index 9ec4fea7..6dac8b4f 100644 --- a/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue +++ b/openhis-ui-vue3/src/views/doctorstation/doctorphrase/index.vue @@ -394,10 +394,8 @@ const handleAdd = async () => { const formData = { ...addForm.value, phraseCode: 'PHR000', // 建议后端自动生成,前端可传空 - enableFlag: 1, - staffId: 1001, // 建议从登录态获取,不要硬编码 - deptCode: 'DEPT001', // 建议从登录态获取 - creatorId: 1001 // 建议从登录态获取 + enableFlag: 1 + // 不手动设置 createTime、updateTime 等审计字段,让后端自动填充 } // 调用新增接口 @@ -481,8 +479,8 @@ const handleEditSave = async () => { // 3. 准备数据 const updateData = { ...editForm.value, - enableFlag: 1, - updateTime: new Date().toISOString() + enableFlag: 1 + // 不手动设置 updateTime,让后端自动填充 } // 4. 调用接口