Browse Source

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

zhoutg 6 năm trước cách đây
mục cha
commit
e76908c8f4

+ 7 - 1
docs/006.20190304慢病基于icss增量脚本/init_icss_NCD.sql

@@ -1,6 +1,7 @@
 use `sys-icss`;
 
 DROP TABLE IF EXISTS `icss_vital_order`;
+DROP TABLE IF EXISTS `icss_lis_unique`;
 -- 周铁钢
 -- ----------------------------
 -- Table structure for icss_dictionary_info
@@ -263,10 +264,15 @@ INSERT INTO `icss_index_config` VALUES ('5', 'N', '1970-01-01 12:00:00', '1970-0
 alter table icss_module_info change  column disease module_type bigint(20) COMMENT '(0.通用 1.根据科室划分 2.慢病)';
 alter table icss_module_info add  column relation_id bigint(20) NOT NULL DEFAULT '0' COMMENT '关联id';
 ALTER TABLE `icss_module_info` MODIFY COLUMN `type`  varchar(20) NOT NULL DEFAULT 0 COMMENT '类型(1.主诉 2.现病史 3.其他史 4.查体 5.化验 6.辅检 7.诊断 8.医嘱 22.现病史空模板 31.主诉子模板 32.现病史子模板 322.现病史空模板子模板)' AFTER `name`;
+alter table icss_module_info modify column name VARCHAR(120);
 -- 修改普通模板的值
 UPDATE `icss_module_info` SET `module_type`='0',`relation_id`='0' WHERE (`id`='1');
 UPDATE `icss_module_info` SET `module_type`='0',`relation_id`='0' WHERE (`id`='2');
 UPDATE `icss_module_info` SET `type` = '32',`module_type`='0',`relation_id`='0' WHERE (`id`='3');
 UPDATE `icss_module_info` SET `module_type`='0',`relation_id`='0' WHERE (`id`='4');
 UPDATE `icss_module_info` SET `type` = '22',`module_type`='0',`relation_id`='0' WHERE (`id`='5');
-UPDATE `icss_module_info` SET `type` = '31',`module_type`='0',`relation_id`='0' WHERE (`id`='6');
+UPDATE `icss_module_info` SET `type` = '31',`module_type`='0',`relation_id`='0' WHERE (`id`='6');
+
+-- 赵佩诗
+-- 提示信息显示位置修改
+ALTER TABLE icss_introduce_detail MODIFY COLUMN `position` VARCHAR (11) DEFAULT '2' COMMENT '显示位置(多选):1-推送展示,2-更多展示,3-一般治疗展示,4-手术治疗展示,5-药品说明书,6-不良反应';

+ 1 - 1
icss-service/src/main/java/com/diagbot/enums/IntroducePositionEnum.java

@@ -14,7 +14,7 @@ public enum IntroducePositionEnum implements KeyedNamed {
     CommonTreatment(3, "一般治疗展示"),
     SurgeryTreatment(4, "手术治疗展示"),
     Drug(5, "药品说明书"),
-    Indication(6, "指标说明");
+    AdverseReaction(6, "不良反应");
 
     @Setter
     private Integer key;

+ 1 - 1
icssman-service/src/main/java/com/diagbot/enums/IntroducePositionEnum.java

@@ -14,7 +14,7 @@ public enum IntroducePositionEnum implements KeyedNamed {
     CommonTreatment(3, "一般治疗展示"),
     SurgeryTreatment(4, "手术治疗展示"),
     Drug(5, "药品说明书"),
-    Indication(6, "指标说明");
+    AdverseReaction(6, "不良反应");
 
     @Setter
     private Integer key;

+ 6 - 7
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -184,8 +184,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
     public List<ModuleInfoDTO> getModuleInfo(GetModuleInfoVO getModuleInfoVO) {
         //获取模板信息
         QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("relation_id", "-1");
+        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
         if (getModuleInfoVO.getModuleType() != null) {
             moduleInfoQueryWrapper.eq("module_type", getModuleInfoVO.getModuleType());
         }
@@ -281,7 +280,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
             //将用户信息放入实体
             for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
                 moduleInfoListDTO.setUserName(respDTO.data.get(moduleInfoListDTO.getModifier()));
-                if(moduleInfoListDTO.getModuleType().intValue() != 3){
+                if(dictionaryInfoMap.get(moduleInfoListDTO.getType()) != null ){
                     moduleInfoListDTO.setAscriptionName(dictionaryInfoMap.get(moduleInfoListDTO.getType()).getName());
                 }
                 if(moduleInfoListDTO.getModuleType().intValue() == 1){//根据科室
@@ -431,8 +430,8 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         if(getModuleTypeVO.getModuleType() != null && getModuleTypeVO.getModuleType().intValue() == 2){//为慢病时过滤现病史空模板、主诉模板、现病史空模板子模板
             dictionaryInfoQueryWrapper.notIn("val","1","22","31","322");
         }
-        if(getModuleTypeVO.getModuleType() != null && getModuleTypeVO.getModuleType().intValue() == 0 && getModuleTypeVO.getModuleType().intValue() == 1){//为通用或科室时过滤化验附件诊断
-            dictionaryInfoQueryWrapper.notIn("val","5","6","7");
+        if(getModuleTypeVO.getModuleType() != null && getModuleTypeVO.getModuleType().intValue() == 0 || getModuleTypeVO.getModuleType() != null && getModuleTypeVO.getModuleType().intValue() == 1){//为通用或科室时过滤化验附件诊断
+            dictionaryInfoQueryWrapper.notIn("val","4","5","6","7");
         }
         List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
         List<GetModuleTypeDTO> getModuleTypeDTOS = new ArrayList<>();
@@ -464,10 +463,10 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         List<DisDTO> disDTOS = new ArrayList<>();
         for (DisType disType: disTypes) {
             DisDTO disDTO = new DisDTO();
-            disDTO.setId(disType.getParentId());
+            disDTO.setId(disType.getDisId());
             disDTOS.add(disDTO);
         }
-        List<Long> questionIds = disTypes.stream().map(DisType::getParentId).collect(Collectors.toList());
+        List<Long> questionIds = disTypes.stream().map(DisType::getDisId).collect(Collectors.toList());
         QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
         questionInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
                 .in("id",questionIds);

+ 29 - 0
icssman-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -46,6 +46,7 @@ import com.diagbot.vo.GetQuestionIdsByTypeVO;
 import com.diagbot.vo.GetQuestionInfoVO;
 import com.diagbot.vo.GetQuestionUsualByDeptVO;
 import com.diagbot.vo.QuestionIdsVO;
+import com.diagbot.vo.QuestionIndexSubVO;
 import com.diagbot.vo.QuestionIndexVO;
 import com.diagbot.vo.QuestionPageVO;
 import com.diagbot.vo.QuestionSaveVO;
@@ -622,6 +623,34 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
         return null;
     }
 
+    /**
+     * 根据主标签id 检索子标签
+     * @param questionIndexSubVO
+     * @return
+     */
+    public List<QuestionInfo> indexSub(QuestionIndexSubVO questionIndexSubVO) {
+        Map<String, Object> paramMap = new HashMap<>();
+        paramMap.put("age", questionIndexSubVO.getAge());
+        paramMap.put("sexType", questionIndexSubVO.getSexType());
+        paramMap.put("tagName", questionIndexSubVO.getTagName());
+        paramMap.put("type", questionIndexSubVO.getType());
+        paramMap.put("controlType", questionIndexSubVO.getControlType());
+        paramMap.put("notIds", questionIndexSubVO.getNotIds());
+        paramMap.put("tagType", questionIndexSubVO.getTagType());
+        paramMap.put("existName", questionIndexSubVO.getExistName());
+        paramMap.put("notTagType", questionIndexSubVO.getNotTagType());
+        paramMap.put("notControlType", questionIndexSubVO.getNotControlType());
+
+        QueryWrapper<QuestionMapping> questionMappingQueryWrapper = new QueryWrapper<>();
+        questionMappingQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("parent_question", questionIndexSubVO.getParentId());
+        List<QuestionMapping> questionMappingList = questionMappingFacade.list(questionMappingQueryWrapper);
+        if (ListUtil.isNotEmpty(questionMappingList)) {
+            List<Long> sonIds = questionMappingList.stream().map(questionMapping -> questionMapping.getSonQuestion()).collect(Collectors.toList());
+            paramMap.put("ids", sonIds);
+        }
+        List<QuestionInfo> res = this.index(paramMap);
+        return res;
+    }
 
     /**
      * 获取特殊标签(同伴|无)

+ 18 - 0
icssman-service/src/main/java/com/diagbot/vo/QuestionIndexSubVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:检索标签子项
+ * @Author:zhaops
+ * @time: 2019/4/22 16:39
+ */
+@Getter
+@Setter
+public class QuestionIndexSubVO extends QuestionIndexVO {
+    @NotNull(message = "请输入父标签id")
+    private Long parentId;
+}

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

@@ -106,8 +106,8 @@ public class ModuleInfoController {
         return RespDTO.onSuc(date);
     }
 
-    @ApiOperation(value = "2期-获取模板信息(作为子模板使用时传入moduleType)[by:wangyu]",
-            notes = "moduleType: 模板类型,0.通用 1.根据科室划分 2.慢病 3.子模板<br>" +
+    @ApiOperation(value = "2期-获取模板信息(作为子模板使用时传入type时需3+模板自己的type)[by:wangyu]",
+            notes = "moduleType: 模板类型,0.通用 1.根据科室划分 2.慢病<br>" +
                     "<br>")
     @PostMapping("/getModuleInfo")
     @SysLogger("getModuleInfo")

+ 12 - 0
icssman-service/src/main/java/com/diagbot/web/QuestionInfoController.java

@@ -4,6 +4,7 @@ package com.diagbot.web;
 import java.util.List;
 import java.util.Map;
 
+import com.diagbot.vo.QuestionIndexSubVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -30,6 +31,8 @@ import com.diagbot.vo.QuestionVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
+import javax.validation.Valid;
+
 /**
  * <p>
  * 标签基础表 前端控制器
@@ -86,6 +89,15 @@ public class QuestionInfoController {
         return RespDTO.onSuc(data);
     }
 
+    @ApiOperation(value = "子标签检索[by:zhaops]",
+            notes = "")
+    @PostMapping("/indexSub")
+    @SysLogger("indexSub")
+    public RespDTO<List<QuestionInfo>> indexSub(@RequestBody @Valid  QuestionIndexSubVO questionIndexSubVO) {
+        List<QuestionInfo> data = questionFacade.indexSub(questionIndexSubVO);
+        return RespDTO.onSuc(data);
+    }
+
     @ApiOperation(value = "获取特殊标签(同伴|无)[by:zhoutg]",
             notes = "")
     @PostMapping("/getSpecial")

+ 27 - 4
icssman-service/src/main/resources/mapper/DisScaleMapper.xml

@@ -18,19 +18,42 @@
 
     <select id="getDisScaleInfo" resultType="com.diagbot.dto.GetDisScaleAllInfoDTO">
         SELECT
-        a.modifier,a.gmt_modified,a.id,a.dis_id,a.scale_id,b.`name` AS dis_name,c.`name` AS scale_name
+        t.id,
+        t.modifier,
+        t.gmt_modified,
+        t.dis_id,
+        t.scale_id,
+        t.dis_name,
+        GROUP_CONCAT(t.scale_name) scale_name
         FROM
-	      `icss_dis_scale` a
+        (
+        SELECT
+        a.modifier,
+        a.gmt_modified,
+        a.id,
+        a.dis_id,
+        a.scale_id,
+        b.`name` AS dis_name,
+        c.`name` AS scale_name
+        FROM
+        `icss_dis_scale` a
         LEFT JOIN icss_question_info b ON a.dis_id = b.id
         LEFT JOIN icss_question_info c ON a.scale_id = c.id
-        WHERE a.is_deleted = 'N' and b.is_deleted = 'N' and c.is_deleted = 'N'
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
         <if test="getDisScaleAllInfoVO.disName != null and getDisScaleAllInfoVO.disName != ''">
             and b.`name` LIKE CONCAT('%',#{getDisScaleAllInfoVO.disName},'%')
         </if>
         <if test="getDisScaleAllInfoVO.scaleName != null and getDisScaleAllInfoVO.scaleName != ''">
             and c.`name` LIKE CONCAT('%',#{getDisScaleAllInfoVO.scaleName},'%')
         </if>
-        ORDER BY a.gmt_modified DESC
+        ) t
+        GROUP BY
+        t.dis_name
+        ORDER BY
+        t.gmt_modified DESC
     </select>
 
 </mapper>

+ 6 - 0
icssman-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -94,6 +94,12 @@
                 #{id}
             </foreach>
         </if>
+        <if test=" ids != null and ids.size() > 0 ">
+            and id  in
+            <foreach  collection="ids" item="id" open="("  separator=","  close=")">
+                #{id}
+            </foreach>
+        </if>
         order by gmt_modified desc
     </select>