Sfoglia il codice sorgente

为健康证对接添加修正体检号功能。

lighter 4 anni fa
parent
commit
5aa09778dd

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>7.5</version>
+    <version>7.6</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
 

+ 14 - 3
src/main/java/thyyxxk/webserver/controller/lisdock/LisDockController.java

@@ -3,12 +3,18 @@ package thyyxxk.webserver.controller.lisdock;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.examinations.inspections.InspectionsIndex;
+import thyyxxk.webserver.entity.examinations.inspections.QueryInspectionParam;
 import thyyxxk.webserver.entity.examinations.lisdock.PushResultParam;
 import thyyxxk.webserver.service.lisdock.LisDockService;
 
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 
+/**
+ * @author dj
+ */
 @RestController
 @RequestMapping("/lisDock")
 public class LisDockController {
@@ -19,9 +25,14 @@ public class LisDockController {
         this.service = service;
     }
 
-    @GetMapping("/scanBarCode")
-    public ResultVo<Map<String, Object>> scanBarCode(@RequestParam("barCode") String barCode) throws Exception {
-        return service.scanBarCode(barCode);
+    @PostMapping("/scanBarCode")
+    public ResultVo<Map<String, Object>> scanBarCode(@RequestBody QueryInspectionParam param) throws Exception {
+        return service.scanBarCode(param);
+    }
+
+    @PostMapping("/getIndexByTjNo")
+    public ResultVo<List<InspectionsIndex>> getIndexByTjNo(@RequestBody QueryInspectionParam param) throws Exception {
+        return service.getIndexByTjNo(param);
     }
 
     @PostMapping("/pushSelectedResult")

+ 7 - 1
src/main/java/thyyxxk/webserver/entity/examinations/inspections/QueryInspectionParam.java

@@ -5,9 +5,15 @@ import lombok.Data;
 
 import java.util.Date;
 
+/**
+ * @author dj
+ */
 @Data
 public class QueryInspectionParam {
-    private Integer type; // 患者类别 0=门诊,1=住院,3=体检
+    /**
+     * 患者类别 0=门诊,1=住院,3=体检
+     * */
+    private Integer type;
     private String content;
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     private Date start;

+ 4 - 0
src/main/java/thyyxxk/webserver/entity/examinations/lisdock/PushResultParam.java

@@ -5,8 +5,12 @@ import thyyxxk.webserver.entity.examinations.inspections.InspectionsIndex;
 
 import java.util.List;
 
+/**
+ * @author dj
+ */
 @Data
 public class PushResultParam {
     private CustomerInfo customerInfo;
+    private String tjNo;
     private List<InspectionsIndex> inspectionsIndex;
 }

+ 11 - 5
src/main/java/thyyxxk/webserver/service/lisdock/LisDockService.java

@@ -59,19 +59,17 @@ public class LisDockService {
         this.service = service;
     }
 
-    public ResultVo<Map<String, Object>> scanBarCode(String barCode) throws Exception {
-        JSONObject customerInfo = getCustomerInfo(barCode);
+    public ResultVo<Map<String, Object>> scanBarCode(QueryInspectionParam param) throws Exception {
+        JSONObject customerInfo = getCustomerInfo(param.getContent());
         if (null == customerInfo) {
             return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "未查询到此条码对应的身份信息。");
         }
         Map<String, Object> map = new HashMap<>(Capacity.TWO);
         map.put("customerInfo", customerInfo);
         String tjNo = dao.selectTjNo(customerInfo.getString("idCard"));
-        QueryInspectionParam param = new QueryInspectionParam();
+        map.put("tjNo", tjNo);
         param.setType(3);
         param.setContent(tjNo);
-        param.setStart(DateFormat.getDateInstance().parse("2021-02-20"));
-        param.setEnd(new Date());
         List<InspectionsIndex> list = service.queryInspectionsIndex(param).get().getData();
         list.removeIf(item -> !item.getAPLY_CTNT().contains("大便培养") &&
                 !item.getAPLY_CTNT().contains("甲肝抗体") && !item.getAPLY_CTNT().contains("戊肝抗体"));
@@ -79,6 +77,14 @@ public class LisDockService {
         return ResultVoUtil.success(map);
     }
 
+    public ResultVo<List<InspectionsIndex>> getIndexByTjNo(QueryInspectionParam param) throws Exception {
+        param.setType(3);
+        List<InspectionsIndex> list = service.queryInspectionsIndex(param).get().getData();
+        list.removeIf(item -> !item.getAPLY_CTNT().contains("大便培养") &&
+                !item.getAPLY_CTNT().contains("甲肝抗体") && !item.getAPLY_CTNT().contains("戊肝抗体"));
+        return ResultVoUtil.success(list);
+    }
+
     public ResultVo<Map<String, String>> pushSelectedResult(PushResultParam param) throws ExecutionException, InterruptedException {
         String itemCode;
         CustomerInfo customerInfo = param.getCustomerInfo();

+ 1 - 1
src/main/java/thyyxxk/webserver/utils/TokenUtil.java

@@ -16,7 +16,7 @@ public class TokenUtil {
     private static String sendCorpWxMsgToken = "";
 
     public static String getTokenUserId() {
-        String token = Objects.requireNonNull(getRequest()).getHeader("token");// 从 http 请求头中取出 token
+        String token = Objects.requireNonNull(getRequest()).getHeader("token");
         return JWT.decode(token).getAudience().get(0);
     }