6 Commits

Author SHA1 Message Date
61f4020487 新增患者:监护人信息限制 2025-12-31 13:43:24 +08:00
aeb6b95970 Merge branch 'develop' of https://gitea.gentronhealth.com/py/his into develop 2025-12-31 13:37:29 +08:00
cf5dbc6133 Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	openhis-ui-vue3/src/views/doctorstation/components/diagnosis/addDiagnosisDialog.vue
#	openhis-ui-vue3/src/views/doctorstation/components/tcm/tcmAdvice.vue
2025-12-30 10:04:25 +08:00
5f6fa50000 修复了作废的中医诊断也显示出来的问题, 2025-12-30 10:03:46 +08:00
08b2e76d47 修复了作废的中医诊断也显示出来的问题, 2025-12-30 09:59:58 +08:00
5ffeab8999 修复了作废的中医诊断也显示出来的问题, 2025-12-30 09:56:39 +08:00
5 changed files with 101 additions and 26 deletions

View File

@@ -61,7 +61,25 @@ public class SysConfigController extends BaseController {
*/
@GetMapping(value = "/configKey/{configKey}")
public AjaxResult getConfigKey(@PathVariable String configKey) {
return success(configService.selectConfigByKey(configKey));
String configValue = configService.selectConfigByKey(configKey);
// 确保即使返回 null 或空字符串,也明确设置 data 字段
// 如果 configValue 是 null转换为空字符串
if (configValue == null) {
configValue = "";
}
// 直接创建 AjaxResult 并明确设置 data 字段,确保 data 字段始终存在
AjaxResult result = new AjaxResult();
result.put("code", 200);
result.put("msg", "操作成功");
result.put("data", configValue); // 明确设置 data 字段,即使值为空字符串
System.out.println("=== getConfigKey 调试信息 ===");
System.out.println("configKey: " + configKey);
System.out.println("configValue: [" + configValue + "]");
System.out.println("result.data: " + result.get("data"));
System.out.println("result.msg: " + result.get("msg"));
System.out.println("result.code: " + result.get("code"));
System.out.println("============================");
return result;
}
/**

View File

@@ -69,8 +69,25 @@ public class SysConfigServiceImpl implements ISysConfigService {
config.setConfigKey(configKey);
SysConfig retConfig = configMapper.selectConfig(config);
if (StringUtils.isNotNull(retConfig)) {
redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue());
return retConfig.getConfigValue();
String dbValue = retConfig.getConfigValue();
System.out.println("=== selectConfigByKey 调试信息 ===");
System.out.println("configKey: " + configKey);
System.out.println("retConfig: " + retConfig);
System.out.println("configId: " + retConfig.getConfigId());
System.out.println("configName: " + retConfig.getConfigName());
System.out.println("configValue from DB: [" + dbValue + "]");
System.out.println("configValue is null: " + (dbValue == null));
System.out.println("configValue is empty: " + StringUtils.isEmpty(dbValue));
System.out.println("================================");
if (StringUtils.isNotEmpty(dbValue)) {
redisCache.setCacheObject(getCacheKey(configKey), dbValue);
return dbValue;
} else {
System.out.println("警告: configValue 为空,返回空字符串");
return StringUtils.EMPTY;
}
} else {
System.out.println("警告: 数据库中未找到 configKey=" + configKey + " 的记录");
}
return StringUtils.EMPTY;
}

View File

@@ -15,7 +15,7 @@ import java.net.UnknownHostException;
/**
* 启动程序
*
* @author system 1
* @author system 1234
*/
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.core", "com.openhis"})
@EnableConfigurationProperties(YbServiceConfig.class)

View File

@@ -701,6 +701,7 @@ const paymentId = ref('');
const loadingText = ref('');
const registerInfo = ref({}); // 原挂号记录信息
const queryType = ref('all'); // 查询类型all-全部, normal-正常挂号, returned-退号记录
const guardianAgeConfig = ref(''); // 监护人规定年龄配置
// 使用 ref 定义查询所得用户信息数据
const patientInfoList = ref(undefined);
@@ -1524,11 +1525,49 @@ getLocationInfo();
async function loadGuardianAgeConfig() {
try {
const response = await getConfigKey('guardianAge');
if (response.code === 200) {
guardianAgeConfig.value = response.data;
console.log('获取监护人年龄配置完整响应:', JSON.stringify(response, null, 2));
console.log('响应 code:', response.code);
console.log('响应 data:', response.data);
console.log('响应 data 类型:', typeof response.data);
console.log('响应 data === null:', response.data === null);
console.log('响应 data === undefined:', response.data === undefined);
console.log('响应 data === "":', response.data === '');
if (response && response.code === 200) {
// response.data 可能是字符串、数字或对象
let configValue = response.data;
// 如果是对象,尝试获取 configValue 字段
if (typeof configValue === 'object' && configValue !== null) {
configValue = configValue.configValue || configValue.value || '';
console.log('从对象中提取的 configValue:', configValue);
}
// 处理数字类型(可能是数字 18
if (typeof configValue === 'number') {
configValue = String(configValue);
console.log('将数字转换为字符串:', configValue);
}
// 转换为字符串并去除空白
const trimmedValue = configValue !== null && configValue !== undefined ? String(configValue).trim() : '';
console.log('trimmedValue:', trimmedValue, '长度:', trimmedValue.length);
if (trimmedValue) {
guardianAgeConfig.value = trimmedValue;
console.log('✅ 监护人年龄配置值已设置为:', guardianAgeConfig.value, '类型:', typeof guardianAgeConfig.value);
} else {
console.warn('⚠️ 配置值为空trimmedValue:', trimmedValue);
guardianAgeConfig.value = '';
}
} else {
console.warn('⚠️ 获取监护人年龄配置失败,响应码:', response?.code, '响应:', response);
guardianAgeConfig.value = '';
}
} catch (error) {
console.error('获取监护人规定年龄配置失败:', error);
console.error('获取监护人规定年龄配置失败:', error);
console.error('错误详情:', error.response || error);
guardianAgeConfig.value = '';
}
}
// 组件加载时获取配置

View File

@@ -82,28 +82,29 @@ function submit() {
return; // 确保选择了诊断和证候
}
// 构建诊断对象
const diagnosis = {
id: Date.now(), // 使用时间戳作为唯一ID
condition: conditionOptions.value.find((item) => item.value === condition.value)?.label || '',
// 构建诊断数据调用API保存到服务器
const diagnosisChildList = [{
conditionCode: condition.value,
syndrome: syndromeOptions.value.find((item) => item.value === syndrome.value)?.label || '',
syndromeCode: syndrome.value,
};
const data = localStorage.getItem(`tcmDiagnosisList_${props.patientInfo.encounterId}`);
diagnosisList.value = JSON.parse(data);
// 添加到列表
diagnosisList.value.push(diagnosis);
localStorage.removeItem(`tcmDiagnosisList_${props.patientInfo.encounterId}`);
// 保存到本地缓存
localStorage.setItem(
`tcmDiagnosisList_${props.patientInfo.encounterId}`,
JSON.stringify(diagnosisList.value)
);
}];
console.log('当前诊断列表:', diagnosisList.value);
emit('flush')
close();
// 调用API保存到服务器
saveTcmDiagnosis({
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
diagnosisChildList: diagnosisChildList,
}).then((res) => {
if (res.code === 200) {
proxy.$modal.msgSuccess('保存成功');
emit('flush');
close();
} else {
proxy.$modal.msgError(res.msg || '保存失败');
}
}).catch((error) => {
console.error('保存中医诊断失败:', error);
proxy.$modal.msgError('保存失败,请重试');
});
}
function openDialog() {