Browse Source

化验大项、化验小项、辅检、诊断、药品、手术等搜索

zhaops 4 years ago
parent
commit
9e18a65823

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

@@ -4,8 +4,10 @@ import com.diagbot.client.hystrix.CdssCoreHystrix;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.vo.IndicationPushVO;
 import com.diagbot.vo.PushVO;
+import com.diagbot.vo.RetrievalVO;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -25,6 +27,15 @@ public interface CdssCoreClient {
 
     @PostMapping("/core/push")
     RespDTO<PushDTO> push(@RequestBody @Valid PushVO pushVo);
+
+    /**
+     * 化验大项、化验小项、辅检、诊断、药品、手术等检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    @PostMapping("/retrieval/index")
+    RespDTO<RetrievalDTO> index(@RequestBody @Valid RetrievalVO retrievalVO);
 }
 
 

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

@@ -4,8 +4,10 @@ import com.diagbot.client.CdssCoreClient;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.vo.IndicationPushVO;
 import com.diagbot.vo.PushVO;
+import com.diagbot.vo.RetrievalVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -32,4 +34,16 @@ public class CdssCoreHystrix implements CdssCoreClient {
         log.error("【hystrix】调用{}异常", "push");
         return null;
     }
+
+    /**
+     * 化验大项、化验小项、辅检、诊断、药品、手术等检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    @Override
+    public RespDTO<RetrievalDTO> index(@RequestBody @Valid RetrievalVO retrievalVO) {
+        log.error("【hystrix】调用{}异常", "index");
+        return null;
+    }
 }

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

@@ -114,6 +114,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/sys/plan/getSysPlanInfoDatas").permitAll()
                 .antMatchers("/sys/plan/cancelPlanDatas").permitAll()
                 .antMatchers("/sys/plan/revStopPlans").permitAll()
+                .antMatchers("/retrieval/index").permitAll()
                 .antMatchers("/**").authenticated();
         //                .antMatchers("/**").permitAll();
     }

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

@@ -156,6 +156,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/sys/plan/getSysPlanInfoDatas", request)
                 || matchers("/sys/plan/cancelPlanDatas", request)
                 || matchers("/sys/plan/revStopPlans", request)
+                || matchers("/retrieval/index", request)
                 || matchers("/", request)) {
             return true;
         }

+ 34 - 0
src/main/java/com/diagbot/facade/RetrievalFacade.java

@@ -0,0 +1,34 @@
+package com.diagbot.facade;
+
+import com.diagbot.client.CdssCoreClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.RetrievalDTO;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.RetrievalVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 16:44
+ */
+@Component
+public class RetrievalFacade {
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 检索
+     *
+     * @param retrievalVO
+     * @return
+     */
+    public RetrievalDTO index(RetrievalVO retrievalVO) {
+        RetrievalDTO retrievalDTO = new RetrievalDTO();
+        RespDTO<RetrievalDTO> respDTO = cdssCoreClient.index(retrievalVO);
+        RespDTOUtil.respNGDealCover(respDTO, "检索失败");
+        retrievalDTO = respDTO.data;
+        return retrievalDTO;
+    }
+}

+ 40 - 0
src/main/java/com/diagbot/web/RetrievalController.java

@@ -0,0 +1,40 @@
+package com.diagbot.web;
+
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.RetrievalDTO;
+import com.diagbot.facade.RetrievalFacade;
+import com.diagbot.vo.RetrievalVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/12 16:45
+ */
+@RestController
+@RequestMapping("/retrieval")
+@Api(value = "术语检索相关API", tags = { "术语检索相关API" })
+@SuppressWarnings("unchecked")
+public class RetrievalController {
+    @Autowired
+    private RetrievalFacade retrievalFacade;
+
+    @ApiOperation(value = "术语检索[zhaops]",
+            notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作 <br>" +
+                    "inputStr: 检索内容<br>" +
+                    "sex: 性别:1-男、2-女、3-通用 <br>" +
+                    "age: 年龄<br>")
+    @PostMapping("/index")
+    public RespDTO<RetrievalDTO> index(@Valid @RequestBody RetrievalVO retrievalVO) {
+        RetrievalDTO data = retrievalFacade.index(retrievalVO);
+        return RespDTO.onSuc(data);
+    }
+}