Kaynağa Gözat

Merge remote-tracking branch 'origin/dev/precSR' into dev/precSR

wangyu 6 yıl önce
ebeveyn
işleme
54255de949
41 değiştirilmiş dosya ile 596 ekleme ve 1028 silme
  1. 4 4
      aipt-service/src/main/java/com/diagbot/client/NLPServiceClient.java
  2. 2 2
      aipt-service/src/main/java/com/diagbot/client/hystrix/NLPServiceHystrix.java
  3. 1 0
      aipt-service/src/main/java/com/diagbot/dto/FeatureConceptDTO.java
  4. 18 1
      aipt-service/src/main/java/com/diagbot/enums/LexiconTypeEnum.java
  5. 32 10
      aipt-service/src/main/java/com/diagbot/facade/ConceptFacade.java
  6. 7 31
      aipt-service/src/main/java/com/diagbot/facade/FeatureFacade.java
  7. 4 4
      aipt-service/src/main/java/com/diagbot/facade/NLPFacade.java
  8. 3 1
      aipt-service/src/main/java/com/diagbot/vo/RetrievalVO.java
  9. 135 145
      aipt-service/src/main/resources/mapper/ConceptMapper.xml
  10. 3 1
      icss-service/src/main/java/com/diagbot/dto/FeatureConceptDTO.java
  11. 5 1
      icss-service/src/main/java/com/diagbot/facade/FeatureFacade.java
  12. 11 0
      icss-service/src/main/java/com/diagbot/facade/QuestionUsualFacade.java
  13. 17 2
      icss-service/src/main/java/com/diagbot/facade/RetrievalFacade.java
  14. 1 1
      icss-service/src/main/java/com/diagbot/vo/RetrievalVO.java
  15. 18 1
      knowledgeman-service/src/main/java/com/diagbot/enums/LexiconTypeEnum.java
  16. 2 2
      knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java
  17. 2 2
      knowledgeman-service/src/main/resources/mapper/RelationMapper.xml
  18. 77 0
      prec-service/src/main/java/com/diagbot/dto/EvaluatorCalDTO.java
  19. 0 102
      prec-service/src/main/java/com/diagbot/dto/SearchEvaluatorDTO.java
  20. 1 1
      prec-service/src/main/java/com/diagbot/entity/InquiryDetail.java
  21. 1 53
      prec-service/src/main/java/com/diagbot/entity/InquiryEvaluator.java
  22. 1 27
      prec-service/src/main/java/com/diagbot/entity/InquiryInfo.java
  23. 1 1
      prec-service/src/main/java/com/diagbot/entity/InquiryReport.java
  24. 0 2
      prec-service/src/main/java/com/diagbot/entity/PhysicalVal.java
  25. 118 152
      prec-service/src/main/java/com/diagbot/facade/InquiryEvaluatorFacade.java
  26. 6 2
      prec-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java
  27. 1 5
      prec-service/src/main/java/com/diagbot/mapper/InquiryEvaluatorMapper.java
  28. 50 32
      prec-service/src/main/java/com/diagbot/vo/AddEvaluatorVO.java
  29. 65 0
      prec-service/src/main/java/com/diagbot/vo/EvaluatorCalVO.java
  30. 0 30
      prec-service/src/main/java/com/diagbot/vo/SearchEvaluatorVO.java
  31. 10 32
      prec-service/src/main/java/com/diagbot/web/InquiryEvaluatorController.java
  32. 0 21
      prec-service/src/main/resources/mapper/InquiryEvaluatorMapper.xml
  33. 0 2
      prec-service/src/main/resources/mapper/InquiryInfoMapper.xml
  34. 0 142
      precman-service/src/main/java/com/diagbot/entity/User.java
  35. 0 13
      precman-service/src/main/java/com/diagbot/facade/SysLogFacade.java
  36. 0 16
      precman-service/src/main/java/com/diagbot/mapper/SysLogMapper.java
  37. 0 15
      precman-service/src/main/java/com/diagbot/service/SysLogService.java
  38. 0 19
      precman-service/src/main/java/com/diagbot/service/impl/SysLogServiceImpl.java
  39. 0 21
      precman-service/src/main/java/com/diagbot/vo/SysLogVo.java
  40. 0 110
      precman-service/src/main/java/com/diagbot/web/SysLogController.java
  41. 0 22
      precman-service/src/main/resources/mapper/SysLogMapper.xml

+ 4 - 4
aipt-service/src/main/java/com/diagbot/client/NLPServiceClient.java

@@ -2,12 +2,12 @@ package com.diagbot.client;
 
 import com.diagbot.client.bean.Response;
 import com.diagbot.client.hystrix.NLPServiceHystrix;
+import com.diagbot.dto.FeatureConceptDTO;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * @Description:调用NLP对接层服务
@@ -22,6 +22,6 @@ public interface NLPServiceClient {
      * @param text
      * @return
      */
-    @PostMapping(value = "/nlp-web/feature/find_symptom_feature")
-    Response<List<Map<String, Object>>> symptomFeaturePageData(@RequestParam("text") String text);
+    @GetMapping(value = "/nlp-web/feature/find_symptom_feature")
+    Response<List<FeatureConceptDTO>> symptomFeaturePageData(@RequestParam("text") String text);
 }

+ 2 - 2
aipt-service/src/main/java/com/diagbot/client/hystrix/NLPServiceHystrix.java

@@ -2,12 +2,12 @@ package com.diagbot.client.hystrix;
 
 import com.diagbot.client.NLPServiceClient;
 import com.diagbot.client.bean.Response;
+import com.diagbot.dto.FeatureConceptDTO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * @Description:调用NLP对接层服务
@@ -25,7 +25,7 @@ public class NLPServiceHystrix implements NLPServiceClient {
      * @return
      */
     @Override
-    public Response<List<Map<String, Object>>> symptomFeaturePageData(@RequestParam("text") String text) {
+    public Response<List<FeatureConceptDTO>> symptomFeaturePageData(@RequestParam("text") String text) {
         log.error("【hystrix】调用{}异常", "symptomFeaturePageData");
         return null;
     }

+ 1 - 0
aipt-service/src/main/java/com/diagbot/dto/FeatureConceptDTO.java

@@ -13,4 +13,5 @@ import lombok.Setter;
 public class FeatureConceptDTO extends ConceptBaseDTO {
     private Integer libType;
     private Integer type;
+    private Integer chronicLabel; //是否慢病复诊标志
 }

+ 18 - 1
aipt-service/src/main/java/com/diagbot/enums/LexiconTypeEnum.java

@@ -60,7 +60,24 @@ public enum LexiconTypeEnum implements KeyedNamed {
     SIDE_EFFECTS(49,"不良反应"),
     CORE_INDICATORS(50,"核心指标"),
     TYPES_OF_DISEASE(51,"疾病类型(慢病|急诊)"),
-    PART_AREA(52,"部位区域");
+    PART_AREA(52,"部位区域"),
+    LOCATION_AREA(52,"部位区域"),
+    CHEMICAL_NAME_OF_DRUG(53,"药品化学名"),
+    DRUG_TRADE_NAMES(54,"药品商品名"),
+    HISTORY_OF_PAST_DISEASES(55,"既往疾病史"),
+    HISTORY_OF_TRAUMA(56,"外伤史"),
+    HISTORY_OF_SURGERY(57,"手术史"),
+    HISTORY_OF_BLOOD_TRANSFUSION(58,"输血史"),
+    INFECTIOUS_DISEASE_HISTORY(59,"传染病史"),
+    BAD_HABITS(60,"不良习惯"),
+    MARITAL_HISTORY(61,"冶游史"),
+    HISTORY_OF_MARRIAGE_AND_CHILDBEARING(62,"婚育史"),
+    BIRTH_HISTORY(63,"生育史"),
+    FAMILY_HISTORY(64,"家族史"),
+    FOOD_ALLERGY_HISTORY(65,"食物过敏史"),
+    HISTORY_OF_DRUG_ALLERGY(66,"药物过敏史"),
+    FAMILY_RELATED_INFECTIOUS_DISEASE_HISTORY(67,"家族相关传染病史");
+
 
     @Setter
     private Integer key;

+ 32 - 10
aipt-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -216,25 +216,47 @@ public class ConceptFacade extends ConceptServiceImpl {
     public List<ConceptRetrievalDTO> retrivelConceptInfo(RetrievalVO retrievalVO){
         List<Integer> typeList = new ArrayList<>();
         if (null != retrievalVO.getType()){
-            for (Integer type: retrievalVO.getType()) {
-                if(type.intValue() == ConceptTypeEnum.Lis.getKey()){//如果是化验,检索类型包括套餐和明细项
-                    typeList.add(LexiconTypeEnum.LIS_PACKAGE.getKey());
-                    typeList.add(LexiconTypeEnum.LIS_DETAILS.getKey());
-                } else{
-                    typeList.add(ParamConvertUtil.conceptConvert2Lib(type));//标签类型
-                }
+            if(retrievalVO.getType().intValue() == ConceptTypeEnum.Lis.getKey()){
+                retrievalVO.setDetilType(LexiconTypeEnum.LIS_DETAILS.getKey());
             }
-            retrievalVO.setType(typeList);
+            retrievalVO.setType(ParamConvertUtil.conceptConvert2Lib(retrievalVO.getType()));
         }
         List<ConceptRetrievalDTO> conceptRetrievalDTOS = this.retrievalConcept(retrievalVO);
+        List<ConceptRetrievalDTO> res = new ArrayList<>();
+        List<Long> selfList = new ArrayList<>(); // 本体
+        List<Long> subList = new ArrayList<>(); // 子项
+        for (ConceptRetrievalDTO bean : conceptRetrievalDTOS) {
+            if(StringUtil.isNotEmpty(bean.getParentName())) { // 重置showType
+                bean.setShowType(2L);
+            }
+            if (bean.getShowType().intValue() == 1) { // 本体
+                selfList.add(bean.getSelfId());
+            } else if (bean.getShowType().intValue() == 2) { // 子项
+                subList.add(bean.getSelfId());
+            }
+        }
+        // 有本体,过滤同义词和子项;无本体,有子项,过滤同义词
+        for (ConceptRetrievalDTO bean : conceptRetrievalDTOS) {
+            if(bean.getShowType().intValue() == 1) {
+                res.add(bean);
+            } else if (bean.getShowType().intValue() == 2) {
+                if(!selfList.contains(bean.getParentId())) {
+                    res.add(bean);
+                }
+            } else if (bean.getShowType().intValue() == 0) {
+                if(!selfList.contains(bean.getSelfId()) && !subList.contains(bean.getSelfId())) {
+                    res.add(bean);
+                }
+            }
+        }
         //把本体的sameName过滤掉
-        for (ConceptRetrievalDTO conceptRetrievalDTO : conceptRetrievalDTOS) {
+        for (ConceptRetrievalDTO conceptRetrievalDTO : res) {
             if(conceptRetrievalDTO.getSameName() != null && conceptRetrievalDTO.getSameName().equals(conceptRetrievalDTO.getSelfName())){
                 conceptRetrievalDTO.setSameName(null);
             }
             conceptRetrievalDTO.setType(ParamConvertUtil.libConvert2Concept(conceptRetrievalDTO.getLibTypeId().intValue()));
         }
-        return conceptRetrievalDTOS;
+        return res;
     }
 
 

+ 7 - 31
aipt-service/src/main/java/com/diagbot/facade/FeatureFacade.java

@@ -1,19 +1,14 @@
 package com.diagbot.facade;
 
 import com.diagbot.dto.FeatureConceptDTO;
-import com.diagbot.entity.Concept;
-import com.diagbot.enums.ConceptTypeEnum;
-import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
-import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
-import com.google.common.collect.Lists;
+import com.diagbot.util.ParamConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * @Description:
@@ -24,8 +19,6 @@ import java.util.Map;
 public class FeatureFacade {
     @Autowired
     private NLPFacade nlpFacade;
-    @Autowired
-    private ConceptFacade conceptFacade;
 
     /**
      * 症状关键词提取
@@ -34,33 +27,16 @@ public class FeatureFacade {
      * @return
      */
     public List<FeatureConceptDTO> getSymptomFeature(String text) {
-        List<FeatureConceptDTO> symptomFeatureDTOList = Lists.newLinkedList();
-        List<Map<String, Object>> symptomFeatureList = nlpFacade.symptomFeaturePageData(text);
-        List<String> symptomNameList = Lists.newLinkedList();
-        for (Map<String, Object> symptomFeature : symptomFeatureList) {
-            if (symptomFeature != null) {
-                String symptomName = symptomFeature.get("feature_name").toString();
-                if (!symptomNameList.contains(symptomName) && symptomFeature.get("feature_type").toString().equals("1")) {
-                    symptomNameList.add(symptomName);
-                }
-            }
-        }
+        List<FeatureConceptDTO> symptomFeatureList = nlpFacade.symptomFeaturePageData(text);
         if (!ListUtil.isNotEmpty(symptomFeatureList)) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "未提取到特征词");
         }
-        List<Concept> concepts = conceptFacade.getListByNamesAndType(symptomNameList, LexiconTypeEnum.SYMPTOM.getKey());
-        Map<String, Concept> conceptMap = EntityUtil.makeEntityMap(concepts, "libName");
-        for (String name : symptomNameList) {
-            FeatureConceptDTO featureConceptDTO = new FeatureConceptDTO();
-            featureConceptDTO.setName(name);
-            featureConceptDTO.setLibType(LexiconTypeEnum.SYMPTOM.getKey());
-            featureConceptDTO.setType(ConceptTypeEnum.Symptom.getKey());
-            if (conceptMap.containsKey(name) && conceptMap.get(name) != null) {
-                Concept concept = conceptMap.get(name);
-                featureConceptDTO.setConceptId(concept.getId());
+
+        for (FeatureConceptDTO featureConceptDTO : symptomFeatureList) {
+            if (null != featureConceptDTO.getLibType()) {
+                featureConceptDTO.setType(ParamConvertUtil.libConvert2Concept(featureConceptDTO.getLibType()));
             }
-            symptomFeatureDTOList.add(featureConceptDTO);
         }
-        return symptomFeatureDTOList;
+        return symptomFeatureList;
     }
 }

+ 4 - 4
aipt-service/src/main/java/com/diagbot/facade/NLPFacade.java

@@ -2,13 +2,13 @@ package com.diagbot.facade;
 
 import com.diagbot.client.NLPServiceClient;
 import com.diagbot.client.bean.Response;
+import com.diagbot.dto.FeatureConceptDTO;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * @Description:
@@ -26,11 +26,11 @@ public class NLPFacade {
      * @param text
      * @return
      */
-    public List<Map<String, Object>> symptomFeaturePageData(String text) {
-        Response<List<Map<String, Object>>> response = nlpServiceClient.symptomFeaturePageData(text);
+    public List<FeatureConceptDTO> symptomFeaturePageData(String text) {
+        Response<List<FeatureConceptDTO>> response = nlpServiceClient.symptomFeaturePageData(text);
         if (response == null || response.getData() == null) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "NLP没有返回结果");
         }
         return response.getData();
     }
-}
+}

+ 3 - 1
aipt-service/src/main/java/com/diagbot/vo/RetrievalVO.java

@@ -14,11 +14,13 @@ import java.util.List;
 @Getter
 @Setter
 public class RetrievalVO {
-    private List<Integer> type;
+    private Integer type;
     private Integer age;
     @NotNull(message = "请输入症状")
     private String InputStr;
     private Integer sexType;
     //需要去重的id
     private List<Long> inputIds;
+    //获取子项时需要用到的type类型
+    private Integer detilType;
 }

+ 135 - 145
aipt-service/src/main/resources/mapper/ConceptMapper.xml

@@ -188,123 +188,6 @@
 
     <select id="retrievalConcept" resultType="com.diagbot.dto.ConceptRetrievalDTO">
         SELECT a1.* from (
-        SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-        LEFT JOIN kl_relation t4 ON t4.end_id= t1.id
-        LEFT JOIN kl_concept t5 on t5.id = t4.start_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t4.is_deleted = 'N'
-        AND t5.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t2.is_concept = 1
-        <if test="type != null">
-            AND t1.lib_type in
-            <foreach item="type" collection="type" open="(" separator="," close=")">
-                #{type}
-            </foreach>
-        </if>
-        <if test="sexType == 3">
-        and t3.sex_type in ('1','2','3')
-        </if>
-        <if test="sexType != 3">
-            and t3.sex_type in ('3',#{sexType})
-        </if>
-        <if test="age != null and age != ''">
-        AND <![CDATA[ t3.min_age <= #{age} ]]>
-        AND <![CDATA[ t3.max_age >= #{age} ]]>
-        </if>
-        AND (t2.spell =  UPPER(#{InputStr}) OR t2.name =  #{InputStr})
-        <if test="inputIds != null and inputIds.size > 0">
-            and t1.id not in
-            <foreach item="id" collection="inputIds" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-        </if>
-        AND t4.relation_id = 18
-        UNION
-        SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-        LEFT JOIN kl_relation t4 ON t4.end_id= t1.id
-        LEFT JOIN kl_concept t5 on t5.id = t4.start_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t4.is_deleted = 'N'
-        AND t5.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t2.is_concept = 1
-        <if test="type != null">
-            AND t1.lib_type in
-            <foreach item="type" collection="type" open="(" separator="," close=")">
-                #{type}
-            </foreach>
-        </if>
-        <if test="sexType == 3">
-            and t3.sex_type in ('1','2','3')
-        </if>
-        <if test="sexType != 3">
-            and t3.sex_type in ('3',#{sexType})
-        </if>
-        <if test="age != null and age != ''">
-            AND <![CDATA[ t3.min_age <= #{age} ]]>
-            AND <![CDATA[ t3.max_age >= #{age} ]]>
-        </if>
-        AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
-        <if test="inputIds != null and inputIds.size > 0">
-            and t1.id not in
-            <foreach item="id" collection="inputIds" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-        </if>
-        AND t4.relation_id = 18
-        UNION
-        SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
-        LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
-        LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
-        LEFT JOIN kl_relation t4 ON t4.end_id= t1.id
-        LEFT JOIN kl_concept t5 on t5.id = t4.start_id
-        LEFT JOIN kl_lexicon t6 ON t6.id = t1.lib_type
-        WHERE
-        t1.is_deleted = 'N'
-        AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
-        AND t4.is_deleted = 'N'
-        AND t5.is_deleted = 'N'
-        AND t6.is_deleted = 'N'
-        AND t2.is_concept = 1
-        <if test="type != null">
-            AND t1.lib_type in
-            <foreach item="type" collection="type" open="(" separator="," close=")">
-                #{type}
-            </foreach>
-        </if>
-        <if test="sexType == 3">
-            and t3.sex_type in ('1','2','3')
-        </if>
-        <if test="sexType != 3">
-            and t3.sex_type in ('3',#{sexType})
-        </if>
-        <if test="age != null and age != ''">
-            AND <![CDATA[ t3.min_age <= #{age} ]]>
-            AND <![CDATA[ t3.max_age >= #{age} ]]>
-        </if>
-        AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
-        <if test="inputIds != null and inputIds.size > 0">
-            and t1.id not in
-            <foreach item="id" collection="inputIds" open="(" separator="," close=")">
-                #{id}
-            </foreach>
-        </if>
-        AND t4.relation_id = 18
-        UNION
         SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
         LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
         LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
@@ -312,23 +195,20 @@
         WHERE
         t1.is_deleted = 'N'
         AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
         AND t6.is_deleted = 'N'
         <if test="type != null">
-            AND t1.lib_type in
-            <foreach item="type" collection="type" open="(" separator="," close=")">
-                #{type}
-            </foreach>
+            AND t1.lib_type = #{type}
         </if>
         <if test="sexType == 3">
-        and t3.sex_type in ('1','2','3')
+            and (t3.sex_type in ('1','2','3') or t3.sex_type is null)
         </if>
         <if test="sexType != 3">
-            and t3.sex_type in ('3',#{sexType})
+            and (t3.sex_type in ('3',#{sexType}) or t3.sex_type is null)
         </if>
         <if test="age != null and age != ''">
-            AND <![CDATA[ t3.min_age <= #{age} ]]>
-            AND <![CDATA[ t3.max_age >= #{age} ]]>
+            AND (( <![CDATA[ t3.min_age <= #{age} ]]>
+            AND <![CDATA[ t3.max_age >= #{age} ]]>)
+            or (t3.min_age is null and t3.max_age is null))
         </if>
         <if test="inputIds != null and inputIds.size > 0">
             and t1.id not in
@@ -337,6 +217,7 @@
             </foreach>
         </if>
         AND (t2.spell =  UPPER(#{InputStr}) OR t2.name =  #{InputStr})
+        LIMIT 100
         UNION
         SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
         LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
@@ -345,23 +226,20 @@
         WHERE
         t1.is_deleted = 'N'
         AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
         AND t6.is_deleted = 'N'
         <if test="type != null">
-            AND t1.lib_type in
-            <foreach item="type" collection="type" open="(" separator="," close=")">
-                #{type}
-            </foreach>
+            AND t1.lib_type = #{type}
         </if>
         <if test="sexType == 3">
-            and t3.sex_type in ('1','2','3')
+            and (t3.sex_type in ('1','2','3') or t3.sex_type is null)
         </if>
         <if test="sexType != 3">
-            and t3.sex_type in ('3',#{sexType})
+            and (t3.sex_type in ('3',#{sexType}) or t3.sex_type is null)
         </if>
         <if test="age != null and age != ''">
-            AND <![CDATA[ t3.min_age <= #{age} ]]>
-            AND <![CDATA[ t3.max_age >= #{age} ]]>
+            AND (( <![CDATA[ t3.min_age <= #{age} ]]>
+            AND <![CDATA[ t3.max_age >= #{age} ]]>)
+            or (t3.min_age is null and t3.max_age is null))
         </if>
         <if test="inputIds != null and inputIds.size > 0">
             and t1.id not in
@@ -370,6 +248,7 @@
             </foreach>
         </if>
         AND (t2.spell LIKE CONCAT( UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
+        LIMIT 100
         UNION
         SELECT t1.id selfId,t1.lib_name selfName,0 parentId,null parentName,t2.`name` sameName,t2.is_concept showType,t1.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
         LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
@@ -378,23 +257,20 @@
         WHERE
         t1.is_deleted = 'N'
         AND t2.is_deleted = 'N'
-        AND t3.is_deleted = 'N'
         AND t6.is_deleted = 'N'
         <if test="type != null">
-            AND t1.lib_type in
-            <foreach item="type" collection="type" open="(" separator="," close=")">
-                #{type}
-            </foreach>
+            AND t1.lib_type = #{type}
         </if>
         <if test="sexType == 3">
-            and t3.sex_type in ('1','2','3')
+            and (t3.sex_type in ('1','2','3') or t3.sex_type is null)
         </if>
         <if test="sexType != 3">
-            and t3.sex_type in ('3',#{sexType})
+            and (t3.sex_type in ('3',#{sexType}) or t3.sex_type is null)
         </if>
         <if test="age != null and age != ''">
-            AND <![CDATA[ t3.min_age <= #{age} ]]>
-            AND <![CDATA[ t3.max_age >= #{age} ]]>
+            AND (( <![CDATA[ t3.min_age <= #{age} ]]>
+            AND <![CDATA[ t3.max_age >= #{age} ]]>)
+            or (t3.min_age is null and t3.max_age is null))
         </if>
         <if test="inputIds != null and inputIds.size > 0">
             and t1.id not in
@@ -403,7 +279,121 @@
             </foreach>
         </if>
         AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
+        LIMIT 100
+        <if test="detilType != null and detilType != ''">
+            UNION
+            SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
+            LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+            LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+            LEFT JOIN kl_relation t4 ON t4.end_id= t1.id
+            LEFT JOIN kl_concept t5 on t5.id = t4.start_id
+            LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
+            WHERE
+            t1.is_deleted = 'N'
+            AND t2.is_deleted = 'N'
+            AND t4.is_deleted = 'N'
+            AND t5.is_deleted = 'N'
+            AND t6.is_deleted = 'N'
+            AND t2.is_concept = 1
+            <if test="detilType != null">
+                AND t1.lib_type = #{detilType}
+            </if>
+            <if test="sexType == 3">
+                and (t3.sex_type in ('1','2','3') or t3.sex_type is null)
+            </if>
+            <if test="sexType != 3">
+                and (t3.sex_type in ('3',#{sexType}) or t3.sex_type is null)
+            </if>
+            <if test="age != null and age != ''">
+                AND (( <![CDATA[ t3.min_age <= #{age} ]]>
+                AND <![CDATA[ t3.max_age >= #{age} ]]>)
+                or (t3.min_age is null and t3.max_age is null))
+            </if>
+            AND (t2.spell =  UPPER(#{InputStr}) OR t2.name =  #{InputStr})
+            <if test="inputIds != null and inputIds.size > 0">
+                and t1.id not in
+                <foreach item="id" collection="inputIds" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
+            AND t4.relation_id = 18
+            LIMIT 100
+            UNION
+            SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
+            LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+            LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+            LEFT JOIN kl_relation t4 ON t4.end_id= t1.id
+            LEFT JOIN kl_concept t5 on t5.id = t4.start_id
+            LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
+            WHERE
+            t1.is_deleted = 'N'
+            AND t2.is_deleted = 'N'
+            AND t4.is_deleted = 'N'
+            AND t5.is_deleted = 'N'
+            AND t6.is_deleted = 'N'
+            AND t2.is_concept = 1
+            <if test="detilType != null">
+                AND t1.lib_type = #{detilType}
+            </if>
+            <if test="sexType == 3">
+                and (t3.sex_type in ('1','2','3') or t3.sex_type is null)
+            </if>
+            <if test="sexType != 3">
+                and (t3.sex_type in ('3',#{sexType}) or t3.sex_type is null)
+            </if>
+            <if test="age != null and age != ''">
+                AND (( <![CDATA[ t3.min_age <= #{age} ]]>
+                AND <![CDATA[ t3.max_age >= #{age} ]]>)
+                or (t3.min_age is null and t3.max_age is null))
+            </if>
+            AND (t2.spell LIKE CONCAT(UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT( #{InputStr},'%'))
+            <if test="inputIds != null and inputIds.size > 0">
+                and t1.id not in
+                <foreach item="id" collection="inputIds" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
+            AND t4.relation_id = 18
+            LIMIT 100
+            UNION
+            SELECT t1.id selfId,t1.lib_name selfName,t5.id parentId,t5.lib_name parentName,null sameName,t2.is_concept showType,t5.lib_type libTypeId,t6.`name` libTypeName FROM kl_concept t1
+            LEFT JOIN kl_library_info t2 ON t1.id = t2.concept_id
+            LEFT JOIN kl_concept_common t3 ON t1.id = t3.concept_id
+            LEFT JOIN kl_relation t4 ON t4.end_id= t1.id
+            LEFT JOIN kl_concept t5 on t5.id = t4.start_id
+            LEFT JOIN kl_lexicon t6 ON t6.id = t5.lib_type
+            WHERE
+            t1.is_deleted = 'N'
+            AND t2.is_deleted = 'N'
+            AND t4.is_deleted = 'N'
+            AND t5.is_deleted = 'N'
+            AND t6.is_deleted = 'N'
+            AND t2.is_concept = 1
+            <if test="detilType != null">
+                AND t1.lib_type = #{detilType}
+            </if>
+            <if test="sexType == 3">
+                and (t3.sex_type in ('1','2','3') or t3.sex_type is null)
+            </if>
+            <if test="sexType != 3">
+                and (t3.sex_type in ('3',#{sexType}) or t3.sex_type is null)
+            </if>
+            <if test="age != null and age != ''">
+                AND (( <![CDATA[ t3.min_age <= #{age} ]]>
+                AND <![CDATA[ t3.max_age >= #{age} ]]>)
+                or (t3.min_age is null and t3.max_age is null))
+            </if>
+            AND (t2.spell LIKE CONCAT('%',UPPER(#{InputStr}),'%') OR t2.name LIKE CONCAT('%',#{InputStr},'%'))
+            <if test="inputIds != null and inputIds.size > 0">
+                and t1.id not in
+                <foreach item="id" collection="inputIds" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
+            AND t4.relation_id = 18
+            LIMIT 100
+        </if>
         ) a1
-        GROUP BY a1.selfId,a1.showType
+        LIMIT 100
     </select>
 </mapper>

+ 3 - 1
icss-service/src/main/java/com/diagbot/dto/FeatureConceptDTO.java

@@ -12,5 +12,7 @@ import lombok.Setter;
 @Setter
 public class FeatureConceptDTO extends ConceptBaseDTO {
     private Integer libType;
+    private Integer type;
     private Long id;
-}
+    private Integer chronicLabel;//是否慢病复诊标志
+}

+ 5 - 1
icss-service/src/main/java/com/diagbot/facade/FeatureFacade.java

@@ -39,7 +39,11 @@ public class FeatureFacade {
         RespDTO<List<FeatureConceptDTO>> res = aiptServiceClient.symptomFeature(text);
         RespDTOUtil.respNGDealCover(res, "AI没有返回结果");
         List<FeatureConceptDTO> symptomFeatureList = res.data;
-        symptomFeatureList = addQuestionId(symptomFeatureList, ConceptTypeEnum.Symptom.getKey());
+        if (ListUtil.isNotEmpty(symptomFeatureList)) {
+            if (!symptomFeatureList.get(0).getChronicLabel().equals(1)) {
+                symptomFeatureList = addQuestionId(symptomFeatureList, ConceptTypeEnum.Symptom.getKey());
+            }
+        }
         return symptomFeatureList;
     }
 

+ 11 - 0
icss-service/src/main/java/com/diagbot/facade/QuestionUsualFacade.java

@@ -7,6 +7,7 @@ import com.diagbot.dto.QuestionUsualDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.QuestionTypeEnum;
 import com.diagbot.service.impl.QuestionUsualServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.ListUtil;
@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -75,6 +77,15 @@ public class QuestionUsualFacade extends QuestionUsualServiceImpl {
             }
             return questionUsualDTOList;
         }
+        //如何没有匹配到questionId就移除
+        Iterator<QuestionUsualDTO> questionUsualDTOIterator = questionUsualDTOList.iterator();
+        while (questionUsualDTOIterator.hasNext()){
+            if(questionUsualDTOIterator.next().getQuestionId() == null
+                    && questionUsualVO.getType().intValue() != QuestionTypeEnum.Pacs.getKey()
+                    && questionUsualVO.getType().intValue() != QuestionTypeEnum.Disease.getKey()){
+                questionUsualDTOIterator.remove();
+            }
+        }
         return questionUsualDTOList;
     }
 }

+ 17 - 2
icss-service/src/main/java/com/diagbot/facade/RetrievalFacade.java

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -49,10 +50,12 @@ public class RetrievalFacade {
         List<String> questionNames = new ArrayList<>();
         if (ListUtil.isNotEmpty(conceptInfos.data)) {
             for (ConceptRetrievalDTO conceptRetrievalDTO : conceptInfos.data) {
-                if (!questionNames.contains(conceptRetrievalDTO.getSameName())) {
+                if (!questionNames.contains(conceptRetrievalDTO.getSameName())
+                        && conceptRetrievalDTO.getSelfName() != null) {
                     questionNames.add(conceptRetrievalDTO.getSelfName());
                 }
-                if (!questionNames.contains(conceptRetrievalDTO.getParentName())) {
+                if (!questionNames.contains(conceptRetrievalDTO.getParentName())
+                        && conceptRetrievalDTO.getParentName() != null) {
                     questionNames.add(conceptRetrievalDTO.getParentName());
                 }
             }
@@ -74,6 +77,7 @@ public class RetrievalFacade {
                     if(null != questionInfoMap.get(conceptRetrievalDTO.getParentName())){//如果匹配到就添加questionId
                         retrievalDTO.setQuestionId(questionInfoMap.get(conceptRetrievalDTO.getParentName()).getId());
                     }
+                    retrievalDTO.setConceptId(conceptRetrievalDTO.getParentId());
                     retrievalDTO.setName(conceptRetrievalDTO.getParentName());
                     retrievalDTO.setRetrievalName(conceptRetrievalDTO.getSelfName());
                 } else {//parent为空时说明没有子项返回本体id
@@ -91,6 +95,17 @@ public class RetrievalFacade {
                 retrievalDTOS.add(retrievalDTO);
             }
         }
+        //如何没有匹配到questionId就移除
+        Iterator<RetrievalDTO> retrievalDTOIterator = retrievalDTOS.iterator();
+        while (retrievalDTOIterator.hasNext()){
+            RetrievalDTO retrievalDTO = new RetrievalDTO();
+            retrievalDTO = retrievalDTOIterator.next();
+                if(retrievalDTO.getQuestionId() == null
+                        && retrievalDTO.getType().intValue() != QuestionTypeEnum.Pacs.getKey()
+                        && retrievalDTO.getType().intValue() != QuestionTypeEnum.Disease.getKey()){
+                        retrievalDTOIterator.remove();
+                }
+        }
         return retrievalDTOS;
     }
 

+ 1 - 1
icss-service/src/main/java/com/diagbot/vo/RetrievalVO.java

@@ -16,7 +16,7 @@ import java.util.List;
 public class RetrievalVO {
 
     @NotNull(message = "请输入标签类型")
-    private List<Integer> type;
+    private Integer type;
     @NotNull(message = "请输入病人年龄")
     private Integer age;
     @NotNull(message = "请输入症状")

+ 18 - 1
knowledgeman-service/src/main/java/com/diagbot/enums/LexiconTypeEnum.java

@@ -60,7 +60,24 @@ public enum LexiconTypeEnum implements KeyedNamed {
     SIDE_EFFECTS(49,"不良反应"),
     CORE_INDICATORS(50,"核心指标"),
     TYPES_OF_DISEASE(51,"疾病类型(慢病|急诊)"),
-    PART_AREA(52,"部位区域");
+    PART_AREA(52,"部位区域"),
+    LOCATION_AREA(52,"部位区域"),
+    CHEMICAL_NAME_OF_DRUG(53,"药品化学名"),
+    DRUG_TRADE_NAMES(54,"药品商品名"),
+    HISTORY_OF_PAST_DISEASES(55,"既往疾病史"),
+    HISTORY_OF_TRAUMA(56,"外伤史"),
+    HISTORY_OF_SURGERY(57,"手术史"),
+    HISTORY_OF_BLOOD_TRANSFUSION(58,"输血史"),
+    INFECTIOUS_DISEASE_HISTORY(59,"传染病史"),
+    BAD_HABITS(60,"不良习惯"),
+    MARITAL_HISTORY(61,"冶游史"),
+    HISTORY_OF_MARRIAGE_AND_CHILDBEARING(62,"婚育史"),
+    BIRTH_HISTORY(63,"生育史"),
+    FAMILY_HISTORY(64,"家族史"),
+    FOOD_ALLERGY_HISTORY(65,"食物过敏史"),
+    HISTORY_OF_DRUG_ALLERGY(66,"药物过敏史"),
+    FAMILY_RELATED_INFECTIOUS_DISEASE_HISTORY(67,"家族相关传染病史");
+
 
     @Setter
     private Integer key;

+ 2 - 2
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -203,9 +203,9 @@ public class ConceptFacade extends ConceptServiceImpl {
                 relationQe.in("start_id", conceptIdList);
                 relationQe.eq(getAllForRelationVO.getRelationConceptId() != null, "end_id", getAllForRelationVO.getRelationConceptId());
                 reCouMap = relationFacade.list(relationQe).stream().collect(Collectors.groupingBy(Relation::getStartId, Collectors.counting()));
-            } else {
+            } else if(getAllForRelationVO.getRelationConceptId() != null) {
                 relationQe.in("end_id", conceptIdList);
-                relationQe.eq(getAllForRelationVO.getRelationConceptId() != null, "start_id", getAllForRelationVO.getRelationConceptId());
+                relationQe.eq("start_id", getAllForRelationVO.getRelationConceptId());
                 reCouMap = relationFacade.list(relationQe).stream().collect(Collectors.groupingBy(Relation::getEndId, Collectors.counting()));
             }
         }

+ 2 - 2
knowledgeman-service/src/main/resources/mapper/RelationMapper.xml

@@ -102,7 +102,7 @@
 		WHERE b.id IS NULL <!-- AND c.id IS NULL AND d.id IS NULL -->) t1
 		JOIN kl_concept t2 ON t1.start_id=t2.id
 		JOIN kl_concept t3 ON t1.end_id=t3.id
-		JOIN kl_lexicon t4 ON t3.lib_type=t4.id
+		JOIN kl_lexicon t4 ON t2.lib_type=t4.id
 		where t2.is_deleted='N' AND t3.is_deleted='N' AND t4.is_deleted='N'
 		GROUP BY t2.id) tab
 		where 1=1
@@ -136,7 +136,7 @@
 		WHERE c.id IS NULL) t1
 		JOIN kl_concept t2 ON t1.start_id=t2.id
 		JOIN kl_concept t3 ON t1.end_id=t3.id
-		JOIN kl_lexicon t4 ON t3.lib_type=t4.id
+		JOIN kl_lexicon t4 ON t2.lib_type=t4.id
 		LEFT JOIN kl_relation_order t5 ON t1.id=t5.t_relation_id
 		where t2.is_deleted='N' AND t3.is_deleted='N' AND t4.is_deleted='N'
 		GROUP BY t2.id) tab

+ 77 - 0
prec-service/src/main/java/com/diagbot/dto/EvaluatorCalDTO.java

@@ -0,0 +1,77 @@
+package com.diagbot.dto;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import com.diagbot.entity.PhysicalInfo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:56
+ */
+@ApiModel(value="儿童体质辨识--体质计算--接口出参")
+@Getter
+@Setter
+public class EvaluatorCalDTO{
+	
+    /**
+     * 平和体质转化分
+     */
+	 @ApiModelProperty(value="平和体质转化分")
+    private BigDecimal mildValue;
+	
+	/**
+     * 气虚体质转化分
+     */
+    @ApiModelProperty(value="气虚体质转化分")
+    private BigDecimal faintValue;
+
+    /**
+     * 湿滞体质转化分
+     */
+    @ApiModelProperty(value="湿滞体质转化分")
+    private BigDecimal wetValue;
+
+    /**
+     * 心肝火旺体质转化分
+     */
+    @ApiModelProperty(value="心肝火旺体质转化分")
+    private BigDecimal heartValue;
+
+    /**
+     * 积滞体质转化分
+     */
+    @ApiModelProperty(value="积滞体质转化分")
+    private BigDecimal stagnantValue;
+
+    /**
+     * 异禀体质转化分
+     */
+    @ApiModelProperty(value="异禀体质转化分")
+    private BigDecimal exceptValue;
+	
+    /**
+     * 体质结果
+     */
+	@ApiModelProperty(value="体质结果")
+    private String physicalRes;
+
+    /**
+     * 需要显示的体质逗号隔开
+     */
+	@ApiModelProperty(value="需要显示的体质逗号隔开")
+    private String physicalTypes;
+    
+	/**
+     * 体质结果基本信息列表
+     */
+	@ApiModelProperty(value="体质结果基本信息列表")
+    private List<PhysicalInfo> physicalInfoList;
+		
+}

+ 0 - 102
prec-service/src/main/java/com/diagbot/dto/SearchEvaluatorDTO.java

@@ -1,102 +0,0 @@
-package com.diagbot.dto;
-
-import com.diagbot.enums.SexEnum;
-import com.diagbot.util.ListUtil;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-
-/**
- * @Description:
- * @author: gaodm
- * @time: 2019/5/30 10:53
- */
-
-@Getter
-@Setter
-public class SearchEvaluatorDTO {
-    /**
-     * 主键
-     */
-    private Long id;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 姓名
-     */
-    private String name;
-
-    /**
-     * 手机号
-     */
-    private String phone;
-
-    /**
-     * 性别(1:男 2:女)
-     */
-    private Integer sex;
-
-    /**
-     * 性别名称(1:男 2:女)
-     */
-    private String sexName;
-
-    /**
-     * 年龄
-     */
-    private Integer age;
-
-    /**
-     * 平和体质转化分
-     */
-    private BigDecimal mildValue;
-
-    /**
-     * 气虚体质转化分
-     */
-    private BigDecimal faintValue;
-
-    /**
-     * 湿滞体质转化分
-     */
-    private BigDecimal wetValue;
-
-    /**
-     * 心肝火旺体质转化分
-     */
-    private BigDecimal heartValue;
-
-    /**
-     * 积滞体质转化分
-     */
-    private BigDecimal stagnantValue;
-
-    /**
-     * 异禀体质转化分
-     */
-    private BigDecimal exceptValue;
-
-    /**
-     * 体质结果
-     */
-    private String physicalRes;
-
-    /**
-     * 需要显示的体质逗号隔开
-     */
-    private String physicalTypes;
-
-    public String getSexName(){
-        return SexEnum.getName(this.getSex());
-    }
-
-    //体质显示列表
-    private List<PhysicalInfoDTO> physicalInfoDTOList = ListUtil.newArrayList();
-}

+ 1 - 1
prec-service/src/main/java/com/diagbot/entity/InquiryDetail.java

@@ -13,7 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
  * </p>
  *
  * @author gaodm
- * @since 2019-06-17
+ * @since 2019-06-20
  */
 @TableName("prec_inquiry_detail")
 public class InquiryDetail implements Serializable {

+ 1 - 53
prec-service/src/main/java/com/diagbot/entity/InquiryEvaluator.java

@@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
  * </p>
  *
  * @author gaodm
- * @since 2019-06-17
+ * @since 2019-06-20
  */
 @TableName("prec_inquiry_evaluator")
 public class InquiryEvaluator implements Serializable {
@@ -62,26 +62,6 @@ public class InquiryEvaluator implements Serializable {
      */
     private String hospitalCode;
 
-    /**
-     * 姓名
-     */
-    private String name;
-
-    /**
-     * 手机号
-     */
-    private String phone;
-
-    /**
-     * 性别(1:男 2:女)
-     */
-    private Integer sex;
-
-    /**
-     * 年龄
-     */
-    private Integer age;
-
     /**
      * 平和体质转化分
      */
@@ -178,34 +158,6 @@ public class InquiryEvaluator implements Serializable {
     public void setHospitalCode(String hospitalCode) {
         this.hospitalCode = hospitalCode;
     }
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-    public String getPhone() {
-        return phone;
-    }
-
-    public void setPhone(String phone) {
-        this.phone = phone;
-    }
-    public Integer getSex() {
-        return sex;
-    }
-
-    public void setSex(Integer sex) {
-        this.sex = sex;
-    }
-    public Integer getAge() {
-        return age;
-    }
-
-    public void setAge(Integer age) {
-        this.age = age;
-    }
     public BigDecimal getMildValue() {
         return mildValue;
     }
@@ -274,10 +226,6 @@ public class InquiryEvaluator implements Serializable {
         ", modifier=" + modifier +
         ", inquiryId=" + inquiryId +
         ", hospitalCode=" + hospitalCode +
-        ", name=" + name +
-        ", phone=" + phone +
-        ", sex=" + sex +
-        ", age=" + age +
         ", mildValue=" + mildValue +
         ", faintValue=" + faintValue +
         ", wetValue=" + wetValue +

+ 1 - 27
prec-service/src/main/java/com/diagbot/entity/InquiryInfo.java

@@ -13,7 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
  * </p>
  *
  * @author gaodm
- * @since 2019-06-17
+ * @since 2019-06-20
  */
 @TableName("prec_inquiry_info")
 public class InquiryInfo implements Serializable {
@@ -86,16 +86,6 @@ public class InquiryInfo implements Serializable {
      */
     private Integer type;
 
-    /**
-     * 诊断
-     */
-    private String diagnose;
-
-    /**
-     * 类型:0:结构化 1:文本模式
-     */
-    private Integer sign;
-
     /**
      * 内容JSON字符串
      */
@@ -197,20 +187,6 @@ public class InquiryInfo implements Serializable {
     public void setType(Integer type) {
         this.type = type;
     }
-    public String getDiagnose() {
-        return diagnose;
-    }
-
-    public void setDiagnose(String diagnose) {
-        this.diagnose = diagnose;
-    }
-    public Integer getSign() {
-        return sign;
-    }
-
-    public void setSign(Integer sign) {
-        this.sign = sign;
-    }
     public String getDataJson() {
         return dataJson;
     }
@@ -242,8 +218,6 @@ public class InquiryInfo implements Serializable {
         ", inquiryCode=" + inquiryCode +
         ", regVisitedState=" + regVisitedState +
         ", type=" + type +
-        ", diagnose=" + diagnose +
-        ", sign=" + sign +
         ", dataJson=" + dataJson +
         ", remark=" + remark +
         "}";

+ 1 - 1
prec-service/src/main/java/com/diagbot/entity/InquiryReport.java

@@ -13,7 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
  * </p>
  *
  * @author gaodm
- * @since 2019-06-17
+ * @since 2019-06-20
  */
 @TableName("prec_inquiry_report")
 public class InquiryReport implements Serializable {

+ 0 - 2
prec-service/src/main/java/com/diagbot/entity/PhysicalVal.java

@@ -3,8 +3,6 @@ package com.diagbot.entity;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.math.BigDecimal;
-
 /**
  * @Description:
  * @author: gaodm

+ 118 - 152
prec-service/src/main/java/com/diagbot/facade/InquiryEvaluatorFacade.java

@@ -1,35 +1,30 @@
 package com.diagbot.facade;
 
-import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 import java.util.stream.Collectors;
 
+import org.assertj.core.util.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.PhysicalInfoDTO;
-import com.diagbot.dto.SearchEvaluatorDTO;
+import com.diagbot.dto.EvaluatorCalDTO;
 import com.diagbot.entity.InquiryEvaluator;
 import com.diagbot.entity.InquiryInfo;
-import com.diagbot.entity.PhysicalInfo;
 import com.diagbot.entity.PhysicalVal;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.PhysicalTypeEnum;
-import com.diagbot.enums.SexEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.InquiryEvaluatorServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.ListUtil;
-import com.diagbot.util.RegexValidateUtil;
 import com.diagbot.vo.AddEvaluatorVO;
-import com.diagbot.vo.SearchEvaluatorVO;
+import com.diagbot.vo.EvaluatorCalVO;
 
 /**
  * @author: zhoutg
@@ -42,194 +37,165 @@ public class InquiryEvaluatorFacade extends InquiryEvaluatorServiceImpl {
 	@Autowired
     private InquiryInfoFacade inquiryInfoFacade;
 
-    public static void main(String[] args) {
-    	InquiryEvaluatorFacade inquiryEvaluatorFacade = new InquiryEvaluatorFacade();
+	/**
+	 * 儿童体质辨识--添加
+	 * @param addDeptInfoVO
+	 * @return
+	 */
+    public Boolean addEvaluator(AddEvaluatorVO addDeptInfoVO) {
+        QueryWrapper<InquiryInfo> inquiryInfoQe = new QueryWrapper<>();
+        inquiryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
+        inquiryInfoQe.eq("hospital_id", addDeptInfoVO.getHospitalId());
+        inquiryInfoQe.eq("hospital_dept_id", addDeptInfoVO.getHospitalDeptId());
+        inquiryInfoQe.eq("doctor_id", addDeptInfoVO.getDoctorId());
+        inquiryInfoQe.eq("patient_id", addDeptInfoVO.getPatientId());
+        inquiryInfoQe.eq("inquiry_code", addDeptInfoVO.getInquiryCode());
+        InquiryInfo inquiryInfo = inquiryInfoFacade.getOne(inquiryInfoQe);
+        
+        Date now = DateUtil.now();
+        
+        if(inquiryInfo==null){
+        	inquiryInfo = new InquiryInfo();
+        	inquiryInfo.setGmtCreate(now);
+        }
+        
+        BeanUtil.copyProperties(addDeptInfoVO, inquiryInfo);
+        inquiryInfo.setGmtModified(now);
+        inquiryInfoFacade.saveOrUpdate(inquiryInfo);
+        
+        EvaluatorCalVO evaluatorCalVO = new EvaluatorCalVO();
+        BeanUtil.copyProperties(addDeptInfoVO, evaluatorCalVO);
+        EvaluatorCalDTO evaluatorCalDTO = evaluatorCalPrav(evaluatorCalVO);
+
         InquiryEvaluator inquiryEvaluator = new InquiryEvaluator();
-        inquiryEvaluator.setMildValue(new BigDecimal(70.0)); // 平和体质
-        inquiryEvaluator.setFaintValue(new BigDecimal(50.0)); // 气虚体质
-        inquiryEvaluator.setStagnantValue(new BigDecimal(49.0)); // 积滞同质
-        inquiryEvaluator.setWetValue(new BigDecimal(31.0)); // 湿滞体质
-        inquiryEvaluator.setHeartValue(new BigDecimal(31.000)); // 心肝火旺体质
-        inquiryEvaluator.setExceptValue(new BigDecimal(22.01)); // 异禀体质
-        //inquiryEvaluatorFacade.valueSort(inquiryEvaluator);
-        inquiryEvaluatorFacade.cal(inquiryEvaluator);
+        BeanUtil.copyProperties(evaluatorCalDTO, inquiryEvaluator);
+        inquiryEvaluator.setInquiryId(inquiryInfo.getId());
+        inquiryEvaluator.setGmtCreate(now);
+        inquiryEvaluator.setGmtModified(now);
+        
+        if (!save(inquiryEvaluator)) {
+            throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "评估结果提交失败!");
+        }
+        
+        return true;
     }
-
-
+    
     /**
-     * 计算体质
-     *
-     * @param evaluator 参数
+     * 儿童体质辨识--体质计算
+     * @param evaluatorCalVO
      * @return
      */
-    public InquiryEvaluator cal(InquiryEvaluator evaluator) {
-
-        List<PhysicalVal> list = this.valueSort(evaluator);
-        Double max = list.get(0).getValue();
-        Double min = list.get(4).getValue();
-
-        if (max >= 50) {
+    public EvaluatorCalDTO evaluatorCal(EvaluatorCalVO evaluatorCalVO){
+    	EvaluatorCalDTO evaluatorCalDTO = evaluatorCalPrav(evaluatorCalVO);
+        evaluatorCalDTO.setPhysicalInfoList(Lists.newArrayList(physicalInfoFacade.listByIds(Arrays.asList(evaluatorCalDTO.getPhysicalTypes().split(",")).stream().map(i->Integer.parseInt(i)).collect(Collectors.toList()))));
+        return evaluatorCalDTO;
+    }
+    
+    /**
+     * 进行体质计算
+     * @param evaluatorCalVO
+     * @return
+     */
+    private EvaluatorCalDTO evaluatorCalPrav(EvaluatorCalVO evaluatorCalVO){
+    	List<PhysicalVal> physicalValList = valueSort(evaluatorCalVO);
+        Double max = physicalValList.get(0).getValue();
+        Double min = physicalValList.get(4).getValue();
+        
+        String physicalRes = null,physicalTypes=null;
+        if(max>=50){
             // 最大值有多个【是XX体质兼有XX体质】,最大值只有1个【是XX体质】
-            if (list.get(1).getValue() >= 50) {
-                evaluator.setPhysicalRes("是" +
-                        PhysicalTypeEnum.getName(list.get(0).getEnumNo())
-                        + "兼有" +
-                        PhysicalTypeEnum.getName(list.get(1).getEnumNo()));
-                evaluator.setPhysicalTypes("" + list.get(0).getEnumNo() + "," + list.get(1).getEnumNo());
-            } else {
-                evaluator.setPhysicalRes("是" +
-                        PhysicalTypeEnum.getName(list.get(0).getEnumNo()));
-                evaluator.setPhysicalTypes("" + list.get(0).getEnumNo());
+            if(physicalValList.get(1).getValue()>=50){
+            	physicalRes = "是" 
+            				+ PhysicalTypeEnum.getName(physicalValList.get(0).getEnumNo())
+            				+ "兼有" 
+            				+ PhysicalTypeEnum.getName(physicalValList.get(1).getEnumNo());
+            	physicalTypes = physicalValList.get(0).getEnumNo() 
+            				  + "," 
+            				  + physicalValList.get(1).getEnumNo();
+            }else{
+            	physicalRes = "是" + PhysicalTypeEnum.getName(physicalValList.get(0).getEnumNo());
+            	physicalTypes = String.valueOf(physicalValList.get(0).getEnumNo());
             }
-        } else if (max < 30) {
+        }else if(max<30){
             // 同时其他5种体质转化分均<30分, max[2/3/4/5/6] < 30
-            evaluator.setPhysicalRes("平和体质");
-            evaluator.setPhysicalTypes(String.valueOf(PhysicalTypeEnum.mild.getKey()));
-        } else {
-            if (evaluator.getMildValue().doubleValue() >= 60.0) {
-                if (max < 50 && min >= 30) {
+        	physicalRes = "平和体质";
+        	physicalTypes = String.valueOf(PhysicalTypeEnum.mild.getKey());
+        }else{
+            if(evaluatorCalVO.getMildValue().doubleValue()>=60.0){
+                if(max<50&&min>=30){
                     // 同时其他5种体质转化分均<50分,min[2/3/4/5/6] >= 30 and max[2/3/4/5/6] < 50
-                    evaluator.setPhysicalRes("基本是平和体质");
-                    evaluator.setPhysicalTypes(String.valueOf(PhysicalTypeEnum.mild.getKey()));
-                } else if (max < 50 && max >= 30 && min < 30) {
+                	physicalRes = "基本是平和体质";
+                	physicalTypes = String.valueOf(PhysicalTypeEnum.mild.getKey());
+                }else if(max<50&&max>=30&&min<30){
                     // 同时其他5种体质转化分有30-49分,max[2/3/4/5/6] < 50 and max[2/3/4/5/6] >= 30 and min[2/3/4/5/6] < 30
-                    evaluator.setPhysicalRes("基本是平和体质兼倾向" + PhysicalTypeEnum.getName(list.get(0).getEnumNo()));
-                    evaluator.setPhysicalTypes(String.valueOf(PhysicalTypeEnum.mild.getKey()) + "," + list.get(0).getEnumNo());
+                	physicalRes = "基本是平和体质兼倾向" + PhysicalTypeEnum.getName(physicalValList.get(0).getEnumNo());
+                	physicalTypes = PhysicalTypeEnum.mild.getKey() + "," + physicalValList.get(0).getEnumNo();
                 }
-            } else {
-                if (list.get(0).getValue().equals(list.get(1).getValue())) {
-                    evaluator.setPhysicalRes(
-                            "倾向是" +
-                                    PhysicalTypeEnum.getName(list.get(0).getEnumNo())
-                                    + "兼有" +
-                                    PhysicalTypeEnum.getName(list.get(1).getEnumNo()));
-                    evaluator.setPhysicalTypes("" + list.get(0).getEnumNo() + "," + list.get(1).getEnumNo());
-                } else {
-                    evaluator.setPhysicalRes("倾向是" +
-                            PhysicalTypeEnum.getName(list.get(0).getEnumNo()));
-                    evaluator.setPhysicalTypes("" + list.get(0).getEnumNo());
+            }else{
+                if(physicalValList.get(0).getValue().equals(physicalValList.get(1).getValue())){
+                	physicalRes = "倾向是" 
+                                + PhysicalTypeEnum.getName(physicalValList.get(0).getEnumNo())
+                                + "兼有" 
+                                + PhysicalTypeEnum.getName(physicalValList.get(1).getEnumNo());
+                	physicalTypes = physicalValList.get(0).getEnumNo() + "," + physicalValList.get(1).getEnumNo();
+                }else{
+                	physicalRes = "倾向是" + PhysicalTypeEnum.getName(physicalValList.get(0).getEnumNo());
+                	physicalTypes = String.valueOf(physicalValList.get(0).getEnumNo());
                 }
             }
         }
-        return evaluator;
+    	
+    	EvaluatorCalDTO evaluatorCalDTO = new EvaluatorCalDTO();
+    	BeanUtil.copyProperties(evaluatorCalVO, evaluatorCalDTO);
+    	evaluatorCalDTO.setPhysicalRes(physicalRes);
+        evaluatorCalDTO.setPhysicalTypes(physicalTypes);
+    	
+    	return evaluatorCalDTO;
     }
-
-
+    
     /**
      * 对偏颇体质排序
-     *
-     * @param evaluator
-     * @return 列表
+     * @param evaluatorCalVO
+     * @return
      */
-    private List<PhysicalVal> valueSort(InquiryEvaluator evaluator){
+    private List<PhysicalVal> valueSort(EvaluatorCalVO evaluatorCalVO){
         List<PhysicalVal> res = ListUtil.newArrayList();
         //气虚体质转化分
         PhysicalVal faintValue = new PhysicalVal();
-        faintValue.setValue(evaluator.getFaintValue().doubleValue());
+        faintValue.setValue(evaluatorCalVO.getFaintValue().doubleValue());
         faintValue.setEnumNo(PhysicalTypeEnum.faint.getKey());
         faintValue.setOrderNo(1);
         res.add(faintValue);
         //积滞体质转化分
         PhysicalVal stagnantValue = new PhysicalVal();
-        stagnantValue.setValue(evaluator.getStagnantValue().doubleValue());
+        stagnantValue.setValue(evaluatorCalVO.getStagnantValue().doubleValue());
         stagnantValue.setEnumNo(PhysicalTypeEnum.stagnant.getKey());
         stagnantValue.setOrderNo(2);
         res.add(stagnantValue);
         //湿滞体质转化分
         PhysicalVal wetValue = new PhysicalVal();
-        wetValue.setValue(evaluator.getWetValue().doubleValue());
+        wetValue.setValue(evaluatorCalVO.getWetValue().doubleValue());
         wetValue.setEnumNo(PhysicalTypeEnum.wet.getKey());
         wetValue.setOrderNo(3);
         res.add(wetValue);
         //心肝火旺体质转化分
         PhysicalVal heartValue = new PhysicalVal();
-        heartValue.setValue(evaluator.getHeartValue().doubleValue());
+        heartValue.setValue(evaluatorCalVO.getHeartValue().doubleValue());
         heartValue.setEnumNo(PhysicalTypeEnum.heart.getKey());
         heartValue.setOrderNo(4);
         res.add(heartValue);
         //异禀体质转化分
         PhysicalVal exceptValue = new PhysicalVal();
-        exceptValue.setValue(evaluator.getExceptValue().doubleValue());
+        exceptValue.setValue(evaluatorCalVO.getExceptValue().doubleValue());
         exceptValue.setEnumNo(PhysicalTypeEnum.except.getKey());
         exceptValue.setOrderNo(5);
         res.add(exceptValue);
 
-        List<PhysicalVal> collect
-                = res.stream()
-                .sorted(Comparator.comparing(PhysicalVal::getValue).reversed()
-                        .thenComparing(PhysicalVal::getOrderNo))
+        return res.stream()
+                .sorted(Comparator.comparing(PhysicalVal::getValue)
+                .reversed()
+                .thenComparing(PhysicalVal::getOrderNo))
                 .collect(Collectors.toList());
-        return collect;
     }
-
-    public Boolean addEvaluator(AddEvaluatorVO addDeptInfoVO) {
-        //参数验证
-        if (!RegexValidateUtil.checkMobileNumber(addDeptInfoVO.getPhone())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
-                    "请输入正确的手机号");
-        }
-        if (null == SexEnum.getName(addDeptInfoVO.getSex())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
-                    "请输入正确的性别类型");
-        }
-        
-        Date now = DateUtil.now();
-        
-        QueryWrapper<InquiryInfo> inquiryInfoQe = new QueryWrapper<>();
-        inquiryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
-        inquiryInfoQe.eq("hospital_id", addDeptInfoVO.getHospitalId());
-        inquiryInfoQe.eq("hospital_dept_id", addDeptInfoVO.getHospitalDeptId());
-        inquiryInfoQe.eq("doctor_id", addDeptInfoVO.getDoctorId());
-        inquiryInfoQe.eq("patient_id", addDeptInfoVO.getPatientId());
-        inquiryInfoQe.eq("inquiry_code", addDeptInfoVO.getInquiryCode());
-        InquiryInfo inquiryInfo = inquiryInfoFacade.getOne(inquiryInfoQe);
-        
-        if(inquiryInfo==null){
-        	inquiryInfo = new InquiryInfo();
-        	inquiryInfo.setGmtCreate(now);
-        }
-        
-        BeanUtil.copyProperties(addDeptInfoVO, inquiryInfo);
-        inquiryInfo.setGmtModified(now);
-        inquiryInfoFacade.saveOrUpdate(inquiryInfo);
-
-        InquiryEvaluator evaluator = new InquiryEvaluator();
-        BeanUtil.copyProperties(addDeptInfoVO, evaluator);
-        evaluator.setInquiryId(inquiryInfo.getId());
-        
-        //计算
-        this.cal(evaluator);
-
-        //保存结果
-        evaluator.setIsDeleted(IsDeleteEnum.N.getKey());
-        evaluator.setGmtCreate(now);
-        evaluator.setGmtModified(now);
-        Boolean res = this.save(evaluator);
-        if (!res) {
-            throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "评估结果提交失败!");
-        }
-        return res;
-    }
-
-    public IPage<SearchEvaluatorDTO> getEvaluatorPage(SearchEvaluatorVO searchEvaluatorVO) {
-        IPage<SearchEvaluatorDTO> res = this.baseMapper.getEvaluators(searchEvaluatorVO);
-        if (ListUtil.isNotEmpty(res.getRecords())) {
-            Map<String, PhysicalInfo> pMap = physicalInfoFacade.getPhysicalMap();
-
-            for (SearchEvaluatorDTO searchEvaluatorDTO : res.getRecords()) {
-                String[] physicalTypes = searchEvaluatorDTO.getPhysicalTypes().split(",");
-                List<PhysicalInfoDTO> physicalInfoDTOList = ListUtil.newArrayList();
-                for (String s : physicalTypes) {
-                    PhysicalInfoDTO physicalInfoDTO = new PhysicalInfoDTO();
-                    if (null != pMap.get(s)) {
-                        BeanUtil.copyProperties(pMap.get(s), physicalInfoDTO);
-                        physicalInfoDTOList.add(physicalInfoDTO);
-                    }
-                }
-                searchEvaluatorDTO.setPhysicalInfoDTOList(physicalInfoDTOList);
-            }
-        }
-        return res;
-    }
-
+    
 }

+ 6 - 2
prec-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -38,7 +38,11 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
     @Qualifier("inquiryReportServiceImpl")
     private InquiryReportServiceImpl inquiryReportServiceImpl;
 
-    
+    /**
+     * 问诊记录保存
+     * @param saveInquiryVO
+     * @return
+     */
 	public SaveInquiryDTO saveInquiry(SaveInquiryVO saveInquiryVO){
 		SaveInquiryDTO saveInquiryDTO = new SaveInquiryDTO();
         Date now = DateUtil.now();
@@ -67,7 +71,7 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         
         BeanUtil.copyProperties(saveInquiryVO, inquiryInfo);
         inquiryInfo.setGmtModified(now);
-        this.saveOrUpdate(inquiryInfo);
+        saveOrUpdate(inquiryInfo);
         
         Long inquiryId = inquiryInfo.getId();
         

+ 1 - 5
prec-service/src/main/java/com/diagbot/mapper/InquiryEvaluatorMapper.java

@@ -1,10 +1,7 @@
 package com.diagbot.mapper;
 
-import com.diagbot.dto.SearchEvaluatorDTO;
-import com.diagbot.entity.InquiryEvaluator;
-import com.diagbot.vo.SearchEvaluatorVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.InquiryEvaluator;
 
 /**
  * <p>
@@ -16,6 +13,5 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
  */
 public interface InquiryEvaluatorMapper extends BaseMapper<InquiryEvaluator> {
 	
-	IPage<SearchEvaluatorDTO> getEvaluators(SearchEvaluatorVO searchEvaluatorVO);
 
 }

+ 50 - 32
prec-service/src/main/java/com/diagbot/vo/AddEvaluatorVO.java

@@ -1,21 +1,23 @@
 package com.diagbot.vo;
 
-import lombok.Getter;
-import lombok.Setter;
+import java.math.BigDecimal;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 
-import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.validator.constraints.Range;
 
-import java.math.BigDecimal;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
 
 /**
  * @Description:
  * @author: gaodm
  * @time: 2019/5/30 10:53
  */
-
+@ApiModel(value="儿童体质辨识--添加--接口传参")
 @Getter
 @Setter
 public class AddEvaluatorVO {
@@ -26,6 +28,13 @@ public class AddEvaluatorVO {
 	@ApiModelProperty(value="医院id",required=true)
 	@NotNull(message="医院id必传")
     private Long hospitalId;
+	
+    /**
+     * 医院编码
+     */
+	@ApiModelProperty(value="医院编码",required=true)
+	@NotBlank(message="医院编码必传")
+    private String hospitalCode;
 
     /**
      * 科室id
@@ -55,63 +64,72 @@ public class AddEvaluatorVO {
 	@NotBlank(message="就诊序列号必传")
     private String inquiryCode;
 	
-    /**
-     * 姓名
-     */
-    @NotBlank(message = "请输入姓名")
-    private String name;
-
-    /**
-     * 手机号
-     */
-    @NotBlank(message = "请输手机号")
-    private String phone;
-
-    /**
-     * 性别(1:男 2:女)
+	/**
+     * 就诊状态(0待接诊,1接诊中,2完成接诊)
      */
-    @NotNull(message = "请输入性别")
-    private Integer sex;
+	@ApiModelProperty(value="就诊状态(0待接诊,1接诊中,2完成接诊)")
+	@Range(min=0,max=2,message="就诊状态必须是0、1、2")
+	private Integer regVisitedState=1;
 
     /**
-     * 年龄
+     * 病历分类(1:门诊,2:住院)
      */
-    @NotNull(message = "请输入年龄")
-    private Integer age;
-
-    /**
+	@ApiModelProperty(value="病历分类(1:门诊,2:住院)")
+	@Range(min=1,max=2,message="病历分类必须是1、2")
+    private Integer type=1;
+	
+	/**
      * 平和体质转化分
      */
-    @NotNull(message = "请输入平和体质转化分")
+	@ApiModelProperty(value="平和体质转化分",required=true)
+	@NotNull(message="平和体质转化分必传")
     private BigDecimal mildValue;
 
     /**
      * 气虚体质转化分
      */
-    @NotNull(message = "请输入气虚体质转化分")
+    @ApiModelProperty(value="气虚体质转化分",required=true)
+	@NotNull(message="气虚体质转化分必传")
     private BigDecimal faintValue;
 
     /**
      * 湿滞体质转化分
      */
-    @NotNull(message = "请输入湿滞体质转化分")
+    @ApiModelProperty(value="湿滞体质转化分",required=true)
+	@NotNull(message="湿滞体质转化分必传")
     private BigDecimal wetValue;
 
     /**
      * 心肝火旺体质转化分
      */
-    @NotNull(message = "请输入心肝火旺体质转化分")
+    @ApiModelProperty(value="心肝火旺体质转化分",required=true)
+	@NotNull(message="心肝火旺体质转化分必传")
     private BigDecimal heartValue;
 
     /**
      * 积滞体质转化分
      */
-    @NotNull(message = "请输入积滞体质转化分")
+    @ApiModelProperty(value="积滞体质转化分",required=true)
+	@NotNull(message="积滞体质转化分必传")
     private BigDecimal stagnantValue;
 
     /**
      * 异禀体质转化分
      */
-    @NotNull(message = "请输入异禀体质转化分")
+    @ApiModelProperty(value="异禀体质转化分",required=true)
+	@NotNull(message="异禀体质转化分必传")
     private BigDecimal exceptValue;
+    
+    /**
+     * 体质结果
+     */
+	@ApiModelProperty(value="体质结果")
+    private String physicalRes;
+
+    /**
+     * 需要显示的体质逗号隔开
+     */
+	@ApiModelProperty(value="需要显示的体质逗号隔开")
+    private String physicalTypes;
+	
 }

+ 65 - 0
prec-service/src/main/java/com/diagbot/vo/EvaluatorCalVO.java

@@ -0,0 +1,65 @@
+package com.diagbot.vo;
+
+import java.math.BigDecimal;
+
+import javax.validation.constraints.NotNull;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value="儿童体质辨识--体质计算--接口传参")
+@Getter
+@Setter
+public class EvaluatorCalVO {
+	
+    /**
+     * 平和体质转化分
+     */
+	@ApiModelProperty(value="平和体质转化分",required=true)
+	@NotNull(message="平和体质转化分必传")
+    private BigDecimal mildValue;
+
+    /**
+     * 气虚体质转化分
+     */
+    @ApiModelProperty(value="气虚体质转化分",required=true)
+	@NotNull(message="气虚体质转化分必传")
+    private BigDecimal faintValue;
+
+    /**
+     * 湿滞体质转化分
+     */
+    @ApiModelProperty(value="湿滞体质转化分",required=true)
+	@NotNull(message="湿滞体质转化分必传")
+    private BigDecimal wetValue;
+
+    /**
+     * 心肝火旺体质转化分
+     */
+    @ApiModelProperty(value="心肝火旺体质转化分",required=true)
+	@NotNull(message="心肝火旺体质转化分必传")
+    private BigDecimal heartValue;
+
+    /**
+     * 积滞体质转化分
+     */
+    @ApiModelProperty(value="积滞体质转化分",required=true)
+	@NotNull(message="积滞体质转化分必传")
+    private BigDecimal stagnantValue;
+
+    /**
+     * 异禀体质转化分
+     */
+    @ApiModelProperty(value="异禀体质转化分",required=true)
+	@NotNull(message="异禀体质转化分必传")
+    private BigDecimal exceptValue;
+	
+    
+}

+ 0 - 30
prec-service/src/main/java/com/diagbot/vo/SearchEvaluatorVO.java

@@ -1,30 +0,0 @@
-package com.diagbot.vo;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description:
- * @author: gaodm
- * @time: 2019/5/30 10:53
- */
-
-@Getter
-@Setter
-public class SearchEvaluatorVO extends Page {
-    /**
-     * 姓名
-     */
-    private String name;
-
-    /**
-     * 手机号
-     */
-    private String phone;
-
-    /**
-     * 性别(1:男 2:女)
-     */
-    private Integer sex;
-}

+ 10 - 32
prec-service/src/main/java/com/diagbot/web/InquiryEvaluatorController.java

@@ -9,14 +9,12 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.EvaluatorCalDTO;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.SearchEvaluatorDTO;
-import com.diagbot.entity.InquiryEvaluator;
 import com.diagbot.facade.InquiryEvaluatorFacade;
 import com.diagbot.vo.AddEvaluatorVO;
-import com.diagbot.vo.SearchEvaluatorVO;
+import com.diagbot.vo.EvaluatorCalVO;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -30,39 +28,19 @@ public class InquiryEvaluatorController {
     @Autowired
     private InquiryEvaluatorFacade inquiryEvaluatorFacade;
 
-    @ApiOperation(value = "儿童体质辨识--添加[by:gaodm]",
-            	  notes = "name: 姓名,必填<br>" +
-            			  "phone: 手机号,必填<br>" +
-            			  "sex: 性别(1:男 2:女),必填<br>" +
-            			  "age: 年龄,必填<br>" +
-            			  "mildValue: 平和体质转化分,必填<br>" +
-            			  "faintValue: 气虚体质转化分,必填<br>" +
-            			  "wetValue: 湿滞体质转化分,必填<br>" +
-            			  "heartValue: 心肝火旺体质转化分,必填<br>" +
-            			  "stagnantValue: 积滞体质转化分,必填<br>" +
-                    	  "exceptValue: 异禀体质转化分,必填")
+    @ApiOperation(value = "儿童体质辨识--添加")
     @PostMapping("/addEvaluator")
     @SysLogger("addEvaluator")
     @Transactional
-    public RespDTO<Boolean> addEvaluator(@RequestBody @Valid AddEvaluatorVO addDeptInfoVO){
+    public RespDTO<Boolean> addEvaluator(@Valid @RequestBody AddEvaluatorVO addDeptInfoVO){
         return RespDTO.onSuc(inquiryEvaluatorFacade.addEvaluator(addDeptInfoVO));
     }
 
-    @ApiOperation(value = "儿童体质辨识--获取分页信息[by:gaodm]",
-            	  notes = "name: 姓名<br>" +
-            			  "phone: 手机号<br>" +
-                    	  "sex: 性别(1:男 2:女)")
-    @PostMapping("/getEvaluatorPage")
-    @SysLogger("getEvaluatorPage")
-    public RespDTO<IPage<SearchEvaluatorDTO>> getEvaluatorPage(@RequestBody SearchEvaluatorVO searchEvaluatorVO){
-        return RespDTO.onSuc(inquiryEvaluatorFacade.getEvaluatorPage(searchEvaluatorVO));
-    }
-
-    @ApiOperation(value = "体质规则计算,测试使用", notes = "体质规则计算,测试使用")
-    @PostMapping("/cal2")
-    @SysLogger("cal2")
-    public RespDTO<String> cal2(@RequestBody InquiryEvaluator inquiryEvaluator) {
-    	inquiryEvaluatorFacade.cal(inquiryEvaluator);
-        return RespDTO.onSuc(inquiryEvaluator.getPhysicalRes());
+    @ApiOperation(value = "儿童体质辨识--体质计算")
+    @PostMapping("/evaluatorCal")
+    @SysLogger("evaluatorCal")
+    public RespDTO<EvaluatorCalDTO> evaluatorCal(@Valid @RequestBody EvaluatorCalVO evaluatorCalVO) {
+        return RespDTO.onSuc(inquiryEvaluatorFacade.evaluatorCal(evaluatorCalVO));
     }
+    
 }

+ 0 - 21
prec-service/src/main/resources/mapper/InquiryEvaluatorMapper.xml

@@ -12,10 +12,6 @@
         <result column="modifier" property="modifier" />
         <result column="inquiry_id" property="inquiryId" />
         <result column="hospital_code" property="hospitalCode" />
-        <result column="name" property="name" />
-        <result column="phone" property="phone" />
-        <result column="sex" property="sex" />
-        <result column="age" property="age" />
         <result column="mild_value" property="mildValue" />
         <result column="faint_value" property="faintValue" />
         <result column="wet_value" property="wetValue" />
@@ -26,22 +22,5 @@
         <result column="physical_types" property="physicalTypes" />
     </resultMap>
     
-    <select id="getEvaluators" resultType="com.diagbot.dto.SearchEvaluatorDTO">
-        SELECT
-        a.*
-        FROM prec_evaluator a
-        WHERE
-        a.is_deleted = 'N'
-        <if test="name != null and name != ''">
-            AND a.`name` LIKE CONCAT('%',#{name},'%')
-        </if>
-        <if test="phone != null and phone != ''">
-            AND a.`phone` LIKE CONCAT('%',#{phone},'%')
-        </if>
-        <if test="sex != null">
-            AND a.`sex` = #{sex}
-        </if>
-        ORDER BY a.gmt_create DESC
-    </select>
 
 </mapper>

+ 0 - 2
prec-service/src/main/resources/mapper/InquiryInfoMapper.xml

@@ -17,8 +17,6 @@
         <result column="inquiry_code" property="inquiryCode" />
         <result column="reg_visited_state" property="regVisitedState" />
         <result column="type" property="type" />
-        <result column="diagnose" property="diagnose" />
-        <result column="sign" property="sign" />
         <result column="data_json" property="dataJson" />
         <result column="remark" property="remark" />
     </resultMap>

+ 0 - 142
precman-service/src/main/java/com/diagbot/entity/User.java

@@ -1,142 +0,0 @@
-package com.diagbot.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 系统用户表
- * </p>
- *
- * @author gaodm
- * @since 2018-08-30
- */
-@TableName("sys_user")
-public class User 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;
-
-    /**
-     * 用户密码
-     */
-    private String password;
-
-    /**
-     * 用户名
-     */
-    private String username;
-
-
-    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 getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    @Override
-    public String toString() {
-        return "User{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", password=" + password +
-                ", username=" + username +
-                "}";
-    }
-}

+ 0 - 13
precman-service/src/main/java/com/diagbot/facade/SysLogFacade.java

@@ -1,13 +0,0 @@
-package com.diagbot.facade;
-
-import com.diagbot.service.impl.SysLogServiceImpl;
-import org.springframework.stereotype.Component;
-
-/**
- * @Description: 用户日志业务层
- * @author: gaodm
- * @time: 2018/8/6 9:11
- */
-@Component
-public class SysLogFacade extends SysLogServiceImpl {
-}

+ 0 - 16
precman-service/src/main/java/com/diagbot/mapper/SysLogMapper.java

@@ -1,16 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.diagbot.entity.SysLog;
-
-/**
- * <p>
- * Mapper 接口
- * </p>
- *
- * @author gaodm
- * @since 2018-08-02
- */
-public interface SysLogMapper extends BaseMapper<SysLog> {
-
-}

+ 0 - 15
precman-service/src/main/java/com/diagbot/service/SysLogService.java

@@ -1,15 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.SysLog;
-
-/**
- * <p>
- * 服务类
- * </p>
- *
- * @author gaodm
- * @since 2018-08-02
- */
-public interface SysLogService extends IService<SysLog> {
-}

+ 0 - 19
precman-service/src/main/java/com/diagbot/service/impl/SysLogServiceImpl.java

@@ -1,19 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.entity.SysLog;
-import com.diagbot.mapper.SysLogMapper;
-import com.diagbot.service.SysLogService;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author gaodm
- * @since 2018-08-02
- */
-@Service
-public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {
-}

+ 0 - 21
precman-service/src/main/java/com/diagbot/vo/SysLogVo.java

@@ -1,21 +0,0 @@
-package com.diagbot.vo;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.Date;
-
-/**
- * @Description:
- * @author: gaodm
- * @time: 2018/8/6 10:16
- */
-@Getter
-@Setter
-public class SysLogVo {
-    private Date createDate;
-    private String ip;
-    private String method;
-    private String operation;
-    private String params;
-}

+ 0 - 110
precman-service/src/main/java/com/diagbot/web/SysLogController.java

@@ -1,110 +0,0 @@
-package com.diagbot.web;
-
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.SysLog;
-import com.diagbot.facade.SysLogFacade;
-import com.diagbot.vo.SysLogVo;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-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 java.util.Date;
-
-/**
- * @Description: 日志操作控制层
- * @author: gaodm
- * @time: 2018/8/30 10:12
- */
-@RestController
-@RequestMapping("/log")
-public class SysLogController {
-
-    @Autowired
-    private SysLogFacade sysLogFacade;
-
-    /**
-     * 新增日志信息
-     *
-     * @param sysLogVo 新增日志输入参数
-     * @return 新增日志是否成功
-     */
-    @ApiOperation(value = "添加日志", notes = "添加日志")
-    @PostMapping("/add")
-    @SysLogger("postLog")
-    public RespDTO add(@RequestBody SysLogVo sysLogVo) {
-        //初始化新增日志信息
-        SysLog sysLog = new SysLog();
-        sysLog.setGmtCreate(new Date());
-        sysLog.setIp(sysLogVo.getIp());
-        sysLog.setMethod(sysLogVo.getMethod());
-        sysLog.setOperation(sysLogVo.getOperation());
-        sysLog.setParams(sysLogVo.getParams());
-        return RespDTO.onSuc(sysLogFacade.save(sysLog) ? "添加成功" : "添加失败");
-    }
-
-    /**
-     * 删除日志
-     *
-     * @param id 日志信息ID
-     * @return 删除是否成功
-     */
-    @ApiOperation(value = "删除日志", notes = "删除日志")
-    @DeleteMapping("/delete/{id}")
-    @SysLogger("deleteLog")
-    public RespDTO delete(@PathVariable(value = "id") Integer id) {
-        return RespDTO.onSuc(sysLogFacade.removeById(id) ? "删除成功" : "删除失败");
-    }
-
-    /**
-     * 修改日志
-     *
-     * @param sysLog 修改日志输入参数
-     * @return 修改是否成功
-     */
-    @ApiOperation(value = "修改日志", notes = "修改日志")
-    @PostMapping("/update")
-    @SysLogger("updateLog")
-    public RespDTO update(@RequestBody SysLog sysLog) {
-        return RespDTO.onSuc(sysLogFacade.updateById(sysLog) ? "修改成功" : "修改失败");
-    }
-
-    /**
-     * 获取日志列表
-     *
-     * @return 日志列信息
-     */
-    @ApiOperation(value = "获取日志列表", notes = "获取日志列表")
-    @GetMapping("/list")
-    @SysLogger("listLog")
-    public RespDTO list() {
-        Wrapper<SysLog> wrapper = new QueryWrapper<>();
-        return RespDTO.onSuc(sysLogFacade.list(wrapper));
-    }
-
-    /**
-     * 获取日志翻页信息
-     *
-     * @return 日志翻页信息
-     */
-    @ApiOperation(value = "获取日志翻页信息", notes = "获取日志翻页信息")
-    @GetMapping("/page")
-    @SysLogger("pageLog")
-    public RespDTO page() {
-        //初始化日志翻页参数
-        IPage<SysLog> wrapper = new Page<>();
-        return RespDTO.onSuc(sysLogFacade.page(wrapper, null));
-    }
-}
-

+ 0 - 22
precman-service/src/main/resources/mapper/SysLogMapper.xml

@@ -1,22 +0,0 @@
-<?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.SysLogMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysLog">
-        <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="ip" property="ip"/>
-        <result column="sys_type" property="sysType"/>
-        <result column="method" property="method"/>
-        <result column="operation" property="operation"/>
-        <result column="params" property="params"/>
-        <result column="username" property="username"/>
-    </resultMap>
-
-</mapper>