前端字典转换和excel转换的代码挺多的。
只有后台做字典转换的比较少。
因为将字典 value 转换成字典 label 是使用 DictUtils 类的 getDictLabel 方法。public static String getDictLabel(String dictType, String dictValue) 方法的定义只能接受 String 类型的字典 value 。
如果重载(overload)该方法,也可以。比如:public static String getDictLabel(String dictType, int dictValue)
实际使用:
e.setDeviceKind(dict.selectDictLabel("device_kind",e.getDeviceKind()));
参考地址:https://blog.csdn.net/sayyy/article/details/109257463