wangwei il y a 6 ans
Parent
commit
a651d81e00

+ 2 - 1
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/cache/SystemPropertyCache.java

@@ -13,6 +13,7 @@ import cn.com.qmth.examcloud.core.basic.dao.entity.SystemPropertyEntity;
 import cn.com.qmth.examcloud.core.basic.service.SystemPropertyService;
 import cn.com.qmth.examcloud.support.cache.bean.SysPropertyCacheBean;
 import cn.com.qmth.examcloud.web.cache.RandomObjectRedisCache;
+import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
 
 @Service
 public class SystemPropertyCache extends RandomObjectRedisCache<SysPropertyCacheBean> {
@@ -27,7 +28,7 @@ public class SystemPropertyCache extends RandomObjectRedisCache<SysPropertyCache
 	public SysPropertyCacheBean loadFromResource(Object... keys) {
 		String propKey = (String) keys[0];
 
-		SystemPropertyEntity sysConf = systemPropertyRepo.getOne(propKey);
+		SystemPropertyEntity sysConf = GlobalHelper.getEntity(systemPropertyRepo, propKey, SystemPropertyEntity.class);
 		if (null == sysConf) {
 			return null;
 		}

+ 3 - 3
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/SystemPropertyServiceImpl.java

@@ -13,6 +13,7 @@ import cn.com.qmth.examcloud.core.basic.dao.entity.SystemPropertyEntity;
 import cn.com.qmth.examcloud.core.basic.service.SystemPropertyService;
 import cn.com.qmth.examcloud.core.basic.service.cache.SystemPropertyCache;
 import cn.com.qmth.examcloud.support.cache.bean.SysPropertyCacheBean;
+import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
 
 /**
  * 系统配置服务
@@ -36,7 +37,7 @@ public class SystemPropertyServiceImpl implements SystemPropertyService {
 			throw new StatusException("350001", "key is blank");
 		}
 
-		SystemPropertyEntity sysConf = systemPropertyRepo.getOne(key);
+		SystemPropertyEntity sysConf = GlobalHelper.getEntity(systemPropertyRepo, key, SystemPropertyEntity.class);
 		if (null == sysConf) {
 			throw new StatusException("350002", "key is wrong");
 		}
@@ -61,8 +62,7 @@ public class SystemPropertyServiceImpl implements SystemPropertyService {
 		} else if (dataType.equals(BasicDataType.DATE)) {
 			try {
 				sysConf.setPropValue(
-						DateUtil.format(DateUtil.parse(value, DatePatterns.CHINA_DEFAULT),
-								DatePatterns.CHINA_DEFAULT));
+						DateUtil.format(DateUtil.parse(value, DatePatterns.CHINA_DEFAULT), DatePatterns.CHINA_DEFAULT));
 			} catch (Exception e) {
 				throw new StatusException("350002", "value is wrong");
 			}