瀏覽代碼

规则更新

rengb 5 年之前
父節點
當前提交
322e71b277

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0002.java

@@ -44,7 +44,7 @@ public class BEH0002 extends QCCatalogue {
         }else {
             String mainDiag = diags.get(0).getName();
             List<String> symptoms=null;
-            Map<String, Map<String, Object>> diagMap =(Map<String, Map<String, Object>>) redisUtil.get(KernelConstants.CONCEPT_DIAG_PROPERTY_MAP);
+            Map<String, Map<String, Object>> diagMap = redisUtil.getJsonStringValue(KernelConstants.CONCEPT_DIAG_PROPERTY_MAP);
             Map<String, Object> map = (Map<String, Object>) diagMap.get(mainDiag);
             if(map != null || map.size() >0){
                 symptoms = (List<String>) map.get("symptoms");

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0011.java

@@ -33,7 +33,7 @@ public class BEH0011 extends QCCatalogue {
             List<String> initDiags = Arrays.asList(initDiagText.split(","));
             if(diags.size()>0){
                 for (Diag diag:diags) {
-                    Map<String, Map<String, Object>> diagMap =(Map<String, Map<String, Object>>) redisUtil.get(KernelConstants.CONCEPT_DIAG_PROPERTY_MAP);
+                    Map<String, Map<String, Object>> diagMap = redisUtil.getJsonStringValue(KernelConstants.CONCEPT_DIAG_PROPERTY_MAP);
                     Map<String, Object> map = (Map<String, Object>) diagMap.get(diag.getName());
                     if(map != null || map.size() >0){
                         String chronic = (String) map.get("chronic");//1是慢病

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0012.java

@@ -27,7 +27,7 @@ public class BEH0012 extends QCCatalogue {
     private RedisUtil redisUtil;
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         List<String> diags_out = new ArrayList<>();
-        Map<String, String> hostpital_standDiag = (Map<String, String>) redisUtil.get(KernelConstants.HOSPITAL_DIAG_MAP);
+        Map<String, String> hostpital_standDiag = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DIAG_MAP);
         List<Diag> diags = inputInfo.getBeHospitalizedDoc().getInitialDiagLabel().getDiags();
         if(diags != null && diags.size()>0){
             for (Diag diag:diags) {

+ 5 - 5
kernel/src/main/java/com/lantone/qc/kernel/util/CacheUtil.java

@@ -69,7 +69,7 @@ public class CacheUtil implements ApplicationRunner {
                 diagMap.put(line_arr[0], map);
             }
         }
-        redisUtil.set(KernelConstants.CONCEPT_DIAG_PROPERTY_MAP, diagMap);
+        redisUtil.setJsonStringValue(KernelConstants.CONCEPT_DIAG_PROPERTY_MAP, diagMap);
     }
 
     /**
@@ -85,7 +85,7 @@ public class CacheUtil implements ApplicationRunner {
             detail.put("icd10", "A001");
             hospitalDiagMap.put(line, detail);
         }
-        redisUtil.set(KernelConstants.HOSPITAL_DIAG_MAP, hospitalDiagMap);
+        redisUtil.setJsonStringValue(KernelConstants.HOSPITAL_DIAG_MAP, hospitalDiagMap);
     }
 
     /**
@@ -101,7 +101,7 @@ public class CacheUtil implements ApplicationRunner {
             detail.put("icd10", "A001");
             hospitalDiagMap.put(line, detail);
         }
-        redisUtil.set(KernelConstants.HOSPITAL_DIAG_HUAZ_MAP, hospitalDiagMap);
+        redisUtil.setJsonStringValue(KernelConstants.HOSPITAL_DIAG_HUAZ_MAP, hospitalDiagMap);
     }
 
     /**
@@ -117,7 +117,7 @@ public class CacheUtil implements ApplicationRunner {
             detail.put("icd10", "A001");
             hospitalDiagMap.put(line, detail);
         }
-        redisUtil.set(KernelConstants.LANTONE_DIAG_HUAZ_MAP, hospitalDiagMap);
+        redisUtil.setJsonStringValue(KernelConstants.LANTONE_DIAG_HUAZ_MAP, hospitalDiagMap);
     }
     /**
      * 症状需要部位描述词典放入redis缓存
@@ -129,6 +129,6 @@ public class CacheUtil implements ApplicationRunner {
         for (String line : lines) {
             clinicBodyPartList.add(line);
         }
-        redisUtil.set(KernelConstants.CONCEPT_CLINIC_BODYPART_PROPERTIES_LIST, clinicBodyPartList);
+        redisUtil.setJsonStringValue(KernelConstants.CONCEPT_CLINIC_BODYPART_PROPERTIES_LIST, clinicBodyPartList);
     }
 }

+ 34 - 34
kernel/src/main/java/com/lantone/qc/kernel/util/RedisUtil.java

@@ -31,7 +31,7 @@ public final class RedisUtil {
      * @param time 时间(秒)
      * @return
      */
-    public boolean expire(String key, long time) {
+    private boolean expire(String key, long time) {
         try {
             if (time > 0) {
                 redisTemplate.expire(key, time, TimeUnit.SECONDS);
@@ -49,7 +49,7 @@ public final class RedisUtil {
      * @param key 键 不能为null
      * @return 时间(秒) 返回0代表为永久有效
      */
-    public long getExpire(String key) {
+    private long getExpire(String key) {
         return redisTemplate.getExpire(key, TimeUnit.SECONDS);
     }
 
@@ -59,7 +59,7 @@ public final class RedisUtil {
      * @param key 键
      * @return true 存在 false不存在
      */
-    public boolean hasKey(String key) {
+    private boolean hasKey(String key) {
         try {
             return redisTemplate.hasKey(key);
         } catch (Exception e) {
@@ -74,7 +74,7 @@ public final class RedisUtil {
      * @param key 可以传一个值 或多个
      */
     @SuppressWarnings("unchecked")
-    public void del(String... key) {
+    private void del(String... key) {
         if (key != null && key.length > 0) {
             if (key.length == 1) {
                 redisTemplate.delete(key[0]);
@@ -92,7 +92,7 @@ public final class RedisUtil {
      * @param key 键
      * @return 值
      */
-    public Object get(String key) {
+    private Object get(String key) {
         return key == null ? null : redisTemplate.opsForValue().get(key);
     }
 
@@ -103,7 +103,7 @@ public final class RedisUtil {
      * @param value 值
      * @return true成功 false失败
      */
-    public boolean set(String key, Object value) {
+    private boolean set(String key, Object value) {
         try {
             redisTemplate.opsForValue().set(key, value);
             return true;
@@ -122,7 +122,7 @@ public final class RedisUtil {
      * @param time  时间(秒) time要大于0 如果time小于等于0 将设置无限期
      * @return true成功 false 失败
      */
-    public boolean set(String key, Object value, long time) {
+    private boolean set(String key, Object value, long time) {
         try {
             if (time > 0) {
                 redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
@@ -143,7 +143,7 @@ public final class RedisUtil {
      * @param delta 要增加几(大于0)
      * @return
      */
-    public long incr(String key, long delta) {
+    private long incr(String key, long delta) {
         if (delta < 0) {
             throw new RuntimeException("递增因子必须大于0");
         }
@@ -157,7 +157,7 @@ public final class RedisUtil {
      * @param delta 要减少几(小于0)
      * @return
      */
-    public long decr(String key, long delta) {
+    private long decr(String key, long delta) {
         if (delta < 0) {
             throw new RuntimeException("递减因子必须大于0");
         }
@@ -173,7 +173,7 @@ public final class RedisUtil {
      * @param item 项 不能为null
      * @return 值
      */
-    public Object hget(String key, String item) {
+    private Object hget(String key, String item) {
         return redisTemplate.opsForHash().get(key, item);
     }
 
@@ -183,7 +183,7 @@ public final class RedisUtil {
      * @param key 键
      * @return 对应的多个键值
      */
-    public Map<Object, Object> hmget(String key) {
+    private Map<Object, Object> hmget(String key) {
         return redisTemplate.opsForHash().entries(key);
     }
 
@@ -194,7 +194,7 @@ public final class RedisUtil {
      * @param map 对应多个键值
      * @return true 成功 false 失败
      */
-    public boolean hmset(String key, Map<String, Object> map) {
+    private boolean hmset(String key, Map<String, Object> map) {
         try {
             redisTemplate.opsForHash().putAll(key, map);
             return true;
@@ -212,7 +212,7 @@ public final class RedisUtil {
      * @param time 时间(秒)
      * @return true成功 false失败
      */
-    public boolean hmset(String key, Map<String, Object> map, long time) {
+    private boolean hmset(String key, Map<String, Object> map, long time) {
         try {
             redisTemplate.opsForHash().putAll(key, map);
             if (time > 0) {
@@ -233,7 +233,7 @@ public final class RedisUtil {
      * @param value 值
      * @return true 成功 false失败
      */
-    public boolean hset(String key, String item, Object value) {
+    private boolean hset(String key, String item, Object value) {
         try {
             redisTemplate.opsForHash().put(key, item, value);
             return true;
@@ -252,7 +252,7 @@ public final class RedisUtil {
      * @param time  时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
      * @return true 成功 false失败
      */
-    public boolean hset(String key, String item, Object value, long time) {
+    private boolean hset(String key, String item, Object value, long time) {
         try {
             redisTemplate.opsForHash().put(key, item, value);
             if (time > 0) {
@@ -271,7 +271,7 @@ public final class RedisUtil {
      * @param key  键 不能为null
      * @param item 项 可以使多个 不能为null
      */
-    public void hdel(String key, Object... item) {
+    private void hdel(String key, Object... item) {
         redisTemplate.opsForHash().delete(key, item);
     }
 
@@ -282,7 +282,7 @@ public final class RedisUtil {
      * @param item 项 不能为null
      * @return true 存在 false不存在
      */
-    public boolean hHasKey(String key, String item) {
+    private boolean hHasKey(String key, String item) {
         return redisTemplate.opsForHash().hasKey(key, item);
     }
 
@@ -294,7 +294,7 @@ public final class RedisUtil {
      * @param by   要增加几(大于0)
      * @return
      */
-    public double hincr(String key, String item, double by) {
+    private double hincr(String key, String item, double by) {
         return redisTemplate.opsForHash().increment(key, item, by);
     }
 
@@ -306,7 +306,7 @@ public final class RedisUtil {
      * @param by   要减少记(小于0)
      * @return
      */
-    public double hdecr(String key, String item, double by) {
+    private double hdecr(String key, String item, double by) {
         return redisTemplate.opsForHash().increment(key, item, -by);
     }
 
@@ -318,7 +318,7 @@ public final class RedisUtil {
      * @param key 键
      * @return
      */
-    public Set<Object> sGet(String key) {
+    private Set<Object> sGet(String key) {
         try {
             return redisTemplate.opsForSet().members(key);
         } catch (Exception e) {
@@ -334,7 +334,7 @@ public final class RedisUtil {
      * @param value 值
      * @return true 存在 false不存在
      */
-    public boolean sHasKey(String key, Object value) {
+    private boolean sHasKey(String key, Object value) {
         try {
             return redisTemplate.opsForSet().isMember(key, value);
         } catch (Exception e) {
@@ -350,7 +350,7 @@ public final class RedisUtil {
      * @param values 值 可以是多个
      * @return 成功个数
      */
-    public long sSet(String key, Object... values) {
+    private long sSet(String key, Object... values) {
         try {
             return redisTemplate.opsForSet().add(key, values);
         } catch (Exception e) {
@@ -367,7 +367,7 @@ public final class RedisUtil {
      * @param values 值 可以是多个
      * @return 成功个数
      */
-    public long sSetAndTime(String key, long time, Object... values) {
+    private long sSetAndTime(String key, long time, Object... values) {
         try {
             Long count = redisTemplate.opsForSet().add(key, values);
             if (time > 0) {
@@ -386,7 +386,7 @@ public final class RedisUtil {
      * @param key 键
      * @return
      */
-    public long sGetSetSize(String key) {
+    private long sGetSetSize(String key) {
         try {
             return redisTemplate.opsForSet().size(key);
         } catch (Exception e) {
@@ -402,7 +402,7 @@ public final class RedisUtil {
      * @param values 值 可以是多个
      * @return 移除的个数
      */
-    public long setRemove(String key, Object... values) {
+    private long setRemove(String key, Object... values) {
         try {
             Long count = redisTemplate.opsForSet().remove(key, values);
             return count;
@@ -421,7 +421,7 @@ public final class RedisUtil {
      * @param end   结束 0 到 -1代表所有值
      * @return
      */
-    public List<Object> lGet(String key, long start, long end) {
+    private List<Object> lGet(String key, long start, long end) {
         try {
             return redisTemplate.opsForList().range(key, start, end);
         } catch (Exception e) {
@@ -436,7 +436,7 @@ public final class RedisUtil {
      * @param key 键
      * @return
      */
-    public long lGetListSize(String key) {
+    private long lGetListSize(String key) {
         try {
             return redisTemplate.opsForList().size(key);
         } catch (Exception e) {
@@ -452,7 +452,7 @@ public final class RedisUtil {
      * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
      * @return
      */
-    public Object lGetIndex(String key, long index) {
+    private Object lGetIndex(String key, long index) {
         try {
             return redisTemplate.opsForList().index(key, index);
         } catch (Exception e) {
@@ -469,7 +469,7 @@ public final class RedisUtil {
      * @param time  时间(秒)
      * @return
      */
-    public boolean lSet(String key, Object value) {
+    private boolean lSet(String key, Object value) {
         try {
             redisTemplate.opsForList().rightPush(key, value);
             return true;
@@ -487,7 +487,7 @@ public final class RedisUtil {
      * @param time  时间(秒)
      * @return
      */
-    public boolean lSet(String key, Object value, long time) {
+    private boolean lSet(String key, Object value, long time) {
         try {
             redisTemplate.opsForList().rightPush(key, value);
             if (time > 0) {
@@ -508,7 +508,7 @@ public final class RedisUtil {
      * @param time  时间(秒)
      * @return
      */
-    public boolean lSet(String key, List<Object> value) {
+    private boolean lSet(String key, List<Object> value) {
         try {
             redisTemplate.opsForList().rightPushAll(key, value);
             return true;
@@ -526,7 +526,7 @@ public final class RedisUtil {
      * @param time  时间(秒)
      * @return
      */
-    public boolean lSet(String key, List<Object> value, long time) {
+    private boolean lSet(String key, List<Object> value, long time) {
         try {
             redisTemplate.opsForList().rightPushAll(key, value);
             if (time > 0) {
@@ -547,7 +547,7 @@ public final class RedisUtil {
      * @param value 值
      * @return
      */
-    public boolean lUpdateIndex(String key, long index, Object value) {
+    private boolean lUpdateIndex(String key, long index, Object value) {
         try {
             redisTemplate.opsForList().set(key, index, value);
             return true;
@@ -565,7 +565,7 @@ public final class RedisUtil {
      * @param value 值
      * @return 移除的个数
      */
-    public long lRemove(String key, long count, Object value) {
+    private long lRemove(String key, long count, Object value) {
         try {
             Long remove = redisTemplate.opsForList().remove(key, count, value);
             return remove;