87 门诊医生站-》增加医生常用语维护界面
医生常用语这个实体类继承了基类HisBaseEntity,使用里面的delete_flag的字段进行逻辑删除,保留了enable_flag字段,方便后续实现启用和禁用的功能
This commit is contained in:
@@ -89,4 +89,13 @@ public class DoctorScheduleController {
|
||||
return R.ok(doctorScheduleAppService.getTodayDoctorScheduleList());
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取当前登录医生今日排班List
|
||||
*
|
||||
* */
|
||||
@GetMapping("/today-my-schedule")
|
||||
public R<?> getTodayMySchedule() {
|
||||
return doctorScheduleAppService.getTodayMySchedule();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ public List<DoctorPhrase> getDoctorPhraseList() {
|
||||
log.debug("orgId: {}", orgId);
|
||||
}
|
||||
LambdaQueryWrapper<DoctorPhrase> wrapper = new LambdaQueryWrapper<>();
|
||||
// 添加启用状态过滤,只查询未被逻辑删除的记录
|
||||
wrapper.eq(DoctorPhrase::getEnableFlag, 1);
|
||||
|
||||
// 1. 获取当前登录用户信息
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
@@ -68,6 +70,8 @@ public List<DoctorPhrase> getDoctorPhraseList() {
|
||||
}
|
||||
String finalDeptCode = deptCode;
|
||||
LambdaQueryWrapper<DoctorPhrase> 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<DoctorPhrase> getDoctorPhraseList() {
|
||||
throw new SecurityException("无权操作:您只能删除自己创建的常用语");
|
||||
}
|
||||
}
|
||||
|
||||
// 使用MyBatis-Plus的内置逻辑删除功能
|
||||
return doctorPhraseService.removeById(doctorPhraseId);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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. 调用接口
|
||||
|
||||
Reference in New Issue
Block a user