瀏覽代碼

心电检查员权限查询调整

denny 8 月之前
父節點
當前提交
a9a4834f77
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      src/HealthExamBookingService/HealthExamBookingService.cs

+ 10 - 0
src/HealthExamBookingService/HealthExamBookingService.cs

@@ -431,6 +431,16 @@ 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");
+        }
+        if (string.IsNullOrEmpty(idCardNo))
+        {
+            ThrowCustomerException(CustomerRpcCode.IdentityCardIsRequired, "IdentityCard is required");
+        }
+
         if (!string.IsNullOrWhiteSpace(idCardNo) && Regex.IsMatch(idCardNo, @"^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})(\d|X)$"))
         {
             var birthDay = new DateTime(Convert.ToInt32(idCardNo.Substring(6, 4)), Convert.ToInt32(idCardNo.Substring(10, 2)), Convert.ToInt32(idCardNo.Substring(12, 2)));