浏览代码

redis修改

rengb 5 年之前
父节点
当前提交
dc1d8a8a10
共有 24 个文件被更改,包括 737 次插入76 次删除
  1. 1 1
      dbanaly/pom.xml
  2. 2 2
      dbanaly/src/main/java/com/lantone/qc/dbanaly/lt/facade/ModelHospitalFacade.java
  3. 639 28
      dbanaly/src/main/java/com/lantone/qc/dbanaly/util/RedisUtil.java
  4. 57 0
      dbanaly/src/main/java/com/lantone/qc/dbanaly/util/SpecialStorageUtil.java
  5. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/analysis/QCAnalysis.java
  6. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0002.java
  7. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0011.java
  8. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0012.java
  9. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0015.java
  10. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0019.java
  11. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0494.java
  12. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/deathrecord/DEAR0338.java
  13. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0096.java
  14. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0147.java
  15. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0508.java
  16. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0094.java
  17. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0128.java
  18. 1 1
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ModelAI.java
  19. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcess.java
  20. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/util/CacheUtil.java
  21. 3 3
      kernel/src/main/java/com/lantone/qc/kernel/util/CatalogueUtil.java
  22. 2 2
      kernel/src/main/java/com/lantone/qc/kernel/util/DiagEnhancer.java
  23. 0 7
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxDocTrans.java
  24. 2 2
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxThreeLevelWardDocTrans.java

+ 1 - 1
dbanaly/pom.xml

@@ -81,7 +81,7 @@
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-pool2</artifactId>
-            <version>2.7.0</version>
+            <version>2.6.0</version>
         </dependency>
     </dependencies>
 

+ 2 - 2
dbanaly/src/main/java/com/lantone/qc/dbanaly/lt/facade/ModelHospitalFacade.java

@@ -3,7 +3,7 @@ package com.lantone.qc.dbanaly.lt.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.lantone.qc.dbanaly.lt.entity.ModelHospital;
 import com.lantone.qc.dbanaly.lt.service.impl.ModelHospitalServiceImpl;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,7 +21,7 @@ import java.util.stream.Collectors;
 public class ModelHospitalFacade extends ModelHospitalServiceImpl {
 
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
 
     public List<String> getRecTitles(long hospitalId, long modelId) {
         List<String> recTitles = redisUtil.getJsonStringValue("recTitles");

+ 639 - 28
dbanaly/src/main/java/com/lantone/qc/dbanaly/util/RedisUtil.java

@@ -1,57 +1,668 @@
 package com.lantone.qc.dbanaly.util;
 
-import com.google.common.collect.Maps;
-import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
 
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 /**
- * @Description:
- * @author: rengb
- * @time: 2020/3/6 17:21
+ * @author 王赛超 基于spring和redis的redisTemplate工具类 针对所有的hash 都是以h开头的方法 针对所有的Set 都是以s开头的方法 不含通用方法 针对所有的List 都是以l开头的方法
  */
 @Component
-public final class RedisUtil {
-    private final Map<String, Map<String, Object>> hospitalCache = Maps.newHashMap();
-    private final ThreadLocal<String> hospitalIdThreadLocal = new ThreadLocal<>();
+@Slf4j
+public class RedisUtil {
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
 
-    public <T> T getJsonStringValue(String key) {
-        return getValByHospitalId(hospitalIdThreadLocal.get(), key);
+    // =============================common============================
+
+    /**
+     * 指定缓存失效时间
+     *
+     * @param key  键
+     * @param time 时间(秒)
+     * @return
+     */
+    public boolean expire(String key, long time) {
+        try {
+            if (time > 0) {
+                redisTemplate.expire(key, time, TimeUnit.SECONDS);
+            }
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    /**
+     * 根据key 获取过期时间
+     *
+     * @param key 键 不能为null
+     * @return 时间(秒) 返回0代表为永久有效
+     */
+    public long getExpire(String key) {
+        return redisTemplate.getExpire(key, TimeUnit.SECONDS);
+    }
+
+    /**
+     * 判断key是否存在
+     *
+     * @param key 键
+     * @return true 存在 false不存在
+     */
+    public boolean hasKey(String key) {
+        try {
+            return redisTemplate.hasKey(key);
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    /**
+     * 删除缓存
+     *
+     * @param key 可以传一个值 或多个
+     */
+    @SuppressWarnings("unchecked")
+    public void del(String... key) {
+        if (key != null && key.length > 0) {
+            if (key.length == 1) {
+                redisTemplate.delete(key[0]);
+            } else {
+                redisTemplate.delete(CollectionUtils.arrayToList(key));
+            }
+        }
+    }
+
+    // ============================String=============================
+
+    /**
+     * 普通缓存获取
+     *
+     * @param key 键
+     * @return 值
+     */
+    public Object get(String key) {
+        return key == null ? null : redisTemplate.opsForValue().get(key);
+    }
+
+    /**
+     * 普通缓存放入
+     *
+     * @param key   键
+     * @param value 值
+     * @return true成功 false失败
+     */
+    public boolean set(String key, Object value) {
+        try {
+            redisTemplate.opsForValue().set(key, value);
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+
+    }
+
+    /**
+     * 普通缓存放入并设置时间
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒) time要大于0 如果time小于等于0 将设置无限期
+     * @return true成功 false 失败
+     */
+    public boolean set(String key, Object value, long time) {
+        try {
+            if (time > 0) {
+                redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
+            } else {
+                set(key, value);
+            }
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    /**
+     * 递增 适用场景: https://blog.csdn.net/y_y_y_k_k_k_k/article/details/79218254 高并发生成订单号,秒杀类的业务逻辑等。。
+     *
+     * @param key 键
+     * @return
+     */
+    public long incr(String key, long delta) {
+        if (delta < 0) {
+            throw new RuntimeException("递增因子必须大于0");
+        }
+        return redisTemplate.opsForValue().increment(key, delta);
+    }
+
+    /**
+     * 递减
+     *
+     * @param key 键
+     * @return
+     */
+    public long decr(String key, long delta) {
+        if (delta < 0) {
+            throw new RuntimeException("递减因子必须大于0");
+        }
+        return redisTemplate.opsForValue().increment(key, -delta);
+    }
+
+    // ================================Map=================================
+
+    /**
+     * HashGet
+     *
+     * @param key  键 不能为null
+     * @param item 项 不能为null
+     * @return 值
+     */
+    public Object hget(String key, String item) {
+        return redisTemplate.opsForHash().get(key, item);
+    }
+
+    /**
+     * 获取hashKey对应的所有键值
+     *
+     * @param key 键
+     * @return 对应的多个键值
+     */
+    public Map<Object, Object> hmget(String key) {
+        return redisTemplate.opsForHash().entries(key);
+    }
+
+    /**
+     * HashSet
+     *
+     * @param key 键
+     * @param map 对应多个键值
+     * @return true 成功 false 失败
+     */
+    public boolean hmset(String key, Map<String, Object> map) {
+        try {
+            redisTemplate.opsForHash().putAll(key, map);
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    /**
+     * HashSet 并设置时间
+     *
+     * @param key  键
+     * @param map  对应多个键值
+     * @param time 时间(秒)
+     * @return true成功 false失败
+     */
+    public boolean hmset(String key, Map<String, Object> map, long time) {
+        try {
+            redisTemplate.opsForHash().putAll(key, map);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    /**
+     * 向一张hash表中放入数据,如果不存在将创建
+     *
+     * @param key   键
+     * @param item  项
+     * @param value 值
+     * @return true 成功 false失败
+     */
+    public boolean hset(String key, String item, Object value) {
+        try {
+            redisTemplate.opsForHash().put(key, item, value);
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    /**
+     * 向一张hash表中放入数据,如果不存在将创建
+     *
+     * @param key   键
+     * @param item  项
+     * @param value 值
+     * @param time  时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
+     * @return true 成功 false失败
+     */
+    public boolean hset(String key, String item, Object value, long time) {
+        try {
+            redisTemplate.opsForHash().put(key, item, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    /**
+     * 删除hash表中的值
+     *
+     * @param key  键 不能为null
+     * @param item 项 可以使多个 不能为null
+     */
+    public void hdel(String key, Object... item) {
+        redisTemplate.opsForHash().delete(key, item);
+    }
+
+    /**
+     * 判断hash表中是否有该项的值
+     *
+     * @param key  键 不能为null
+     * @param item 项 不能为null
+     * @return true 存在 false不存在
+     */
+    public boolean hHasKey(String key, String item) {
+        return redisTemplate.opsForHash().hasKey(key, item);
+    }
+
+    /**
+     * hash递增 如果不存在,就会创建一个 并把新增后的值返回
+     *
+     * @param key  键
+     * @param item 项
+     * @param by   要增加几(大于0)
+     * @return
+     */
+    public double hincr(String key, String item, double by) {
+        return redisTemplate.opsForHash().increment(key, item, by);
+    }
+
+    /**
+     * hash递减
+     *
+     * @param key  键
+     * @param item 项
+     * @param by   要减少记(小于0)
+     * @return
+     */
+    public double hdecr(String key, String item, double by) {
+        return redisTemplate.opsForHash().increment(key, item, -by);
+    }
+
+    // ============================set=============================
+
+    /**
+     * 根据key获取Set中的所有值
+     *
+     * @param key 键
+     * @return
+     */
+    public Set<Object> sGet(String key) {
+        try {
+            return redisTemplate.opsForSet().members(key);
+        } catch (Exception e) {
+            log.error(key, e);
+            return null;
+        }
+    }
+
+    /**
+     * 根据value从一个set中查询,是否存在
+     *
+     * @param key   键
+     * @param value 值
+     * @return true 存在 false不存在
+     */
+    public boolean sHasKey(String key, Object value) {
+        try {
+            return redisTemplate.opsForSet().isMember(key, value);
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    /**
+     * 将数据放入set缓存
+     *
+     * @param key    键
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    public long sSet(String key, Object... values) {
+        try {
+            return redisTemplate.opsForSet().add(key, values);
+        } catch (Exception e) {
+            log.error(key, e);
+            return 0;
+        }
+    }
+
+    /**
+     * 将set数据放入缓存
+     *
+     * @param key    键
+     * @param time   时间(秒)
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    public long sSetAndTime(String key, long time, Object... values) {
+        try {
+            Long count = redisTemplate.opsForSet().add(key, values);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return count;
+        } catch (Exception e) {
+            log.error(key, e);
+            return 0;
+        }
+    }
+
+    /**
+     * 获取set缓存的长度
+     *
+     * @param key 键
+     * @return
+     */
+    public long sGetSetSize(String key) {
+        try {
+            return redisTemplate.opsForSet().size(key);
+        } catch (Exception e) {
+            log.error(key, e);
+            return 0;
+        }
+    }
+
+    /**
+     * 移除值为value的
+     *
+     * @param key    键
+     * @param values 值 可以是多个
+     * @return 移除的个数
+     */
+    public long setRemove(String key, Object... values) {
+        try {
+            Long count = redisTemplate.opsForSet().remove(key, values);
+            return count;
+        } catch (Exception e) {
+            log.error(key, e);
+            return 0;
+        }
+    }
+
+    // ============================zset=============================
+
+    /**
+     * 根据key获取Set中的所有值
+     *
+     * @param key 键
+     * @return
+     */
+    public Set<Object> zSGet(String key) {
+        try {
+            return redisTemplate.opsForSet().members(key);
+        } catch (Exception e) {
+            log.error(key, e);
+            return null;
+        }
+    }
+
+    /**
+     * 根据value从一个set中查询,是否存在
+     *
+     * @param key   键
+     * @param value 值
+     * @return true 存在 false不存在
+     */
+    public boolean zSHasKey(String key, Object value) {
+        try {
+            return redisTemplate.opsForSet().isMember(key, value);
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    public Boolean zSSet(String key, Object value, double score) {
+        try {
+            return redisTemplate.opsForZSet().add(key, value, 2);
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    /**
+     * 将set数据放入缓存
+     *
+     * @param key    键
+     * @param time   时间(秒)
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    public long zSSetAndTime(String key, long time, Object... values) {
+        try {
+            Long count = redisTemplate.opsForSet().add(key, values);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return count;
+        } catch (Exception e) {
+            log.error(key, e);
+            return 0;
+        }
+    }
+
+    /**
+     * 获取set缓存的长度
+     *
+     * @param key 键
+     * @return
+     */
+    public long zSGetSetSize(String key) {
+        try {
+            return redisTemplate.opsForSet().size(key);
+        } catch (Exception e) {
+            log.error(key, e);
+            return 0;
+        }
+    }
+
+    /**
+     * 移除值为value的
+     *
+     * @param key    键
+     * @param values 值 可以是多个
+     * @return 移除的个数
+     */
+    public long zSetRemove(String key, Object... values) {
+        try {
+            Long count = redisTemplate.opsForSet().remove(key, values);
+            return count;
+        } catch (Exception e) {
+            log.error(key, e);
+            return 0;
+        }
     }
+    // ===============================list=================================
 
-    public <T> T getValByHospitalId(String hospitalId, String key) {
-        if (StringUtil.isBlank(hospitalId)) {
+    /**
+     * 获取list缓存的内容
+     *
+     * @param key   键
+     * @param start 开始 0 是第一个元素
+     * @param end   结束 -1代表所有值
+     * @return
+     * @取出来的元素 总数 end-start+1
+     */
+    public List<Object> lGet(String key, long start, long end) {
+        try {
+            return redisTemplate.opsForList().range(key, start, end);
+        } catch (Exception e) {
+            log.error(key, e);
             return null;
         }
-        Map<String, Object> map = hospitalCache.get(hospitalId);
-        if (map == null) {
+    }
+
+    /**
+     * 获取list缓存的长度
+     *
+     * @param key 键
+     * @return
+     */
+    public long lGetListSize(String key) {
+        try {
+            return redisTemplate.opsForList().size(key);
+        } catch (Exception e) {
+            log.error(key, e);
+            return 0;
+        }
+    }
+
+    /**
+     * 通过索引 获取list中的值
+     *
+     * @param key   键
+     * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
+     * @return
+     */
+    public Object lGetIndex(String key, long index) {
+        try {
+            return redisTemplate.opsForList().index(key, index);
+        } catch (Exception e) {
+            log.error(key, e);
             return null;
         }
-        return (T) map.get(key);
     }
 
-    public <T> void setJsonStringValue(String key, Object value) {
-        setValByHospitalId(hospitalIdThreadLocal.get(), key, value);
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @return
+     */
+    public boolean lSet(String key, Object value) {
+        try {
+            redisTemplate.opsForList().rightPush(key, value);
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
     }
 
-    public <T> void setValByHospitalId(String hospitalId, String key, Object value) {
-        if (StringUtil.isBlank(hospitalId)) {
-            return;
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     * @return
+     */
+    public boolean lSet(String key, Object value, long time) {
+        try {
+            redisTemplate.opsForList().rightPush(key, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
         }
-        Map<String, Object> map = hospitalCache.get(hospitalId);
-        if (map == null) {
-            return;
+    }
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @return
+     */
+    public boolean lSet(String key, List<Object> value) {
+        try {
+            redisTemplate.opsForList().rightPushAll(key, value);
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     * @return
+     */
+    public boolean lSet(String key, List<Object> value, long time) {
+        try {
+            redisTemplate.opsForList().rightPushAll(key, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
         }
-        map.put(key, value);
     }
 
-    public ThreadLocal<String> getHospitalIdThreadLocal() {
-        return hospitalIdThreadLocal;
+    /**
+     * 根据索引修改list中的某条数据
+     *
+     * @param key   键
+     * @param index 索引
+     * @param value 值
+     * @return
+     */
+    public boolean lUpdateIndex(String key, long index, Object value) {
+        try {
+            redisTemplate.opsForList().set(key, index, value);
+            return true;
+        } catch (Exception e) {
+            log.error(key, e);
+            return false;
+        }
     }
 
-    public Map<String, Map<String, Object>> getHospitalCache() {
-        return hospitalCache;
+    /**
+     * 移除N个值为value
+     *
+     * @param key   键
+     * @param count 移除多少个
+     * @param value 值
+     * @return 移除的个数
+     */
+    public long lRemove(String key, long count, Object value) {
+        try {
+            Long remove = redisTemplate.opsForList().remove(key, count, value);
+            return remove;
+        } catch (Exception e) {
+            log.error(key, e);
+            return 0;
+        }
     }
 
 }

+ 57 - 0
dbanaly/src/main/java/com/lantone/qc/dbanaly/util/SpecialStorageUtil.java

@@ -0,0 +1,57 @@
+package com.lantone.qc.dbanaly.util;
+
+import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2020/3/6 17:21
+ */
+@Component
+public final class SpecialStorageUtil {
+    private final Map<String, Map<String, Object>> hospitalCache = Maps.newHashMap();
+    private final ThreadLocal<String> hospitalIdThreadLocal = new ThreadLocal<>();
+
+    public <T> T getJsonStringValue(String key) {
+        return getValByHospitalId(hospitalIdThreadLocal.get(), key);
+    }
+
+    public <T> T getValByHospitalId(String hospitalId, String key) {
+        if (StringUtil.isBlank(hospitalId)) {
+            return null;
+        }
+        Map<String, Object> map = hospitalCache.get(hospitalId);
+        if (map == null) {
+            return null;
+        }
+        return (T) map.get(key);
+    }
+
+    public <T> void setJsonStringValue(String key, Object value) {
+        setValByHospitalId(hospitalIdThreadLocal.get(), key, value);
+    }
+
+    public <T> void setValByHospitalId(String hospitalId, String key, Object value) {
+        if (StringUtil.isBlank(hospitalId)) {
+            return;
+        }
+        Map<String, Object> map = hospitalCache.get(hospitalId);
+        if (map == null) {
+            return;
+        }
+        map.put(key, value);
+    }
+
+    public ThreadLocal<String> getHospitalIdThreadLocal() {
+        return hospitalIdThreadLocal;
+    }
+
+    public Map<String, Map<String, Object>> getHospitalCache() {
+        return hospitalCache;
+    }
+
+}

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/analysis/QCAnalysis.java

@@ -5,7 +5,7 @@ import com.lantone.qc.kernel.client.CRFServiceClient;
 import com.lantone.qc.kernel.client.SimilarityServiceClient;
 import com.lantone.qc.kernel.structure.ai.AIAnalyze;
 import com.lantone.qc.kernel.util.CatalogueUtil;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.exception.AIException;
 import com.lantone.qc.pub.exception.CatalogueException;
 import com.lantone.qc.pub.model.InputInfo;
@@ -28,7 +28,7 @@ public class QCAnalysis {
     @Autowired
     CRFServiceClient crfServiceClient;
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
     @Autowired
     SimilarityServiceClient similarityServiceClient;
 

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

@@ -5,7 +5,7 @@ import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.client.ChiefPresentSimilarityServiceClient;
 import com.lantone.qc.kernel.structure.ai.ModelAI;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
@@ -30,7 +30,7 @@ import java.util.Map;
 @Component
 public class BEH0002 extends QCCatalogue {
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
     @Autowired
     ChiefPresentSimilarityServiceClient chiefPresentSimilarityServiceClient;
 

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

@@ -2,7 +2,7 @@ package com.lantone.qc.kernel.catalogue.behospitalized;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.Diag;
@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
 @Component
 public class BEH0011 extends QCCatalogue {
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         if(inputInfo.getBeHospitalizedDoc() == null){
             status.set("0");

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

@@ -2,7 +2,7 @@ package com.lantone.qc.kernel.catalogue.behospitalized;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.Diag;
@@ -26,7 +26,7 @@ import java.util.Map;
 public class BEH0012 extends QCCatalogue {
     private static String[] strings = { "2型糖尿病" };
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         if (inputInfo.getBeHospitalizedDoc() == null) {

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0015.java

@@ -2,7 +2,7 @@ package com.lantone.qc.kernel.catalogue.behospitalized;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.BodyPart;
@@ -22,7 +22,7 @@ import java.util.List;
 @Component
 public class BEH0015 extends QCCatalogue {
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         if(inputInfo.getBeHospitalizedDoc() == null){

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0019.java

@@ -1,7 +1,7 @@
 package com.lantone.qc.kernel.catalogue.behospitalized;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.Clinical;
@@ -22,7 +22,7 @@ import java.util.List;
 @Component
 public class BEH0019 extends QCCatalogue {
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         if(inputInfo.getBeHospitalizedDoc() == null){
             status.set("0");

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0494.java

@@ -2,7 +2,7 @@ package com.lantone.qc.kernel.catalogue.behospitalized;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.util.SpringContextUtil;
@@ -29,7 +29,7 @@ public class BEH0494 extends QCCatalogue {
             doctorName = inputInfo.getBeHospitalizedDoc().getStructureMap().get("签名");
         }
         if (StringUtils.isNotEmpty(doctorName)) {
-            RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
+            SpecialStorageUtil redisUtil = SpringContextUtil.getBean("redisUtil");
             Map<String, Object> surgeon = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
             if (surgeon == null) {
                 return;

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/deathrecord/DEAR0338.java

@@ -2,7 +2,7 @@ package com.lantone.qc.kernel.catalogue.deathrecord;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.util.StringUtil;
@@ -20,7 +20,7 @@ import java.util.Map;
 @Component
 public class DEAR0338 extends QCCatalogue {
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         if (inputInfo.getDeathRecordDoc() == null) {

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0096.java

@@ -2,7 +2,7 @@ package com.lantone.qc.kernel.catalogue.firstcourserecord;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
@@ -24,7 +24,7 @@ import java.util.Map;
 @Component
 public class FIRC0096 extends QCCatalogue {
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         if(inputInfo.getFirstCourseRecordDoc() == null){
             status.set("0");

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0147.java

@@ -2,7 +2,7 @@ package com.lantone.qc.kernel.catalogue.leavehospital;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.DeathRecordDoc;
@@ -27,7 +27,7 @@ import java.util.Map;
 public class LEA0147 extends QCCatalogue {
 
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0508.java

@@ -2,7 +2,7 @@ package com.lantone.qc.kernel.catalogue.leavehospital;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
@@ -34,7 +34,7 @@ public class LEA0508 extends QCCatalogue {
             status.set("0");
             return;
         }
-        RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
+        SpecialStorageUtil redisUtil = SpringContextUtil.getBean("redisUtil");
         Map<String, Object> surgeon = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
         if (surgeon == null) {
             status.set("0");

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0094.java

@@ -2,7 +2,7 @@ package com.lantone.qc.kernel.catalogue.threelevelward;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
@@ -36,7 +36,7 @@ public class THR0094 extends QCCatalogue {
         }
 
 
-        RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
+        SpecialStorageUtil redisUtil = SpringContextUtil.getBean("redisUtil");
         Map<String, Object> surgeon = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
         if (surgeon == null) {
             status.set("0");

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0128.java

@@ -3,7 +3,7 @@ package com.lantone.qc.kernel.catalogue.threelevelward;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
@@ -29,7 +29,7 @@ import java.util.Map;
 @Component
 public class THR0128 extends QCCatalogue {
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ModelAI.java

@@ -189,7 +189,7 @@ public class ModelAI {
      * @return
      */
     public JSONArray loadChiefPresentSimilarAI(String string1, List<String> string2, boolean directionCheck
-            ,String modelName, ChiefPresentSimilarityServiceClient chiefPresentSimilarityServiceClient) {
+            , String modelName, ChiefPresentSimilarityServiceClient chiefPresentSimilarityServiceClient) {
         //存储CRF完整所需结构数据
         ChiefPresentSimilarityVo similarityVo = new ChiefPresentSimilarityVo();
         JSONObject data = new JSONObject();

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcess.java

@@ -6,7 +6,7 @@ import com.lantone.qc.kernel.structure.ai.model.EntityEnum;
 import com.lantone.qc.kernel.structure.ai.model.Lemma;
 import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.kernel.structure.ai.model.Relation;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.entity.Negative;
 import com.lantone.qc.pub.model.entity.PD;
 import org.apache.commons.beanutils.BeanUtils;
@@ -29,7 +29,7 @@ import java.util.regex.Pattern;
 @Component
 public class EntityProcess {
     @Autowired
-    RedisUtil redisUtil;
+    SpecialStorageUtil redisUtil;
     /**
      * 树形结构存储三元组关系,返回传入实体类型为节点的所有关联实体对象
      * @param aiOut

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

@@ -2,7 +2,7 @@ package com.lantone.qc.kernel.util;
 
 import com.google.common.collect.Maps;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.nlp.participle.cfg.Configuration;
 import com.lantone.qc.nlp.participle.cfg.DefaultConfig;
 import com.lantone.qc.pub.util.StringUtil;
@@ -30,7 +30,7 @@ import java.util.Map;
 public class CacheUtil implements ApplicationRunner {
     private Configuration configuration = new DefaultConfig();
     @Autowired
-    private RedisUtil redisUtil;
+    private SpecialStorageUtil redisUtil;
     @Value("${qc.hospital_id}")
     private String hospitalIds;
 

+ 3 - 3
kernel/src/main/java/com/lantone/qc/kernel/util/CatalogueUtil.java

@@ -3,7 +3,7 @@ package com.lantone.qc.kernel.util;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.model.doc.DoctorAdviceDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
@@ -116,7 +116,7 @@ public class CatalogueUtil {
         if (ListUtil.isEmpty(diags) || StringUtil.isBlank(nature) || StringUtil.isBlank(natureValue)) {
             return null;
         }
-        RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
+        SpecialStorageUtil redisUtil = SpringContextUtil.getBean("redisUtil");
         Map<String, Map<String, String>> conceptDiagPropertyMap = redisUtil.getJsonStringValue(KernelConstants.CONCEPT_DIAG_PROPERTY_MAP);
         if (conceptDiagPropertyMap == null) {
             return null;
@@ -424,7 +424,7 @@ public class CatalogueUtil {
      */
     public static String getDoctorTitle(List<OperationDoc> operationDocs, Date recordDate, String findTitle) {
         String title = "";
-        RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
+        SpecialStorageUtil redisUtil = SpringContextUtil.getBean("redisUtil");
         Map<String, Object> surgeon = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
         if (surgeon == null) {
             return title;

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/util/DiagEnhancer.java

@@ -1,7 +1,7 @@
 package com.lantone.qc.kernel.util;
 
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.entity.Diag;
 import com.lantone.qc.pub.util.SpringContextUtil;
 import com.lantone.qc.pub.util.StringUtil;
@@ -18,7 +18,7 @@ public class DiagEnhancer {
     public static Diag create(String hospitalDiagName) {
         Diag diag = new Diag();
         diag.setHospitalDiagName(hospitalDiagName);
-        RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
+        SpecialStorageUtil redisUtil = SpringContextUtil.getBean("redisUtil");
         Map<String, Map<String, String>> hospitalDiagHuazMap = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DIAG_HUAZ_MAP);
         Map<String, Map<String, String>> lantoneDiagHuazMap = redisUtil.getJsonStringValue(KernelConstants.LANTONE_DIAG_HUAZ_MAP);
         if (hospitalDiagHuazMap != null && lantoneDiagHuazMap != null) {

+ 0 - 7
trans/src/main/java/com/lantone/qc/trans/changx/ChangxDocTrans.java

@@ -1,20 +1,13 @@
 package com.lantone.qc.trans.changx;
 
 import com.google.common.collect.Lists;
-import com.lantone.qc.dbanaly.util.RedisUtil;
 import com.lantone.qc.pub.model.InputInfo;
-import com.lantone.qc.pub.model.doc.operation.OperationDoc;
-import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.model.vo.QueryVo;
 import com.lantone.qc.pub.util.ListUtil;
-import com.lantone.qc.pub.util.SpringContextUtil;
-import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.DocTrans;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
 
-import java.util.Calendar;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;

+ 2 - 2
trans/src/main/java/com/lantone/qc/trans/changx/ChangxThreeLevelWardDocTrans.java

@@ -5,7 +5,7 @@ import com.google.common.collect.Maps;
 import com.lantone.qc.dbanaly.facade.changx.CxXmlUtil;
 import com.lantone.qc.dbanaly.lt.facade.ModelHospitalFacade;
 import com.lantone.qc.dbanaly.util.KernelConstants;
-import com.lantone.qc.dbanaly.util.RedisUtil;
+import com.lantone.qc.dbanaly.util.SpecialStorageUtil;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
@@ -229,7 +229,7 @@ public class ChangxThreeLevelWardDocTrans extends ModelDocTrans {
      */
     public static String getDoctorTitle(List<OperationDoc> operationDocs, Date recordDate, String findTitle) {
         String title = "";
-        RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
+        SpecialStorageUtil redisUtil = SpringContextUtil.getBean("redisUtil");
         Map<String, Object> surgeon = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
         if (surgeon == null) {
             return title;