Quellcode durchsuchen

优化部分代码

yuanrf vor 1 Jahr
Ursprung
Commit
504e7a1949
1 geänderte Dateien mit 6 neuen und 3 gelöschten Zeilen
  1. 6 3
      OASystem/OASystem.Api/Controllers/BaiduOCRController.cs

+ 6 - 3
OASystem/OASystem.Api/Controllers/BaiduOCRController.cs

@@ -8,6 +8,7 @@ using OASystem.Domain.Dtos.Baidu;
 using OASystem.Domain.Dtos.CRM;
 using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.ViewModels.OCR;
+using Quartz.Util;
 
 namespace OASystem.API.Controllers
 {
@@ -158,7 +159,7 @@ namespace OASystem.API.Controllers
                             }
                             else if (values.Equals("DOB"))
                             {
-                                client.Birthday = words;
+                                client.Birthday = words.Replace(".", "-");
                                 DateTime time = new DateTime();
                                 if (DateTime.TryParse(client.Birthday, out time))
                                 {
@@ -188,9 +189,11 @@ namespace OASystem.API.Controllers
                             }
                         }
 
-                        ClientArr.Add(client);
+                        if(!(client.FirstName + client.LastName + client.Pinyin + client.CompanyFullName + client.Job + client.Phone + client.Birthday).IsNullOrWhiteSpace())
+                        {
+                            ClientArr.Add(client);
+                        }
                     }
-
                     jw.Code = 200;
                     jw.Msg = "获取成功!";
                     jw.Data = ClientArr;