Commit 83d9e1bf by zhangxingmin

redis缓存->根据字典类型和字典名称获取字典值

parent dc6f241b
......@@ -81,4 +81,26 @@ public class GetDictItemListByDictTypeResponse implements Serializable {
}
return itemLabel;
}
/**
* 根据字典类型和字典名称获取字典值
* @param list
* @param dictType
* @param itemLabel
* @return
*/
public static String getItemValue(List<GetDictItemListByDictTypeResponse> list,
String dictType,String itemLabel) {
String itemValue = "";
if (!CollectionUtils.isEmpty(list)) {
List<GetDictItemListByDictTypeResponse> singeList = list.stream()
.filter(item -> item.getDictType().equals(dictType) && item.getItemLabel().equals(itemLabel))
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(singeList)) {
GetDictItemListByDictTypeResponse typeResponse = singeList.get(0);
itemValue = typeResponse.getItemValue();
}
}
return itemValue;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment