Browse Source

Merge branch 'master' into his/common

# Conflicts:
#	src/main/java/com/diagbot/config/ResourceServerConfigurer.java
#	src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
liuqq 3 years ago
parent
commit
a5ff56883f
47 changed files with 2054 additions and 34 deletions
  1. 6 0
      pom.xml
  2. 126 7
      src/main/java/com/diagbot/aggregate/AssembleAggregate.java
  3. 19 0
      src/main/java/com/diagbot/annotation/CdssLog.java
  4. 81 0
      src/main/java/com/diagbot/aop/CdssLogAspect.java
  5. 6 0
      src/main/java/com/diagbot/config/MybatisPlusConfigurer.java
  6. 4 0
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  7. 223 0
      src/main/java/com/diagbot/config/mybatisLike/AbstractLikeSqlConverter.java
  8. 79 0
      src/main/java/com/diagbot/config/mybatisLike/MapLikeSqlConverter.java
  9. 160 0
      src/main/java/com/diagbot/config/mybatisLike/MybatisLikeSqlInterceptor.java
  10. 28 0
      src/main/java/com/diagbot/config/mybatisLike/ObjectLikeSqlConverter.java
  11. 4 0
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  12. 45 0
      src/main/java/com/diagbot/entity/AdministrationRouteConfig.java
  13. 4 4
      src/main/java/com/diagbot/entity/AnesthesiaConfig.java
  14. 269 0
      src/main/java/com/diagbot/entity/TranLog.java
  15. 23 0
      src/main/java/com/diagbot/entity/wrapper/AdministrationRouteConfigWrapper.java
  16. 2 1
      src/main/java/com/diagbot/enums/ConceptTypeEnum.java
  17. 15 0
      src/main/java/com/diagbot/facade/KlConceptStaticFacade.java
  18. 58 0
      src/main/java/com/diagbot/facade/LogTestFacade.java
  19. 27 3
      src/main/java/com/diagbot/facade/MappingConfigFacade.java
  20. 3 1
      src/main/java/com/diagbot/facade/RetrievalFacade.java
  21. 56 0
      src/main/java/com/diagbot/facade/TranLogFacade.java
  22. 19 0
      src/main/java/com/diagbot/mapper/TranLogMapper.java
  23. 23 0
      src/main/java/com/diagbot/rabbit/MyProcessor.java
  24. 28 0
      src/main/java/com/diagbot/rabbit/MyReceiver.java
  25. 28 0
      src/main/java/com/diagbot/rabbit/MySender.java
  26. 19 0
      src/main/java/com/diagbot/service/TranLogService.java
  27. 26 0
      src/main/java/com/diagbot/service/impl/TranLogServiceImpl.java
  28. 296 0
      src/main/java/com/diagbot/util/CdssLogUtil.java
  29. 4 0
      src/main/java/com/diagbot/vo/Drug.java
  30. 35 0
      src/main/java/com/diagbot/vo/LogTestVO.java
  31. 2 2
      src/main/java/com/diagbot/vo/MappingConfigPageVO.java
  32. 1 1
      src/main/java/com/diagbot/vo/PrecDataVO.java
  33. 5 0
      src/main/java/com/diagbot/vo/RetrievalVO.java
  34. 31 0
      src/main/java/com/diagbot/vo/TranLogPageVO.java
  35. 12 0
      src/main/java/com/diagbot/web/ConceptInfoController.java
  36. 42 0
      src/main/java/com/diagbot/web/LogTestController.java
  37. 12 12
      src/main/java/com/diagbot/web/MappingConfigController.java
  38. 2 1
      src/main/java/com/diagbot/web/RetrievalController.java
  39. 1 1
      src/main/java/com/diagbot/web/TermMatchingController.java
  40. 59 0
      src/main/java/com/diagbot/web/TranLogController.java
  41. 22 0
      src/main/resources/application-dev.yml
  42. 22 0
      src/main/resources/application-local.yml
  43. 23 0
      src/main/resources/application-pre.yml
  44. 22 0
      src/main/resources/application-pro.yml
  45. 22 0
      src/main/resources/application-test.yml
  46. 59 0
      src/main/resources/mapper/TranLogMapper.xml
  47. 1 1
      src/test/java/com/diagbot/CodeGeneration.java

+ 6 - 0
pom.xml

@@ -188,6 +188,12 @@
             <artifactId>commons-pool2</artifactId>
         </dependency>
 
+        <!--消息中心-->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
+        </dependency>
+
         <!-- 文件上传相关架包 -->
         <dependency>
             <groupId>commons-fileupload</groupId>

+ 126 - 7
src/main/java/com/diagbot/aggregate/AssembleAggregate.java

@@ -47,7 +47,8 @@ public class AssembleAggregate {
             @DataConsumer("drugConfigMap") Map<String, Map<String, Map<String, List<String>>>> drugConfigMap,
             @DataConsumer("operationConfigMap") Map<String, Map<String, Map<String, List<String>>>> operationConfigMap,
             @DataConsumer("deptConfigMap") Map<String, Map<String, Map<String, List<String>>>> deptConfigMap,
-            @DataConsumer("transfusionConfigMap") Map<String, Map<String, Map<String, List<String>>>> transfusionConfigMap) {
+            @DataConsumer("transfusionConfigMap") Map<String, Map<String, Map<String, List<String>>>> transfusionConfigMap,
+            @DataConsumer("routeConfigMap") Map<String, Map<String, Map<String, List<String>>>> routeConfigMap) {
         //检验
         if (MapUtils.isNotEmpty(lisConfigMap)) {
             if (ListUtil.isNotEmpty(searchData.getLis())) {
@@ -97,6 +98,18 @@ public class AssembleAggregate {
                 searchData.setDrugOrder(convertItem);
             }
         }
+        //给药途径,没有映射的数据标准术语名称赋值成医院术语名称
+        //if (MapUtils.isNotEmpty(routeConfigMap)) {
+        if (ListUtil.isNotEmpty(searchData.getDrug())) {
+            List<Drug> convertItem = addUniqueName(searchData.getDrug(), routeConfigMap, ConceptTypeEnum.AdministrationRoute.getKey(), "routeName", "routeUniqueName");
+            searchData.setDrug(convertItem);
+        }
+        if (ListUtil.isNotEmpty(searchData.getDrugOrder())) {
+            List<Drug> convertItem = addUniqueName(searchData.getDrugOrder(), routeConfigMap, ConceptTypeEnum.AdministrationRoute.getKey(), "routeName", "routeUniqueName");
+            searchData.setDrugOrder(convertItem);
+        }
+        //}
+
         //手术
         if (MapUtils.isNotEmpty(operationConfigMap)) {
             if (ListUtil.isNotEmpty(searchData.getOperation())) {
@@ -196,7 +209,7 @@ public class AssembleAggregate {
         Map<String, Map<String, Map<String, List<String>>>> pacsConfigMap = new HashMap<>();
         if (ListUtil.isNotEmpty(pacsHisNameList)) {
             pacsConfigMap
-                    = mappingConfigFacade.groupByHisNameWithName(pacsHisNameList, ConceptTypeEnum.Pacs.getKey(), searchData.getHospitalId(),StatusEnum.Enable.getKey());
+                    = mappingConfigFacade.groupByHisNameWithName(pacsHisNameList, ConceptTypeEnum.Pacs.getKey(), searchData.getHospitalId(), StatusEnum.Enable.getKey());
         }
         return pacsConfigMap;
     }
@@ -234,7 +247,7 @@ public class AssembleAggregate {
         Map<String, Map<String, Map<String, List<String>>>> configMap = new HashMap<>();
         if (ListUtil.isNotEmpty(diagHisNameList)) {
             configMap
-                    = mappingConfigFacade.groupByHisNameWithName(diagHisNameList, ConceptTypeEnum.Disease.getKey(), searchData.getHospitalId(),StatusEnum.Enable.getKey());
+                    = mappingConfigFacade.groupByHisNameWithName(diagHisNameList, ConceptTypeEnum.Disease.getKey(), searchData.getHospitalId(), StatusEnum.Enable.getKey());
         }
         return configMap;
     }
@@ -267,7 +280,7 @@ public class AssembleAggregate {
         Map<String, Map<String, Map<String, List<String>>>> configMap = new HashMap<>();
         if (ListUtil.isNotEmpty(drugHisNameList)) {
             configMap
-                    = mappingConfigFacade.groupByHisNameWithName(drugHisNameList, ConceptTypeEnum.Drug.getKey(), searchData.getHospitalId(),StatusEnum.Enable.getKey());
+                    = mappingConfigFacade.groupByHisNameWithName(drugHisNameList, ConceptTypeEnum.Drug.getKey(), searchData.getHospitalId(), StatusEnum.Enable.getKey());
         }
         return configMap;
     }
@@ -305,7 +318,7 @@ public class AssembleAggregate {
         Map<String, Map<String, Map<String, List<String>>>> configMap = new HashMap<>();
         if (ListUtil.isNotEmpty(operationHisNameList)) {
             configMap
-                    = mappingConfigFacade.groupByHisNameWithName(operationHisNameList, ConceptTypeEnum.Operation.getKey(), searchData.getHospitalId(),StatusEnum.Enable.getKey());
+                    = mappingConfigFacade.groupByHisNameWithName(operationHisNameList, ConceptTypeEnum.Operation.getKey(), searchData.getHospitalId(), StatusEnum.Enable.getKey());
         }
         return configMap;
     }
@@ -331,7 +344,7 @@ public class AssembleAggregate {
 
         if (ListUtil.isNotEmpty(deptHisNameList)) {
             configMap
-                    = mappingConfigFacade.groupByHisNameWithName(deptHisNameList, ConceptTypeEnum.Dept.getKey(), searchData.getHospitalId(),StatusEnum.Enable.getKey());
+                    = mappingConfigFacade.groupByHisNameWithName(deptHisNameList, ConceptTypeEnum.Dept.getKey(), searchData.getHospitalId(), StatusEnum.Enable.getKey());
         }
         return configMap;
     }
@@ -365,7 +378,40 @@ public class AssembleAggregate {
 
         if (ListUtil.isNotEmpty(transfusionHisNameList)) {
             configMap
-                    = mappingConfigFacade.groupByHisNameWithName(transfusionHisNameList, ConceptTypeEnum.Transfusion.getKey(), searchData.getHospitalId(),StatusEnum.Enable.getKey());
+                    = mappingConfigFacade.groupByHisNameWithName(transfusionHisNameList, ConceptTypeEnum.Transfusion.getKey(), searchData.getHospitalId(), StatusEnum.Enable.getKey());
+        }
+        return configMap;
+    }
+
+    @DataProvider("routeConfigMap")
+    public Map<String, Map<String, Map<String, List<String>>>> routeConfigMap(@InvokeParameter("searchData") SearchData searchData) {
+        //药品给药途径公表转换
+        List<String> routeHisNameList = Lists.newArrayList();
+        //drug
+        if (ListUtil.isNotEmpty(searchData.getDrug())) {
+            routeHisNameList.addAll(searchData.getDrug()
+                    .stream()
+                    .filter(i -> StringUtil.isNotBlank(i.getRouteName()) || StringUtil.isNotBlank(i.getRouteUniqueName()))
+                    .map(i -> i.getRouteName())
+                    .collect(Collectors.toList()));
+        }
+        //drugOrder
+        if (ListUtil.isNotEmpty(searchData.getDrugOrder())) {
+            routeHisNameList.addAll(searchData.getDrugOrder()
+                    .stream()
+                    .filter(i -> StringUtil.isNotBlank(i.getRouteName()) || StringUtil.isNotBlank(i.getRouteUniqueName()))
+                    .map(i -> i.getRouteName())
+                    .collect(Collectors.toList()));
+        }
+        routeHisNameList = routeHisNameList
+                .stream()
+                .distinct()
+                .collect(Collectors.toList());
+
+        Map<String, Map<String, Map<String, List<String>>>> configMap = new HashMap<>();
+        if (ListUtil.isNotEmpty(routeHisNameList)) {
+            configMap
+                    = mappingConfigFacade.groupByHisNameWithName(routeHisNameList, ConceptTypeEnum.AdministrationRoute.getKey(), searchData.getHospitalId(), StatusEnum.Enable.getKey());
         }
         return configMap;
     }
@@ -456,4 +502,77 @@ public class AssembleAggregate {
         }
         return retList;
     }
+
+    /**
+     * 标准名称转换,指定字段
+     *
+     * @param list
+     * @param configMap
+     * @param type
+     * @param <T>
+     * @return
+     */
+    public <T> List<T> addUniqueName(List<T> list, Map<String, Map<String, Map<String, List<String>>>> configMap, Integer type,
+                                     String fieldName, String uniqueFieldName) {
+        List<T> retList = new ArrayList<>();
+        if (ListUtil.isEmpty(list)) {
+            return list;
+        }
+
+        if (configMap == null) {
+            configMap = new HashMap<>();
+        }
+
+        try {
+            for (T item : list) {
+                String name = ReflectUtil.getProperty(item, fieldName);
+                if (StringUtil.isBlank(name)) {
+                    retList.add(item);
+                    continue;
+                }
+
+                String uniqueName = ReflectUtil.getProperty(item, uniqueFieldName);
+                if (StringUtil.isNotBlank(uniqueName)) {
+                    retList.add(item);
+                    continue;
+                }
+
+                String hisDetailName = "";
+
+                if (configMap.containsKey(name)) {
+                    Map<String, Map<String, List<String>>> subMap = configMap.get(name);
+                    if (subMap.containsKey(hisDetailName)) {
+                        List<String> standNames = new ArrayList<>(subMap.get(hisDetailName).keySet());
+                        //映射关系没找到,uniqueName赋值成name
+                        if (ListUtil.isEmpty(standNames)) {
+                            T o = (T) item.getClass().newInstance();
+                            BeanUtil.copyProperties(item, o);
+                            Method setUniqueName = o.getClass().getMethod("set" + uniqueFieldName.substring(0, 1).toUpperCase() + uniqueFieldName.substring(1), String.class);
+                            setUniqueName.invoke(o, name);
+                            retList.add(o);
+                        } else {
+                            for (String stdName : standNames) {
+                                T o = (T) item.getClass().newInstance();
+                                BeanUtil.copyProperties(item, o);
+                                Method setUniqueName = o.getClass().getMethod("set" + uniqueFieldName.substring(0, 1).toUpperCase() + uniqueFieldName.substring(1), String.class);
+                                setUniqueName.invoke(o, stdName);
+                                retList.add(o);
+                            }
+                        }
+                    } else {
+                        retList.add(item);
+                    }
+                } else {
+                    T o = (T) item.getClass().newInstance();
+                    BeanUtil.copyProperties(item, o);
+                    Method setUniqueName = o.getClass().getMethod("set" + uniqueFieldName.substring(0, 1).toUpperCase() + uniqueFieldName.substring(1), String.class);
+                    setUniqueName.invoke(o, name);
+                    retList.add(o);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return retList;
+    }
 }

+ 19 - 0
src/main/java/com/diagbot/annotation/CdssLog.java

@@ -0,0 +1,19 @@
+package com.diagbot.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @Description: 需要二次Token验证注解
+ * @author: gaodm
+ * @time: 2020/7/29 9:23
+ */
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface CdssLog {
+    String value() default "";
+}

+ 81 - 0
src/main/java/com/diagbot/aop/CdssLogAspect.java

@@ -0,0 +1,81 @@
+package com.diagbot.aop;
+
+import com.diagbot.annotation.CdssLog;
+import com.diagbot.entity.TranLog;
+import com.diagbot.rabbit.MySender;
+import com.diagbot.util.CdssLogUtil;
+import com.diagbot.util.DateUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.AfterThrowing;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
+import java.util.Date;
+
+/**
+ * @Description: 日志记录切面
+ * @author: gaodm
+ * @time: 2021/10/20 9:58
+ */
+@Aspect
+@Component
+@ConditionalOnProperty(prefix = "cdssLog", value = { "enable" }, havingValue = "true")
+@Slf4j
+public class CdssLogAspect {
+
+    @Autowired
+    MySender mySender;
+
+    //切所有Controller
+    @Pointcut("execution(* com.diagbot.web..*.*(..)) && @annotation(com.diagbot.annotation.CdssLog)")
+    public void pointcutController() {
+    }
+
+    @Around("pointcutController()")
+    public Object cdssLogIntercept(ProceedingJoinPoint joinPoint) throws Throwable {
+        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+        Method method = signature.getMethod();
+        //获取方法参数
+        Object[] args = joinPoint.getArgs();
+        //请求的参数
+        TranLog tanLog = CdssLogUtil.tranLogReqAspect(joinPoint);
+        Date now = DateUtil.now();
+        tanLog.setGmtCreate(now);
+        tanLog.setGmtModified(now);
+        tanLog.setSceneName(method.getAnnotation(CdssLog.class).value());
+        long start = System.currentTimeMillis();
+        tanLog.setGmtReq(DateUtil.now());
+        Object proceed = joinPoint.proceed(args);
+        //执行方法后获取出参
+        tanLog = CdssLogUtil.tranLogRespAspect(proceed, tanLog, start, joinPoint);
+
+        //异步记录日志
+        mySender.outputCdssLogSend(tanLog);
+        return proceed;
+    }
+
+    @AfterThrowing(pointcut = "pointcutController()", throwing = "ex")
+    public void cdssLogInterceptThrow(JoinPoint joinPoint, Throwable ex) {
+        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+        Method method = signature.getMethod();
+        TranLog tanLog = new TranLog();
+        Date now = DateUtil.now();
+        tanLog.setGmtCreate(now);
+        tanLog.setGmtModified(now);
+        tanLog.setSceneName(method.getAnnotation(CdssLog.class).value());
+        long start = System.currentTimeMillis();
+        tanLog.setGmtReq(DateUtil.now());
+        tanLog = CdssLogUtil.tranLogRespAspectThrow(joinPoint, tanLog, start, ex);
+
+        //保存日志
+        mySender.outputCdssLogSend(tanLog);
+    }
+}

+ 6 - 0
src/main/java/com/diagbot/config/MybatisPlusConfigurer.java

@@ -1,6 +1,7 @@
 package com.diagbot.config;
 
 import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import com.diagbot.config.mybatisLike.MybatisLikeSqlInterceptor;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -30,4 +31,9 @@ public class MybatisPlusConfigurer {
         return paginationInterceptor;
     }
 
+    @Bean
+    public MybatisLikeSqlInterceptor mybatisSqlInterceptor() {
+        return new MybatisLikeSqlInterceptor();
+    }
+
 }

+ 4 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -61,6 +61,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/tran/mappingConfig/deleteRecord").permitAll()
                 .antMatchers("/tran/mappingConfig/deleteRecords").permitAll()
                 //.antMatchers("/tran/hospitalInfo/saveRecord").permitAll()
+                .antMatchers("/tran/log/pageList").permitAll()
+                .antMatchers("/tran/log/getRecordById").permitAll()
                 .antMatchers("/tran/hospitalInfo/getHospitalInfo").permitAll()
                 .antMatchers("/tran/hospitalInfo/getAllHospitalInfo").permitAll()
                 .antMatchers("/tran/hospitalInfo/getAllEnableHospitalInfo").permitAll()
@@ -97,6 +99,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/kl/conceptInfo/staticKnowledgeIndexWithoutInfo").permitAll()
                 .antMatchers("/kl/conceptInfo/getStaticKnowledge").permitAll()
                 .antMatchers("/kl/conceptInfo/getStaticKnowledgeForHIS").permitAll()
+                .antMatchers("/kl/conceptInfo/isExistForHIS").permitAll()
                 .antMatchers("/kl/conceptInfo/getPage").permitAll()
                 .antMatchers("/kl/conceptInfo/staticIndexPage").permitAll()
                 //.antMatchers("/kl/conceptInfo/saveOrUpdateRecord").permitAll()
@@ -133,6 +136,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/cache/clearRuleAll").permitAll()
                 .antMatchers("/term/termMatching").permitAll()
                 .antMatchers("/sys/mr/testIndication").permitAll()
+                .antMatchers("/test/logTest").permitAll()
                 .antMatchers("/dataPage/docking/getDataService").permitAll()
                 .antMatchers("/dataPage/docking/getStaticKnowledge").permitAll()
                 .antMatchers("/dataPage/docking/getDataEngine").permitAll()

+ 223 - 0
src/main/java/com/diagbot/config/mybatisLike/AbstractLikeSqlConverter.java

@@ -0,0 +1,223 @@
+package com.diagbot.config.mybatisLike;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+import java.beans.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+
+/**
+ * @Description: 包含like的SQL语句转义模板
+ * @author: gaodm
+ * @time: 2020/11/2 16:05
+ */
+@Slf4j
+public abstract class AbstractLikeSqlConverter<T> {
+
+    /**
+     * SQL语句like使用关键字%
+     */
+    private final static String LIKE_SQL_KEY = "%";
+
+    /**
+     * SQL语句需要转义的关键字
+     */
+    private final static String[] ESCAPE_CHAR = new String[] { LIKE_SQL_KEY, "_", "\\" };
+
+    /**
+     * mybatis-plus中like的SQL语句样式
+     */
+    private final static String MYBATIS_PLUS_LIKE_SQL = " like ?";
+
+    /**
+     * mybatis-plus中参数前缀
+     */
+    private final static String MYBATIS_PLUS_WRAPPER_PREFIX = "ew.paramNameValuePairs.";
+
+    /**
+     * mybatis-plus中参数键
+     */
+    final static String MYBATIS_PLUS_WRAPPER_KEY = "ew";
+
+    /**
+     * mybatis-plus中参数分隔符
+     */
+    final static String MYBATIS_PLUS_WRAPPER_SEPARATOR = ".";
+
+    /**
+     * mybatis-plus中参数分隔符替换器
+     */
+    final static String MYBATIS_PLUS_WRAPPER_SEPARATOR_REGEX = "\\.";
+
+    /**
+     * 已经替换过的标记
+     */
+    final static String REPLACED_LIKE_KEYWORD_MARK = "replaced.keyword";
+
+    /**
+     * 转义特殊字符
+     *
+     * @param sql       SQL语句
+     * @param fields    字段列表
+     * @param parameter 参数对象
+     */
+    public void convert(String sql, Set<String> fields, T parameter) {
+        for (String field : fields) {
+            if (this.hasMybatisPlusLikeSql(sql)) {
+                if (this.hasWrapper(field)) {
+                    // 第一种情况:在业务层进行条件构造产生的模糊查询关键字,使用QueryWrapper,LambdaQueryWrapper
+                    this.transferWrapper(field, parameter);
+                } else {
+                    // 第二种情况:未使用条件构造器,但是在service层进行了查询关键字与模糊查询符`%`手动拼接
+                    this.transferSelf(field, parameter);
+                }
+            } else {
+                // 第三种情况:在Mapper类的注解SQL中进行了模糊查询的拼接
+                this.transferSplice(field, parameter);
+            }
+        }
+    }
+
+    /**
+     * 转义条件构造的特殊字符
+     * 在业务层进行条件构造产生的模糊查询关键字,使用QueryWrapper,LambdaQueryWrapper
+     *
+     * @param field     字段名称
+     * @param parameter 参数对象
+     */
+    public abstract void transferWrapper(String field, T parameter);
+
+    /**
+     * 转义自定义条件拼接的特殊字符
+     * 未使用条件构造器,但是在service层进行了查询关键字与模糊查询符`%`手动拼接
+     *
+     * @param field     字段名称
+     * @param parameter 参数对象
+     */
+    public abstract void transferSelf(String field, T parameter);
+
+    /**
+     * 转义自定义条件拼接的特殊字符
+     * 在Mapper类的注解SQL中进行了模糊查询的拼接
+     *
+     * @param field     字段名称
+     * @param parameter 参数对象
+     */
+    public abstract void transferSplice(String field, T parameter);
+
+    /**
+     * 转义通配符
+     *
+     * @param before 待转义字符串
+     * @return 转义后字符串
+     */
+    String escapeChar(String before) {
+        if (StringUtils.isNotBlank(before)) {
+            before = before.replaceAll("\\\\", "\\\\\\\\");
+            before = before.replaceAll("_", "\\\\_");
+            before = before.replaceAll("%", "\\\\%");
+        }
+        return before;
+    }
+
+    /**
+     * 是否包含需要转义的字符
+     *
+     * @param obj 待判断的对象
+     * @return true/false
+     */
+    boolean hasEscapeChar(Object obj) {
+        if (!(obj instanceof String)) {
+            return false;
+        }
+        return this.hasEscapeChar((String) obj);
+    }
+
+    /**
+     * 处理对象like问题
+     *
+     * @param field     对象字段
+     * @param parameter 对象
+     */
+    void resolveObj(String field, Object parameter) {
+        if (parameter == null || StringUtils.isBlank(field)) {
+            return;
+        }
+        try {
+            PropertyDescriptor descriptor = new PropertyDescriptor(field, parameter.getClass());
+            Method readMethod = descriptor.getReadMethod();
+            Object param = readMethod.invoke(parameter);
+            if (this.hasEscapeChar(param)) {
+                Method setMethod = descriptor.getWriteMethod();
+                setMethod.invoke(parameter, this.escapeChar(param.toString()));
+            } else if (this.cascade(field)) {
+                int index = field.indexOf(MYBATIS_PLUS_WRAPPER_SEPARATOR) + 1;
+                this.resolveObj(field.substring(index), param);
+            }
+        } catch (IntrospectionException | IllegalAccessException | InvocationTargetException e) {
+            log.error("反射 {} 的 {} get/set方法出现异常", parameter, field, e);
+        }
+    }
+
+    /**
+     * 判断是否是级联属性
+     *
+     * @param field 字段名
+     * @return true/false
+     */
+    boolean cascade(String field) {
+        if (StringUtils.isBlank(field)) {
+            return false;
+        }
+        return field.contains(MYBATIS_PLUS_WRAPPER_SEPARATOR) && !this.hasWrapper(field);
+    }
+
+    /**
+     * 是否包含mybatis-plus的包含like的SQL语句格式
+     *
+     * @param sql 完整SQL语句
+     * @return true/false
+     */
+    private boolean hasMybatisPlusLikeSql(String sql) {
+        if (StringUtils.isBlank(sql)) {
+            return false;
+        }
+        return sql.toLowerCase().contains(MYBATIS_PLUS_LIKE_SQL);
+    }
+
+    /**
+     * 判断是否使用mybatis-plus条件构造器
+     *
+     * @param field 字段
+     * @return true/false
+     */
+    private boolean hasWrapper(String field) {
+        if (StringUtils.isBlank(field)) {
+            return false;
+        }
+        return field.contains(MYBATIS_PLUS_WRAPPER_PREFIX);
+    }
+
+    /**
+     * 判断字符串是否含有需要转义的字符
+     *
+     * @param str 待判断的字符串
+     * @return true/false
+     */
+    private boolean hasEscapeChar(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        for (String s : ESCAPE_CHAR) {
+            if (str.contains(s)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

+ 79 - 0
src/main/java/com/diagbot/config/mybatisLike/MapLikeSqlConverter.java

@@ -0,0 +1,79 @@
+package com.diagbot.config.mybatisLike;
+
+import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
+
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * @Description: 参数对象为Map的转换器
+ * @author: gaodm
+ * @time: 2020/11/2 16:07
+ */
+public class MapLikeSqlConverter extends AbstractLikeSqlConverter<Map> {
+
+    @Override
+    public void transferWrapper(String field, Map parameter) {
+        AbstractWrapper wrapper = (AbstractWrapper) parameter.get(MYBATIS_PLUS_WRAPPER_KEY);
+        parameter = wrapper.getParamNameValuePairs();
+        String[] keys = field.split(MYBATIS_PLUS_WRAPPER_SEPARATOR_REGEX);
+        // ew.paramNameValuePairs.param1,截取字符串之后,获取第三个,即为参数名
+        String paramName = keys[2];
+        String mapKey = String.format("%s.%s", REPLACED_LIKE_KEYWORD_MARK, paramName);
+        if (parameter.containsKey(mapKey) && Objects.equals(parameter.get(mapKey), true)) {
+            return;
+        }
+        if (this.cascade(field)) {
+            this.resolveCascadeObj(field, parameter);
+        } else {
+            Object param = parameter.get(paramName);
+            if (this.hasEscapeChar(param)) {
+                String paramStr = param.toString();
+                parameter.put(keys[2], String.format("%%%s%%", this.escapeChar(paramStr.substring(1, paramStr.length() - 1))));
+            }
+        }
+        parameter.put(mapKey, true);
+    }
+
+    @Override
+    public void transferSelf(String field, Map parameter) {
+        if (this.cascade(field)) {
+            this.resolveCascadeObj(field, parameter);
+            return;
+        }
+        Object param = parameter.get(field);
+        if (this.hasEscapeChar(param)) {
+            String paramStr = param.toString();
+            parameter.put(field, String.format("%%%s%%", this.escapeChar(paramStr.substring(1, paramStr.length() - 1))));
+        }
+    }
+
+    @Override
+    public void transferSplice(String field, Map parameter) {
+        if (this.cascade(field)) {
+            this.resolveCascadeObj(field, parameter);
+            return;
+        }
+        Object param = parameter.get(field);
+        if (this.hasEscapeChar(param)) {
+            parameter.put(field, this.escapeChar(param.toString()));
+        }
+    }
+
+    /**
+     * 处理级联属性
+     *
+     * @param field     级联字段名
+     * @param parameter 参数Map对象
+     */
+    private void resolveCascadeObj(String field, Map parameter) {
+        int index = field.indexOf(MYBATIS_PLUS_WRAPPER_SEPARATOR);
+        Object param = parameter.get(field.substring(0, index));
+        if (param == null) {
+            return;
+        }
+        this.resolveObj(field.substring(index + 1), param);
+    }
+
+}
+

+ 160 - 0
src/main/java/com/diagbot/config/mybatisLike/MybatisLikeSqlInterceptor.java

@@ -0,0 +1,160 @@
+package com.diagbot.config.mybatisLike;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.executor.Executor;
+import org.apache.ibatis.mapping.BoundSql;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.plugin.Interceptor;
+import org.apache.ibatis.plugin.Intercepts;
+import org.apache.ibatis.plugin.Invocation;
+import org.apache.ibatis.plugin.Plugin;
+import org.apache.ibatis.plugin.Signature;
+import org.apache.ibatis.session.ResultHandler;
+import org.apache.ibatis.session.RowBounds;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * @Description: mybatis/mybatis-plus模糊查询语句特殊字符转义拦截器
+ * @author: gaodm
+ * @time: 2020/11/2 16:04
+ */
+@Intercepts({ @Signature(type = Executor.class, method = "query", args = { MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class }) })
+@Slf4j
+public class MybatisLikeSqlInterceptor implements Interceptor {
+
+    /**
+     * SQL语句like
+     */
+    private final static String SQL_LIKE = " like ";
+
+    /**
+     * SQL语句占位符
+     */
+    private final static String SQL_PLACEHOLDER = "?";
+
+    /**
+     * SQL语句占位符分隔
+     */
+    private final static String SQL_PLACEHOLDER_REGEX = "\\?";
+
+    /**
+     * 所有的转义器
+     */
+    private static Map<Class, AbstractLikeSqlConverter> converterMap = new HashMap<>(4);
+
+    static {
+        converterMap.put(Map.class, new MapLikeSqlConverter());
+        converterMap.put(Object.class, new ObjectLikeSqlConverter());
+    }
+
+    @Override
+    public Object intercept(Invocation invocation) throws Throwable {
+        Object[] args = invocation.getArgs();
+        MappedStatement statement = (MappedStatement) args[0];
+        Object parameterObject = args[1];
+        BoundSql boundSql = statement.getBoundSql(parameterObject);
+        String sql = boundSql.getSql();
+        this.transferLikeSql(sql, parameterObject, boundSql);
+        return invocation.proceed();
+    }
+
+    @Override
+    public Object plugin(Object target) {
+        return Plugin.wrap(target, this);
+    }
+
+    @Override
+    public void setProperties(Properties arg0) {
+
+    }
+
+    /**
+     * 修改包含like的SQL语句
+     *
+     * @param sql             SQL语句
+     * @param parameterObject 参数对象
+     * @param boundSql        绑定SQL对象
+     */
+    private void transferLikeSql(String sql, Object parameterObject, BoundSql boundSql) {
+        if (!isEscape(sql)) {
+            return;
+        }
+        sql = sql.replaceAll(" {2}", " ");
+        // 获取关键字的个数(去重)
+        Set<String> fields = this.getKeyFields(sql, boundSql);
+        if (fields == null) {
+            return;
+        }
+        // 此处可以增强,不止是支持Map对象,Map对象仅用于传入的条件为Map或者使用@Param传入的对象被Mybatis转为的Map
+        AbstractLikeSqlConverter converter;
+        // 对关键字进行特殊字符“清洗”,如果有特殊字符的,在特殊字符前添加转义字符(\)
+        if (parameterObject instanceof Map) {
+            converter = converterMap.get(Map.class);
+        } else {
+            converter = converterMap.get(Object.class);
+        }
+        converter.convert(sql, fields, parameterObject);
+    }
+
+    /**
+     * 是否需要转义
+     *
+     * @param sql SQL语句
+     * @return true/false
+     */
+    private boolean isEscape(String sql) {
+        return this.hasLike(sql) && this.hasPlaceholder(sql);
+    }
+
+    /**
+     * 判断SQL语句中是否含有like关键字
+     *
+     * @param str SQL语句
+     * @return true/false
+     */
+    private boolean hasLike(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        return str.toLowerCase().contains(SQL_LIKE);
+    }
+
+    /**
+     * 判断SQL语句中是否包含SQL占位符
+     *
+     * @param str SQL语句
+     * @return true/false
+     */
+    private boolean hasPlaceholder(String str) {
+        if (StringUtils.isBlank(str)) {
+            return false;
+        }
+        return str.toLowerCase().contains(SQL_PLACEHOLDER);
+    }
+
+    /**
+     * 获取需要替换的所有字段集合
+     *
+     * @param sql      完整SQL语句
+     * @param boundSql 绑定的SQL对象
+     * @return 字段集合列表
+     */
+    private Set<String> getKeyFields(String sql, BoundSql boundSql) {
+        String[] params = sql.split(SQL_PLACEHOLDER_REGEX);
+        Set<String> fields = new HashSet<>();
+        for (int i = 0; i < params.length; i++) {
+            if (this.hasLike(params[i])) {
+                String field = boundSql.getParameterMappings().get(i).getProperty();
+                fields.add(field);
+            }
+        }
+        return fields;
+    }
+
+}

+ 28 - 0
src/main/java/com/diagbot/config/mybatisLike/ObjectLikeSqlConverter.java

@@ -0,0 +1,28 @@
+package com.diagbot.config.mybatisLike;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @Description: 通用参数的转换器
+ * @author: gaodm
+ * @time: 2020/11/2 16:06
+ */
+@Slf4j
+public class ObjectLikeSqlConverter extends AbstractLikeSqlConverter<Object> {
+
+    @Override
+    public void transferWrapper(String field, Object parameter) {
+        // 尚未发现这种情况
+    }
+
+    @Override
+    public void transferSelf(String field, Object parameter) {
+        // 尚未发现这种情况
+    }
+
+    @Override
+    public void transferSplice(String field, Object parameter) {
+        this.resolveObj(field, parameter);
+    }
+
+}

+ 4 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -103,6 +103,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/tran/mappingConfig/saveOrUpdateRecord", request)
                 || matchers("/tran/mappingConfig/deleteRecord", request)
                 || matchers("/tran/mappingConfig/deleteRecords", request)
+                || matchers("/tran/log/pageList", request)
+                || matchers("/tran/log/getRecordById", request)
                 //|| matchers("/tran/hospitalInfo/saveRecord", request)
                 || matchers("/tran/hospitalInfo/getHospitalInfo", request)
                 || matchers("/tran/hospitalInfo/getAllHospitalInfo", request)
@@ -139,6 +141,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/kl/conceptInfo/staticKnowledgeIndexWithoutInfo", request)
                 || matchers("/kl/conceptInfo/getStaticKnowledge", request)
                 || matchers("/kl/conceptInfo/getStaticKnowledgeForHIS", request)
+                || matchers("/kl/conceptInfo/isExistForHIS", request)
                 || matchers("/kl/conceptInfo/getPage", request)
                 || matchers("/kl/conceptInfo/staticIndexPage", request)
                 //|| matchers("/kl/conceptInfo/saveOrUpdateRecord", request)
@@ -175,6 +178,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/cache/clearRuleAll", request)
                 || matchers("/term/termMatching", request)
                 || matchers("/sys/mr/testIndication", request)
+                || matchers("/test/logTest", request)
                 || matchers("/dataPage/docking/getDataService", request)
                 || matchers("/dataPage/docking/getStaticKnowledge", request)
                 || matchers("/dataPage/docking/getDataEngine", request)

+ 45 - 0
src/main/java/com/diagbot/entity/AdministrationRouteConfig.java

@@ -0,0 +1,45 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/10/26 13:39
+ */
+@Data
+public class AdministrationRouteConfig {
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院科室名称
+     */
+    @Excel(name = "医院给药途径名称", width = 40, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院给药途径名称")
+    private String hisName;
+
+    /**
+     * 标准科室名称
+     */
+    @Excel(name = "标准给药途径名称", width = 40, orderNum = "2", isImportField = "true")
+    @NotBlank(message = "请输入标准给药途径名称")
+    private String uniqueName;
+
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
+    private Integer isMatch;
+
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    private Integer source;
+}

+ 4 - 4
src/main/java/com/diagbot/entity/AnesthesiaConfig.java

@@ -1,6 +1,7 @@
 package com.diagbot.entity;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -11,8 +12,7 @@ import javax.validation.constraints.NotBlank;
  * @Author:zhaops
  * @time: 2021/6/10 19:16
  */
-@Getter
-@Setter
+@Data
 public class AnesthesiaConfig {
     /**
      * 医院id
@@ -36,12 +36,12 @@ public class AnesthesiaConfig {
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**
      * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
      */
-    @Excel(name = "数据来源", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
     private Integer source;
 }

+ 269 - 0
src/main/java/com/diagbot/entity/TranLog.java

@@ -0,0 +1,269 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 系统日志表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-22
+ */
+public class TranLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 日志ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 病人唯一标识(病人id、病历号等)
+     */
+    private String patientId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 子医院编码
+     */
+    private String subHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    private String subHospitalName;
+
+    /**
+     * 场景名称
+     */
+    private String sceneName;
+
+    /**
+     * 输入参数
+     */
+    private String params;
+
+    /**
+     * 返回参数
+     */
+    private String result;
+
+    /**
+     * 请求时间
+     */
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
+    private Date gmtReq;
+
+    /**
+     * 响应时间
+     */
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
+    private Date gmtResp;
+
+    /**
+     * 耗时
+     */
+    private String execTime;
+
+    /**
+     * 调用是否成功(0:失败;1:成功)
+     */
+    private Integer successFlag;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public String getPatientId() {
+        return patientId;
+    }
+
+    public void setPatientId(String patientId) {
+        this.patientId = patientId;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hosptialId) {
+        this.hospitalId = hosptialId;
+    }
+
+    public String getSubHospitalCode() {
+        return subHospitalCode;
+    }
+
+    public void setSubHospitalCode(String subHospitalCode) {
+        this.subHospitalCode = subHospitalCode;
+    }
+
+    public String getSubHospitalName() {
+        return subHospitalName;
+    }
+
+    public void setSubHospitalName(String subHospitalName) {
+        this.subHospitalName = subHospitalName;
+    }
+
+    public String getSceneName() {
+        return sceneName;
+    }
+
+    public void setSceneName(String sceneName) {
+        this.sceneName = sceneName;
+    }
+
+    public String getParams() {
+        return params;
+    }
+
+    public void setParams(String params) {
+        this.params = params;
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+    public Date getGmtReq() {
+        return gmtReq;
+    }
+
+    public void setGmtReq(Date gmtReq) {
+        this.gmtReq = gmtReq;
+    }
+
+    public Date getGmtResp() {
+        return gmtResp;
+    }
+
+    public void setGmtResp(Date gmtResp) {
+        this.gmtResp = gmtResp;
+    }
+
+    public String getExecTime() {
+        return execTime;
+    }
+
+    public void setExecTime(String execTime) {
+        this.execTime = execTime;
+    }
+
+    public Integer getSuccessFlag() {
+        return successFlag;
+    }
+
+    public void setSuccessFlag(Integer successFlag) {
+        this.successFlag = successFlag;
+    }
+
+    @Override
+    public String toString() {
+        return "TranLog{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", patientId=" + patientId +
+                ", hospitalId=" + hospitalId +
+                ", subHospitalCode=" + subHospitalCode +
+                ", subHospitalName=" + subHospitalName +
+                ", sceneName=" + sceneName +
+                ", params=" + params +
+                ", result=" + result +
+                ", gmtReq=" + gmtReq +
+                ", gmtResp=" + gmtResp +
+                ", execTime=" + execTime +
+                ", successFlag=" + successFlag +
+                "}";
+    }
+}

+ 23 - 0
src/main/java/com/diagbot/entity/wrapper/AdministrationRouteConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.AdministrationRouteConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/10/26 13:41
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class AdministrationRouteConfigWrapper extends AdministrationRouteConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 2 - 1
src/main/java/com/diagbot/enums/ConceptTypeEnum.java

@@ -25,7 +25,8 @@ public enum ConceptTypeEnum implements KeyedNamed {
     Tcmdisease(12,"中医疾病"),
     Tcmsyndrome(13,"中医证候"),
     Anesthesia(14, "麻醉"),
-    Form(15, "药品剂型");
+    Form(15, "药品剂型"),
+    AdministrationRoute(16,"给药途径");
 
     @Setter
     private int key;

+ 15 - 0
src/main/java/com/diagbot/facade/KlConceptStaticFacade.java

@@ -147,6 +147,21 @@ public class KlConceptStaticFacade {
         return retList;
     }
 
+    /**
+     * 医院对接静态知识判断是否有静态知识
+     *
+     * @param staticKnowledgeHISVO
+     * @return
+     */
+    public Boolean isExistForHIS(StaticKnowledgeHISVO staticKnowledgeHISVO) {
+        List<StaticKnowledgeHISDTO> staticList = getStaticKnowledgeForHIS(staticKnowledgeHISVO);
+        if (ListUtil.isEmpty(staticList)) {
+            return false;
+        } else {
+            return true;
+        }
+    }
+
     /**
      * 分页查询
      *

+ 58 - 0
src/main/java/com/diagbot/facade/LogTestFacade.java

@@ -0,0 +1,58 @@
+package com.diagbot.facade;
+
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.util.CdssLogUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.LogTestVO;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/10/20 10:57
+ */
+@Component
+public class LogTestFacade {
+    public Boolean logTest(LogTestVO logTestVO) {
+        CdssLogUtil.addBizHospitalId(logTestVO.getHospitalId());
+        if (StringUtil.isNotBlank(logTestVO.getPatientId())) {
+            CdssLogUtil.addBizPatientId(logTestVO.getPatientId());
+        }
+        if (StringUtil.isNotBlank(logTestVO.getSubHospitalName())) {
+            CdssLogUtil.addBizSubHospitalName(logTestVO.getSubHospitalName());
+        }
+        if (StringUtil.isNotBlank(logTestVO.getSubHospitalCode())) {
+            CdssLogUtil.addBizSubHospitalCode(logTestVO.getSubHospitalCode());
+        }
+        if (logTestVO.getType().equals(1)) {
+            //抛错
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        } else if (logTestVO.getType().equals(2)) {
+            paramLog(logTestVO);
+        } else {
+            /** DO NOTHING*/
+        }
+        return true;
+    }
+
+    /**
+     * 日志里面加入参数
+     *
+     * @param logTestVO
+     * @return
+     */
+    private LogTestVO paramLog(LogTestVO logTestVO) {
+        LogTestVO logTestVOResp = new LogTestVO();
+        logTestVOResp.setMsg("返回参数");
+        logTestVOResp.setType(4);
+        //示例入参设置
+        CdssLogUtil.addBizReq(logTestVO);
+        CdssLogUtil.addBizReq(logTestVO);
+        //出参设置
+        CdssLogUtil.addBizResp(logTestVOResp);
+        CdssLogUtil.addBizResp(logTestVOResp);
+        CdssLogUtil.addBizResp(logTestVOResp);
+        return logTestVOResp;
+    }
+}

+ 27 - 3
src/main/java/com/diagbot/facade/MappingConfigFacade.java

@@ -10,6 +10,7 @@ import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.KllisDetailDTO;
 import com.diagbot.dto.LisDetailDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.AdministrationRouteConfig;
 import com.diagbot.entity.AnesthesiaConfig;
 import com.diagbot.entity.DeptConfig;
 import com.diagbot.entity.DiseaseConfig;
@@ -23,6 +24,7 @@ import com.diagbot.entity.ScaleConfig;
 import com.diagbot.entity.TcmdiseaseConfig;
 import com.diagbot.entity.TcmsyndromeConfig;
 import com.diagbot.entity.TransfusionConfig;
+import com.diagbot.entity.wrapper.AdministrationRouteConfigWrapper;
 import com.diagbot.entity.wrapper.AnesthesiaConfigWrapper;
 import com.diagbot.entity.wrapper.DeptConfigWrapper;
 import com.diagbot.entity.wrapper.DiseaseConfigWrapper;
@@ -379,6 +381,16 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
                     ExcelUtils.exportExcel(anesthesiaConfigList, null, "sheet1", AnesthesiaConfigWrapper.class, fileName, response, 12.8f);
                 }
                 break;
+            case 16:
+                fileName = "给药途径" + fileName;
+                if (mode.equals(1)) {
+                    List<AdministrationRouteConfig> administrationRouteConfigList = BeanUtil.listCopyTo(list, AdministrationRouteConfig.class);
+                    ExcelUtils.exportExcel(administrationRouteConfigList, null, "sheet1", AdministrationRouteConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<AdministrationRouteConfigWrapper> administrationRouteConfigList = BeanUtil.listCopyTo(list, AdministrationRouteConfigWrapper.class);
+                    ExcelUtils.exportExcel(administrationRouteConfigList, null, "sheet1", AdministrationRouteConfigWrapper.class, fileName, response, 12.8f);
+                }
+                break;
             default:
                 break;
         }
@@ -514,6 +526,10 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
                     List<AnesthesiaConfig> anesthesiaConfigList = ExcelUtils.importExcel(file, 0, 1, AnesthesiaConfig.class);
                     originList = BeanUtil.listCopyTo(anesthesiaConfigList, MappingConfigWrapper.class);
                     break;
+                case 16:
+                    List<AdministrationRouteConfig> administrationRouteConfigList = ExcelUtils.importExcel(file, 0, 1, AdministrationRouteConfig.class);
+                    originList = BeanUtil.listCopyTo(administrationRouteConfigList, MappingConfigWrapper.class);
+                    break;
                 default:
                     break;
             }
@@ -1024,7 +1040,15 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
             return list;
         }
         IndexByApprovalVO indexByApprovalVO = new IndexByApprovalVO();
-        indexByApprovalVO.setApprovalList(list.stream().map(MappingConfigWrapper::getApproval).collect(Collectors.toList()));
+        indexByApprovalVO.setApprovalList(list.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getApproval()))
+                .map(MappingConfigWrapper::getApproval)
+                .distinct()
+                .collect(Collectors.toList()));
+
+        if(ListUtil.isEmpty(indexByApprovalVO.getApprovalList())){
+            return list;
+        }
 
         RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.indexByApproval(indexByApprovalVO);
         RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
@@ -1958,7 +1982,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
      */
     public Boolean isExistRecord(MappingConfig mappingConfig) {
         if (mappingConfig.getType() == null) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉");
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径");
         }
         if (mappingConfig.getHospitalId() == null) {
             mappingConfig.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
@@ -2014,7 +2038,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
      */
     public Boolean saveOrUpdateRecord(MappingConfig mappingConfig) {
         if (mappingConfig.getType() == null) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉");
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径");
         }
         if (mappingConfig.getConceptId() == null) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "标准术语不允许为空,请输入标准术语id");

+ 3 - 1
src/main/java/com/diagbot/facade/RetrievalFacade.java

@@ -47,7 +47,8 @@ public class RetrievalFacade {
             retrievalDTO = respDTO.data;
         } else {
             //实际医院查询医院词
-            if (StringUtil.isBlank(retrievalVO.getInputStr())) {
+            if (retrievalVO.getDefaultList().equals(0)
+                    && StringUtil.isBlank(retrievalVO.getInputStr())) {
                 throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入检索内容!");
             }
             HospitalCheckVO hospitalCheckVO = new HospitalCheckVO();
@@ -71,6 +72,7 @@ public class RetrievalFacade {
                     case 12:
                     case 13:
                     case 14:
+                    case 16:
                         List<RetrievalConceptDTO> hisNameList = new ArrayList<>();
                         List<String> hisNames = mappingConfigFacade.getHisNames(retrievalVO);
                         for (String str : hisNames) {

+ 56 - 0
src/main/java/com/diagbot/facade/TranLogFacade.java

@@ -0,0 +1,56 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.TranLog;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.TranLogServiceImpl;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.TranLogPageVO;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/10/20 10:24
+ */
+@Component
+public class TranLogFacade extends TranLogServiceImpl {
+    public IPage<TranLog> pageList(TranLogPageVO tranLogPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        tranLogPageVO.setHospitalId(Long.valueOf(hospitalId));
+        if (tranLogPageVO.getStartGmtReq() != null && tranLogPageVO.getEndGmtReq() == null) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入完整时间区间");
+        }
+        if (tranLogPageVO.getStartGmtReq() == null && tranLogPageVO.getEndGmtReq() != null) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入完整时间区间");
+        }
+        if (tranLogPageVO.getStartGmtResp() != null && tranLogPageVO.getEndGmtResp() == null) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入完整时间区间");
+        }
+        if (tranLogPageVO.getStartGmtResp() == null && tranLogPageVO.getEndGmtResp() != null) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入完整时间区间");
+        }
+
+        if (tranLogPageVO.getEndGmtReq() != null) {
+            DateUtils.addMinutes(tranLogPageVO.getEndGmtReq(), 1);
+        }
+        if (tranLogPageVO.getEndGmtResp() != null) {
+            DateUtils.addMinutes(tranLogPageVO.getEndGmtResp(), 1);
+        }
+
+        IPage<TranLog> page = super.getPage(tranLogPageVO);
+        return page;
+    }
+
+    /**
+     * 获取单条记录
+     * @param idVO
+     * @return
+     */
+    public TranLog getRecordById(IdVO idVO) {
+        return this.getById(idVO.getId());
+    }
+}

+ 19 - 0
src/main/java/com/diagbot/mapper/TranLogMapper.java

@@ -0,0 +1,19 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.TranLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.TranLogPageVO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * 系统日志表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-20
+ */
+public interface TranLogMapper extends BaseMapper<TranLog> {
+    IPage<TranLog> getPage(@Param("tranLogPageVO") TranLogPageVO tranLogPageVO);
+}

+ 23 - 0
src/main/java/com/diagbot/rabbit/MyProcessor.java

@@ -0,0 +1,23 @@
+package com.diagbot.rabbit;
+
+import org.springframework.cloud.stream.annotation.Input;
+import org.springframework.cloud.stream.annotation.Output;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.messaging.SubscribableChannel;
+
+/**
+ * @Description: 自定义Stream发布和消费对象
+ * @author: gaodm
+ * @time: 2018/8/29 13:39
+ */
+public interface MyProcessor {
+
+    String INPUT_CdssLog = "inputCdssLog";
+    String OUTPUT_CdssLog= "outputCdssLog";
+
+    @Input(INPUT_CdssLog)
+    SubscribableChannel inputCdssLog();
+    @Output(OUTPUT_CdssLog)
+    MessageChannel outputCdssLog();
+
+}

+ 28 - 0
src/main/java/com/diagbot/rabbit/MyReceiver.java

@@ -0,0 +1,28 @@
+package com.diagbot.rabbit;
+
+import com.diagbot.entity.TranLog;
+import com.diagbot.facade.TranLogFacade;
+import com.diagbot.util.FastJsonUtils;
+import com.diagbot.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cloud.stream.annotation.EnableBinding;
+import org.springframework.cloud.stream.annotation.StreamListener;
+
+/**
+ * @Description: 消费者
+ * @author: wangfeng
+ * @time: 2018/8/29 14:02
+ */
+@EnableBinding({ MyProcessor.class })
+public class MyReceiver {
+    @Autowired
+    private TranLogFacade tranLogFacade;
+
+    @StreamListener(MyProcessor.INPUT_CdssLog)
+    public void inputCdssLog(String message) {
+        //System.out.println("Received <" + "接受到的信息" + ">" + message);
+        if (StringUtil.isNotBlank(message)) {
+            tranLogFacade.save(FastJsonUtils.getJsonToBean(message, TranLog.class));
+        }
+    }
+}

+ 28 - 0
src/main/java/com/diagbot/rabbit/MySender.java

@@ -0,0 +1,28 @@
+package com.diagbot.rabbit;
+
+import com.diagbot.entity.TranLog;
+import com.diagbot.util.FastJsonUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.cloud.stream.annotation.EnableBinding;
+import org.springframework.integration.support.MessageBuilder;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 发布者
+ * @author: gaodm
+ * @time: 2018/8/29 13:41
+ */
+@Component
+@EnableBinding({ MyProcessor.class })
+public class MySender {
+
+    @Autowired
+    @Qualifier("outputCdssLog")
+    MessageChannel outputCdssLog;
+
+    public void outputCdssLogSend(TranLog msg) {
+        outputCdssLog.send(MessageBuilder.withPayload(FastJsonUtils.getBeanToJson(msg)).build());
+    }
+}

+ 19 - 0
src/main/java/com/diagbot/service/TranLogService.java

@@ -0,0 +1,19 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.TranLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.vo.TranLogPageVO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * 系统日志表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-20
+ */
+public interface TranLogService extends IService<TranLog> {
+    IPage<TranLog> getPage(@Param("tranLogPageVO") TranLogPageVO tranLogPageVO);
+}

+ 26 - 0
src/main/java/com/diagbot/service/impl/TranLogServiceImpl.java

@@ -0,0 +1,26 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.TranLog;
+import com.diagbot.mapper.TranLogMapper;
+import com.diagbot.service.TranLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.TranLogPageVO;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 系统日志表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-20
+ */
+@Service
+public class TranLogServiceImpl extends ServiceImpl<TranLogMapper, TranLog> implements TranLogService {
+    @Override
+    public IPage<TranLog> getPage(@Param("tranLogPageVO") TranLogPageVO tranLogPageVO) {
+        return baseMapper.getPage(tranLogPageVO);
+    }
+}

+ 296 - 0
src/main/java/com/diagbot/util/CdssLogUtil.java

@@ -0,0 +1,296 @@
+package com.diagbot.util;
+
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.TranLog;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.springframework.validation.BindException;
+import org.springframework.validation.FieldError;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Description: Cdss日志工具类
+ * @author: gaodm
+ * @time: 2021/10/20 10:30
+ */
+public class CdssLogUtil {
+
+    private final static String CDSS_REQ = "Cdss_Req";
+    private final static String CDSS_RESP = "Cdss_Resp";
+    private final static String CDSS_HOSPITAL_ID = "Cdss_Hospital_Id";
+    private final static String CDSS_SUB_HOSPITAL_NAME = "Cdss_Sub_Hospital_Name";
+    private final static String CDSS_SUB_HOSPITAL_CODE = "Cdss_Sub_Hospital_Code";
+    private final static String CDSS_PATIENT_ID = "Cdss_Patient_Id";
+    private final static String CDSS_LOG_SP = "→";
+
+    /**
+     * 入参设置
+     *
+     * @param joinPoint
+     */
+    public static TranLog tranLogReqAspect(ProceedingJoinPoint joinPoint) {
+        TranLog tranLog = new TranLog();
+        //请求的参数
+        Object[] args = joinPoint.getArgs();
+        //请求的参数
+        String params = "";
+        for (Object o : args) {
+            params += FastJsonUtils.getBeanToJson(o);
+            break;
+        }
+        if (!StringUtil.isEmpty(params)) {
+            tranLog.setParams(params);
+        }
+        return tranLog;
+    }
+
+    /**
+     * 正常结束出参
+     *
+     * @param tranLog
+     * @param joinPoint
+     * @return
+     * @throws Throwable
+     */
+    public static TranLog tranLogRespAspect(Object proceed, TranLog tranLog, long start, ProceedingJoinPoint joinPoint) throws Throwable {
+        String result = "";
+        result = FastJsonUtils.getBeanToJson(proceed);
+        tranLog.setSuccessFlag(1);
+        if (!StringUtil.isEmpty(result)) {
+            tranLog.setResult(result);
+            if (proceed instanceof RespDTO) {
+                RespDTO respDTO = (RespDTO) proceed;
+                if (!respDTO.code.equals("0")) {
+                    tranLog.setSuccessFlag(0);
+                }
+            }
+        }
+        long execTime = System.currentTimeMillis() - start;
+        tranLog.setGmtResp(DateUtil.now());
+        tranLog.setExecTime(String.valueOf(execTime));
+        //业务处理
+        bizDeal(tranLog);
+        return tranLog;
+    }
+
+    /**
+     * 异常结束
+     *
+     * @param joinPoint
+     * @param ex
+     * @return
+     */
+    public static TranLog tranLogRespAspectThrow(JoinPoint joinPoint, TranLog tranLog, long start, Throwable ex) {
+        //请求的参数
+        Object[] args = joinPoint.getArgs();
+        //请求的参数
+        String params = "";
+        for (Object o : args) {
+            params += FastJsonUtils.getBeanToJson(o);
+            break;
+        }
+        if (!StringUtil.isEmpty(params)) {
+            tranLog.setParams(params);
+        }
+        //出参设置
+        String result = "";
+        result = FastJsonUtils.getBeanToJson(handleException((Exception) ex));
+        tranLog.setResult(result);
+        tranLog.setSuccessFlag(0);
+        long execTime = System.currentTimeMillis() - start;
+        tranLog.setGmtResp(DateUtil.now());
+        tranLog.setExecTime(String.valueOf(execTime));
+        //业务处理
+        bizDeal(tranLog);
+        return tranLog;
+    }
+
+    /**
+     * 抛错信息处理
+     *
+     * @param e
+     * @return 结果参数
+     */
+    private static RespDTO handleException(Exception e) {
+        RespDTO resp = new RespDTO();
+        if (e instanceof BindException) {
+            BindException ex = (BindException) e;
+            Map<String, String> stringMap = new HashMap<>();
+            for (FieldError fieldError : ex.getBindingResult().getFieldErrors()) {
+                stringMap.put(fieldError.getField(), fieldError.getDefaultMessage());
+            }
+            String msg = FastJsonUtils.getBeanToJson(stringMap);
+            resp.code = CommonErrorCode.PARAM_ERROR.getCode();
+            resp.msg = msg;
+            return resp;
+        }
+        if (e instanceof MethodArgumentNotValidException) {
+            MethodArgumentNotValidException ex = (MethodArgumentNotValidException) e;
+            Map<String, String> stringMap = new HashMap<>();
+            for (FieldError fieldError : ex.getBindingResult().getFieldErrors()) {
+                stringMap.put(fieldError.getField(), fieldError.getDefaultMessage());
+            }
+            String msg = FastJsonUtils.getBeanToJson(stringMap);
+            resp.code = CommonErrorCode.PARAM_ERROR.getCode();
+            resp.msg = msg;
+            return resp;
+        }
+        if (e instanceof MissingServletRequestParameterException) {
+            MissingServletRequestParameterException ex = (MissingServletRequestParameterException) e;
+            Map<String, String> stringMap = new HashMap<>();
+            stringMap.put(ex.getParameterName(), "不能为null");
+            String msg = FastJsonUtils.getBeanToJson(stringMap);
+            resp.code = CommonErrorCode.PARAM_ERROR.getCode();
+            resp.msg = msg;
+            return resp;
+        }
+        if (e instanceof CommonException) {
+            CommonException taiChiException = (CommonException) e;
+            resp.code = taiChiException.getCode();
+            resp.msg = e.getMessage();
+            return resp;
+        }
+        resp.code = CommonErrorCode.FAIL.getCode();
+        resp.msg = e.getMessage();
+        return resp;
+    }
+
+    /**
+     * 日志处理
+     *
+     * @param tranLog
+     */
+    private static void bizDeal(TranLog tranLog) {
+        HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
+        //入参处理
+        String params = tranLog.getParams();
+        String req = response.getHeader(CDSS_REQ);
+        if (StringUtil.isNotBlank(req)) {
+            if (StringUtil.isNotBlank(params)) {
+                params += CDSS_LOG_SP + req;
+            } else {
+                params = req;
+            }
+            response.setHeader(CDSS_REQ, "");
+        }
+        tranLog.setParams(params);
+        //出参处理
+        String result = tranLog.getResult();
+        String resp = response.getHeader(CDSS_RESP);
+        if (StringUtil.isNotBlank(resp)) {
+            if (StringUtil.isNotBlank(result)) {
+                result += CDSS_LOG_SP + resp;
+            } else {
+                result = resp;
+            }
+            response.setHeader(CDSS_RESP, "");
+        }
+        tranLog.setResult(result);
+
+        //todo 个性化处理
+
+        //设置医院id
+        Long hospitalId = tranLog.getHospitalId();
+        String hosId = response.getHeader(CDSS_HOSPITAL_ID);
+        if (StringUtil.isNotBlank(hosId)) {
+            hospitalId = Long.valueOf(hosId);
+            response.setHeader(CDSS_HOSPITAL_ID, "");
+        }
+        tranLog.setHospitalId(hospitalId);
+
+        //设置子医院名称
+        String subHospitalName = tranLog.getSubHospitalName();
+        String subHosName = response.getHeader(CDSS_SUB_HOSPITAL_NAME);
+        if (StringUtil.isNotBlank(subHosName)) {
+            subHospitalName = subHosName;
+            response.setHeader(CDSS_SUB_HOSPITAL_NAME, "");
+        }
+        tranLog.setSubHospitalName(subHospitalName);
+
+        //设置子医院编码
+        String subHospitalCode = tranLog.getSubHospitalCode();
+        String subHosCode = response.getHeader(CDSS_SUB_HOSPITAL_CODE);
+        if (StringUtil.isNotBlank(subHosCode)) {
+            subHospitalCode = subHosCode;
+            response.setHeader(CDSS_SUB_HOSPITAL_CODE, "");
+        }
+        tranLog.setSubHospitalCode(subHospitalCode);
+    }
+
+
+    /**
+     * 增加入参
+     *
+     * @param o
+     */
+    public static void addBizReq(Object o) {
+        handleRespHeaderMap(CDSS_REQ, o);
+    }
+
+    /**
+     * 增加出参
+     *
+     * @param o
+     */
+    public static void addBizResp(Object o) {
+        handleRespHeaderMap(CDSS_RESP, o);
+    }
+
+    /**
+     * 设置医院id
+     *
+     * @param o
+     */
+    public static void addBizHospitalId(Object o) {
+        handleRespHeaderMap(CDSS_HOSPITAL_ID, o);
+    }
+
+    /**
+     * 设置子医院编码
+     *
+     * @param o
+     */
+    public static void addBizSubHospitalName(Object o) {
+        handleRespHeaderMap(CDSS_SUB_HOSPITAL_NAME, o);
+    }
+
+    /**
+     * 设置子医院名称
+     *
+     * @param o
+     */
+    public static void addBizSubHospitalCode(Object o) {
+        handleRespHeaderMap(CDSS_SUB_HOSPITAL_CODE, o);
+    }
+
+    /**
+     * 设置病人标识
+     *
+     * @param o
+     */
+    public static void addBizPatientId(Object o) {
+        handleRespHeaderMap(CDSS_PATIENT_ID, o);
+    }
+
+
+    private static void handleRespHeaderMap(String key, Object o) {
+        HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
+        String value = response.getHeader(key);
+        if (StringUtil.isNotBlank(value)) {
+            value += CDSS_LOG_SP + FastJsonUtils.getBeanToJson(o);
+        } else {
+            value = FastJsonUtils.getBeanToJson(o);
+        }
+        // 设置Header
+        response.setHeader(key, value);
+    }
+}

+ 4 - 0
src/main/java/com/diagbot/vo/Drug.java

@@ -14,4 +14,8 @@ import lombok.Setter;
 public class Drug extends Item {
     // 剂型
     private String form;
+    // 给药途径医院名称
+    private String routeName;
+    // 给药途径标准名称
+    private String routeUniqueName;
 }

+ 35 - 0
src/main/java/com/diagbot/vo/LogTestVO.java

@@ -0,0 +1,35 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/10/20 10:53
+ */
+@Getter
+@Setter
+public class LogTestVO {
+    private String msg;
+    //0:正常,1:抛错,2:子方法放入参数
+    @NotNull
+    private Integer type = 0;
+    @NotNull(message = "请输入医院id")
+    private Long hospitalId;
+    /**
+     * 病人唯一标识(病人id、病历号等)
+     */
+    private String patientId;
+    /**
+     * 子医院编码
+     */
+    private String subHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    private String subHospitalName;
+}

+ 2 - 2
src/main/java/com/diagbot/vo/MappingConfigPageVO.java

@@ -22,9 +22,9 @@ public class MappingConfigPageVO extends Page {
     @ApiModelProperty(hidden = true)
     private Long hospitalId;
     /**
-     * 医学术语类型( 1-检验套餐、2-检验细项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医疾病、13-中医证候、14-麻醉)
+     * 医学术语类型( 1-检验套餐、2-检验细项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医疾病、13-中医证候、14-麻醉、16-给药途径
      */
-    @NotNull(message = "请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉")
+    @NotNull(message = "请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径")
     private Integer type;
 
     /**

+ 1 - 1
src/main/java/com/diagbot/vo/PrecDataVO.java

@@ -14,6 +14,6 @@ import java.util.List;
 @Data
 public class PrecDataVO {
     private List<PrecRecordVO> originList;
-    @NotNull(message = "请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 ")
+    @NotNull(message = "请输入术语类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 ")
     private Integer type;
 }

+ 5 - 0
src/main/java/com/diagbot/vo/RetrievalVO.java

@@ -31,4 +31,9 @@ public class RetrievalVO {
 //     * 年龄
 //     */
 //    private Integer age;
+
+    /**
+     * 默认展示 0:不展示,1:展示全部
+     */
+    private Integer defaultList = 0;
 }

+ 31 - 0
src/main/java/com/diagbot/vo/TranLogPageVO.java

@@ -0,0 +1,31 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/10/25 9:57
+ */
+@Data
+public class TranLogPageVO extends Page {
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+    private String patientId;
+    private String sceneName;
+    //@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
+    private Date startGmtReq;
+    //@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
+    private Date endGmtReq;
+    //@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
+    private Date startGmtResp;
+    //@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss.SSS",timezone = "GMT+8")
+    private Date endGmtResp;
+    private Integer successFlag;
+    private String subHospitalName;
+}

+ 12 - 0
src/main/java/com/diagbot/web/ConceptInfoController.java

@@ -98,6 +98,18 @@ public class ConceptInfoController {
         return RespDTO.onSuc(data);
     }
 
+    @ApiOperation(value = "对接获取静态知识-判断是否有静态知识[zhaops]",
+            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、7-手术和操作、8-量表、9-护理、10-政策法规 <br>" +
+                    "contentTypes: 内容类型(多选):1-静态信息、2-注意事项、3-临床路径、4-治疗方案 <br>" +
+                    "hisName: HIS大项名称<br>" +
+                    "hisDetailName: HIS小项名称<br>")
+    @PostMapping("/isExistForHIS")
+    @SysLogger("isExistForHIS")
+    public RespDTO<Boolean> isExistForHIS(@Valid @RequestBody StaticKnowledgeHISVO staticKnowledgeHISVO) {
+        Boolean data = klConceptStaticFacade.isExistForHIS(staticKnowledgeHISVO);
+        return RespDTO.onSuc(data);
+    }
+
     @ApiOperation(value = "获取静态知识列表[zhaops]",
             notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作、8-量表、9-护理、10-政策法规 <br>" +
                     "name: 术语名称<br>" +

+ 42 - 0
src/main/java/com/diagbot/web/LogTestController.java

@@ -0,0 +1,42 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.CdssLog;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.LogTestFacade;
+import com.diagbot.vo.LogTestVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * @Description: 站内信控制层
+ * @author: gaodm
+ * @time: 2018/8/30 10:12
+ */
+@RestController
+@Api(value = "日志测试API", tags = { "日志测试API" })
+@RequestMapping("/test")
+@SuppressWarnings("unchecked")
+public class LogTestController {
+    @Autowired
+    private LogTestFacade logTestFacade;
+
+
+    @ApiOperation(value = "异步日志测试[by:gaodm]",
+            notes = "msg:信息内容<br>" +
+                    "type:0:正常,1:抛错,2:子方法放入参数")
+    @PostMapping("/logTest")
+    @SysLogger("logTest")
+    @CdssLog("异步日志测试")
+    public RespDTO<Boolean> logTest(@RequestBody @Valid LogTestVO logTestVO) {
+        return RespDTO.onSuc(logTestFacade.logTest(logTestVO));
+    }
+}
+

+ 12 - 12
src/main/java/com/diagbot/web/MappingConfigController.java

@@ -45,7 +45,7 @@ public class MappingConfigController {
 
 
     @ApiOperation(value = "数据导入模板导出[by:zhaops]",
-            notes = "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+            notes = "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping("/exportExcelModule")
     @SysLogger("exportExcelModule")
     public void exportExcelModule(HttpServletResponse response, @RequestBody @Valid MappingConfigVO mappingConfigVO) {
@@ -54,7 +54,7 @@ public class MappingConfigController {
 
     @ApiOperation(value = "预匹配导入术语校验[by:zhaops]",
             notes = "file(必填):预匹配文件 <br>" +
-                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping(value = "/dataVerify", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @SysLogger("dataVerify")
     public RespDTO<Boolean> dataVerify(@RequestParam("file") MultipartFile file,
@@ -65,7 +65,7 @@ public class MappingConfigController {
 
     @ApiOperation(value = "预匹配[by:zhaops]",
             notes = "file(必填):预匹配文件 <br>" +
-                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping(value = "/precDataMatch", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @SysLogger("precDataMatch")
     public void precDataMatch(@RequestParam("file") MultipartFile file,
@@ -85,7 +85,7 @@ public class MappingConfigController {
     }
 
     @ApiOperation(value = "预匹配(非文件匹配)[by:zhaops]",
-            notes = "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>" +
+            notes = "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>" +
                     "hisName(必填):医院术语名称 <br>" +
                     "hisDetailName(选填):医院术语名称-细项 <br>" +
                     "code(选填):诊断ICD10编码、手术编码、中医疾病编码、中医证候编码 <br>" +
@@ -101,7 +101,7 @@ public class MappingConfigController {
             notes = "file(必填):导入文件 <br>" +
                     "hospitalId(必填):医院id <br>" +
                     "uesrId(必填):操作人id <br>" +
-                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping(value = "/importExcelDataVerify", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @SysLogger("importExcelDataVerify")
     public RespDTO<Boolean> importExcelDataVerify(@RequestParam("file") MultipartFile file,
@@ -116,7 +116,7 @@ public class MappingConfigController {
             notes = "file(必填):导入文件 <br>" +
                     "hospitalId(必填):医院id <br>" +
                     "uesrId(必填):操作人id <br>" +
-                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping(value = "/importExcel", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @SysLogger("importExcel")
     @Transactional
@@ -133,7 +133,7 @@ public class MappingConfigController {
             notes = "file(必填):导入文件 <br>" +
                     "hospitalId(必填):医院id <br>" +
                     "uesrId(必填):操作人id <br>" +
-                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping(value = "/importExcel_remote", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @SysLogger("importExcel_remote")
     @Transactional
@@ -151,7 +151,7 @@ public class MappingConfigController {
     @ApiOperation(value = "数据导出[by:zhaops]",
             notes = "hospitalId(必填):医院id <br>" +
                     "isMatch(选填,默认全部):是否匹配(0-未匹配、1-已匹配、2-多条匹配) <br>" +
-                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping("/exportExcel")
     @SysLogger("exportExcel")
     public void exportExcel(HttpServletResponse response, @RequestBody @Valid MappingConfigPageVO mappingConfigPageVO) {
@@ -173,7 +173,7 @@ public class MappingConfigController {
                     "isMatch(选填,默认全部):是否匹配(0-未匹配、1-已匹配、2-多条匹配) <br>" +
                     "hisName(必填):医院术语名称 <br>" +
                     "uniqueName(选填,可为空):标准术语名称 <br>" +
-                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping("/getPage")
     @SysLogger("getPage")
     public RespDTO<Page<MappingConfigWrapper>> getPage(@RequestBody @Valid MappingConfigPageVO mappingConfigPageVO) {
@@ -202,7 +202,7 @@ public class MappingConfigController {
                     "conceptId(必填):标准术语id <br>" +
                     "formConceptId(选填,可为空):药品剂型id,选填 <br>" +
                     "source(必填):数据来源:1-标准词、2-同义词、3-编码、4-历史数据、5-相似词 <br>" +
-                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping("/isExistRecord")
     @SysLogger("isExistRecord")
     public RespDTO<Boolean> isExistRecord(@RequestBody @Valid MappingConfig mappingConfig) {
@@ -214,7 +214,7 @@ public class MappingConfigController {
             notes = "hospitalId(必填):医院id <br>" +
                     "hisName(必填):医院术语名称 <br>" +
                     "hisDetailName(选填,可为空):医院术语名称-细项 <br>" +
-                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping("/getRelatedMapping")
     @SysLogger("getRelatedMapping")
     public RespDTO<List<MappingConfigWrapper>> getRelatedMapping(@RequestBody @Valid MappingConfigVO mappingConfigVO) {
@@ -231,7 +231,7 @@ public class MappingConfigController {
                     "conceptId(必填):标准术语id <br>" +
                     "formConceptId(选填,可为空):药品剂型id,选填 <br>" +
                     "source:数据来源(必填):1-标准词、2-同义词、3-编码、4-历史数据、5-相似词 <br>" +
-                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>")
     @PostMapping("/saveOrUpdateRecord")
     @SysLogger("saveOrUpdateRecord")
     @Transactional

+ 2 - 1
src/main/java/com/diagbot/web/RetrievalController.java

@@ -28,8 +28,9 @@ public class RetrievalController {
     private RetrievalFacade retrievalFacade;
 
     @ApiOperation(value = "术语检索[zhaops]",
-            notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医疾病、13-中医证候 <br>" +
+            notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医疾病、13-中医证候、14-麻醉、15-药品剂型、16-给药途径 <br>" +
                     "inputStr: 检索内容<br>" +
+                    "defaultList: 默认展示 0:不展示,1:展示全部<br>" +
                     "sex: 性别:1-男、2-女、3-通用 <br>" +
                     "age: 年龄<br>")
     @PostMapping("/index")

+ 1 - 1
src/main/java/com/diagbot/web/TermMatchingController.java

@@ -29,7 +29,7 @@ public class TermMatchingController {
     TermMatchingFacade termMatchingFacade;
 
     @ApiOperation(value = "术语匹配搜索[wangfeng]",
-            notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>" +
+            notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、16-给药途径 <br>" +
                     "inputStr: 检索内容<br>")
     @PostMapping("/termMatching")
     public RespDTO<List<TermConceptDTO>> getTermMatching(@Valid @RequestBody TermMatchingVO termMatchingVO) {

+ 59 - 0
src/main/java/com/diagbot/web/TranLogController.java

@@ -0,0 +1,59 @@
+package com.diagbot.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.TranLog;
+import com.diagbot.facade.TranLogFacade;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.TranLogPageVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/10/25 11:23
+ */
+@RestController
+@RequestMapping("/tran/log")
+@Api(value = "对接日志记录相关API", tags = { "对接日志记录相关API" })
+@SuppressWarnings("unchecked")
+public class TranLogController {
+    @Autowired
+    private TranLogFacade tranLogFacade;
+
+    @ApiOperation(value = "调用记录[by:zhaops]",
+            notes = "patientId:病人标识<br>" +
+                    "sceneName:服务名<br>" +
+                    "startGmtReq:接收时间(起始区间),格式【yyyy-MM-dd HH:mm:ss】<br>" +
+                    "endGmtReq:接收时间(结束区间),格式【yyyy-MM-dd HH:mm:ss】<br>" +
+                    "startGmtResp:响应时间(起始区间),格式【yyyy-MM-dd HH:mm:ss】<br>" +
+                    "endGmtResp:响应时间(结束区间),格式【yyyy-MM-dd HH:mm:ss】<br>" +
+                    "successFlag:状态 1:成功,0:失败<br>" +
+                    "subHospitalName:院区<br>")
+    @PostMapping("/pageList")
+    @SysLogger("pageList")
+    public RespDTO<IPage<TranLog>> pageList(@Valid @RequestBody TranLogPageVO tranLogPageVO) {
+        IPage<TranLog> data = tranLogFacade.pageList(tranLogPageVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "查看接口记录[by:zhaops]",
+            notes = "id")
+    @PostMapping("/getRecordById")
+    @SysLogger("getRecordById")
+    @Transactional
+    public RespDTO<TranLog> getRecordById(@RequestBody @Valid IdVO idVO) {
+        TranLog data = tranLogFacade.getRecordById(idVO);
+        return RespDTO.onSuc(data);
+    }
+}

+ 22 - 0
src/main/resources/application-dev.yml

@@ -106,6 +106,24 @@ spring:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
 
+  cloud:
+    stream:
+      bindings:
+        outputCdssLog:
+          destination: cdssLog
+        inputCdssLog:
+          destination: cdssLog
+          group: cdssLogReceiveGroup
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.236
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
   #redis
   redis:
     database:
@@ -166,6 +184,10 @@ oath.self.address: http://${myhost}:${server.port}
 swagger:
   enable: true
 
+#日志记录
+cdssLog:
+  enable: true
+
 #Token鉴权
 tokenAuth:
   enable: false

+ 22 - 0
src/main/resources/application-local.yml

@@ -106,6 +106,24 @@ spring:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
 
+  cloud:
+    stream:
+      bindings:
+        outputCdssLog:
+          destination: cdssLog
+        inputCdssLog:
+          destination: cdssLog
+          group: cdssLogReceiveGroup
+
+  #mq
+  rabbitmq:
+    host: localhost
+    port: 5672
+    username: guest
+    password: guest
+    publisher-confirms: true
+    virtual-host: /
+
   #redis
   redis:
     database:
@@ -166,6 +184,10 @@ oath.self.address: http://${myhost}:${server.port}
 swagger:
   enable: true
 
+#日志记录
+cdssLog:
+  enable: true
+
 #Token鉴权
 tokenAuth:
   enable: false

+ 23 - 0
src/main/resources/application-pre.yml

@@ -106,6 +106,25 @@ spring:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
 
+  cloud:
+    stream:
+      bindings:
+        outputCdssLog:
+          destination: cdssLog
+        inputCdssLog:
+          destination: cdssLog
+          group: cdssLogReceiveGroup
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.121
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
+
   #redis
   redis:
     database:
@@ -166,6 +185,10 @@ oath.self.address: http://${myhost}:${server.port}
 swagger:
   enable: true
 
+#日志记录
+cdssLog:
+  enable: true
+
 #Token鉴权
 tokenAuth:
   enable: false

+ 22 - 0
src/main/resources/application-pro.yml

@@ -106,6 +106,24 @@ spring:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
 
+  cloud:
+    stream:
+      bindings:
+        outputCdssLog:
+          destination: cdssLog
+        inputCdssLog:
+          destination: cdssLog
+          group: cdssLogReceiveGroup
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.122
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
   #redis
   redis:
     database:
@@ -166,6 +184,10 @@ oath.self.address: http://${myhost}:${server.port}
 swagger:
   enable: true
 
+#日志记录
+cdssLog:
+  enable: true
+
 #Token鉴权
 tokenAuth:
   enable: false

+ 22 - 0
src/main/resources/application-test.yml

@@ -106,6 +106,24 @@ spring:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
 
+  cloud:
+    stream:
+      bindings:
+        outputCdssLog:
+          destination: cdssLog
+        inputCdssLog:
+          destination: cdssLog
+          group: cdssLogReceiveGroup
+
+  #mq
+  rabbitmq:
+    host: 192.168.2.241
+    port: 5672
+    username: lantone
+    password: lantone
+    publisher-confirms: true
+    virtual-host: /
+
   #redis
   redis:
     database:
@@ -166,6 +184,10 @@ oath.self.address: http://${myhost}:${server.port}
 swagger:
   enable: true
 
+#日志记录
+cdssLog:
+  enable: true
+
 #Token鉴权
 tokenAuth:
   enable: false

+ 59 - 0
src/main/resources/mapper/TranLogMapper.xml

@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.TranLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.TranLog">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="patient_id" property="patientId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="sub_hospital_code" property="subHospitalCode" />
+        <result column="sub_hospital_name" property="subHospitalName" />
+        <result column="scene_name" property="sceneName" />
+        <result column="params" property="params" />
+        <result column="result" property="result" />
+        <result column="gmt_req" property="gmtReq" />
+        <result column="gmt_resp" property="gmtResp" />
+        <result column="exec_time" property="execTime" />
+        <result column="success_flag" property="successFlag" />
+    </resultMap>
+
+    <select id="getPage" resultType="com.diagbot.entity.TranLog">
+        SELECT
+        *
+        FROM
+        tran_log a
+        WHERE
+        a.is_deleted = 'N'
+        <if test="tranLogPageVO.hospitalId != null">
+            AND a.hospital_id = #{tranLogPageVO.hospitalId}
+        </if>
+        <if test="tranLogPageVO.patientId != null and tranLogPageVO.patientId != ''">
+            AND a.patient_id LIKE CONCAT( '%', #{tranLogPageVO.patientId}, '%' )
+        </if>
+        <if test="tranLogPageVO.sceneName != null and tranLogPageVO.sceneName != ''">
+            AND a.scene_name LIKE CONCAT( '%', #{tranLogPageVO.sceneName}, '%' )
+        </if>
+        <if test="tranLogPageVO.subHospitalName != null and tranLogPageVO.subHospitalName != ''">
+            AND a.sub_hospital_name LIKE CONCAT( '%', #{tranLogPageVO.subHospitalName}, '%' )
+        </if>
+        <if test="tranLogPageVO.startGmtReq != null and tranLogPageVO.endGmtReq != null">
+            AND DATE_FORMAT( a.gmt_req, '%Y-%m-%d %T' ) BETWEEN  DATE_FORMAT(#{tranLogPageVO.startGmtReq}, '%Y-%m-%d %T' )
+            AND DATE_FORMAT(#{tranLogPageVO.endGmtReq}, '%Y-%m-%d %T' )
+        </if>
+        <if test="tranLogPageVO.startGmtResp != null and tranLogPageVO.endGmtResp != null">
+            AND DATE_FORMAT( a.gmt_resp, '%Y-%m-%d %T' ) BETWEEN DATE_FORMAT(#{tranLogPageVO.startGmtResp}, '%Y-%m-%d %T' )
+            AND DATE_FORMAT(#{tranLogPageVO.endGmtResp}, '%Y-%m-%d %T' )
+        </if>
+        <if test="tranLogPageVO.successFlag != null">
+            AND a.success_flag = #{tranLogPageVO.successFlag}
+        </if>
+        ORDER BY
+        a.gmt_modified DESC
+    </select>
+</mapper>

+ 1 - 1
src/test/java/com/diagbot/CodeGeneration.java

@@ -57,7 +57,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
         // strategy.setTablePrefix(new String[] { "demo_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "tran_hospital_relation"}); // 需要生成的表
+        strategy.setInclude(new String[] { "tran_log"}); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);