|
|
@@ -3689,13 +3689,13 @@ FROM
|
|
|
var familys = new List<Crm_VisaCustomerFamily>();
|
|
|
var schools = new List<Crm_VisaCustomerSchool>();
|
|
|
var works = new List<Crm_VisaCustomerCompany>();
|
|
|
- var refusalRecords = new List<VisaRefusalRecord>(); //拒签记录
|
|
|
- var travelHistories = new List<TravelHistory>(); //出行历史
|
|
|
- var militaries = new List<MilitaryInfo>(); //军事信息
|
|
|
- var countryVisiteds = new List<CountryVisited>(); //已出访的国家
|
|
|
- var schengenVisaRecords = new List<SchengenVisaRecord>(); //申根签证记录
|
|
|
- var socialAccounts = new List<SocialAccount>(); //社交账号
|
|
|
- var personInfos = new List<PersonInfo>(); //亲属朋友信息
|
|
|
+ var refusalRecords = new List<VisaRefusalRecord>(); // 拒签记录
|
|
|
+ var travelHistories = new List<TravelHistory>(); // 出行历史
|
|
|
+ var militaries = new List<MilitaryInfo>(); // 军事信息
|
|
|
+ var countryVisiteds = new List<CountryVisited>(); // 已出访的国家
|
|
|
+ var schengenVisaRecords = new List<SchengenVisaRecord>(); // 申根签证记录
|
|
|
+ var socialAccounts = new List<SocialAccount>(); // 社交账号
|
|
|
+ var personInfos = new List<PersonInfo>(); // 亲属朋友信息
|
|
|
|
|
|
try
|
|
|
{
|
|
|
@@ -4300,8 +4300,11 @@ FROM
|
|
|
return Ok(JsonView(false, "工作信息添加失败!"));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
+ _sqlSugar.CommitTran();
|
|
|
+ return Ok(JsonView(true, "操作成功"));
|
|
|
+
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
@@ -4309,11 +4312,9 @@ FROM
|
|
|
return Ok(JsonView(false, ex.Message));
|
|
|
}
|
|
|
|
|
|
- _sqlSugar.CommitTran();
|
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
- return Ok(JsonView(true));
|
|
|
}
|
|
|
|
|
|
private static bool TryGetNonEmptyStringProperty(JsonElement root, string propertyName, out string value)
|
|
|
@@ -7857,15 +7858,44 @@ FROM
|
|
|
SetFieldValue(formFields, "firstname", CommonFun.ConvertToPinyin(custInfo?.FirstName?.Trim() ?? "")?.ToLower() ?? ""); // 名 英文
|
|
|
|
|
|
#region 出生日期(日-月-年)
|
|
|
- string idCard = idInfo?.CertNo?.Trim() ?? "";
|
|
|
string birthday = string.Empty;
|
|
|
- if (!string.IsNullOrEmpty(idCard))
|
|
|
+ string idCard = idInfo?.CertNo?.Trim() ?? "";
|
|
|
+
|
|
|
+ // 1. 优先从身份证中提取 (需为18位身份证)
|
|
|
+ if (!string.IsNullOrEmpty(idCard) && idCard.Length >= 14)
|
|
|
{
|
|
|
- string year = idCard.Substring(6, 4);
|
|
|
- string month = idCard.Substring(10, 2);
|
|
|
- string day = idCard.Substring(12, 2);
|
|
|
- birthday = day + "-" + month + "-" + year;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ string year = idCard.Substring(6, 4);
|
|
|
+ string month = idCard.Substring(10, 2);
|
|
|
+ string day = idCard.Substring(12, 2);
|
|
|
+
|
|
|
+ // 统一格式为 yyyy-MM-dd
|
|
|
+ birthday = $"{day}-{month}-{year}";
|
|
|
+ }
|
|
|
+ catch
|
|
|
+ {
|
|
|
+ // 如果截取失败,回退为空
|
|
|
+ birthday = string.Empty;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ // 2. 身份证不存在或提取失败,则从 custInfo 获取
|
|
|
+ if (string.IsNullOrEmpty(birthday))
|
|
|
+ {
|
|
|
+ DateTime? date = custInfo?.BirthDay;
|
|
|
+
|
|
|
+ // 验证逻辑:排除空值、1900年、或 DateTime.MinValue
|
|
|
+ if (!date.HasValue || date.Value.Year == 1900 || date.Value == DateTime.MinValue)
|
|
|
+ {
|
|
|
+ birthday = "";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ birthday = date.Value.ToString("dd-MM-yyyy");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
SetFieldValue(formFields, "birthday", birthday);
|
|
|
#endregion
|
|
|
|