yuanrf 3 dienas atpakaļ
vecāks
revīzija
ba54888286

+ 358 - 357
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -160,7 +160,7 @@ namespace OASystem.API.Controllers
         /// <summary>
         /// 城市机票默认报价系数
         /// </summary>
-        public const decimal Def_CityFlightCoeff = 2.50M;     
+        public const decimal Def_CityFlightCoeff = 2.50M;
 
         /// <summary>
         /// 初始化岗位对应负责的数据类型
@@ -1201,7 +1201,7 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpGet]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GroupItemNativeKeywordSearch (string keyword)
+        public async Task<IActionResult> GroupItemNativeKeywordSearch(string keyword)
         {
             var jw = JsonView(true, "暂无数据");
             if (string.IsNullOrEmpty(keyword)) return Ok(jw);
@@ -1301,7 +1301,7 @@ namespace OASystem.API.Controllers
                             //item.Data.VisitDate
                         });
                     }
-                    
+
                     return Ok(JsonView(true, result.Message, data, data.Count));
                 }
 
@@ -1603,7 +1603,7 @@ namespace OASystem.API.Controllers
                 PageFuncAuth = pageFunAuthView,
                 Data = _DelegationList
             };
-           
+
             return Ok(JsonView(true, $"查询成功!", _view, total));
         }
 
@@ -3552,7 +3552,7 @@ FROM
                     if (TryGetNonEmptyStringProperty(root, "maiden_name", out string maiden_name))
                         info.OldName = maiden_name;
 
-                    if (TryGetNonEmptyStringProperty(root, "pinyin_name", out string pinyin_name)) 
+                    if (TryGetNonEmptyStringProperty(root, "pinyin_name", out string pinyin_name))
                         info.Pinyin = pinyin_name;
 
                     if (TryGetNonEmptyStringProperty(root, "gender", out string gender))
@@ -3639,7 +3639,7 @@ FROM
 
                             //if (TryGetNonEmptyStringProperty(family_members, "current_nationality", out string family_current_nationality))
                             //    familyInfo.BirthPlace = family_current_nationality;
-                            
+
                             //if (TryGetNonEmptyStringProperty(family_members, "current_country_of_residence", out string family_current_country_of_residence))
                             //    familyInfo.BirthPlace = family_current_country_of_residence;
 
@@ -3785,7 +3785,7 @@ FROM
                     }
 
                     #endregion
-                    
+
                     #region  已出访的国家
 
                     if (root.TryGetProperty("countries_visited_list", out JsonElement countries_visited_list))
@@ -3811,360 +3811,360 @@ FROM
             }
 
 
-                #region 111
-                //按照表格类型分别进行参数处理
-                // 1. 澳新签证个人申请表
-                // 2. 出国个人申请表
-                // 3. 美国签证个人申请表格
-                // 4. 沙特个人信息表格
-                // 5. 申根签证个人资料表
-                // 6. 中文个人简历模板
-                //switch (fileTypeId)
-                //{
-                //    //澳新签证个人申请表
-                //    case 1:
+            #region 111
+            //按照表格类型分别进行参数处理
+            // 1. 澳新签证个人申请表
+            // 2. 出国个人申请表
+            // 3. 美国签证个人申请表格
+            // 4. 沙特个人信息表格
+            // 5. 申根签证个人资料表
+            // 6. 中文个人简历模板
+            //switch (fileTypeId)
+            //{
+            //    //澳新签证个人申请表
+            //    case 1:
 
-                //        _logger.LogInformation("【签证上传文件操作信息】【澳新签证个人申请表】【KIMI-AI-API访问计次】{count} 次", kimiAI_API_Index);
-                //        VisaApplication resInfo = System.Text.Json.JsonSerializer.Deserialize<VisaApplication>(jsonString);
+            //        _logger.LogInformation("【签证上传文件操作信息】【澳新签证个人申请表】【KIMI-AI-API访问计次】{count} 次", kimiAI_API_Index);
+            //        VisaApplication resInfo = System.Text.Json.JsonSerializer.Deserialize<VisaApplication>(jsonString);
 
-                //        break;
+            //        break;
 
-                //    //美国签证个人申请表格
-                //    case 3:
+            //    //美国签证个人申请表格
+            //    case 3:
 
-                //        _logger.LogInformation("【签证上传文件操作信息】【美国签证个人申请表格】【KIMI-AI-API访问计次】{count} 次", kimiAI_API_Index);
+            //        _logger.LogInformation("【签证上传文件操作信息】【美国签证个人申请表格】【KIMI-AI-API访问计次】{count} 次", kimiAI_API_Index);
 
-                //        string name = (string)jsonData.GetType().GetProperty("姓名")!.GetValue(jsonData)!;
-                //        string passportNo = (string)jsonData.GetType().GetProperty("护照号码")!.GetValue(jsonData)!;
-                //        string passportPlace = (string)jsonData.GetType().GetProperty("护照签发地")!.GetValue(jsonData)!;
-                //        string idNo = (string)jsonData.GetType().GetProperty("身份证号码")!.GetValue(jsonData)!;
-                //        string maritalStatusText = (string)jsonData.GetType().GetProperty("婚姻状况")!.GetValue(jsonData)!;
-                //        int maritalStatus = maritalStatusText switch
-                //        {
-                //            "未设置" => 0,
-                //            "未婚" => 1,
-                //            "已婚" => 2,
-                //            "离异" => 3,
-                //            "丧偶" => 4,
-                //            _ => -1
-                //        };
-                //        string birthDay = (string)jsonData.GetType().GetProperty("出生日期")!.GetValue(jsonData)!;
-                //        DateTime.TryParse(birthDay, out DateTime birthDayDt);
-                //        string birthPlace = (string)jsonData.GetType().GetProperty("出生地点")!.GetValue(jsonData)!;
-                //        var birthDay1 = CommonFun.SplitProvinceCity(birthPlace);
-                //        string birthDay_mate = (string)jsonData.GetType().GetProperty("配偶出生日期")!.GetValue(jsonData)!;
-                //        DateTime.TryParse(birthDay_mate, out DateTime birthDayDt_mate);
-                //        string birthPlace_mate = (string)jsonData.GetType().GetProperty("配偶出生地")!.GetValue(jsonData)!;
-                //        var birthDay1_mate = CommonFun.SplitProvinceCity(birthPlace_mate);
-                //        var addressText = (string)jsonData.GetType().GetProperty("家庭地址")!.GetValue(jsonData)!;
-                //        var address = SplitAddressZip(addressText);
-
-                //        //美国驾照信息
-                //        string driveText = (string)jsonData.GetType().GetProperty("是否有美国驾照")!.GetValue(jsonData)!;
-                //        var driveInfo = LicenseParser(driveText);
-                //        //美国社会安全号或者纳税ID号
-                //        string ssnText = (string)jsonData.GetType().GetProperty("是否有美国社会安全号或者纳税ID号")!.GetValue(jsonData)!;
-
-                //        //单位信息
-                //        string clientName = (string)jsonData.GetType().GetProperty("目前就职单位或就读学校")!.GetValue(jsonData)!;
-                //        string clientAddr = (string)jsonData.GetType().GetProperty("目前就职单位或就读学校地址")!.GetValue(jsonData)!;// 
-                //        var (hasSsnItin, number) = SsnItinParser(ssnText);
-
-                //        //婚姻相关
-                //        var WeddingText = (string)jsonData.GetType().GetProperty("若离婚,婚姻起止时间")!.GetValue(jsonData)!;
-                //        var (f, t) = WeddingParser(WeddingText);
-
-                //        //美国联系人电话和邮箱
-                //        var peText = (string)jsonData.GetType().GetProperty("联系人电话及邮箱")!.GetValue(jsonData)!;
-                //        var usa_phone = Regex.Match(peText ?? "", @"[\d-]+").Value;          // 数字和中横线
-                //        var usa_email = Regex.Match(peText ?? "", @"[^@\s]+@[^@\s]+\.[^@\s]+").Value;
-                //        //赴美时间、停留时间处理 
-                //        var usa_dateText = (string)jsonData.GetType().GetProperty("联系人电话及邮箱")!.GetValue(jsonData)!;
-                //        var (usa_d, usa_days) = TravelParser(usa_dateText);
-                //        //赴美同行人
-                //        string usaCmpNameText = (string)jsonData.GetType().GetProperty("赴美同行人")!.GetValue(jsonData)!;
-                //        string usaCmpName = string.Empty;
-                //        if (usaCmpNameText.Contains("是"))
-                //        {
-                //            var usaCmpNameTextSplit = usaCmpNameText.Replace(":", "-").Replace("", "-").Split("-");
-                //            if (usaCmpNameTextSplit.Length > 1)
-                //            {
-                //                usaCmpName = usaCmpNameTextSplit[1];
-                //            }
-                //        }
-                //        //是否丢失过护照
-                //        string loseCodeText = (string)jsonData.GetType().GetProperty("是否丢失过护照")!.GetValue(jsonData)!;
-                //        string loseCode = string.Empty;
-                //        if (loseCodeText.Contains("是"))
-                //        {
-                //            var loseCodeTextSplit = loseCodeText.Replace(":", "-").Replace("", "-").Split("-");
-                //            if (loseCodeTextSplit.Length > 1)
-                //            {
-                //                usaCmpName = loseCodeTextSplit[1];
-                //            }
-                //        }
-                //        //是否获得过美国签证
-                //        string usaVisaText = (string)jsonData.GetType().GetProperty("是否丢失过护照")!.GetValue(jsonData)!;
-                //        string usaVisaDateText = (string)jsonData.GetType().GetProperty("获得日期")!.GetValue(jsonData)!;
-                //        //DateTime usaVisaDate;
-                //        if (!string.IsNullOrEmpty(usaVisaDateText))
-                //        {
-                //            if (DateTime.TryParse(usaVisaDateText, out DateTime usaVisaDate))
-                //            {
-                //                visaDetails.ClientInfo.GetUSAVisaDate = usaVisaDate;
-                //            }
-                //        }
+            //        string name = (string)jsonData.GetType().GetProperty("姓名")!.GetValue(jsonData)!;
+            //        string passportNo = (string)jsonData.GetType().GetProperty("护照号码")!.GetValue(jsonData)!;
+            //        string passportPlace = (string)jsonData.GetType().GetProperty("护照签发地")!.GetValue(jsonData)!;
+            //        string idNo = (string)jsonData.GetType().GetProperty("身份证号码")!.GetValue(jsonData)!;
+            //        string maritalStatusText = (string)jsonData.GetType().GetProperty("婚姻状况")!.GetValue(jsonData)!;
+            //        int maritalStatus = maritalStatusText switch
+            //        {
+            //            "未设置" => 0,
+            //            "未婚" => 1,
+            //            "已婚" => 2,
+            //            "离异" => 3,
+            //            "丧偶" => 4,
+            //            _ => -1
+            //        };
+            //        string birthDay = (string)jsonData.GetType().GetProperty("出生日期")!.GetValue(jsonData)!;
+            //        DateTime.TryParse(birthDay, out DateTime birthDayDt);
+            //        string birthPlace = (string)jsonData.GetType().GetProperty("出生地点")!.GetValue(jsonData)!;
+            //        var birthDay1 = CommonFun.SplitProvinceCity(birthPlace);
+            //        string birthDay_mate = (string)jsonData.GetType().GetProperty("配偶出生日期")!.GetValue(jsonData)!;
+            //        DateTime.TryParse(birthDay_mate, out DateTime birthDayDt_mate);
+            //        string birthPlace_mate = (string)jsonData.GetType().GetProperty("配偶出生地")!.GetValue(jsonData)!;
+            //        var birthDay1_mate = CommonFun.SplitProvinceCity(birthPlace_mate);
+            //        var addressText = (string)jsonData.GetType().GetProperty("家庭地址")!.GetValue(jsonData)!;
+            //        var address = SplitAddressZip(addressText);
+
+            //        //美国驾照信息
+            //        string driveText = (string)jsonData.GetType().GetProperty("是否有美国驾照")!.GetValue(jsonData)!;
+            //        var driveInfo = LicenseParser(driveText);
+            //        //美国社会安全号或者纳税ID号
+            //        string ssnText = (string)jsonData.GetType().GetProperty("是否有美国社会安全号或者纳税ID号")!.GetValue(jsonData)!;
+
+            //        //单位信息
+            //        string clientName = (string)jsonData.GetType().GetProperty("目前就职单位或就读学校")!.GetValue(jsonData)!;
+            //        string clientAddr = (string)jsonData.GetType().GetProperty("目前就职单位或就读学校地址")!.GetValue(jsonData)!;// 
+            //        var (hasSsnItin, number) = SsnItinParser(ssnText);
+
+            //        //婚姻相关
+            //        var WeddingText = (string)jsonData.GetType().GetProperty("若离婚,婚姻起止时间")!.GetValue(jsonData)!;
+            //        var (f, t) = WeddingParser(WeddingText);
+
+            //        //美国联系人电话和邮箱
+            //        var peText = (string)jsonData.GetType().GetProperty("联系人电话及邮箱")!.GetValue(jsonData)!;
+            //        var usa_phone = Regex.Match(peText ?? "", @"[\d-]+").Value;          // 数字和中横线
+            //        var usa_email = Regex.Match(peText ?? "", @"[^@\s]+@[^@\s]+\.[^@\s]+").Value;
+            //        //赴美时间、停留时间处理 
+            //        var usa_dateText = (string)jsonData.GetType().GetProperty("联系人电话及邮箱")!.GetValue(jsonData)!;
+            //        var (usa_d, usa_days) = TravelParser(usa_dateText);
+            //        //赴美同行人
+            //        string usaCmpNameText = (string)jsonData.GetType().GetProperty("赴美同行人")!.GetValue(jsonData)!;
+            //        string usaCmpName = string.Empty;
+            //        if (usaCmpNameText.Contains("是"))
+            //        {
+            //            var usaCmpNameTextSplit = usaCmpNameText.Replace(":", "-").Replace("", "-").Split("-");
+            //            if (usaCmpNameTextSplit.Length > 1)
+            //            {
+            //                usaCmpName = usaCmpNameTextSplit[1];
+            //            }
+            //        }
+            //        //是否丢失过护照
+            //        string loseCodeText = (string)jsonData.GetType().GetProperty("是否丢失过护照")!.GetValue(jsonData)!;
+            //        string loseCode = string.Empty;
+            //        if (loseCodeText.Contains("是"))
+            //        {
+            //            var loseCodeTextSplit = loseCodeText.Replace(":", "-").Replace("", "-").Split("-");
+            //            if (loseCodeTextSplit.Length > 1)
+            //            {
+            //                usaCmpName = loseCodeTextSplit[1];
+            //            }
+            //        }
+            //        //是否获得过美国签证
+            //        string usaVisaText = (string)jsonData.GetType().GetProperty("是否丢失过护照")!.GetValue(jsonData)!;
+            //        string usaVisaDateText = (string)jsonData.GetType().GetProperty("获得日期")!.GetValue(jsonData)!;
+            //        //DateTime usaVisaDate;
+            //        if (!string.IsNullOrEmpty(usaVisaDateText))
+            //        {
+            //            if (DateTime.TryParse(usaVisaDateText, out DateTime usaVisaDate))
+            //            {
+            //                visaDetails.ClientInfo.GetUSAVisaDate = usaVisaDate;
+            //            }
+            //        }
 
-                //        string usaFingerText = (string)jsonData.GetType().GetProperty("是否留过十指指纹")!.GetValue(jsonData)!;
-                //        int usaFinger = 0;
-                //        if (usaFingerText.Contains('是')) usaFinger = 1;
+            //        string usaFingerText = (string)jsonData.GetType().GetProperty("是否留过十指指纹")!.GetValue(jsonData)!;
+            //        int usaFinger = 0;
+            //        if (usaFingerText.Contains('是')) usaFinger = 1;
 
-                //        string usaLoseText = (string)jsonData.GetType().GetProperty("签证是否曾遗失")!.GetValue(jsonData)!;
-                //        int usaLose = 0;
-                //        if (usaLoseText.Contains("是")) usaLose = 1;
+            //        string usaLoseText = (string)jsonData.GetType().GetProperty("签证是否曾遗失")!.GetValue(jsonData)!;
+            //        int usaLose = 0;
+            //        if (usaLoseText.Contains("是")) usaLose = 1;
 
-                //        //是否曾抵达过美国
-                //        string usaHadArrival‌Text = (string)jsonData.GetType().GetProperty("是否曾抵达过美国")!.GetValue(jsonData)!;
-                //        var (usaHadArrivalf, usaHadArrivalD, usaHadArrivalDays) = TravelHadFlagParser(usaHadArrival‌Text);
+            //        //是否曾抵达过美国
+            //        string usaHadArrival‌Text = (string)jsonData.GetType().GetProperty("是否曾抵达过美国")!.GetValue(jsonData)!;
+            //        var (usaHadArrivalf, usaHadArrivalD, usaHadArrivalDays) = TravelHadFlagParser(usaHadArrival‌Text);
 
-                //        //是否有被美国拒发签证的经历
-                //        string usaRejecteVisaTest = (string)jsonData.GetType().GetProperty("是否有被美国拒发签证的经历")!.GetValue(jsonData)!;
-                //        var (denied, rejectedDate, rejectedPlace, rejectedType) = VisaDenialParser(usaRejecteVisaTest);
-                //        if (denied)
-                //        {
-                //            visaDetails.ClientInfo.RejectedDate = rejectedDate;
-                //            visaDetails.ClientInfo.RejectedPlace = rejectedPlace;
-                //            visaDetails.ClientInfo.RejectedVisa = rejectedType;
-                //        }
-                //        //是否在申请或曾经申请过美国移民签证
-                //        string usaImmVisaText‌ = (string)jsonData.GetType().GetProperty("是否在申请或曾经申请过美国移民签证")!.GetValue(jsonData)!;
-                //        var (immDenied, immDate, immPlace, immType) = VisaDenialParser(usaImmVisaText‌);
-                //        if (immDenied)
-                //        {
-                //            visaDetails.ClientInfo.USAImmVisa‌Date = immDate;
-                //            visaDetails.ClientInfo.USAImmVisa‌Place = immPlace;
-                //            visaDetails.ClientInfo.USAImmVisa‌ = immType;
-                //        }
+            //        //是否有被美国拒发签证的经历
+            //        string usaRejecteVisaTest = (string)jsonData.GetType().GetProperty("是否有被美国拒发签证的经历")!.GetValue(jsonData)!;
+            //        var (denied, rejectedDate, rejectedPlace, rejectedType) = VisaDenialParser(usaRejecteVisaTest);
+            //        if (denied)
+            //        {
+            //            visaDetails.ClientInfo.RejectedDate = rejectedDate;
+            //            visaDetails.ClientInfo.RejectedPlace = rejectedPlace;
+            //            visaDetails.ClientInfo.RejectedVisa = rejectedType;
+            //        }
+            //        //是否在申请或曾经申请过美国移民签证
+            //        string usaImmVisaText‌ = (string)jsonData.GetType().GetProperty("是否在申请或曾经申请过美国移民签证")!.GetValue(jsonData)!;
+            //        var (immDenied, immDate, immPlace, immType) = VisaDenialParser(usaImmVisaText‌);
+            //        if (immDenied)
+            //        {
+            //            visaDetails.ClientInfo.USAImmVisa‌Date = immDate;
+            //            visaDetails.ClientInfo.USAImmVisa‌Place = immPlace;
+            //            visaDetails.ClientInfo.USAImmVisa‌ = immType;
+            //        }
 
-                //        //在美直系 
-                //        string usaImmedText‌ = (string)jsonData.GetType().GetProperty("是否有直系亲属在美国")!.GetValue(jsonData)!;
-                //        var (immedDenied, immedName, immedRel, immedStat) = FourFieldParser(usaImmedText‌);
-                //        if (immedDenied)
-                //        {
-                //            visaDetails.ClientInfo.USAImmedFamName = immedName;
-                //            visaDetails.ClientInfo.USAImmedFamRel = immedRel;
-                //            visaDetails.ClientInfo.USAImmedFamStat = immedStat;
-                //        }
-                //        //在美旁系
-                //        string usaUncleText‌ = (string)jsonData.GetType().GetProperty("是否有旁系亲属在美国")!.GetValue(jsonData)!;
-                //        var (uncleDenied, uncleName, uncleRel, uncleStat) = FourFieldParser(usaUncleText‌);
-                //        if (immedDenied)
-                //        {
-                //            visaDetails.ClientInfo.USAUncleFamName = uncleName;
-                //            visaDetails.ClientInfo.USAUncleFamRel = uncleName;
-                //            visaDetails.ClientInfo.USAUncleFamStat = uncleStat;
-                //        }
+            //        //在美直系 
+            //        string usaImmedText‌ = (string)jsonData.GetType().GetProperty("是否有直系亲属在美国")!.GetValue(jsonData)!;
+            //        var (immedDenied, immedName, immedRel, immedStat) = FourFieldParser(usaImmedText‌);
+            //        if (immedDenied)
+            //        {
+            //            visaDetails.ClientInfo.USAImmedFamName = immedName;
+            //            visaDetails.ClientInfo.USAImmedFamRel = immedRel;
+            //            visaDetails.ClientInfo.USAImmedFamStat = immedStat;
+            //        }
+            //        //在美旁系
+            //        string usaUncleText‌ = (string)jsonData.GetType().GetProperty("是否有旁系亲属在美国")!.GetValue(jsonData)!;
+            //        var (uncleDenied, uncleName, uncleRel, uncleStat) = FourFieldParser(usaUncleText‌);
+            //        if (immedDenied)
+            //        {
+            //            visaDetails.ClientInfo.USAUncleFamName = uncleName;
+            //            visaDetails.ClientInfo.USAUncleFamRel = uncleName;
+            //            visaDetails.ClientInfo.USAUncleFamStat = uncleStat;
+            //        }
 
-                //        //服役时间 MilitaryParser
-                //        string militaryText‌ = (string)jsonData.GetType().GetProperty("是否曾参过军")!.GetValue(jsonData)!;
-                //        var (militaryH, militaryB, militaryR, militaryS, (militaryStart, militaryEnd)) = MilitaryParser(militaryText‌);
-                //        var militarys = new List<MilitaryInfo>();
-                //        if (militaryH)
-                //        {
-                //            militarys.Add(new()
-                //            {
-                //                MilBranch = militaryB,
-                //                MilRank = militaryR,
-                //                MilSkill = militaryS,
-                //                ServeTimeBegin = militaryStart,
-                //                ServeTimeEnd = militaryEnd,
-                //            });
-                //        }
-                //        //申请人父母信息 ParentParser
-                //        string fthMthText‌ = (string)jsonData.GetType().GetProperty("申请人父母信息")!.GetValue(jsonData)!;
-                //        if (!string.IsNullOrEmpty(fthMthText‌))
-                //        {
-                //            var (fName, fDob, mName, mDob) = ParentParser(fthMthText‌);
-                //            visaDetails.ClientInfo.FthName = fName;
-                //            visaDetails.ClientInfo.FthBirth = fDob;
-                //            visaDetails.ClientInfo.MthName = mName;
-                //            visaDetails.ClientInfo.MthBirth = mDob;
-                //        }
+            //        //服役时间 MilitaryParser
+            //        string militaryText‌ = (string)jsonData.GetType().GetProperty("是否曾参过军")!.GetValue(jsonData)!;
+            //        var (militaryH, militaryB, militaryR, militaryS, (militaryStart, militaryEnd)) = MilitaryParser(militaryText‌);
+            //        var militarys = new List<MilitaryInfo>();
+            //        if (militaryH)
+            //        {
+            //            militarys.Add(new()
+            //            {
+            //                MilBranch = militaryB,
+            //                MilRank = militaryR,
+            //                MilSkill = militaryS,
+            //                ServeTimeBegin = militaryStart,
+            //                ServeTimeEnd = militaryEnd,
+            //            });
+            //        }
+            //        //申请人父母信息 ParentParser
+            //        string fthMthText‌ = (string)jsonData.GetType().GetProperty("申请人父母信息")!.GetValue(jsonData)!;
+            //        if (!string.IsNullOrEmpty(fthMthText‌))
+            //        {
+            //            var (fName, fDob, mName, mDob) = ParentParser(fthMthText‌);
+            //            visaDetails.ClientInfo.FthName = fName;
+            //            visaDetails.ClientInfo.FthBirth = fDob;
+            //            visaDetails.ClientInfo.MthName = mName;
+            //            visaDetails.ClientInfo.MthBirth = mDob;
+            //        }
 
-                //        visaDetails.ClientInfo = new()
-                //        {
-                //            LastName = name.GetLastName(),
-                //            FirstName = name.GetFirstName(),
-                //            Sex = (string)jsonData.GetType().GetProperty("性别")!.GetValue(jsonData)! == "男" ? 0 : 1,
-                //            OldName = (string)jsonData.GetType().GetProperty("曾用名")!.GetValue(jsonData)!,
-                //            BirthDay = birthDayDt,
-                //            BirthProvince = birthDay1.province,
-                //            BirthCity = birthDay1.city,
-                //            Address = address.address,
-                //            PostCodes = address.zipCode,
-                //            Marriage = maritalStatus,
-                //            MateName = (string)jsonData.GetType().GetProperty("配偶姓名")!.GetValue(jsonData)!,
-                //            MateBirthDay = birthDayDt_mate,
-                //            MateBirthCountry = birthDay1_mate.province,
-                //            MateBirthCity = birthDay1_mate.city,
-                //            USA_DLNo = driveInfo.number,
-                //            USA_DLPlace = driveInfo.place,
-                //            USA_SSNOrITIN = number,
-                //            Resident = CleanPrefix((string)jsonData.GetType().GetProperty("是否是其他国家的永久居民")!.GetValue(jsonData)!),
-                //            HasSocialAcc‌ = CleanPrefix((string)jsonData.GetType().GetProperty("近五年内是否使用过任何社交账号")!.GetValue(jsonData)!),
-                //            WeddingDate = f,
-                //            DivorceDate = t,
-                //            DivorceRsn = (string)jsonData.GetType().GetProperty("离婚原因")!.GetValue(jsonData)!,
-                //            Job = (string)jsonData.GetType().GetProperty("职务")!.GetValue(jsonData)!,
-                //            Wage = (string)jsonData.GetType().GetProperty("月薪")!.GetValue(jsonData)!,
-                //            WorkState = (string)jsonData.GetType().GetProperty("工作职责")!.GetValue(jsonData)!,
-                //            WorkDate = (string)jsonData.GetType().GetProperty("入职/入学时间(详细到月)")!.GetValue(jsonData)!,
-                //            USAAddress = (string)jsonData.GetType().GetProperty("请提供美国详细住址")!.GetValue(jsonData)!,
-                //            USAPurpose = (string)jsonData.GetType().GetProperty("赴美目的")!.GetValue(jsonData)!,
-                //            CostBearers = (string)jsonData.GetType().GetProperty("费用谁付")!.GetValue(jsonData)!,
-                //            USAContact = (string)jsonData.GetType().GetProperty("美国联系人或组织")!.GetValue(jsonData)!,
-                //            USAContactTel = usa_phone,
-                //            USAContactEmail = usa_email,
-                //            USADate = usa_d,
-                //            USADays = usa_days,
-                //            USAArrivalCity‌ = (string)jsonData.GetType().GetProperty("赴美的到达城市")!.GetValue(jsonData)!,
-                //            USADepartCity‌ = (string)jsonData.GetType().GetProperty("赴美的离开城市")!.GetValue(jsonData)!,
-                //            USAVisitSites‌ = (string)jsonData.GetType().GetProperty("计划在美国访问的景点")!.GetValue(jsonData)!,
-                //            USACmpName = usaCmpName,
-                //            USACmpRelation = (string)jsonData.GetType().GetProperty("同行人关系")!.GetValue(jsonData)!,
-                //            Tel = (string)jsonData.GetType().GetProperty("家庭电话")!.GetValue(jsonData)!,
-                //            ClientPhone = (string)jsonData.GetType().GetProperty("单位电话")!.GetValue(jsonData)!,
-                //            Phone = (string)jsonData.GetType().GetProperty("移动电话")!.GetValue(jsonData)!,
-                //            Cntry5Y‌ = (string)jsonData.GetType().GetProperty("过去5年内到过的国家")!.GetValue(jsonData)!,
-                //            LangSkill‌ = (string)jsonData.GetType().GetProperty("面签时能流利交流的语言")!.GetValue(jsonData)!,
-                //            LoseCode = loseCode,
-                //            DenyNationRsn = (string)jsonData.GetType().GetProperty("曾被哪些国家拒签/拒签原因")!.GetValue(jsonData)!,
-                //            USAVisaCode = (string)jsonData.GetType().GetProperty("签证号码")!.GetValue(jsonData)!,
-                //            USAVisaCate = (string)jsonData.GetType().GetProperty("获签类型")!.GetValue(jsonData)!,
-                //            //GetUSAVisaDate = usaVisaDate,
-                //            USAFinger = usaFinger,
-                //            IsLose = usaLose,
-                //            USAHadArrival = usaHadArrivalD,
-                //            USAHadDays = usaHadArrivalDays,
-                //            ArmyState = JsonConvert.SerializeObject(militarys)
-                //        };
-                //        visaDetails.ClientCerts = new() {
-                //                new(){ SdId = 74,CertNo = passportNo,IDCardAddress = passportPlace },
-                //                new(){ SdId = 73,CertNo = idNo},
-                //            };
-                //        visaDetails.ClientCompany = new() { CompanyFullName = clientName, Address = clientAddr };
-
-
-
-                //        break;
-                //    //中文个人简历模板
-                //    case 6:
-                //        _logger.LogInformation("【签证上传文件操作信息】【中文个人简历模板】【KIMI-AI-API访问计次】{count} 次", kimiAI_API_Index);
-
-                //        visaDetails.ClientInfo.LastName = (string)jsonData.GetType().GetProperty("姓名(中英文拼音)")!.GetValue(jsonData)!;
-                //        visaDetails.ClientInfo.Sex = (string)jsonData.GetType().GetProperty("性别")!.GetValue(jsonData)! == "男" ? 0 : 1;
-
-                //        DateTime.TryParse((string)jsonData.GetType().GetProperty("出生日期")!.GetValue(jsonData)!, out DateTime birthDay11);
-                //        visaDetails.ClientInfo.BirthDay = birthDay11;
-
-                //        visaDetails.ClientInfo.BirthProvince = (string)jsonData.GetType().GetProperty("出生地")!.GetValue(jsonData)!;
-                //        visaDetails.ClientInfo.Address = (string)jsonData.GetType().GetProperty("家庭地址")!.GetValue(jsonData)!;
-                //        visaDetails.ClientInfo.Tel = (string)jsonData.GetType().GetProperty("家庭电话")!.GetValue(jsonData)!;
-                //        visaDetails.ClientInfo.TableOpTel = (string)jsonData.GetType().GetProperty("工作电话")!.GetValue(jsonData)!;
-                //        visaDetails.ClientInfo.Phone = (string)jsonData.GetType().GetProperty("移动电话")!.GetValue(jsonData)!;
-                //        visaDetails.ClientInfo.Email = (string)jsonData.GetType().GetProperty("电子邮件")!.GetValue(jsonData)!;
-
-                //        //学校信息
-                //        visaDetails.ClientSchools.Add(new()
-                //        {
-                //            School = (string)jsonData.GetType().GetProperty("教育学校名称")!.GetValue(jsonData)!,
-                //            Education = (string)jsonData.GetType().GetProperty("教育学位")!.GetValue(jsonData)!,
-                //            Subject = (string)jsonData.GetType().GetProperty("教育专业")!.GetValue(jsonData)!,
-                //            Remark = (string)jsonData.GetType().GetProperty("教育论文题目/研究重点(硕士、博士)")!.GetValue(jsonData)!,
-                //        });
-
-                //        //工作信息
-                //        visaDetails.ClientCompany = new()
-                //        {
-                //            CompanyFullName = (string)jsonData.GetType().GetProperty("工作经历雇主")!.GetValue(jsonData)!,
-                //        };
+            //        visaDetails.ClientInfo = new()
+            //        {
+            //            LastName = name.GetLastName(),
+            //            FirstName = name.GetFirstName(),
+            //            Sex = (string)jsonData.GetType().GetProperty("性别")!.GetValue(jsonData)! == "男" ? 0 : 1,
+            //            OldName = (string)jsonData.GetType().GetProperty("曾用名")!.GetValue(jsonData)!,
+            //            BirthDay = birthDayDt,
+            //            BirthProvince = birthDay1.province,
+            //            BirthCity = birthDay1.city,
+            //            Address = address.address,
+            //            PostCodes = address.zipCode,
+            //            Marriage = maritalStatus,
+            //            MateName = (string)jsonData.GetType().GetProperty("配偶姓名")!.GetValue(jsonData)!,
+            //            MateBirthDay = birthDayDt_mate,
+            //            MateBirthCountry = birthDay1_mate.province,
+            //            MateBirthCity = birthDay1_mate.city,
+            //            USA_DLNo = driveInfo.number,
+            //            USA_DLPlace = driveInfo.place,
+            //            USA_SSNOrITIN = number,
+            //            Resident = CleanPrefix((string)jsonData.GetType().GetProperty("是否是其他国家的永久居民")!.GetValue(jsonData)!),
+            //            HasSocialAcc‌ = CleanPrefix((string)jsonData.GetType().GetProperty("近五年内是否使用过任何社交账号")!.GetValue(jsonData)!),
+            //            WeddingDate = f,
+            //            DivorceDate = t,
+            //            DivorceRsn = (string)jsonData.GetType().GetProperty("离婚原因")!.GetValue(jsonData)!,
+            //            Job = (string)jsonData.GetType().GetProperty("职务")!.GetValue(jsonData)!,
+            //            Wage = (string)jsonData.GetType().GetProperty("月薪")!.GetValue(jsonData)!,
+            //            WorkState = (string)jsonData.GetType().GetProperty("工作职责")!.GetValue(jsonData)!,
+            //            WorkDate = (string)jsonData.GetType().GetProperty("入职/入学时间(详细到月)")!.GetValue(jsonData)!,
+            //            USAAddress = (string)jsonData.GetType().GetProperty("请提供美国详细住址")!.GetValue(jsonData)!,
+            //            USAPurpose = (string)jsonData.GetType().GetProperty("赴美目的")!.GetValue(jsonData)!,
+            //            CostBearers = (string)jsonData.GetType().GetProperty("费用谁付")!.GetValue(jsonData)!,
+            //            USAContact = (string)jsonData.GetType().GetProperty("美国联系人或组织")!.GetValue(jsonData)!,
+            //            USAContactTel = usa_phone,
+            //            USAContactEmail = usa_email,
+            //            USADate = usa_d,
+            //            USADays = usa_days,
+            //            USAArrivalCity‌ = (string)jsonData.GetType().GetProperty("赴美的到达城市")!.GetValue(jsonData)!,
+            //            USADepartCity‌ = (string)jsonData.GetType().GetProperty("赴美的离开城市")!.GetValue(jsonData)!,
+            //            USAVisitSites‌ = (string)jsonData.GetType().GetProperty("计划在美国访问的景点")!.GetValue(jsonData)!,
+            //            USACmpName = usaCmpName,
+            //            USACmpRelation = (string)jsonData.GetType().GetProperty("同行人关系")!.GetValue(jsonData)!,
+            //            Tel = (string)jsonData.GetType().GetProperty("家庭电话")!.GetValue(jsonData)!,
+            //            ClientPhone = (string)jsonData.GetType().GetProperty("单位电话")!.GetValue(jsonData)!,
+            //            Phone = (string)jsonData.GetType().GetProperty("移动电话")!.GetValue(jsonData)!,
+            //            Cntry5Y‌ = (string)jsonData.GetType().GetProperty("过去5年内到过的国家")!.GetValue(jsonData)!,
+            //            LangSkill‌ = (string)jsonData.GetType().GetProperty("面签时能流利交流的语言")!.GetValue(jsonData)!,
+            //            LoseCode = loseCode,
+            //            DenyNationRsn = (string)jsonData.GetType().GetProperty("曾被哪些国家拒签/拒签原因")!.GetValue(jsonData)!,
+            //            USAVisaCode = (string)jsonData.GetType().GetProperty("签证号码")!.GetValue(jsonData)!,
+            //            USAVisaCate = (string)jsonData.GetType().GetProperty("获签类型")!.GetValue(jsonData)!,
+            //            //GetUSAVisaDate = usaVisaDate,
+            //            USAFinger = usaFinger,
+            //            IsLose = usaLose,
+            //            USAHadArrival = usaHadArrivalD,
+            //            USAHadDays = usaHadArrivalDays,
+            //            ArmyState = JsonConvert.SerializeObject(militarys)
+            //        };
+            //        visaDetails.ClientCerts = new() {
+            //                new(){ SdId = 74,CertNo = passportNo,IDCardAddress = passportPlace },
+            //                new(){ SdId = 73,CertNo = idNo},
+            //            };
+            //        visaDetails.ClientCompany = new() { CompanyFullName = clientName, Address = clientAddr };
+
+
+
+            //        break;
+            //    //中文个人简历模板
+            //    case 6:
+            //        _logger.LogInformation("【签证上传文件操作信息】【中文个人简历模板】【KIMI-AI-API访问计次】{count} 次", kimiAI_API_Index);
+
+            //        visaDetails.ClientInfo.LastName = (string)jsonData.GetType().GetProperty("姓名(中英文拼音)")!.GetValue(jsonData)!;
+            //        visaDetails.ClientInfo.Sex = (string)jsonData.GetType().GetProperty("性别")!.GetValue(jsonData)! == "男" ? 0 : 1;
+
+            //        DateTime.TryParse((string)jsonData.GetType().GetProperty("出生日期")!.GetValue(jsonData)!, out DateTime birthDay11);
+            //        visaDetails.ClientInfo.BirthDay = birthDay11;
+
+            //        visaDetails.ClientInfo.BirthProvince = (string)jsonData.GetType().GetProperty("出生地")!.GetValue(jsonData)!;
+            //        visaDetails.ClientInfo.Address = (string)jsonData.GetType().GetProperty("家庭地址")!.GetValue(jsonData)!;
+            //        visaDetails.ClientInfo.Tel = (string)jsonData.GetType().GetProperty("家庭电话")!.GetValue(jsonData)!;
+            //        visaDetails.ClientInfo.TableOpTel = (string)jsonData.GetType().GetProperty("工作电话")!.GetValue(jsonData)!;
+            //        visaDetails.ClientInfo.Phone = (string)jsonData.GetType().GetProperty("移动电话")!.GetValue(jsonData)!;
+            //        visaDetails.ClientInfo.Email = (string)jsonData.GetType().GetProperty("电子邮件")!.GetValue(jsonData)!;
+
+            //        //学校信息
+            //        visaDetails.ClientSchools.Add(new()
+            //        {
+            //            School = (string)jsonData.GetType().GetProperty("教育学校名称")!.GetValue(jsonData)!,
+            //            Education = (string)jsonData.GetType().GetProperty("教育学位")!.GetValue(jsonData)!,
+            //            Subject = (string)jsonData.GetType().GetProperty("教育专业")!.GetValue(jsonData)!,
+            //            Remark = (string)jsonData.GetType().GetProperty("教育论文题目/研究重点(硕士、博士)")!.GetValue(jsonData)!,
+            //        });
+
+            //        //工作信息
+            //        visaDetails.ClientCompany = new()
+            //        {
+            //            CompanyFullName = (string)jsonData.GetType().GetProperty("工作经历雇主")!.GetValue(jsonData)!,
+            //        };
 
-                //        visaDetails.ClientInfo.Job = (string)jsonData.GetType().GetProperty("工作经历职位或头衔职责")!.GetValue(jsonData)!;
+            //        visaDetails.ClientInfo.Job = (string)jsonData.GetType().GetProperty("工作经历职位或头衔职责")!.GetValue(jsonData)!;
 
-                //        break;
-                //    default:
+            //        break;
+            //    default:
 
-                //        break;
+            //        break;
 
-                //}
-                #endregion
+            //}
+            #endregion
 
-                //数据提交
-                #region 数据提交
+            //数据提交
+            #region 数据提交
 
-                //_sqlSugar.BeginTran();
-                //// 客户公司表
-                //var compId = UpsertReturnId<Crm_CustomerCompany>(visaDetails.ClientCompany, o => o.CompanyFullName);
-                //if (compId < 1)
-                //{
-                //    _sqlSugar.RollbackTran();
-                //    return Ok(JsonView(false, "公司信息更新失败!"));
-                //}
-                //visaDetails.ClientInfo.CrmCompanyId = compId;
-                //// 客户资料表
-                //var clientId = UpsertReturnId<Crm_DeleClient>(visaDetails.ClientInfo, o => new { o.LastName, o.FirstName });
-                //if (clientId < 1)
-                //{
-                //    _sqlSugar.RollbackTran();
-                //    return Ok(JsonView(false, "客户信息更新失败!"));
-                //}
-                //for (int i = 0; i < visaDetails.ClientFamilys.Count(); i++)
-                //{
-                //    visaDetails.ClientFamilys[i].DcId = clientId;
-                //}
-                //for (int i = 0; i < visaDetails.ClientCerts.Count(); i++)
-                //{
-                //    visaDetails.ClientCerts[i].DcId = clientId;
-                //}
-                //for (int i = 0; i < visaDetails.ClientSchools.Count(); i++)
-                //{
-                //    visaDetails.ClientSchools[i].DcId = clientId;
-                //}
+            //_sqlSugar.BeginTran();
+            //// 客户公司表
+            //var compId = UpsertReturnId<Crm_CustomerCompany>(visaDetails.ClientCompany, o => o.CompanyFullName);
+            //if (compId < 1)
+            //{
+            //    _sqlSugar.RollbackTran();
+            //    return Ok(JsonView(false, "公司信息更新失败!"));
+            //}
+            //visaDetails.ClientInfo.CrmCompanyId = compId;
+            //// 客户资料表
+            //var clientId = UpsertReturnId<Crm_DeleClient>(visaDetails.ClientInfo, o => new { o.LastName, o.FirstName });
+            //if (clientId < 1)
+            //{
+            //    _sqlSugar.RollbackTran();
+            //    return Ok(JsonView(false, "客户信息更新失败!"));
+            //}
+            //for (int i = 0; i < visaDetails.ClientFamilys.Count(); i++)
+            //{
+            //    visaDetails.ClientFamilys[i].DcId = clientId;
+            //}
+            //for (int i = 0; i < visaDetails.ClientCerts.Count(); i++)
+            //{
+            //    visaDetails.ClientCerts[i].DcId = clientId;
+            //}
+            //for (int i = 0; i < visaDetails.ClientSchools.Count(); i++)
+            //{
+            //    visaDetails.ClientSchools[i].DcId = clientId;
+            //}
 
-                //// 客户家庭表
-                //foreach (var item in visaDetails.ClientFamilys)
-                //{
-                //    var famId = UpsertReturnId<Crm_VisaCustomerFamily>(item, o => o.Name);
-                //    if (famId < 1)
-                //    {
-                //        _sqlSugar.RollbackTran();
-                //        return Ok(JsonView(false, "客户家庭信息更新失败!"));
-                //    }
-                //}
+            //// 客户家庭表
+            //foreach (var item in visaDetails.ClientFamilys)
+            //{
+            //    var famId = UpsertReturnId<Crm_VisaCustomerFamily>(item, o => o.Name);
+            //    if (famId < 1)
+            //    {
+            //        _sqlSugar.RollbackTran();
+            //        return Ok(JsonView(false, "客户家庭信息更新失败!"));
+            //    }
+            //}
 
-                //// 客户证件表
-                //foreach (var item in visaDetails.ClientCerts)
-                //{
-                //    var certId = UpsertReturnId<Crm_CustomerCert>(item, o => o.CertNo);
-                //    if (certId < 1)
-                //    {
-                //        _sqlSugar.RollbackTran();
-                //        return Ok(JsonView(false, "客户证件信息更新失败!"));
-                //    }
-                //}
-                //// 客户学历表
-                //foreach (var item in visaDetails.ClientSchools)
-                //{
-                //    var schoolId = UpsertReturnId<Crm_VisaCustomerSchool>(item, o => o.School);
-                //    if (schoolId < 1)
-                //    {
-                //        _sqlSugar.RollbackTran();
-                //        return Ok(JsonView(false, "客户证件信息更新失败!"));
-                //    }
-                //}
+            //// 客户证件表
+            //foreach (var item in visaDetails.ClientCerts)
+            //{
+            //    var certId = UpsertReturnId<Crm_CustomerCert>(item, o => o.CertNo);
+            //    if (certId < 1)
+            //    {
+            //        _sqlSugar.RollbackTran();
+            //        return Ok(JsonView(false, "客户证件信息更新失败!"));
+            //    }
+            //}
+            //// 客户学历表
+            //foreach (var item in visaDetails.ClientSchools)
+            //{
+            //    var schoolId = UpsertReturnId<Crm_VisaCustomerSchool>(item, o => o.School);
+            //    if (schoolId < 1)
+            //    {
+            //        _sqlSugar.RollbackTran();
+            //        return Ok(JsonView(false, "客户证件信息更新失败!"));
+            //    }
+            //}
 
-                //_sqlSugar.CommitTran();
-                #endregion
+            //_sqlSugar.CommitTran();
+            #endregion
             #endregion
 
             return Ok(JsonView(true, jsonString));
@@ -5045,7 +5045,7 @@ FROM
                                 dics.Add("HotalTel", hotelInfo?.HotelTel ?? "");  //酒店电话
                             }
                         }
-                        
+
                         dics.Add("Tel", custInfo?.Tel ?? "");//移动电话
                         dics.Add("Client", companyInfos?.FirstOrDefault()?.Company ?? "");//单位名称
                         dics.Add("ClientPhone", companyInfos?.FirstOrDefault()?.Phone ?? "");//单位电话
@@ -5515,7 +5515,7 @@ FROM
 
                             string currentNationality = custInfo.BirthProvince + custInfo.BirthCity;
                             SetFieldValue(formFields, "CurrentNationality", currentNationality); // 出生地
-                            SetFieldValue(formFields, "CountryBirth","中国"); // 出生国
+                            SetFieldValue(formFields, "CountryBirth", "中国"); // 出生国
                             SetFieldValue(formFields, "CurrentNationalityCountry", "中国"); // 现国籍
                             SetFieldValue(formFields, "NationalityBirth", ""); // 出生时国籍,如与现国籍不同
                             SetFieldValue(formFields, "OtherNationalities", ""); // 其他国籍
@@ -5865,7 +5865,8 @@ FROM
                     {
                         EncryptionProcessor.DecryptProperties(custInfo);
 
-                        var visaData = new VisaDateView() {
+                        var visaData = new VisaDateView()
+                        {
                             groupInfo = groupInfo,
                             idInfo = certInfos.FirstOrDefault(x => x.DcId == custInfo.Id && x.PassportType == 773),
                             passportInfo = certInfos.FirstOrDefault(x => x.DcId == custInfo.Id && x.PassportType == 774),
@@ -5944,7 +5945,7 @@ FROM
         /// <param name="currTempPath"></param>
         /// <returns></returns>
         /// <exception cref="Exception"></exception>
-        private string CreatePolandVisaPdf(VisaDateView data, string currSavePath,string currTempPath)
+        private string CreatePolandVisaPdf(VisaDateView data, string currSavePath, string currTempPath)
         {
             var groupInfo = data.groupInfo;
             var groupId = groupInfo.Id;
@@ -6030,7 +6031,7 @@ FROM
                 SetFieldValue(formFields, "9.Widow(er)", "Off"); // 婚姻状况 - 丧偶
                 SetFieldValue(formFields, "9.OtherCivilStatus", "Off"); // 婚姻状况 - 其它
                 SetFieldValue(formFields, "9.CivilStatusOther", ""); // 婚姻状况 - 其它(请注明)
-                                                                   //设置婚姻状况
+                                                                     //设置婚姻状况
                 switch (custInfo.Marriage)
                 {
                     case 1: // 未婚
@@ -6377,7 +6378,7 @@ FROM
             public List<Crm_VisaCustomerCompany> companyInfos { get; set; }
         }
 
-        
+
         private class SSGDetails
         {
             public string Three { get; set; }        //三字码
@@ -6781,7 +6782,7 @@ FROM
                 {
                     sqlWhere += $" AND IsSure = {dto.IsSure}";
                 }
-                
+
                 // 搜索条件
                 if (!string.IsNullOrEmpty(dto.SearchCriteria))
                 {
@@ -11044,7 +11045,7 @@ FROM
         /// <returns></returns>
         [HttpGet("{groupId}")]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GetEnterExitCostOVFeeDetails(int groupId,int currUserId)
+        public async Task<IActionResult> GetEnterExitCostOVFeeDetails(int groupId, int currUserId)
         {
             var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.Id == groupId).FirstAsync();
             if (groupInfo == null)
@@ -13345,7 +13346,7 @@ FROM
 
             return Ok(JsonView(false, "未操作!"));
         }
-        
+
         #endregion
 
         #region 团组经理模块 出入境费用-草稿
@@ -31186,7 +31187,7 @@ ORDER BY
                 .FirstAsync();
             if (groupInfo == null)
             {
-                return Ok(JsonView(false, "团组信息不存在"));
+                return Ok(JsonView(false, "团组信息不存在", ""));
             }
 
             var conferenceProceduresList = await _sqlSugar.Queryable<Grp_ConferenceProcedures>()
@@ -31195,13 +31196,13 @@ ORDER BY
 
             if (!conferenceProceduresList.Any())
             {
-                return Ok(JsonView(false, "会务流程信息不存在"));
+                return Ok(JsonView(false, "会务流程信息不存在", ""));
             }
 
             var filePath = $"{AppSettingsHelper.Get("ExcelBasePath")}Template/会务流程.xlsx";
             if (!System.IO.File.Exists(filePath))
             {
-                return Ok(JsonView(false, "模板文件不存在"));
+                return Ok(JsonView(false, "模板文件不存在", ""));
             }
 
             var designer = new WorkbookDesigner();
@@ -31921,9 +31922,9 @@ WHERE
         /// <returns></returns>
         [HttpGet]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> ConfProcessChangeNodeTempSave(int groupId,int nodeTempId,int currUserId)
+        public async Task<IActionResult> ConfProcessChangeNodeTempSave(int groupId, int nodeTempId, int currUserId)
         {
-            var res = await _processOverviewRep.ConfProcessChangeNodeTempSaveAsync(groupId, nodeTempId,currUserId);
+            var res = await _processOverviewRep.ConfProcessChangeNodeTempSaveAsync(groupId, nodeTempId, currUserId);
 
             if (res.Code == StatusCodes.Status200OK)
             {
@@ -31941,9 +31942,9 @@ WHERE
         /// <returns></returns>
         [HttpGet]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> ConfProcessDetails(int groupId,int currUserId)
+        public async Task<IActionResult> ConfProcessDetails(int groupId, int currUserId)
         {
-            var res = await _processOverviewRep.ConfProcessesDetailsAsync(groupId,currUserId);
+            var res = await _processOverviewRep.ConfProcessesDetailsAsync(groupId, currUserId);
 
             if (res.Code == StatusCodes.Status200OK)
             {
@@ -31978,7 +31979,7 @@ WHERE
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> ConfProcessSetActualDone(ConfProcessSetActualDoneDto dto)
-        { 
+        {
             var res = await _processOverviewRep.SetNodeInfoAsync(dto);
 
             if (res.Code == StatusCodes.Status200OK)

+ 163 - 5
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -17,6 +17,7 @@ using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Domain.ViewModels.Statistics;
 using OASystem.Infrastructure.Repositories.Groups;
 using OASystem.Infrastructure.Repositories.PersonnelModule;
+using System.Collections;
 using System.Data;
 using System.Diagnostics;
 using System.Globalization;
@@ -4068,11 +4069,168 @@ OPTION (MAXRECURSION 0); -- 允许无限递归      ";
         /// <param name="end"></param>
         /// <param name="createUserId"></param>
         /// <returns></returns>
-        // [HttpGet]
-        // public async Task<IActionResult> AiPerformanceAnalysis_PlanningDepartmentAsync(int userId, DateTime start, DateTime end, int createUserId)
-        // {
+        [HttpGet]
+        public async Task<IActionResult> AiPerformanceAnalysis_PlanningDepartmentAsync(int userId, DateTime start, DateTime end, int createUserId)
+        {
+            var jw = JsonView(false);
+            var month = start.ToString("yyyy-MM");
+            var user_entity = await _sqlSugar.Queryable<Sys_Users>().FirstAsync(x => x.Id == userId && x.IsDel == 0);
+            if (user_entity == null)
+            {
+                jw.Msg = "用户不存在!";
+                return Ok(jw);
+            }
 
-        // }
+            var data = await _companyDailyKyiRep.InfoAsync(month, userId);
+            if (data.Code == 200)
+            {
+                var value = data.Data as List<CompanyDailyKpiView>;
+
+                if (value == null || value.Count == 0)
+                {
+                    jw.Msg = "用户没有日常考勤数据!";
+                    return Ok(jw);
+                }
+
+                var valueFormat = value.Select(x => new
+                {
+                    年月 = x.Month,
+                    序号 = x.EvalContentOrder,
+                    内容 = x.EvalContent,
+                    考核人 = x.EvaluatorName,
+                    是否出现失误 = x.IsMistake,
+                    失误原因 = x.MistakeReason
+                }
+                ).ToList();
+
+
+                //检索负责的团组
+                var group_data = await _sqlSugar.Queryable<Grp_DelegationInfo>()
+                .Where(x => x.IsDel == 0)
+                .Where(x => SqlFunc.Between(x.VisitDate, start, end.AddMonths(1)))
+                .ToListAsync();
+
+                //检索会务成本数据
+                var conf_cost_data = await _sqlSugar.Queryable<Grp_ConfProcessOverview>()
+                .Where(x => x.IsDel == 0)
+                .Where(x => group_data.Select(y => y.Id).ToList().Contains(x.GroupId))
+                .ToListAsync();
+
+                //检索详情
+                var detail_data = await _sqlSugar.Queryable<Grp_ConfProcessNode>()
+                .Where(x => x.IsDel == 0)
+                .Where(x => conf_cost_data.Select(y => y.Id).ToList().Contains(x.ProcessId))
+                .ToListAsync();
+
+                var users = await _sqlSugar.Queryable<Sys_Users>().Select(x => new { x.Id, x.CnName }).ToListAsync();
+
+                //遍历团组
+                var Insert_detail_data = new ArrayList();
+                foreach (var group_item in group_data)
+                {
+                    var conf_cost_data_item = conf_cost_data.FirstOrDefault(x => x.GroupId == group_item.Id);
+                    if (conf_cost_data_item != null)
+                    {
+                        var query_detail_data = await _sqlSugar.Queryable<Grp_ConfProcessNode>()
+                        .Where(x => x.IsDel == 0)
+                        .Where(x => x.ProcessId == conf_cost_data_item.Id)
+                        .ToListAsync();
+
+                        if (query_detail_data.Count > 0)
+                        {
+                            Insert_detail_data.AddRange(query_detail_data.Select(x =>
+                            {
+                                var uList = new List<string>();
+                                foreach (var user in x.Participators)
+                                {
+                                    var user_item = users.FirstOrDefault(y => y.Id == user)?.CnName;
+                                    if (!string.IsNullOrEmpty(user_item))
+                                    {
+                                        uList.Add(user_item);
+                                    }
+                                }
+
+                                return new
+                                {
+                                    节点名称 = x.NodeName,
+                                    节点描述提示 = x.NodeDescTips,
+                                    节点状态 = x.OverallStatus,
+                                    实际完成时间 = x.ActualDone,
+                                    操作人 = uList,
+                                };
+
+                            }).ToList());
+                        }
+                    }
+                }
+
+                string question = string.Empty;
+                var settingTemp = await _sqlSugar.Queryable<Sys_SetData>().FirstAsync(x => x.Id == 1495 && x.IsDel == 0);
+                if (settingTemp != null && !string.IsNullOrEmpty(settingTemp.Remark))
+                {
+                    var temp = await GeneralMethod.StringFormatAsync(new StringFormatDto
+                    {
+                        FormatTemplate = settingTemp.Remark,
+                        Parameters = new List<string> {
+                            JsonConvert.SerializeObject(valueFormat),
+                            user_entity.CnName,
+                            month,
+                            JsonConvert.SerializeObject(Insert_detail_data),
+                        }
+                    });
+
+                    if (temp.Success)
+                    {
+                        question = temp.FormattedResult;
+                    }
+                }
+
+                var resp = await _deepSeekService.ChatAsync(question);
+                if (!resp.Success)
+                {
+                    jw.Msg = "Ai分析用户绩效失败!" + resp.Message;
+                    return Ok(jw);
+                }
+
+                var kaoqinResp = await GetKaoqinAnalysisAsync(user_entity, start, end, jw, "Ai分析用户绩效");
+                if (string.IsNullOrEmpty(kaoqinResp))
+                {
+                    return Ok(jw);
+                }
+
+                jw.Code = 200;
+                jw.Msg = "操作成功!";
+                jw.Data = new AiResponse()
+                {
+                    Answer = resp.Answer,
+                    KaoqinAnswer = kaoqinResp
+                };
+
+                //存入数据库
+                Pm_PerformanceAnalysis insertData = new Pm_PerformanceAnalysis
+                {
+                    CreateTime = DateTime.Now,
+                    CreateUserId = createUserId,
+                    IsDel = 0,
+                    Year = start.Year,
+                    Month = start.Month,
+                    JsonResult = JsonConvert.SerializeObject(jw.Data),
+                    StartDate = start,
+                    EndDate = end,
+                    UserId = userId
+                };
+
+                await _sqlSugar.Insertable(insertData).ExecuteCommandAsync();
+
+                return Ok(jw);
+            }
+            else
+            {
+                jw.Msg = "获取用户考勤数据失败!";
+                return Ok(jw);
+            }
+
+        }
 
         /// <summary>
         /// 任务分配分析
@@ -4336,7 +4494,7 @@ OPTION (MAXRECURSION 0); -- 允许无限递归      ";
         }
 
         /// <summary>
-        /// 国交员工分析pdf下载
+        /// 通用绩效分析pdf下载
         /// </summary>
         /// <param name="year"></param>
         /// <param name="month"></param>