浏览代码

Merge remote-tracking branch 'origin/debug' into debug

MarkHuang 6 年之前
父节点
当前提交
bc9a46d188
共有 19 个文件被更改,包括 84 次插入19 次删除
  1. 1 0
      icss-service/src/main/java/com/diagbot/dto/QuestionDTO.java
  2. 5 0
      icss-service/src/main/java/com/diagbot/entity/QuestionInfo.java
  3. 4 0
      icss-service/src/main/java/com/diagbot/vo/RetrievalVO.java
  4. 3 1
      icss-service/src/main/java/com/diagbot/web/RetrievalController.java
  5. 1 0
      icss-service/src/main/resources/mapper/QuestionInfoMapper.xml
  6. 18 0
      icss-service/src/main/resources/mapper/RetrievalMapper.xml
  7. 5 0
      icssman-service/src/main/java/com/diagbot/dto/GetModuleDetailInfoDTO.java
  8. 1 0
      icssman-service/src/main/java/com/diagbot/dto/QuestionDTO.java
  9. 2 0
      icssman-service/src/main/java/com/diagbot/dto/QuestionPageDTO.java
  10. 5 0
      icssman-service/src/main/java/com/diagbot/entity/QuestionInfo.java
  11. 1 0
      icssman-service/src/main/java/com/diagbot/entity/wrapper/QuestionWrapper.java
  12. 21 9
      icssman-service/src/main/java/com/diagbot/facade/ModuleDetailFacade.java
  13. 3 1
      icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java
  14. 2 0
      icssman-service/src/main/java/com/diagbot/vo/AddModuleInfoVO.java
  15. 3 0
      icssman-service/src/main/java/com/diagbot/vo/GetQuestionUsualByDeptVO.java
  16. 2 0
      icssman-service/src/main/java/com/diagbot/vo/QuestionUsualVO.java
  17. 3 2
      icssman-service/src/main/java/com/diagbot/web/ModuleInfoController.java
  18. 3 2
      icssman-service/src/main/resources/mapper/QuestionInfoMapper.xml
  19. 1 4
      icssman-service/src/main/resources/mapper/QuestionUsualMapper.xml

+ 1 - 0
icss-service/src/main/java/com/diagbot/dto/QuestionDTO.java

@@ -40,5 +40,6 @@ public class QuestionDTO {
     private String joint = "";     //标签后的连接符
     private List<QuestionDetail> questionDetailList = new ArrayList<>(); //标签明细表
     private List<QuestionDTO> questionMapping = new ArrayList<>();     //下级标签
+    private String formulaCode;     //公式编码
     private String remark;//备注
 }

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

@@ -115,6 +115,11 @@ public class QuestionInfo implements Serializable {
      */
     private String showAdd;
 
+    /**
+     * 公式编码
+     */
+    private String formulaCode;
+
     /**
      * 是否显示 i
      */

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

@@ -25,4 +25,8 @@ public class RetrievalVO {
     private Integer sexType;
     //需要去重的id
     private List<Long> inputIds;
+    //标签标识
+    private Integer tagType;
+    //元素类型
+    private Integer itemType;
 }

+ 3 - 1
icss-service/src/main/java/com/diagbot/web/RetrievalController.java

@@ -38,7 +38,9 @@ public class RetrievalController {
                     "age:年龄,必填<br>" +
                     "inputStr:检索内容,必填<br>" +
                     "sexType:性别,必填<br>" +
-                    "inputIds:需要去重的id")
+                    "inputIds:需要去重的id<br>" +
+                    "tagType: 标签标识<br>" +
+                    "itemType: 元素类型<br>")
     @PostMapping("/getTagInfos")
     @SysLogger("getTagInfos")
     public RespDTO<List<RetrievalDTO>> getTagInfos(@Valid @RequestBody RetrievalVO retrievalVO) {

+ 1 - 0
icss-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -24,6 +24,7 @@
         <result column="show_add" property="showAdd" />
         <result column="show_info" property="showInfo" />
         <result column="joint" property="joint" />
+        <result column="formula_code" property="formulaCode" />
         <result column="remark" property="remark" />
     </resultMap>
 

+ 18 - 0
icss-service/src/main/resources/mapper/RetrievalMapper.xml

@@ -26,6 +26,12 @@
             <![CDATA[ and c.age_begin <= #{age} ]]>
             <![CDATA[ and c.age_end >= #{age} ]]>
         </if>
+        <if test="tagType != null and tagType != ''">
+            <![CDATA[ and c.tag_type = #{tagType} ]]>
+        </if>
+        <if test="itemType != null">
+            <![CDATA[ and c.item_type = #{itemType} ]]>
+        </if>
         <if test="sexType == 3">
             and c.sex_type in ('1','2','3')
         </if>
@@ -49,6 +55,12 @@
             <![CDATA[ and c.age_begin <= #{age} ]]>
             <![CDATA[ and c.age_end >= #{age} ]]>
         </if>
+        <if test="tagType != null and tagType != ''">
+            <![CDATA[ and c.tag_type = #{tagType} ]]>
+        </if>
+        <if test="itemType != null">
+            <![CDATA[ and c.item_type = #{itemType} ]]>
+        </if>
         <if test="sexType == 3">
             and c.sex_type in ('1','2','3')
         </if>
@@ -72,6 +84,12 @@
             <![CDATA[ and c.age_begin <= #{age} ]]>
             <![CDATA[ and c.age_end >= #{age} ]]>
         </if>
+        <if test="tagType != null and tagType != ''">
+            <![CDATA[ and c.tag_type = #{tagType} ]]>
+        </if>
+        <if test="itemType != null">
+            <![CDATA[ and c.item_type = #{itemType} ]]>
+        </if>
         <if test="sexType == 3">
             and c.sex_type in ('1','2','3')
         </if>

+ 5 - 0
icssman-service/src/main/java/com/diagbot/dto/GetModuleDetailInfoDTO.java

@@ -32,6 +32,11 @@ public class GetModuleDetailInfoDTO {
      */
     private String tagName;
 
+    /**
+     * 标签类型
+     */
+    private Integer tagType;
+
     /**
      * 关联模板
      */

+ 1 - 0
icssman-service/src/main/java/com/diagbot/dto/QuestionDTO.java

@@ -38,6 +38,7 @@ public class QuestionDTO {
     private Integer copyType;//是否复制
     private Integer showInfo; //是否显示i
     private String joint = "";     //标签后的连接符
+    private String formulaCode; //公式编码
     private List<QuestionDetail> questionDetailList = new ArrayList<>(); //标签明细表
     private List<QuestionDTO> questionMapping = new ArrayList<>();     //下级标签
     private String remark;//备注

+ 2 - 0
icssman-service/src/main/java/com/diagbot/dto/QuestionPageDTO.java

@@ -158,6 +158,8 @@ public class QuestionPageDTO implements Serializable {
      */
     private String showAdd;
 
+    private String formulaCode; //公式编码
+
     /**
      * 备注
      */

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

@@ -155,6 +155,11 @@ public class QuestionInfo implements Serializable {
      */
     private String joint;
 
+    /**
+     * 公式编码
+     */
+    private String formulaCode;
+
     /**
      * 备注
      */

+ 1 - 0
icssman-service/src/main/java/com/diagbot/entity/wrapper/QuestionWrapper.java

@@ -41,6 +41,7 @@ public class QuestionWrapper implements Serializable {
     private String showAdd; //复制文字
     private Integer showInfo; //是否显示i
     private String joint;     //标签连接符
+    private String formulaCode; //公式编码
     private String remark; //备注
     private List<QuestionDetail> questionDetails = new ArrayList<>(); //明细
     private List<QuestionMappingWrapper> questionMappings = new ArrayList<>(); //映射关系

+ 21 - 9
icssman-service/src/main/java/com/diagbot/facade/ModuleDetailFacade.java

@@ -10,6 +10,7 @@ import com.diagbot.service.ModuleDetailService;
 import com.diagbot.service.QuestionInfoService;
 import com.diagbot.service.impl.ModuleDetailServiceImpl;
 import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.AddModuleDetailVO;
@@ -20,6 +21,7 @@ import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -90,20 +92,23 @@ public class ModuleDetailFacade extends ModuleDetailServiceImpl {
         QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
         questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("tag_type", TagTypeEnum.T8.getKey())
+                .eq("type", addModuleInfoVO.getTextType())
                 .in("name",textList);
         List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
         //将标签id放入map
-        Map<String,Long> questionIdMap = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getTagName,questionInfo -> questionInfo.getId()));
+        Map<String,Long> questionIdMap = new HashMap<>();
+        for (AddModuleDetailVO addModuleDetailVO: addModuleInfoVO.getModelDetils()) {
+            if(StringUtil.isNotEmpty(addModuleDetailVO.getText())){
+                questionIdMap = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getTagName,questionInfo -> questionInfo.getId()));
+            }
+        }
         QuestionInfo addquestionInfo = null;
         List<QuestionInfo> addQuestionInfoList = new ArrayList<>();
-        /*for (QuestionInfo questionInfo:questionInfoList) {
-            questionIdMap.put(questionInfo.getTagName(),questionInfo.getId());
-        }*/
         //循环给questionId赋值,如果遇到赋值失败的则是没有questionID,执行添加
         for (AddModuleDetailVO addModuleDetailVO:addModuleInfoVO.getModelDetils()) {
             if (StringUtil.isNotEmpty(addModuleDetailVO.getText())){
                 addModuleDetailVO.setQuestionId(questionIdMap.get(addModuleDetailVO.getText()));
-                if(addModuleDetailVO.getQuestionId() == null){
+                if(addModuleDetailVO.getQuestionId() == null && addModuleDetailVO.getText() != null){
                     addquestionInfo = new QuestionInfo();
                     addquestionInfo.setModifier(userId);
                     addquestionInfo.setCreator(userId);
@@ -112,10 +117,12 @@ public class ModuleDetailFacade extends ModuleDetailServiceImpl {
                     addquestionInfo.setTagType(TagTypeEnum.T8.getKey());
                     addquestionInfo.setTagName(addModuleDetailVO.getText());
                     addquestionInfo.setName(addModuleDetailVO.getText());
-                    addquestionInfo.setType(addModuleInfoVO.getType());
+                    addquestionInfo.setType(addModuleInfoVO.getTextType());
                     addquestionInfo.setSubType(1);
                     addquestionInfo.setName(addModuleDetailVO.getText());
-                    addQuestionInfoList.add(addquestionInfo);
+                    if(!addQuestionInfoList.contains(addquestionInfo)){
+                        addQuestionInfoList.add(addquestionInfo);
+                    }
                 }
             }
         }
@@ -123,10 +130,15 @@ public class ModuleDetailFacade extends ModuleDetailServiceImpl {
         //查询自定义标签的id
         QueryWrapper<QuestionInfo> questionInfoQueryWrapper1 = new QueryWrapper<>();
         questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("type", addModuleInfoVO.getTextType())
                 .eq("tag_type", TagTypeEnum.T8.getKey());
         List<QuestionInfo> questionInfoList1 = questionFacade.list(questionInfoQueryWrapper1);
-        for (QuestionInfo questionInfo:questionInfoList1) {
-            questionIdMap.put(questionInfo.getTagName(),questionInfo.getId());
+        if(ListUtil.isNotEmpty(questionInfoList1)){
+            for (QuestionInfo questionInfo:questionInfoList1) {
+                if(StringUtil.isNotEmpty(questionInfo.getTagName())){
+                    questionIdMap.put(questionInfo.getTagName(),questionInfo.getId());
+                }
+            }
         }
         //二次赋值保证每一个questionId都有值
         ModuleDetail moduleDetail = null;

+ 3 - 1
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -106,6 +106,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         moduleInfo.setModifier(userId);
         moduleInfo.setGmtCreate(now);
         moduleInfo.setGmtModified(now);
+        moduleInfo.setType(addModulInfoVO.getType());
         this.save(moduleInfo);
         Long moduleId = moduleInfo.getId();
         return moduleDetailFacade.saveOrUpdateInfos(addModulInfoVO, moduleId);
@@ -256,8 +257,9 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
             BeanUtil.copyProperties(moduleDetail, getModuleDetailInfoDTO);
             if (moduleDetail.getQuestionId() != null) {
                 getModuleDetailInfoDTO.setTagName(questionInfoMap.get(moduleDetail.getQuestionId()).getTagName());
+                getModuleDetailInfoDTO.setTagType(questionInfoMap.get(moduleDetail.getQuestionId()).getTagType());
             } else {
-                getModuleDetailInfoDTO.setRelationModuleName(moduleInfoMap.get(moduleDetail.getModuleId()).getName());
+                getModuleDetailInfoDTO.setRelationModuleName(moduleInfoMap.get(moduleDetail.getRelationModule()).getName());
             }
             getModuleDetailInfoDTOList.add(getModuleDetailInfoDTO);
         }

+ 2 - 0
icssman-service/src/main/java/com/diagbot/vo/AddModuleInfoVO.java

@@ -18,6 +18,8 @@ public class AddModuleInfoVO {
     private String name;
     @NotNull(message="模板类型")
     private int type;
+    //特殊标签归属类型
+    private Integer textType;
     //标签id
     private List<AddModuleDetailVO> modelDetils;
 }

+ 3 - 0
icssman-service/src/main/java/com/diagbot/vo/GetQuestionUsualByDeptVO.java

@@ -15,4 +15,7 @@ import javax.validation.constraints.NotNull;
 public class GetQuestionUsualByDeptVO {
     @NotNull(message = "请输入科室id")
     private Long deptId;
+
+    @NotNull(message = "请输入标签类型")
+    private Integer type;
 }

+ 2 - 0
icssman-service/src/main/java/com/diagbot/vo/QuestionUsualVO.java

@@ -18,4 +18,6 @@ public class QuestionUsualVO {
     private Long deptId;
     @NotNull(message = "请输入症状id")
     private List<Long> questionId;
+    @NotNull(message = "请输入标签类型")
+    private Integer type;
 }

+ 3 - 2
icssman-service/src/main/java/com/diagbot/web/ModuleInfoController.java

@@ -53,7 +53,8 @@ public class ModuleInfoController {
                     "questionId: 标签id,不是标点符号时需要填写<br>" +
                     "flag: 特殊标示类型<br>" +
                     "relationModule: 关联模板id<br>" +
-                    "text: 特殊标签(如逗号句号)")
+                    "text: 特殊标签(如逗号句号)<br>" +
+                    "textType: 特殊标签归属类型")
     @PostMapping("/saveModuleInfo")
     @SysLogger("saveModuleInfo")
     @Transactional
@@ -118,7 +119,7 @@ public class ModuleInfoController {
         return RespDTO.onSuc(date);
     }
 
-    @ApiOperation(value = "获取模板明细信息——修改获取已添加过的标签[by:wangyu]",
+    @ApiOperation(value = "获取模板明细信息——修改获取已添加过的标签[by:wangyu]",
             notes = "moduleId: 模板id<br>" +
                     "<br>")
     @PostMapping("/getModuleDetailInfo")

+ 3 - 2
icssman-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -29,6 +29,7 @@
         <result column="show_add" property="showAdd" />
         <result column="show_info" property="showInfo" />
         <result column="joint" property="joint" />
+        <result column="formula_code" property="formulaCode" />
         <result column="remark" property="remark" />
     </resultMap>
 
@@ -53,7 +54,7 @@
         <if test="existName != null and existName != ''">
             and tag_name = #{existName}
         </if>
-        <if test="sexType != null and sexType != ''">
+        <if test="sexType != null and sexType != 3 and sexType != ''">
             and sex_type in (3, #{sexType})
         </if>
         <if test="age != null and age != ''">
@@ -174,7 +175,7 @@
     <select id="getQuestionUsualsByDept" resultType="com.diagbot.dto.GetQuestionInfoDTO">
         SELECT a.* FROM `icss_question_info` a
         LEFT JOIN icss_question_usual b ON a.id = b.question_id
-        WHERE b.dept_id = #{deptId}
+        WHERE b.dept_id = #{deptId} AND a.type = #{type}
         GROUP BY a.id
     </select>
 

+ 1 - 4
icssman-service/src/main/resources/mapper/QuestionUsualMapper.xml

@@ -17,10 +17,7 @@
     </resultMap>
 
     <select id="getQuestionUsualByQuestionId" resultType="com.diagbot.entity.QuestionUsual">
-        SELECT a.* FROM `icss_question_usual` a WHERE a.is_deleted = 'N' AND a.dept_id = #{questionUsualVO.deptId} AND a.question_id in
-        <foreach item="questionId" collection="questionUsualVO.questionId" open="(" separator="," close=")">
-            #{questionId}
-        </foreach>
+        SELECT a.* FROM `icss_question_usual` a WHERE a.is_deleted = 'N' AND a.dept_id = #{questionUsualVO.deptId} AND a.type = #{type}
     </select>
 
     <select id="getQuestionUsualByDeptIds" resultType="com.diagbot.dto.GetQuestionUsualAndTypeDTO">