Browse Source

收藏医学知识(静态知识)检索和收藏医学知识(静态知识)/经典病例后端接口11.1

xiewei 7 months ago
parent
commit
a1a0df2582

+ 26 - 0
src/main/java/com/diagbot/client/CdssCoreClient.java

@@ -70,6 +70,15 @@ public interface CdssCoreClient {
     @PostMapping("/retrieval/staticKnowledgeIndex")
     RespDTO<List<StaticKnowledgeIndexDTO>> staticKnowledgeIndex(@RequestBody @Valid StaticKnowledgeIndexVO staticKnowledgeIndexVO);
 
+    /**
+     * 收藏静态知识检索
+     *
+     * @param
+     * @return
+     */
+    @PostMapping("/retrieval/collectionStaticKnowledgeIndex")
+    RespDTO<List<StaticKnowledgeIndexDTO>> collectionStaticKnowledgeIndex();
+
     /**
      * 经典病例检索
      *
@@ -79,6 +88,23 @@ public interface CdssCoreClient {
     @PostMapping("/retrieval/classicCaseIndex")
     RespDTO<List<ClassicCaseIndexDTO>> classicCaseIndex(@RequestBody @Valid StaticKnowledgeIndexVO staticKnowledgeIndexVO);
 
+    /**
+     * 收藏经典病例检索
+     *
+     * @param
+     * @return
+     */
+    @PostMapping("/retrieval/collectionClassicCaseIndex")
+    public RespDTO<List<ClassicCaseIndexDTO>> collectionClassicCaseIndex();
+
+    /**
+     * 收藏医学知识(静态知识)/经典病例
+     * @param staticKnowledgeAndClassicCaseVO
+     * @return
+     */
+    @PostMapping("/retrieval/collectionStaticKnowledgeAndClassicCase")
+    public Boolean collectionStaticKnowledgeAndClassicCase(@Valid @RequestBody StaticKnowledgeAndClassicCaseVO staticKnowledgeAndClassicCaseVO);
+
     /**
      * 术语关联医学术语检索
      *

+ 20 - 0
src/main/java/com/diagbot/client/hystrix/CdssCoreHystrix.java

@@ -7,6 +7,7 @@ import com.diagbot.entity.KlRuleMenuWrapper;
 import com.diagbot.vo.*;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.validation.Valid;
@@ -90,6 +91,7 @@ public class CdssCoreHystrix implements CdssCoreClient {
         return null;
     }
 
+
     /**
      * 经典病例检索
      *
@@ -431,4 +433,22 @@ public class CdssCoreHystrix implements CdssCoreClient {
         log.error("【hystrix】调用{}异常", "getRuleDetail");
         return null;
     }
+
+    @Override
+    public RespDTO<List<StaticKnowledgeIndexDTO>> collectionStaticKnowledgeIndex() {
+        log.error("【hystrix】调用{}异常", "collectionStaticKnowledgeIndex");
+        return null;
+    }
+
+    @Override
+    public RespDTO<List<ClassicCaseIndexDTO>> collectionClassicCaseIndex(){
+        log.error("【hystrix】调用{}异常", "collectionClassicCaseIndex");
+        return null;
+    }
+
+    @Override
+    public Boolean collectionStaticKnowledgeAndClassicCase(@Valid @RequestBody StaticKnowledgeAndClassicCaseVO staticKnowledgeAndClassicCaseVO){
+        log.error("【hystrix】调用{}异常", "collectionStaticKnowledgeAndClassicCase");
+        return null;
+    }
 }

+ 2 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -98,6 +98,8 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/demo/retrieval/index").permitAll()
                 .antMatchers("/demo/retrieval/diseaseIndex").permitAll()
                 .antMatchers("/kl/conceptInfo/staticKnowledgeIndex").permitAll()
+                .antMatchers("/kl/conceptInfo/collectionStaticKnowledgeIndex").permitAll()
+                .antMatchers("/kl/conceptInfo/collectionStaticKnowledgeAndClassicCase").permitAll()
                 .antMatchers("/kl/conceptInfo/staticKnowledgeIndexWithoutInfo").permitAll()
                 .antMatchers("/kl/conceptInfo/classicCaseIndexWithoutInfo").permitAll()
                 .antMatchers("/kl/conceptInfo/getStaticKnowledge").permitAll()

+ 2 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -140,6 +140,8 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/demo/retrieval/index", request)
                 || matchers("/demo/retrieval/diseaseIndex", request)
                 || matchers("/kl/conceptInfo/staticKnowledgeIndex", request)
+                || matchers("/kl/conceptInfo/collectionStaticKnowledgeIndex", request)
+                || matchers("/kl/conceptInfo/collectionStaticKnowledgeAndClassicCase", request)
                 || matchers("/kl/conceptInfo/staticKnowledgeIndexWithoutInfo", request)
                 || matchers("/kl/conceptInfo/classicCaseIndexWithoutInfo", request)
                 || matchers("/kl/conceptInfo/getStaticKnowledge", request)

+ 6 - 0
src/main/java/com/diagbot/dto/ClassicCaseIndexDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -39,4 +40,9 @@ public class ClassicCaseIndexDTO {
      * 启用禁用
      */
     private Integer status;
+
+    /**
+     * 收藏状态:0-未收藏,1-已收藏
+     */
+    private Integer collectionStatus = 0;
 }

+ 5 - 0
src/main/java/com/diagbot/dto/StaticKnowledgeIndexDTO.java

@@ -1,5 +1,6 @@
 package com.diagbot.dto;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -72,4 +73,8 @@ public class StaticKnowledgeIndexDTO {
      */
     private Integer status;
 
+    /**
+     * 收藏状态:0-未收藏,1-已收藏
+     */
+    private Integer collectionStatus = 0;
 }

+ 42 - 0
src/main/java/com/diagbot/facade/KlConceptStaticFacade.java

@@ -92,6 +92,37 @@ public class KlConceptStaticFacade {
         return retList;
     }
 
+    /**
+     * 收藏静态知识检索
+     *
+     * @param
+     * @return
+     */
+    public List<StaticKnowledgeIndexDTO> CollectionStaticKnowledgeIndex() {
+        List<StaticKnowledgeIndexDTO> retList = Lists.newLinkedList();
+        RespDTO<List<ClassicCaseIndexDTO>> caseDTO = RespDTO.onSuc(new ArrayList<>(0));
+        RespDTO<List<StaticKnowledgeIndexDTO>> respDTO = RespDTO.onSuc(new ArrayList<>(0));
+
+        caseDTO = cdssCoreClient.collectionClassicCaseIndex();
+        respDTO = cdssCoreClient.collectionStaticKnowledgeIndex();
+
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            retList = respDTO.data;
+            if (RespDTOUtil.respIsOK(caseDTO)) {
+                for (ClassicCaseIndexDTO classicCase : caseDTO.data) {
+                    StaticKnowledgeIndexDTO dto = new StaticKnowledgeIndexDTO();
+                    BeanUtil.copyProperties(classicCase, dto);
+                    dto.setCollectionStatus(classicCase.getCollectionStatus());
+                    retList.add(dto);
+                }
+            }
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+        }
+
+        return retList;
+    }
+
     /**
      * 经典病例检索
      *
@@ -423,4 +454,15 @@ public class KlConceptStaticFacade {
         }
         return exist;
     }
+
+    /**
+     * 收藏医学知识(静态知识)/经典病例
+     * @param staticKnowledgeAndClassicCaseVO
+     * @return
+     */
+    public Boolean collectionStaticKnowledgeAndClassicCase(StaticKnowledgeAndClassicCaseVO staticKnowledgeAndClassicCaseVO) {
+
+        Boolean success = cdssCoreClient.collectionStaticKnowledgeAndClassicCase(staticKnowledgeAndClassicCaseVO);
+        return success;
+    }
 }

+ 19 - 0
src/main/java/com/diagbot/web/ConceptInfoController.java

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -51,6 +52,24 @@ public class ConceptInfoController {
         return RespDTO.onSuc(data);
     }
 
+    @ApiOperation(value = "收藏医学知识(静态知识)检索[zhaops]",
+            notes = "types: 类型(多选):0-全部、1-诊断、2-药品、3-检验、5-检查、6-手术和操作、8-量表、9-护理、10-政策法规 <br>" +
+                    "inputStr: 检索内容<br>")
+    @PostMapping("/collectionStaticKnowledgeIndex")
+    @SysLogger("collectionStaticKnowledgeIndex")
+    public RespDTO<List<StaticKnowledgeIndexDTO>> collectionStaticKnowledgeIndex() {
+        List<StaticKnowledgeIndexDTO> data = klConceptStaticFacade.CollectionStaticKnowledgeIndex();
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "收藏医学知识(静态知识)/经典病例")
+    @PostMapping("/collectionStaticKnowledgeAndClassicCase")
+    @SysLogger("collectionStaticKnowledgeAndClassicCase")
+    public RespDTO<Boolean> collectionStaticKnowledgeAndClassicCase(@Valid @RequestBody StaticKnowledgeAndClassicCaseVO staticKnowledgeAndClassicCaseVO) {
+        Boolean data = klConceptStaticFacade.collectionStaticKnowledgeAndClassicCase(staticKnowledgeAndClassicCaseVO);
+        return RespDTO.onSuc(data);
+    }
+
     @ApiOperation(value = "医学术语检索-新增静态知识[zhaops]",
             notes = "types: 类型(多选):0-全部、1-诊断、2-药品、3-检验、5-检查、6-手术和操作、8-量表、9-护理、10-政策法规 <br>" +
                     "inputStr: 检索内容<br>")