新增患者:监护人信息限制
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user