找方法

1.之前别人的代码用的是RedisUtil,但我这边在一个子工程使用时报如下错误,已经配置了正确的redis。后来换成RedisCacheUtil

/*RedisUtil redisUtil = SpringContextHolder.getBean(RedisUtil.class);
  String ssoRole= (String)redisUtil.hget(Constants.SYS_PARAM, "HUAWEI_SSO_ADMIN_ROLE");

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.iss.common.base.util.RedisUtil' available

*/
  RedisCacheUtil redisCacheUtil = SpringContextHolder.getBean(RedisCacheUtil.class);
  String ssoRole= (String)redisCacheUtil.getDatasFromCacheMap(Constants.SYS_PARAM, "HUAWEI_SSO_ADMIN_ROLE");

2.SimpleDateFormat dateformat = new SimpleDateFormat();

date 转 String  dateformat.format(date);

String 转 date dateformat.parse(String);

java基础知识
原文地址:https://www.cnblogs.com/jinnian18sui/p/9826548.html