门诊医生站-》医嘱:诊疗开具医嘱点击项目选择下拉框,获取时间过慢40多秒,解决了之后正常情况获取4秒

This commit is contained in:
weixin_45799331
2026-01-21 17:27:28 +08:00
parent a0b546266d
commit 34dd969cb4
2 changed files with 12 additions and 8 deletions

View File

@@ -116,8 +116,11 @@ public class DictAspect {
}
private String queryDictLabel(String dictTable, String dictCode, String dictText, String dictValue) {
if (StringUtils.hasText(dictTable)) {
// 场景 1查询指定表
if (!StringUtils.hasText(dictTable)) {
// 场景 1默认字典走DictUtils缓存
return DictUtils.getDictLabel(dictCode, dictValue);
} else {
// 场景 2查询指定表
String sql = String.format("SELECT %s FROM %s WHERE %s::varchar = ? LIMIT 1", dictText, dictTable, dictCode);
try {
return jdbcTemplate.queryForObject(sql, String.class, dictValue);
@@ -125,9 +128,6 @@ public class DictAspect {
// 如果查询结果为空,返回 空字符串
return "";
}
} else {
// 场景 2默认字典走DictUtils缓存
return DictUtils.getDictLabel(dictCode, dictValue);
}
}
}