jeremy 8 months ago
parent
commit
751878a5b7
1 changed files with 21 additions and 27 deletions
  1. 21 27
      src/HealthExamBookingService/HealthExamBookingService.cs

+ 21 - 27
src/HealthExamBookingService/HealthExamBookingService.cs

@@ -540,42 +540,36 @@ public partial class HealthExamBookingService : JsonRpcService, IVitalHealthExam
         if (registerInfo != null && registerInfo.JingQiExamInfos != null && registerInfo.JingQiExamInfos.Any()
             && registerInfo.JingQiExamInfos.ContainsKey("PhyId") && !string.IsNullOrWhiteSpace(registerInfo.JingQiExamInfos["PhyId"]))
         {
-            try
+            var jingQiRes = await _vitalFacturyUserService.FacturyExamDeleteAsync(new FacturyExamDeleteRequest
+            {
+                Token = request.Token,
+                PhyId = registerInfo.JingQiExamInfos["PhyId"],
+                Identity = registerInfo.IDCardNo,
+                PatientName = registerInfo.Name,
+            });
+            if (jingQiRes.Status != "0")
             {
-                var jingQiRes = await _vitalFacturyUserService.FacturyExamDeleteAsync(new FacturyExamDeleteRequest
+                Logger.WriteLineError($"HealthExamBookingService DeleteRegiterInfoAsync failed, cardNo:{registerInfo.IDCardNo}, Status:{jingQiRes.Status}, ErroMsg:{jingQiRes.ErroMsg}");
+                if (jingQiRes.Status == "")
                 {
-                    Token = request.Token,
-                    PhyId = registerInfo.JingQiExamInfos["PhyId"],
-                    Identity = registerInfo.IDCardNo,
-                    PatientName = registerInfo.Name,
-                });
-                if (jingQiRes.Status != "0")
+                    ThrowCustomerException(CustomerRpcCode.JingQiException, "JingQiException");
+                }
+                else if (jingQiRes.Status == "2")
                 {
-                    Logger.WriteLineError($"HealthExamBookingService DeleteRegiterInfoAsync failed, cardNo:{registerInfo.IDCardNo}, Status:{jingQiRes.Status}, ErroMsg:{jingQiRes.ErroMsg}");
-                    if (jingQiRes.Status == "")
-                    {
-                        ThrowCustomerException(CustomerRpcCode.JingQiException, "JingQiException");
-                    }
-                    else if (jingQiRes.Status == "2")
-                    {
-                        ThrowCustomerException(CustomerRpcCode.JingQiNonArea, "JingQiNonArea");
-                    }
-                    else if (jingQiRes.Status == "3")
-                    {
-                        ThrowCustomerException(CustomerRpcCode.JingQiExamedInYear, "JingQiExamedInYear");
-                    }
-                    else
-                    {
-                        ThrowCustomerException(CustomerRpcCode.JingQiApiFailed, jingQiRes.ErroMsg);
-                    }
+                    ThrowCustomerException(CustomerRpcCode.JingQiNonArea, "JingQiNonArea");
+                }
+                else if (jingQiRes.Status == "3")
+                {
+                    ThrowCustomerException(CustomerRpcCode.JingQiExamedInYear, "JingQiExamedInYear");
                 }
                 else
                 {
-                    Logger.WriteLineInfo($"HealthExamBookingService DeleteRegiterInfoAsync success, cardNo:{registerInfo.IDCardNo}, Status:{jingQiRes.Status}, ErroMsg:{jingQiRes.ErroMsg}");
+                    ThrowCustomerException(CustomerRpcCode.JingQiApiFailed, jingQiRes.ErroMsg);
                 }
             }
-            catch (Exception ex)
+            else
             {
+                Logger.WriteLineInfo($"HealthExamBookingService DeleteRegiterInfoAsync success, cardNo:{registerInfo.IDCardNo}, Status:{jingQiRes.Status}, ErroMsg:{jingQiRes.ErroMsg}");
             }
         }
         return await _registerInfoDBService.DeleteRegisterInfoAsync(registerCode);