258 预约管理-》医生排班管理:点【预约设置】界面编辑内容【确定】提示”保存成功“但是刷新重新进入未显示最后一次更新的数据
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.openhis.appointmentmanage.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 预约配置Entity
|
||||
*
|
||||
* @date 2026-03-23
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "appointment_config")
|
||||
@Accessors(chain = true)
|
||||
public class AppointmentConfig {
|
||||
|
||||
/** 主键ID */
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 机构ID(关联 sys_tenant) */
|
||||
private Integer tenantId;
|
||||
|
||||
/** 取消预约时间类型:YEAR/MONTH/DAY */
|
||||
private String cancelAppointmentType;
|
||||
|
||||
/** 取消预约次数限制 */
|
||||
private Integer cancelAppointmentCount;
|
||||
|
||||
/** 有效标志:1=有效,0=无效 */
|
||||
private Integer validFlag;
|
||||
|
||||
/** 创建人 */
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.openhis.appointmentmanage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.appointmentmanage.domain.AppointmentConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 预约配置Mapper接口
|
||||
*
|
||||
* @author openhis
|
||||
* @date 2026-03-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface AppointmentConfigMapper extends BaseMapper<AppointmentConfig> {
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.openhis.appointmentmanage.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.openhis.appointmentmanage.domain.AppointmentConfig;
|
||||
|
||||
/**
|
||||
* 预约配置Service接口
|
||||
*
|
||||
* @author openhis
|
||||
* @date 2026-03-23
|
||||
*/
|
||||
public interface IAppointmentConfigService extends IService<AppointmentConfig> {
|
||||
|
||||
/**
|
||||
* 根据机构ID获取预约配置
|
||||
*
|
||||
* @param tenantId 机构ID
|
||||
* @return 预约配置
|
||||
*/
|
||||
AppointmentConfig getConfigByTenantId(Integer tenantId);
|
||||
|
||||
/**
|
||||
* 保存或更新预约配置
|
||||
*
|
||||
* @param appointmentConfig 预约配置
|
||||
* @return 结果
|
||||
*/
|
||||
int saveOrUpdateConfig(AppointmentConfig appointmentConfig);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.openhis.appointmentmanage.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.appointmentmanage.domain.AppointmentConfig;
|
||||
import com.openhis.appointmentmanage.mapper.AppointmentConfigMapper;
|
||||
import com.openhis.appointmentmanage.service.IAppointmentConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 预约配置Service实现类
|
||||
*
|
||||
* @author openhis
|
||||
* @date 2026-03-23
|
||||
*/
|
||||
@Service
|
||||
public class AppointmentConfigServiceImpl
|
||||
extends ServiceImpl<AppointmentConfigMapper, AppointmentConfig>
|
||||
implements IAppointmentConfigService {
|
||||
|
||||
@Override
|
||||
public AppointmentConfig getConfigByTenantId(Integer tenantId) {
|
||||
LambdaQueryWrapper<AppointmentConfig> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(AppointmentConfig::getTenantId, tenantId)
|
||||
.eq(AppointmentConfig::getValidFlag, 1);
|
||||
return this.getOne(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveOrUpdateConfig(AppointmentConfig appointmentConfig) {
|
||||
if (appointmentConfig.getId() == null) {
|
||||
// 新增
|
||||
appointmentConfig.setCreateTime(LocalDateTime.now());
|
||||
appointmentConfig.setUpdateTime(LocalDateTime.now());
|
||||
return this.baseMapper.insert(appointmentConfig) > 0 ? 1 : 0;
|
||||
} else {
|
||||
// 更新
|
||||
appointmentConfig.setUpdateTime(LocalDateTime.now());
|
||||
return this.baseMapper.updateById(appointmentConfig) > 0 ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user