Selaa lähdekoodia

重命名部分变量

lighter 2 vuotta sitten
vanhempi
commit
a2d6fee917

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>wxservice-server</artifactId>
-    <version>9.1</version>
+    <version>9.2</version>
     <name>wxservice-server</name>
     <description>server for wxservice-web</description>
 

+ 1 - 0
src/main/java/thyyxxk/wxservice_server/service/InpatientService.java

@@ -68,6 +68,7 @@ public class InpatientService {
     }
 
     private String getInpatientNoByPatientId(String patientId) {
+        log.info("getInpatientNoByPatientId:{}", patientId);
         String inpatientNo = dao.selectInpatientNoByPatientId(patientId);
         if (StringUtil.isBlank(inpatientNo)) {
             inpatientNo = dao.selectInpatientNoBySocialNo(patientId);

+ 15 - 16
src/main/java/thyyxxk/wxservice_server/service/InspectionsService.java

@@ -20,7 +20,6 @@ import thyyxxk.wxservice_server.entity.inspections.QueryReportDetail;
 import thyyxxk.wxservice_server.entity.inspections.detail.*;
 import thyyxxk.wxservice_server.utils.*;
 
-import java.awt.geom.RectangularShape;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -31,14 +30,14 @@ import java.util.*;
 @Service
 public class InspectionsService {
     private final InspectionsDao dao;
-    private final SoapInvokeService invokeService;
+    private final SoapInvokeService soapInvokeService;
     @Value("${hrgApiUrl}")
     private String hrgApiUrl;
 
     @Autowired
-    public InspectionsService(InspectionsDao dao, SoapInvokeService invokeService) {
+    public InspectionsService(InspectionsDao dao, SoapInvokeService soapInvokeService) {
         this.dao = dao;
-        this.invokeService = invokeService;
+        this.soapInvokeService = soapInvokeService;
     }
 
     public ResultVo<List<ExamIndexResult>> getExamIndex(CheckExamParam param) {
@@ -63,9 +62,9 @@ public class InspectionsService {
         List<ExamIndexResult> list = new ArrayList<>();
         for (String sendHead : sendHeads) {
             if (null != sendHead) {
-                String sendXml = sendHead + sendEnd;
-                String resXml = invokeService.invokeRemoteMethod("GetLabReportIndex", sendXml);
-                list.addAll(invokeService.analyzeExamIndex(resXml));
+                String paramXml = sendHead + sendEnd;
+                String resultXml = soapInvokeService.invokeRemoteMethod("GetLabReportIndex", paramXml);
+                list.addAll(soapInvokeService.analyzeExamIndex(resultXml));
             }
         }
         return ResultVoUtil.success(list);
@@ -109,8 +108,8 @@ public class InspectionsService {
         List<ExamIndexResult> results = new ArrayList<>();
         for (String mzNo : mzNos) {
             String mzHead = "<message><PATIENT_TYPE>0</PATIENT_TYPE><PTNT_NO>" + mzNo + "</PTNT_NO>";
-            String xml = invokeService.invokeRemoteMethod("GetLabReportIndex", mzHead+xmlEnd);
-            List<ExamIndexResult> list = invokeService.analyzeExamIndex(xml);
+            String xml = soapInvokeService.invokeRemoteMethod("GetLabReportIndex", mzHead+xmlEnd);
+            List<ExamIndexResult> list = soapInvokeService.analyzeExamIndex(xml);
             for (ExamIndexResult index : list) {
                 if (BooleanUtil.isCovidExam(index.getAPLY_CTNT())) {
                     results.add(index);
@@ -124,8 +123,8 @@ public class InspectionsService {
         List<ExamIndexResult> results = new ArrayList<>();
         for (HshjPatient hshj : hshjNos) {
             String hshjHead = "<message><PATIENT_TYPE>0</PATIENT_TYPE><PTNT_NO>" + hshj.getParentId() + "</PTNT_NO>";
-            String xml = invokeService.invokeRemoteMethod("GetLabReportIndex", hshjHead+xmlEnd);
-            List<ExamIndexResult> list = invokeService.analyzeExamIndex(xml);
+            String xml = soapInvokeService.invokeRemoteMethod("GetLabReportIndex", hshjHead+xmlEnd);
+            List<ExamIndexResult> list = soapInvokeService.analyzeExamIndex(xml);
             for (ExamIndexResult index : list) {
                 if (BooleanUtil.isCovidExam(index.getAPLY_CTNT())) {
                     index.setPTNT_ID(hshj.getPatientId());
@@ -143,7 +142,7 @@ public class InspectionsService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "报告ID不能为空!");
         }
         String send = "<message><ORDR_ID>" + param.getOrderId() + "</ORDR_ID></message>";
-        String xml = invokeService.invokeRemoteMethod("GetLabReport", send);
+        String xml = soapInvokeService.invokeRemoteMethod("GetLabReport", send);
         Element retEle = getResultElement(xml);
         if (null == retEle) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结果集为空!");
@@ -155,24 +154,24 @@ public class InspectionsService {
         }
         Element reportListEle = retEle.element("Result").element("ReportList");
         ReportHeader header = new ReportHeader();
-        detail.setReportHeader((ReportHeader) invokeService.reflect(header, reportListEle.element("ReportHeader")));
+        detail.setReportHeader((ReportHeader) soapInvokeService.reflect(header, reportListEle.element("ReportHeader")));
         List<ReportItem> reportItems = new ArrayList<>();
         List<Element> reportItemElements = reportListEle.elements("ReportItem");
         reportItemElements.forEach(reportItemElement -> {
             ReportItem reportItem = new ReportItem();
-            invokeService.reflect(reportItem, reportItemElement);
+            soapInvokeService.reflect(reportItem, reportItemElement);
             List<Element> bacteriaResultElements = reportItemElement.elements("BacteriaResult");
             if (bacteriaResultElements.size() > 0) {
                 List<BacteriaResult> bacteriaResults = new ArrayList<>();
                 bacteriaResultElements.forEach(bacterialResultElement -> {
                     BacteriaResult bacteriaResult = new BacteriaResult();
-                    invokeService.reflect(bacteriaResult, bacterialResultElement);
+                    soapInvokeService.reflect(bacteriaResult, bacterialResultElement);
                     List<Element> antibioticResultElements = bacterialResultElement.elements("AntibioticResult");
                     if (antibioticResultElements.size() > 0) {
                         List<AntibioticResult> antibioticResults = new ArrayList<>();
                         antibioticResultElements.forEach(antibioticResultElement -> {
                             AntibioticResult antibioticResult = new AntibioticResult();
-                            antibioticResults.add((AntibioticResult) invokeService.reflect(antibioticResult, antibioticResultElement));
+                            antibioticResults.add((AntibioticResult) soapInvokeService.reflect(antibioticResult, antibioticResultElement));
                         });
                         bacteriaResult.setAntibioticResults(antibioticResults);
                     }

+ 10 - 10
src/main/java/thyyxxk/wxservice_server/service/SoapInvokeService.java

@@ -24,23 +24,23 @@ import java.util.List;
 @Service
 public class SoapInvokeService {
 
-    public String invokeRemoteMethod(String operation, String message) {
-        log.info("查询检验报告:方法:{},参数:{}", operation, message);
+    public String invokeRemoteMethod(String function, String paramXml) {
+        log.info("查询检验报告:方法:{},参数:{}", function, paramXml);
         PushServiceSoap soap = new PushService().getPushServiceSoap();
-        if (operation.equals("GetLabReportIndex")) {
-            return soap.getLabReportIndex(message);
+        if (function.equals("GetLabReportIndex")) {
+            return soap.getLabReportIndex(paramXml);
         }
-        return soap.getLabReport(message);
+        return soap.getLabReport(paramXml);
     }
 
-    public List<ExamIndexResult> analyzeExamIndex(String xml) {
+    public List<ExamIndexResult> analyzeExamIndex(String resultXml) {
         Element retEle = null;
         try {
-            Document document = DocumentHelper.parseText(xml);
+            Document document = DocumentHelper.parseText(resultXml);
             Element root = document.getRootElement();
             retEle = root.element("return");
         } catch (DocumentException e) {
-            log.error("【SoapInvokeService.class: line 51】解析检验报告出错", e);
+            log.error("【SoapInvokeService.class: line 43】解析检验报告出错", e);
         }
         if (retEle == null) {
             return new ArrayList<>();
@@ -61,7 +61,7 @@ public class SoapInvokeService {
                         Method m = pojo.getClass().getMethod("set" + name, String.class);
                         m.invoke(pojo, item.elementTextTrim(name));
                     } catch (Exception e) {
-                        log.error("【SoapInvokeService.class: line 88】解析检验报告出错", e);
+                        log.error("【SoapInvokeService.class: line 64】解析检验报告出错", e);
                     }
                 }
                 examList.add(pojo);
@@ -85,7 +85,7 @@ public class SoapInvokeService {
                 Method m = pojo.getClass().getMethod("set" + name, String.class);
                 m.invoke(pojo, element.elementTextTrim(name));
             } catch (Exception e) {
-                log.error("【SoapInvokeService.class: line 112】解析检验报告反射实体类出错", e);
+                log.error("【SoapInvokeService.class: line 88】解析检验报告反射实体类出错", e);
             }
         }
         return pojo;