jeremy 8 months ago
parent
commit
c4d5bd8b17
1 changed files with 17 additions and 1 deletions
  1. 17 1
      src/HealthExamBookingService/HealthExamBookingService.cs

+ 17 - 1
src/HealthExamBookingService/HealthExamBookingService.cs

@@ -431,7 +431,7 @@ public partial class HealthExamBookingService : JsonRpcService, IVitalHealthExam
         var userInfo = await GetUserInfoByTokenAsync(token);
         var dto = request.MappingTo<RegisterInfoDTO>();
         var idCardNo = request.IDCardNo;
-        
+
         if (string.IsNullOrEmpty(request.Name))
         {
             ThrowCustomerException(CustomerRpcCode.PatientNameIsEmpty, "Patient name is empty");
@@ -552,6 +552,22 @@ public partial class HealthExamBookingService : JsonRpcService, IVitalHealthExam
                 if (jingQiRes.Status != "0")
                 {
                     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);
+                    }
                 }
                 else
                 {