lighter 1 månad sedan
förälder
incheckning
bc63447bf0

+ 9 - 10
src/main/java/thyyxxk/webserver/api/medicallaboratory/MedicalLaboratoryController.java

@@ -100,6 +100,13 @@ public class MedicalLaboratoryController {
     }
 
     private void pushWxMessage(MedicalLaboratoryState body) {
+        if (null != body.getPatType() && body.getPatType() == PatientType.INPATIENT) {
+            String cardNo = dao.getPatientIdByInpatientNo(body.getPatNo());
+            if (StringUtil.isBlank(cardNo)) {
+                return;
+            }
+            body.setPatNo(cardNo);
+        }
         String xmLabel = getLabel(body.getCategory());
         String firstData = StrUtil.format("您之前进行的{}项目已生成{}报告,详情如下:", xmLabel, xmLabel);
         String pbtime = DateUtil.formatDate(body.getPublishTime());
@@ -117,16 +124,8 @@ public class MedicalLaboratoryController {
                 "\"url\":\"" + redirect + "\"}";
 
         JSONObject obj = new JSONObject();
-        String cardNo;
-        if (null != body.getPatType() && body.getPatType() == PatientType.INPATIENT) {
-            cardNo = dao.getPatientIdByInpatientNo(body.getPatNo());
-            if (StringUtil.isBlank(cardNo)) {
-                return;
-            }
-        } else {
-            cardNo = body.getPatNo();
-        }
-        obj.put("cardNo", cardNo);
+
+        obj.put("cardNo", body.getPatNo());
         obj.put("msgContext", JSON.parseObject(msgContent));
         wxServer.pushWxMessage(obj);
     }