Explorar o código

自助开单核酸检测也要做流调。

lighter %!s(int64=4) %!d(string=hai) anos
pai
achega
3dffd19ccc

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>wxservice-server</artifactId>
-    <version>1.9</version>
+    <version>2.0</version>
     <name>wxservice-server</name>
     <description>vue3 web server</description>
 

+ 3 - 3
src/main/java/thyyxxk/wxservice_server/controller/AppointmentController.java

@@ -55,9 +55,9 @@ public class AppointmentController {
         return service.getDoctorInfo(doctorCode, openId);
     }
 
-    @GetMapping("/hasDoneCovidAssessment")
-    public ResultVo<String> hasDoneCovidAssessment(@RequestParam("patientId") String patientId) {
-        return service.hasDoneCovidAssessment(patientId);
+    @GetMapping("/hasValidCovidAssessment")
+    public ResultVo<String> hasValidCovidAssessment(@RequestParam("patientId") String patientId) {
+        return service.hasValidCovidAssessment(patientId);
     }
 
     @PostMapping("/getSourcesByDateAndDoctor")

+ 5 - 0
src/main/java/thyyxxk/wxservice_server/controller/OrderCovidController.java

@@ -15,6 +15,11 @@ public class OrderCovidController {
         this.service = service;
     }
 
+    @GetMapping("/hasDoneCovidAssessment")
+    public ResultVo<String> hasDoneCovidAssessment(@RequestParam("patientId") String patientId) {
+        return service.hasDoneCovidAssessment(patientId);
+    }
+
     @GetMapping("/savePrescription")
     public ResultVo<String> savePrescription(@RequestParam("patientId") String patientId) {
         return service.savePrescription(patientId);

+ 1 - 1
src/main/java/thyyxxk/wxservice_server/pojo/covid/OrderCovidExamParam.java

@@ -9,7 +9,7 @@ import java.util.List;
 @Data
 public class OrderCovidExamParam {
     private String patientId;
-    private String visitDeptCode = "1400002";
+    private String visitDeptCode = "1400004";
     private String doctorCode = "99999";
     private String inspectPart = "";
     private String reqComment = "申请核酸检测";

+ 1 - 1
src/main/java/thyyxxk/wxservice_server/service/AppointmentService.java

@@ -156,7 +156,7 @@ public class AppointmentService {
         return ResultVoUtil.success(source);
     }
 
-    public ResultVo<String> hasDoneCovidAssessment(String patientId) {
+    public ResultVo<String> hasValidCovidAssessment(String patientId) {
         CovidPojo covid = dao.validCovidAssessment(patientId);
         if (null == covid) {
             return ResultVoUtil.success("no valid assessment");

+ 18 - 0
src/main/java/thyyxxk/wxservice_server/service/OrderCovidExamService.java

@@ -1,11 +1,14 @@
 package thyyxxk.wxservice_server.service;
 
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
 import thyyxxk.wxservice_server.config.exception.ExceptionEnum;
+import thyyxxk.wxservice_server.dao.AppointmentDao;
 import thyyxxk.wxservice_server.pojo.HrgResponse;
 import thyyxxk.wxservice_server.pojo.ResultVo;
+import thyyxxk.wxservice_server.pojo.assessment.CovidPojo;
 import thyyxxk.wxservice_server.pojo.covid.OrderCovidExamParam;
 import thyyxxk.wxservice_server.utils.ThmzUrls;
 import thyyxxk.wxservice_server.utils.ResultVoUtil;
@@ -13,6 +16,21 @@ import thyyxxk.wxservice_server.utils.ResultVoUtil;
 @Slf4j
 @Service
 public class OrderCovidExamService {
+    private final AppointmentDao dao;
+
+    @Autowired
+    public OrderCovidExamService(AppointmentDao dao) {
+        this.dao = dao;
+    }
+
+    public ResultVo<String> hasDoneCovidAssessment(String patientId) {
+        CovidPojo covid = dao.validCovidAssessment(patientId);
+        if (null == covid) {
+            return ResultVoUtil.success("no");
+        } else {
+            return ResultVoUtil.success("yes");
+        }
+    }
 
     public ResultVo<String> savePrescription(String patientId) {
         OrderCovidExamParam param = new OrderCovidExamParam();