| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.HashMap; |
| | | |
| | | public class Utils { |
| | | |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //获取设备日志采集时间 |
| | | public static int getDeviceLogCollectTime() { |
| | | int defaultTime = 200; |
| | | try { |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | if (redisUtil == null) { |
| | | return defaultTime; |
| | | } |
| | | |
| | | Object object = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (object == null) { |
| | | return defaultTime; |
| | | } |
| | | |
| | | HashMap<String, String> systemConfigMap = (HashMap<String, String>) object; |
| | | String deviceLogCollectTime = systemConfigMap.get("deviceLogCollectTime"); |
| | | if(deviceLogCollectTime == null){ |
| | | return defaultTime; |
| | | } |
| | | |
| | | return Integer.parseInt(deviceLogCollectTime); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return defaultTime; |
| | | } |
| | | } |