Browse Source

根据标签id获取标签内容

zhoutg 6 years ago
parent
commit
a93c834d2c

+ 6 - 5
icss-service/src/main/java/com/diagbot/dto/QuestionDTO.java

@@ -20,17 +20,18 @@ public class QuestionDTO {
     private Long id;// id
     private String name;//内容
     private String tagName;//标签名称
-    private Integer type;//类型(1:主诉 2:现病史 3:其他史 4:查体,5:化验 6:辅检 7:诊断)
+    private Integer type;//类型(1:症状 3:其他史 4:查体,5:化验 6:辅检 7:诊断)
     private Integer controlType; //控件类型
     private Integer subType; //子类型
-    private String tagType; //标签标识(0:单项  1:组合项 2:填充项)
+    private String tagType; //标签标识
     private String labelPrefix; //前置内容
     private String labelSuffix; //后置内容
     private BigDecimal minValue; //最小值
     private BigDecimal maxValue; //最大值
-    private Integer position;    //显示位置(0:在标签后,1:在标签前)
-    private Integer formPosition;  //填写单显示位置(0:左, 1:上)
-    private Integer textGenerate;    //显示位置(0:在标签后,1:在标签前)
+    private Integer position;    //标签显示位置(0:在标签后,1:在标签前)
+    private Integer showAdd;    //是否显示+
+    private Integer formPosition; //填写单显示位置(0:左, 1:上)
+    private Integer textGenerate;  //文本生成规则
     private Integer symptomType; //主症状和伴随症状对应的question类型
     private Integer exclusionType; //互斥类型
     private String judgeType; //判断类型(0:本身异常;1:本身正常;2:数字范围;3:计算公式;9:无需判断)

+ 13 - 0
icss-service/src/main/java/com/diagbot/entity/QuestionDetail.java

@@ -46,11 +46,22 @@ public class QuestionDetail implements Serializable {
      */
     private Long questionId;
 
+    /**
+     * question_relation
+     */
+    private Long questionRelation;
+
     /**
      * 排序号
      */
     private Integer orderNo;
 
+
+    /**
+     * 特殊类型
+     */
+    private Integer code;
+
     /**
      * 是否默认被选中(0:不选中,1:选中)
      */
@@ -62,4 +73,6 @@ public class QuestionDetail implements Serializable {
     private String remark;
 
 
+
+
 }

+ 5 - 0
icss-service/src/main/java/com/diagbot/entity/QuestionInfo.java

@@ -111,6 +111,11 @@ public class QuestionInfo implements Serializable {
      */
     private Integer textGenerate;
 
+    /**
+     * 是否显示 +
+     */
+    private Integer showAdd;
+
     /**
      * 备注
      */

+ 0 - 28
icss-service/src/main/java/com/diagbot/facade/ModuleDetailFacade.java

@@ -1,16 +1,8 @@
 package com.diagbot.facade;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.diagbot.dto.ModuleInfoDTO;
-import com.diagbot.entity.ModuleInfo;
-import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.ModuleDetailServiceImpl;
-import com.diagbot.util.BeanUtil;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * @Description: 模型明细务层
  * @author: zhoutg
@@ -20,24 +12,4 @@ import java.util.List;
 public class ModuleDetailFacade extends ModuleDetailServiceImpl {
 
 
-    /**
-     * 返回所有的模型结构
-     *
-     * @return 模型结构
-     */
-    public List<ModuleInfoDTO> getAll() {
-        List<ModuleInfoDTO> data = new ArrayList<>();
-        QueryWrapper queryWrapper = new QueryWrapper();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
-        List<ModuleInfo> list =  this.list(queryWrapper);
-        data = BeanUtil.listCopyTo(list, ModuleInfoDTO.class);
-        for(ModuleInfoDTO bean : data) {
-            QueryWrapper wrapper = new QueryWrapper();
-            wrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
-            wrapper.eq("module_id", bean.getId());
-            wrapper.orderByAsc("order_no");
-        }
-        return data;
-    }
-
 }

+ 18 - 5
icss-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -53,20 +53,33 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
             res.setQuestionDetailList(questionDetailList);
         }
 
-        //获取同级标签
-//        List<QuestionInfo> questionRelation = this.getByQuestionRelation(paramMap);
-//        List<QuestionDTO> questionRelationDTO = BeanUtil.listCopyTo(questionRelation, QuestionDTO.class);
-//        res.setQuestionRelationList(questionRelationDTO);
-
         //获取子标签
         List<QuestionInfoWrapper> questionMapping = this.getByQuestionMapping(paramMap);
         List<QuestionDTO> sonQuestionList = BeanUtil.listCopyTo(questionMapping, QuestionDTO.class);
         res.setQuestionMapping(sonQuestionList);
         //获取子标签的明细项
         if(ListUtil.isNotEmpty(sonQuestionList)) {
+            Map paramMap1 = new HashMap<>();
+            paramMap1.put("sexType", questionVO.getSexType());
+            paramMap1.put("age", questionVO.getAge());
+
             for(QuestionDTO bean : sonQuestionList) {
                 List<QuestionDetail> questionDetailList = questionDetailFacade.getByQuestionId(bean.getId());
                 bean.setQuestionDetailList(questionDetailList);
+                paramMap1.put("id", bean.getId());
+                //获取第二级子标签
+                List<QuestionInfoWrapper> questionMapping1 = this.getByQuestionMapping(paramMap1);
+                List<QuestionDTO> sonQuestionList1 = BeanUtil.listCopyTo(questionMapping1, QuestionDTO.class);
+                bean.setQuestionMapping(sonQuestionList1);
+
+                for(QuestionDTO questionDTO : sonQuestionList1) {
+                    //获取明细项
+                    if(ControlTypeEnum.EMPTY_TAG.getKey() != questionDTO.getControlType()) { //不为空标签
+                        List<QuestionDetail> questionDetailList1 = questionDetailFacade.getByQuestionId(questionDTO.getId());
+                        questionDTO.setQuestionDetailList(questionDetailList1);
+                    }
+                }
+
             }
         }
         return res;