diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index c2bae49..97626ba 100644
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/sqldialects.xml b/.idea/sqldialects.xml
deleted file mode 100644
index d576a09..0000000
--- a/.idea/sqldialects.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
deleted file mode 100644
index e96534f..0000000
--- a/.idea/uiDesigner.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/java/com/nis/restful/RestBusinessCode.java b/src/main/java/com/nis/restful/RestBusinessCode.java
index 31b33b2..6b8bdf5 100644
--- a/src/main/java/com/nis/restful/RestBusinessCode.java
+++ b/src/main/java/com/nis/restful/RestBusinessCode.java
@@ -29,6 +29,16 @@ public enum RestBusinessCode {
*/
missing_args (1002,"缺少必要的参数信息"),
+ /**
+ * 已接收,响应成功
+ */
+ syncStatusSuccessed(2021000,"已接收,响应成功"),
+
+ /**
+ * 已接收,响应失败(原因可能正在忙,指令不规范等)
+ */
+ syncStatusFailed(2021010,"已接收,响应失败(原因可能正在忙,指令不规范等)"),
+
/**
* 操作行为错误,1-插入2-更新 3-删除4-查询 ,插入时选择了删除这种错误返回该异常代码
*/
diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java
index 193ac00..a9c343d 100644
--- a/src/main/java/com/nis/util/Constants.java
+++ b/src/main/java/com/nis/util/Constants.java
@@ -223,9 +223,13 @@ public final class Constants {
/**
- * redis分布式锁超时时间,默认五分钟,3000秒
+ * redis分布式锁超时时间,默认五分钟,300秒
*/
- public static final Long REDISLOCKTIME=Configurations.getLongProperty("redisLockTime", 3000);
+ public static final Long REDISLOCKTIME=Configurations.getLongProperty("redisLockTime", 300);
+ /**
+ * 全量数据同步分布式锁时间,默认两个小时
+ */
+ public static final Long CONFIGSYNCLOCKTIME=Configurations.getLongProperty("configSyncLockTime", 7200);
/**
* 获取redis分布式锁失败后的尝试获取锁的次数,每次失败暂停一秒钟后再次尝试
*/
diff --git a/src/main/java/com/nis/util/JedisClusterUtils.java b/src/main/java/com/nis/util/JedisClusterUtils.java
new file mode 100644
index 0000000..e5d1044
--- /dev/null
+++ b/src/main/java/com/nis/util/JedisClusterUtils.java
@@ -0,0 +1,361 @@
+package com.nis.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Lists;
+import com.nis.restful.RestBusinessCode;
+import com.nis.restful.ServiceRuntimeException;
+import com.nis.web.service.SpringContextHolder;
+
+import redis.clients.jedis.JedisCluster;
+import redis.clients.jedis.exceptions.JedisException;
+
+/**
+ * @ClassName: JedisClusterUtils
+ * @Description: redis-cluster库工具类
+ * @author (rkg)
+ * @date 2018年12月01日 上午10:31:00
+ * @version V1.0
+ */
+public class JedisClusterUtils {
+ private static Logger logger = LoggerFactory.getLogger(JedisClusterUtils.class);
+
+ /**
+ * 获取缓存
+ *
+ * @param key 键
+ * @return 值
+ */
+ public static String get(String key) {
+ String value = null;
+ JedisCluster jedis = null;
+ try {
+ jedis = getResource();
+ if (jedis.exists(key)) {
+ value = jedis.get(key);
+ value = StringUtils.isNotBlank(value) && !"nil".equalsIgnoreCase(value) ? value : null;
+ logger.debug("get {} = {}", key, value);
+ }
+ } catch (Exception e) {
+ throw new ServiceRuntimeException("从redis-cluster中获取" + key + "对应的值失败",
+ RestBusinessCode.KeyNotExistsInRedis.getValue());
+ } finally {
+ returnResource(jedis);
+ }
+ return value;
+ }
+
+ /**
+ * 获取缓存
+ *
+ * @param key 键
+ * @return 值
+ */
+ public static Object getObject(String key) {
+ Object value = null;
+ JedisCluster jedis = null;
+ try {
+ jedis = getResource();
+ if (jedis.exists(getBytesKey(key))) {
+ value = toObject(jedis.get(getBytesKey(key)));
+ logger.debug("getObject {} = {}", key, value);
+ }
+ } catch (Exception e) {
+ throw new ServiceRuntimeException("从redis-cluster中获取" + key + "对应的值失败",
+ RestBusinessCode.KeyNotExistsInRedis.getValue());
+ } finally {
+ returnResource(jedis);
+ }
+ return value;
+ }
+
+ /**
+ * 可以作为获取唯一id的方法
+ * 将key对应的value加上指定的值,只有value可以转为数字时该方法才可用
+ *
+ * @param String key
+ * @param long number 要减去的值
+ * @return long 相加后的值
+ */
+ public static long incrBy(String key, long number) {
+ JedisCluster jedis = getResource();
+ long len = jedis.incrBy(key, number);
+ returnResource(jedis);
+ return len;
+ }
+
+ /**
+ * 设置缓存
+ *
+ * @param key 键
+ * @param value 值
+ * @param cacheSeconds 超时时间,0为不超时
+ * @return
+ */
+ public static String set(String key, String value, int cacheSeconds) {
+ String result = null;
+ JedisCluster jedis = null;
+ try {
+ jedis = getResource();
+ result = jedis.set(key, value);
+ if (cacheSeconds != 0) {
+ jedis.expire(key, cacheSeconds);
+ }
+ logger.debug("set {} = {}", key, value);
+ } catch (Exception e) {
+ throw new ServiceRuntimeException("向redis-cluster中设置zset失败,key=" + key + ",value=" + value,
+ RestBusinessCode.ZsetFailed.getValue());
+ } finally {
+ returnResource(jedis);
+ }
+ return result;
+ }
+
+ /**
+ * 获取List缓存
+ *
+ * @param key 键
+ * @return 值
+ */
+ public static List getList(String key) {
+ List value = null;
+ JedisCluster jedis = null;
+ try {
+ jedis = getResource();
+ if (jedis.exists(key)) {
+ value = jedis.lrange(key, 0, -1);
+ logger.debug("getList {} = {}", key, value);
+ }
+ } catch (Exception e) {
+ throw new ServiceRuntimeException("从redis-cluster中获取" + key + "对应的值失败",
+ RestBusinessCode.KeyNotExistsInRedis.getValue());
+ } finally {
+ returnResource(jedis);
+ }
+ return value;
+ }
+
+ /**
+ * 获取List缓存
+ *
+ * @param key 键
+ * @return 值
+ */
+ public static List