Browse Source

Merge branch 'develop' into dev/diagbotcloud20191024_pacs

gaodm 5 năm trước cách đây
mục cha
commit
c4dad7b482

+ 3 - 1
aipt-service/src/main/java/com/diagbot/dto/ConceptIntroduceDTO.java

@@ -13,6 +13,8 @@ import java.util.List;
  */
 @Getter
 @Setter
-public class ConceptIntroduceDTO extends ConceptBaseDTO{
+public class ConceptIntroduceDTO extends ConceptBaseDTO {
     private List<ConceptDetailDTO> details = ListUtil.newArrayList();
+    private Long libType;
+    private Integer type;
 }

+ 24 - 1
aipt-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java

@@ -19,6 +19,7 @@ import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ConceptBaseVO;
 import com.diagbot.vo.ConceptIntroduceVO;
 import com.diagbot.vo.ExistListByConceptIdsVO;
+import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -38,7 +39,7 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
     private ConceptFacade conceptFacade;
 
     /**
-     * 获取提示信息
+     * 单条获取静态知识
      *
      * @param conceptIntroduceVO
      * @return
@@ -82,10 +83,32 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
         ConceptIntroduceDTO conceptIntroduceDTO = new ConceptIntroduceDTO();
         conceptIntroduceDTO.setConceptId(concept.getId());
         conceptIntroduceDTO.setName(concept.getLibName());
+        conceptIntroduceDTO.setLibType(concept.getLibType());
+        conceptIntroduceDTO.setType(ParamConvertUtil.libConvert2Concept(concept.getLibType().intValue()));
         conceptIntroduceDTO.setDetails(conceptDetailDTOList);
         return conceptIntroduceDTO;
     }
 
+    /**
+     * 批量取静态知识
+     *
+     * @param conceptIntroduceVOList
+     * @return
+     */
+    public List<ConceptIntroduceDTO> getConceptDetails(List<ConceptIntroduceVO> conceptIntroduceVOList) {
+        List<ConceptIntroduceDTO> conceptIntroduceDTOList = Lists.newLinkedList();
+        if (ListUtil.isNotEmpty(conceptIntroduceVOList)) {
+            for (ConceptIntroduceVO conceptIntroduceVO : conceptIntroduceVOList) {
+                ConceptIntroduceDTO conceptIntroduceDTO = getConceptDetail(conceptIntroduceVO);
+                if (conceptIntroduceDTO != null) {
+                    conceptIntroduceDTOList.add(conceptIntroduceDTO);
+                }
+
+            }
+        }
+        return conceptIntroduceDTOList;
+    }
+
     /**
      * 是否存在提示信息
      *

+ 12 - 0
aipt-service/src/main/java/com/diagbot/web/ConceptDetailController.java

@@ -46,6 +46,18 @@ public class ConceptDetailController {
         return RespDTO.onSuc(data);
     }
 
+    @ApiOperation(value = "知识库标准化-批量获取提示信息[by:zhaops]",
+            notes = "name: 标签名称,必填<br>" +
+                    "titles: 标题,数组选填<br>" +
+                    "type:标签类型(1-症状,5-化验,6-辅检,7-诊断,8-药品,9-药品大类,10-不良反应,11-药品小类,12-化验公表项,22-指标),单选必填<br>" +
+                    "position:1-摘要,2-全文,5-药品说明书,6-不良反应,单选选填")
+    @PostMapping("/getConceptDetails")
+    @SysLogger("getConceptDetails")
+    public RespDTO<List<ConceptIntroduceDTO>> getConceptDetails(@Valid @RequestBody List<ConceptIntroduceVO> conceptIntroduceVOList) {
+        List<ConceptIntroduceDTO> data = conceptDetailFacade.getConceptDetails(conceptIntroduceVOList);
+        return RespDTO.onSuc(data);
+    }
+
     @ApiOperation(value = "知识库标准化-获取提示信息存在性[by:zhaops]",
             notes = "name: 标签名称,必填<br>" +
                     "type:标签类型(1-症状,5-化验,6-辅检,7-诊断,8-药品,9-药品大类,10-不良反应,11-药品小类,12-化验公表项,22-指标),单选必填<br>")

+ 9 - 0
data-service/src/main/java/com/diagbot/client/AiptServiceClient.java

@@ -79,6 +79,15 @@ public interface AiptServiceClient {
     @PostMapping(value = "/conceptDetail/getConceptDetail")
     RespDTO<ConceptIntroduceDTO> getConceptDetail(@Valid @RequestBody ConceptIntroduceVO conceptIntroduceVO);
 
+    /**
+     * 批量获取提示信息
+     *
+     * @param conceptIntroduceVOList
+     * @return
+     */
+    @PostMapping(value = "/conceptDetail/getConceptDetails")
+    RespDTO<List<ConceptIntroduceDTO>> getConceptDetails(@Valid @RequestBody List<ConceptIntroduceVO> conceptIntroduceVOList);
+
     /**
      * 获取版本信息
      */

+ 12 - 0
data-service/src/main/java/com/diagbot/client/hystrix/AiptServiceHystrix.java

@@ -97,6 +97,18 @@ public class AiptServiceHystrix implements AiptServiceClient {
         return null;
     }
 
+    /**
+     * 批量获取提示信息
+     *
+     * @param conceptIntroduceVOList
+     * @return
+     */
+    @Override
+    public RespDTO<List<ConceptIntroduceDTO>> getConceptDetails(@Valid @RequestBody List<ConceptIntroduceVO> conceptIntroduceVOList) {
+        log.error("【hystrix】调用{}异常", "getConceptDetails");
+        return null;
+    }
+
     /**
      * 获取版本信息
      */

+ 2 - 0
data-service/src/main/java/com/diagbot/dto/ConceptIntroduceDTO.java

@@ -14,4 +14,6 @@ import java.util.List;
 @Setter
 public class ConceptIntroduceDTO extends ConceptBaseDTO {
     private List<ConceptDetailDTO> details;
+    private Long libType;
+    private Integer type;
 }

+ 22 - 2
data-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java

@@ -8,6 +8,8 @@ import com.diagbot.vo.ConceptIntroduceVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
+
 /**
  * @Description:
  * @Author:zhaops
@@ -18,9 +20,27 @@ public class ConceptDetailFacade {
     @Autowired
     private AiptServiceClient aiptServiceClient;
 
+    /**
+     * 获取提示信息
+     *
+     * @param conceptIntroduceVO
+     * @return
+     */
     public ConceptIntroduceDTO getConceptDetail(ConceptIntroduceVO conceptIntroduceVO) {
         RespDTO<ConceptIntroduceDTO> res = aiptServiceClient.getConceptDetail(conceptIntroduceVO);
-        RespDTOUtil.respNGDeal(res, "获取提示信息失败");
+        RespDTOUtil.respNGDeal(res, "获取静态知识失败");
+        return res.data;
+    }
+
+    /**
+     * 批量获取提示信息
+     *
+     * @param conceptIntroduceVOList
+     * @return
+     */
+    public List<ConceptIntroduceDTO> getConceptDetails(List<ConceptIntroduceVO> conceptIntroduceVOList) {
+        RespDTO<List<ConceptIntroduceDTO>> res = aiptServiceClient.getConceptDetails(conceptIntroduceVOList);
+        RespDTOUtil.respNGDeal(res, "获取静态知识失败");
         return res.data;
     }
-}
+}

+ 17 - 0
data-service/src/main/java/com/diagbot/vo/ConceptIntorducesVO.java

@@ -0,0 +1,17 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/10/31 16:45
+ */
+@Getter
+@Setter
+public class ConceptIntorducesVO {
+    private List<ConceptIntroduceVO> conceptIntorduces;
+}

+ 16 - 1
data-service/src/main/java/com/diagbot/web/ConceptDetailController.java

@@ -4,6 +4,7 @@ import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.ConceptIntroduceDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.ConceptDetailFacade;
+import com.diagbot.vo.ConceptIntorducesVO;
 import com.diagbot.vo.ConceptIntroduceVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
+import java.util.List;
 
 /**
  * @Description:
@@ -39,4 +41,17 @@ public class ConceptDetailController {
         ConceptIntroduceDTO data = conceptDetailFacade.getConceptDetail(conceptIntroduceVO);
         return RespDTO.onSuc(data);
     }
-}
+
+    @ApiOperation(value = "批量获取提示信息[by:zhaops]",
+            notes = "conceptIntorduces:数组,必填<br>" +
+                    "name: 标签名称,必填<br>" +
+                    "type:标签类型(1-症状,5-化验,6-辅检,7-诊断,8-药品,9-药品大类,10-不良反应,11-药品小类,12-化验公表项,22-指标),单选必填<br>" +
+                    "titles:提示信息标题列表,数组选填<br>" +
+                    "position:1-摘要,2-全文,5-药品说明书,6-不良反应,单选选填")
+    @PostMapping("/getConceptDetails")
+    @SysLogger("getConceptDetails")
+    public RespDTO<List<ConceptIntroduceDTO>> getConceptDetails(@Valid @RequestBody ConceptIntorducesVO conceptIntorducesVO) {
+        List<ConceptIntroduceDTO> data = conceptDetailFacade.getConceptDetails(conceptIntorducesVO.getConceptIntorduces());
+        return RespDTO.onSuc(data);
+    }
+}