Explorar el Código

新增瑞典签证生成逻辑及性能优化

- 在 `GroupsController.cs` 中引入 `iTextSharp` 库,用于处理 PDF 文件。
- 新增签证下载类型初始化逻辑,支持瑞典签证类型。
- 添加申根国、欧盟国家等数组,用于国家分类。
- 实现瑞典签证申请表生成,包括 PDF 模板读取和字段填充。
- 优化客户信息查询逻辑,支持姓名模糊查询及解密。
- 在 `SystemController.cs` 中新增用户绩效分析功能。
- 移除冗余代码,简化签证初始化逻辑。
- 在 `OASystem.API.csproj` 中新增 `iTextSharp` 包引用。
- 删除 `Grp_ProcessOverview.cs` 中的国家字段。
- 优化 `CountryFeeRepository.cs` 的查询条件,提升灵活性。
Lyyyi hace 1 hora
padre
commit
472eca4804

+ 454 - 12
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -5,6 +5,8 @@ using Aspose.Words.Tables;
 using DiffMatchPatch;
 using Dm.util;
 using Humanizer;
+using iTextSharp.text.pdf;
+using Microsoft.AspNetCore.Routing.Template;
 using Microsoft.AspNetCore.SignalR;
 using NPOI.SS.Formula.Functions;
 using NPOI.SS.UserModel;
@@ -36,6 +38,7 @@ using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.CRM;
 using OASystem.Domain.ViewModels.Financial;
 using OASystem.Domain.ViewModels.Groups;
+using OASystem.Domain.ViewModels.JuHeExchangeRate;
 using OASystem.Domain.ViewModels.OCR;
 using OASystem.Domain.ViewModels.SmallFun;
 using OASystem.Infrastructure.Repositories.CRM;
@@ -149,16 +152,6 @@ namespace OASystem.API.Controllers
                 { 28, new List<int> { 79 } }       // 商邀 -> 车/导游地接
             };
 
-        /// <summary>
-        /// 签证下载类型初始化
-        /// </summary>
-        private readonly Dictionary<int, string> _visaTypeInit = new()
-        {
-            { 1, "美国" },
-            { 2, "日本" },
-            { 3, "韩国" },
-        };
-
         /// <summary>
         /// 构造函数
         /// </summary>
@@ -4188,6 +4181,27 @@ FROM
         #endregion
 
         #region 文件下载
+
+        /// <summary>
+        /// 签证下载类型初始化
+        /// </summary>
+        private readonly Dictionary<int, string> _visaTypeInit = new()
+        {
+            { 1, "美国" },
+            { 2, "日本" },
+            { 3, "韩国" },
+            { 4, "瑞典" },
+        };
+
+        //申根国
+        private readonly string[] _shenGenGuos = new string[] { "奥地利", "比利时", "丹麦", "芬兰", "法国", "德国", "冰岛", "意大利", "希腊", "卢森堡", "荷兰", "挪威", "葡萄牙", "西班牙",
+                                              "瑞典", "匈牙利", "捷克", "斯洛伐克", "斯洛文尼亚","波兰","爱沙尼亚","拉脱维亚","立陶宛","马耳他","瑞士","列支敦士登" };
+        //欧盟国家
+        private readonly string[] _eucountries = new string[] { "奥地利", "比利时", "丹麦", "芬兰", "法国", "德国", "意大利", "希腊", "卢森堡", "荷兰",  "葡萄牙", "西班牙","爱尔兰","罗马尼亚",
+                                              "保加利亚","匈牙利", "捷克", "斯洛伐克", "斯洛文尼亚","波兰","爱沙尼亚","拉脱维亚","立陶宛","马耳他","瑞士","列支敦士登" };
+        //欧洲国家
+        private readonly string[] _aBC = new string[] { "英国", "爱尔兰" };
+
         /// <summary>
         ///  团组&签证 New
         ///  签证文申请表下载
@@ -4659,7 +4673,6 @@ FROM
                             }
                         }
                         
-
                         dics.Add("Tel", custInfo?.Tel ?? "");//移动电话
                         dics.Add("Client", companyInfos?.FirstOrDefault()?.Company ?? "");//单位名称
                         dics.Add("ClientPhone", companyInfos?.FirstOrDefault()?.Phone ?? "");//单位电话
@@ -4784,7 +4797,6 @@ FROM
                              birthday = year + "/" + month + "/" + day;
                         }
 
-
                         dics.Add("BirthDay", birthday);//出生日期 
                         dics.Add("Nationality", "中国");//国籍                                                                               
                         dics.Add("NationalityCountry", "中国");//出生国 
@@ -5064,6 +5076,404 @@ FROM
                         #endregion
                     }
 
+                    break;
+                case 4: // 瑞典
+
+                    visaTypeName = $"瑞典签证申请表";
+                    currTempPath = $"{tempPath}{visaTypeName}.pdf";
+
+                    var swedenSavePath = $"{fileServerPath}{visaTypeName}/";
+                    if (!Directory.Exists(swedenSavePath)) Directory.CreateDirectory(swedenSavePath);
+
+                    if (!System.IO.File.Exists(currTempPath))
+                    {
+                        return Ok(JsonView(false, $"{currTempPath}模板不存在!"));
+                    }
+
+                    foreach (var custInfo in groupCustInfos)
+                    {
+                        EncryptionProcessor.DecryptProperties(custInfo);
+
+                        var idInfo = certInfos.FirstOrDefault(x => x.DcId == custInfo.Id && x.PassportType == 773);
+                        var passportInfo = certInfos.FirstOrDefault(x => x.DcId == custInfo.Id && x.PassportType == 774);
+                        var clinetInfo = companyInfos.FirstOrDefault(x => x.DcId == custInfo.Id && x.Id == custInfo.CrmCompanyId);
+                        var currSchoolInfos = schoolInfos.Where(x => x.DcId == custInfo.Id).ToList();
+                        var currFamilyInfos = familyInfos.Where(x => x.DcId == custInfo.Id).ToList();
+                        var currCompanyInfos = companyInfos.Where(x => x.DcId == custInfo.Id).ToList();
+
+                        #region 生成文件
+
+                        PdfReader reader = null;
+                        FileStream templateStream = null;
+                        FileStream outputStream = null;
+                        PdfStamper stamper = null;
+
+                        try
+                        {
+                            string outputPath = $"{swedenSavePath}{custInfo.LastName}{custInfo.FirstName}.pdf";
+
+                            //读取模板文件
+                            templateStream = new FileStream(currTempPath, FileMode.Open, FileAccess.Read, FileShare.Read);
+                            reader = new PdfReader(templateStream);
+
+                            //创建输出文件
+                            outputStream = new FileStream(outputPath, FileMode.Create, FileAccess.Write);
+                            stamper = new PdfStamper(reader, outputStream);
+
+                            AcroFields formFields = stamper.AcroFields;
+
+                            #region 设置文本值
+
+                            SetFieldValue(formFields, "LastName", custInfo.LastName); //姓
+                            SetFieldValue(formFields, "BirthLastName", custInfo.LastName); // 出生时姓氏
+                            SetFieldValue(formFields, "FirstName", custInfo.FirstName); // 名
+
+                            // 出生日期(日-月-年)
+                            string idCard = idInfo.CertNo;
+                            string birthday = string.Empty;
+                            if (!string.IsNullOrEmpty(idCard))
+                            {
+                                string year = idCard.Substring(6, 4);
+                                string month = idCard.Substring(10, 2);
+                                string day = idCard.Substring(12, 2);
+                                birthday = day + "-" + month + "-" + year;
+                            }
+                            SetFieldValue(formFields, "Birthday", birthday);
+
+                            string currentNationality = custInfo.BirthProvince + custInfo.BirthCity;
+                            SetFieldValue(formFields, "CurrentNationality", currentNationality); // 出生地
+                            SetFieldValue(formFields, "CountryBirth","中国"); // 出生国
+                            SetFieldValue(formFields, "CurrentNationalityCountry", "中国"); // 现国籍
+                            SetFieldValue(formFields, "NationalityBirth", ""); // 出生时国籍,如与现国籍不同
+                            SetFieldValue(formFields, "OtherNationalities", ""); // 其他国籍
+
+                            #region 性别处理
+                            //清除性别
+                            SetFieldValue(formFields, "Male", "Off"); // 性别 - 男
+                            SetFieldValue(formFields, "Female", "Off"); // 性别 - 女
+                            //设置性别
+                            if (custInfo.Sex == 0) //男
+                            {
+                                SetFieldValue(formFields, "Male", "Yes"); // 性别 - 男
+                            }
+                            else if (custInfo.Sex == 1) //女
+                            {
+                                SetFieldValue(formFields, "Female", "Yes"); // 性别 - 女
+                            }
+
+                            #endregion
+
+                            #region 婚姻状况处理
+                            //清除婚姻状况
+                            SetFieldValue(formFields, "Single", "Off"); // 婚姻状况 - 未婚
+                            SetFieldValue(formFields, "Married", "Off"); // 婚姻状况 - 已婚
+                            SetFieldValue(formFields, "RegisteredPartnership", "Off"); // 婚姻状况 - 注册伴侣关系
+                            SetFieldValue(formFields, "Separated", "Off"); // 婚姻状况 - 分居
+                            SetFieldValue(formFields, "Divorced", "Off"); // 婚姻状况 - 离婚
+                            SetFieldValue(formFields, "Widow(er)", "Off"); // 婚姻状况 - 丧偶
+                            SetFieldValue(formFields, "OtherCivilStatus", "Off"); // 婚姻状况 - 其它
+                            SetFieldValue(formFields, "CivilStatusOther", ""); // 婚姻状况 - 其它(请注明)
+                            //设置婚姻状况
+                            switch (custInfo.Marriage)
+                            {
+                                case 1: // 未婚
+                                    SetFieldValue(formFields, "Single", "Yes");
+                                    break;
+                                case 2: // 已婚
+                                    SetFieldValue(formFields, "Married", "Yes");
+                                    break;
+                                case 3: // 离异
+                                    SetFieldValue(formFields, "Divorced", "Yes");
+                                    break;
+                                case 4: // 离异
+                                    SetFieldValue(formFields, "Widow(er)", "Yes");
+                                    break;
+                            }
+
+                            #endregion
+
+                            //亲权人(如是未成年申请人 )/合法监护人(姓名、住址,如与申请人不同) 电话号码、电子邮件及国籍
+                            SetFieldValue(formFields, "ParentalAuthority", "");
+
+                            SetFieldValue(formFields, "NationalIdentityNumber", idCard);  //公民身份证号码
+
+                            #region 护照(旅行证件类型)处理
+                            //清除值
+                            SetFieldValue(formFields, "OrdinaryPassport", "Off");  //旅行证件类型 - 普通护照
+                            SetFieldValue(formFields, "DiplomaticPassport", "Off");  //旅行证件类型 - 外交护照
+                            SetFieldValue(formFields, "ServicePassport", "Off");  //旅行证件类型 - 公务护照
+                            SetFieldValue(formFields, "OfficialPassport", "Off");  //旅行证件类型 - 因公护照
+                            SetFieldValue(formFields, "SpecialPassport", "Off");  //旅行证件类型 - 特殊护照
+                            SetFieldValue(formFields, "OtherTravel", "Off");  //旅行证件类型 - 其它旅行证件
+                            SetFieldValue(formFields, "OtherTravelDesc", "");     //旅行证件类型 - 其它旅行证件(请注明)
+                            //设置值
+                            SetFieldValue(formFields, "OrdinaryPassport", "Yes");  //旅行证件类型 - 普通护照
+                            if (passportInfo != null)
+                            {
+                                SetFieldValue(formFields, "TravelNumber", passportInfo.CertNo);  //旅行证件编号
+                                SetFieldValue(formFields, "IssueDate", passportInfo.IssueDt?.ToString("yyyy-MM-dd") ?? "");  //签发日期
+                                SetFieldValue(formFields, "ValidUntil", passportInfo.ExpiryDt?.ToString("yyyy-MM-dd") ?? "");  //有效期至
+                                SetFieldValue(formFields, "IssuedCountry", passportInfo.Country);  //签发(国)
+                            }
+                            #endregion
+
+                            //如有家庭成员为欧盟、欧洲经济区、瑞士或受益于退欧协议的英国公民的,请填写该家庭成员的个人信息
+                            SetFieldValue(formFields, "LastName_om", "");  //姓
+                            SetFieldValue(formFields, "FirstName_om", "");  //名
+                            SetFieldValue(formFields, "BirthDate_om", "");  //出生日期(日-月-年)
+                            SetFieldValue(formFields, "Nationality_om", "");  //国籍
+                            SetFieldValue(formFields, "TravelNuber_om", "");  //旅行证件或身分证编号
+
+                            //申请人与欧盟、欧洲经济区、瑞士或受益于退欧协议的英国公民的关系 
+                            SetFieldValue(formFields, "Spouse_om", "");  //配偶
+                            SetFieldValue(formFields, "RegisteredPartnership_om", "");  //注册伴侣
+                            SetFieldValue(formFields, "Child_om", "");  //子女
+                            SetFieldValue(formFields, "DependentAscendant_om", "");  //受养人
+                            SetFieldValue(formFields, "Grandchild_om", "");  //孙子女 
+                            SetFieldValue(formFields, "FamilyOther_om", "");  //其他 
+                            SetFieldValue(formFields, "FamilyOtherDesc_om", "");  //其他(说明)
+
+                            //申请人住址及电子邮件
+                            string applicantHomeAddress = $"{custInfo.Address} {custInfo.Email}";
+                            SetFieldValue(formFields, "ApplicantHomeAddress", applicantHomeAddress);  //申请人住址及电子邮件
+                            SetFieldValue(formFields, "TelephoneNo", custInfo.Tel);  //电话号码
+
+                            //是否居住在现时国籍以外的国家
+                            SetFieldValue(formFields, "AnotherCountryNo", "Yes");  //否
+                            SetFieldValue(formFields, "AnotherCountryYes", "");  //是。
+                            SetFieldValue(formFields, "ResidencePermit", "");  //居住许可或同等证
+                            SetFieldValue(formFields, "Number", "");  //编号
+                            SetFieldValue(formFields, "ValidUntils", "");  //有效期至
+
+                            SetFieldValue(formFields, "CurrentOccupation", custInfo.Job);  //当前职业 
+
+                            //工作单位名称,地址和电话,学生填写学校名称及地址
+                            var currCompanyInfo = currCompanyInfos.FirstOrDefault();
+                            string employerInfoStr = $"{currCompanyInfo?.Company ?? ""} {currCompanyInfo?.CompanyAddress ?? ""} {currCompanyInfo?.Phone ?? ""}";
+                            SetFieldValue(formFields, "EmployerInfo", employerInfoStr);
+
+                            #region 旅行的目的
+                            //清空值
+                            SetFieldValue(formFields, "Tourism", "Off");  //旅游
+                            SetFieldValue(formFields, "Business", "Off");  //商务
+                            SetFieldValue(formFields, "VisitingFamily", "Off");  //探亲访友
+                            SetFieldValue(formFields, "Cultural", "Off");  //文化
+                            SetFieldValue(formFields, "Sports", "Off");  //体育
+                            SetFieldValue(formFields, "OfficialVisit", "Off");  //官方访问
+                            SetFieldValue(formFields, "MedicalReasons", "Off");  //医疗
+                            SetFieldValue(formFields, "Study", "Off");  //学习
+                            SetFieldValue(formFields, "AirportTransit", "Off");  //机场过境
+                            SetFieldValue(formFields, "Other", "Off");  //其它
+                            SetFieldValue(formFields, "OtherDesc", "");  //其它 (请注明)
+
+                            //设置值
+                            if (groupInfo.VisitPurpose.contains("旅游")) SetFieldValue(formFields, "Tourism", "Yes");  //旅游
+                            if (groupInfo.VisitPurpose.contains("商务")) SetFieldValue(formFields, "Business", "Yes");  //商务
+                            if (groupInfo.VisitPurpose.contains("探亲访友")) SetFieldValue(formFields, "VisitingFamily", "Yes");  //探亲访友
+                            if (groupInfo.VisitPurpose.contains("文化")) SetFieldValue(formFields, "Cultural", "Yes");  //文化
+                            if (groupInfo.VisitPurpose.contains("体育")) SetFieldValue(formFields, "Sports", "Yes");  //体育
+                            if (groupInfo.VisitPurpose.contains("官方访问")) SetFieldValue(formFields, "OfficialVisit", "Yes");  //官方访问
+                            if (groupInfo.VisitPurpose.contains("医疗")) SetFieldValue(formFields, "MedicalReasons", "Yes");  //医疗
+                            if (groupInfo.VisitPurpose.contains("学习")) SetFieldValue(formFields, "Study", "Yes");  //学习
+                            if (groupInfo.VisitPurpose.contains("机场过境")) SetFieldValue(formFields, "AirportTransit", "Yes");  //机场过境
+
+                            #endregion
+
+                            SetFieldValue(formFields, "AdditionalInfo", "");  //有关停留原因的补充信息
+
+                            string[] RD_country = new string[] { };  //接收处理的国家
+
+                            string firstEntryLabel = string.Empty; //首入申根国标签
+                            string membeDescLabel = string.Empty; //申根国目的地
+                            string stopDays = string.Empty; //停留天数
+                            if (!string.IsNullOrEmpty(groupInfo.VisitCountry))
+                            {
+                                List<string> SGGNames = new List<string>();//接收处理后的国家  是申根国
+                                if (groupInfo.VisitCountry.Contains(","))
+                                    RD_country = groupInfo.VisitCountry.Split(',');
+                                else if (groupInfo.VisitCountry.Contains(' '))
+                                    RD_country = groupInfo.VisitCountry.Split(' ');
+                                else if (groupInfo.VisitCountry.Contains(","))
+                                    RD_country = groupInfo.VisitCountry.Split(',');
+                                else if (groupInfo.VisitCountry.Contains("、"))
+                                    RD_country = groupInfo.VisitCountry.Split('、');
+                                else if (groupInfo.VisitCountry.Contains("|"))
+                                    RD_country = groupInfo.VisitCountry.Split('|');
+
+                                //判断是否是申根国家
+                                for (int i = 0; i < RD_country.Length; i++)
+                                {
+                                    if (RD_country[i].ToString() != null)
+                                    {
+                                        //在申根国家中筛选 该国家是否是申根国家
+                                        for (int j = 0; j < _shenGenGuos.Length; j++)
+                                        {
+                                            if (RD_country[i] == _shenGenGuos[j])
+                                                SGGNames.Add(_shenGenGuos[j]); //添加申根国
+                                        }
+                                    }
+                                }
+
+                                //目的地国是否有申根国
+                                if (SGGNames.Count > 0)
+                                {
+                                    firstEntryLabel = SGGNames.First();
+                                    membeDescLabel = string.Join(",", SGGNames.ToArray());
+
+                                    //接收生根国详细信息  存储顺序 起飞日期:Day 起飞时刻:StartTime  抵达日期:ArrivedDate 到达时刻:EndTime
+                                    List<SSGDetails> ListSSGDetails = new List<SSGDetails>();
+
+                                    //处理申根国家 预定到达时间  预定离开时间 预定停留天数   
+                                    for (int i = 0; i < SGGNames.Count; i++)
+                                    {
+                                        //在相同的国家下  得到该航班的信息  //抵达时间 起飞日期:Day   起飞时刻:StartTime  到达时刻:EndTime  抵达日期:ArrivedDate 飞行时间:FlightTime  航司  Fliagtcode  入境口岸 
+                                        var atbc = GeneralMethod.GetTableByBlackCode(groupId);
+                                        //ResidenceTime1 机票三字码信息
+                                        if (atbc != null)
+                                        {
+                                            string HL_Three = ""; //三字码  Three  
+
+                                            for (int j = 0; j < atbc.Rows.Count; j++)
+                                            {
+                                                HL_Three = atbc.Rows[j]["Three"].ToString();
+
+                                                if (!string.IsNullOrEmpty(HL_Three))
+                                                {
+                                                    string threeCodeTwo = HL_Three.Substring(3);
+                                                    var tc = _sqlSugar.Queryable<Res_ThreeCode>().Where(x => x.Three == threeCodeTwo).First();
+                                                    if (tc != null)
+                                                    {
+                                                        //首入申根国时间
+                                                        if (SGGNames[i] == tc.Country)
+                                                        {
+                                                            SSGDetails SSGDetails = new SSGDetails()
+                                                            {
+                                                                Three = atbc.Rows[j]["Three"].ToString(),           //三字码
+                                                                Fliagtcode = atbc.Rows[j]["Fliagtcode"].ToString(), //航司
+                                                                startDate = atbc.Rows[j]["Day"].ToString(),        //整理起飞日期
+                                                                startTime = atbc.Rows[j]["StartTime"].ToString(),  //整理起飞时刻
+                                                                endDate = atbc.Rows[j]["ArrivedDate"].ToString(),  //整理抵达日期
+                                                                endTime = atbc.Rows[j]["EndTime"].ToString()       //整理抵达时刻
+                                                            };
+                                                            ListSSGDetails.Add(SSGDetails);
+                                                        }
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+                                    ListSSGDetails.Sort((a, b) => a.startDate.CompareTo(b.startDate));
+                                    //得到并计算出入境时间
+                                    if (ListSSGDetails != null)
+                                    {
+                                        string RuJingTime = ListSSGDetails.First().endDate + " " + ListSSGDetails.First().endTime.Substring(0, 2) + ":" + ListSSGDetails.First().endTime.Substring(2);  //入境时间
+                                        string LiJingTime = ListSSGDetails[ListSSGDetails.Count - 1].startDate + " " + ListSSGDetails[ListSSGDetails.Count - 1].endTime.Substring(0, 2) + ":" + ListSSGDetails[ListSSGDetails.Count - 1].endTime.Substring(2); //离境时间
+
+                                        stopDays = Convert.ToDateTime(LiJingTime).Subtract(Convert.ToDateTime(RuJingTime)).Days.ToString();
+                                    }
+                                }
+                            }
+
+                            SetFieldValue(formFields, "MembeDesc", membeDescLabel);  //主要申根目的地 (以及其他申根目的地,如适用)
+                            SetFieldValue(formFields, "FirstEntry", firstEntryLabel);  //首入申根国
+
+                            //申请入境次数 
+                            SetFieldValue(formFields, "27.SingleEntry", "");  //单次
+                            SetFieldValue(formFields, "27.TwoEntries", "");  //两次
+                            SetFieldValue(formFields, "27.MultipleEntries", "");  //多次
+                            SetFieldValue(formFields, "27.IntendedDateIn", "");  //在申根地区预计首次停留的预计抵达日期
+                            SetFieldValue(formFields, "27.IntendedDateOut", "");  //在申根地区预计首次停留之后的预计离开日期
+
+                            //以往申根国签证是否有指纹记录
+                            SetFieldValue(formFields, "28.No", "");  //否 
+                            SetFieldValue(formFields, "28.Yes", "");  //是 
+                            SetFieldValue(formFields, "28.KnownDate", "");  //如有,请写明日期
+                            SetFieldValue(formFields, "28.KnownVisanumber", "");  //如有,请写明签证贴纸号码
+
+                            //最后目的地之入境许可
+                            SetFieldValue(formFields, "29.Issued", "");  //签发机关 
+                            SetFieldValue(formFields, "29.ValidFrom", "");  //有效期由 
+                            SetFieldValue(formFields, "29.Until", "");  //至 
+
+                            //申根国的邀请人姓名。如无邀请人,请填写申根国的酒店或暂住居所名称
+                            //得到当前国家下的城市酒店信息
+                            var hotelInfo = _sqlSugar.Queryable<Grp_HotelReservations>()
+                                .Where(x => x.DiId == groupId)
+                                //.Where(x => x.City.contains(city))
+                                .First();
+                            //酒店住址
+                            if (hotelInfo != null)
+                            {
+                                SetFieldValue(formFields, "30.SurnameFirstName", hotelInfo?.HotelName ?? "");  //申根国的酒店 
+                                var otherInfo = $"{hotelInfo.HotelAddress}";
+                                SetFieldValue(formFields, "30.HotelInfo", otherInfo);  //邀请人/酒店/暂住居所的地址及电子邮件 
+                                SetFieldValue(formFields, "30.TelephoneNo", hotelInfo?.HotelTel ?? "");  //电话号码
+                            }
+
+                            //邀请公司或机构的名称及地址
+                            var oa = _sqlSugar.Queryable<Res_OfficialActivities>()
+                                   .Where(x => x.IsDel == 0 && x.DiId == groupId)
+                                   //.Where(x => x.Country.Contains(county))
+                                   //.Where(x => x.Area.Contains(city))
+                                   .First();
+                            if (oa != null)
+                            {
+                                //申根国的邀请人姓名。如无邀请人,请填写申根国的酒店或暂住居所名称
+                                SetFieldValue(formFields, "30.SurnameFirstName", oa?.Contact ?? "");  //申根国的酒店 
+                                SetFieldValue(formFields, "30.HotelInfo", oa?.Address ?? "");  //邀请人/酒店/暂住居所的地址及电子邮件 
+                                SetFieldValue(formFields, "30.TelephoneNo", oa?.Tel ?? "");  //电话号码
+
+                                string nameAddressLabel = $"{oa.Client} {oa.Address}";
+                                SetFieldValue(formFields, "31.NameAddress", nameAddressLabel);  //邀请公司或机构的名称及地址 
+                                string surnameLabel = $"{oa.Contact} {oa.Tel}";
+                                SetFieldValue(formFields, "31.Surname", surnameLabel);  //邀请公司或机构的联系人姓名、地址、电话号码及电子邮件 
+                                SetFieldValue(formFields, "31.TelephoneNo", oa?.Tel ?? "");  //邀请公司或机构的电话
+                            }
+
+                            //申请人的旅费以及在国外停留期间的生活费用
+                            SetFieldValue(formFields, "32.Applicant", "");  //由申请人支付
+                            SetFieldValue(formFields, "32.Cash", "");  //支付方式 - 现金
+                            SetFieldValue(formFields, "32.Traveller", "");  //支付方式 - 旅行支票
+                            SetFieldValue(formFields, "32.CreditCard", "");  //支付方式 - 信用卡
+                            SetFieldValue(formFields, "32.Prepaid", "");  //支付方式 - 预缴住宿
+                            SetFieldValue(formFields, "32.Prepaid1", "");  //支付方式 - 预缴交通
+                            SetFieldValue(formFields, "32.OtherMeans", "");  //支付方式 - 其它
+                            SetFieldValue(formFields, "32.OtherMeansDesc", "");  //支付方式 - 其它(请注明)
+
+                            SetFieldValue(formFields, "32.Sponsor", "");  //由赞助方(邀请人、公司或机构)支付,请注明
+                            SetFieldValue(formFields, "32.Referred", "");  //参见第 30 及 31 项
+                            SetFieldValue(formFields, "32.ReferredDesc", "");  //参见第 30 及 31 项(请注明)
+                            SetFieldValue(formFields, "32.OtherSponsor", "");  //其它
+                            SetFieldValue(formFields, "32.OtherSponsorDesc", "");  //其它(请注明)
+
+                            SetFieldValue(formFields, "32.SponsorCash", "");  //赞助方式 - 现金
+                            SetFieldValue(formFields, "32.SponsorAccommodation", "");  //赞助方式 - 提供住宿
+                            SetFieldValue(formFields, "32.SponsorExpenses", "");  //赞助方式 - 支付旅程期间所有开支
+                            SetFieldValue(formFields, "32.SponsorPrepaid", "");  //赞助方式 - 预缴交通
+                            SetFieldValue(formFields, "32.ponsorOther", "");  //赞助方式 - 其它
+                            SetFieldValue(formFields, "32.ponsorOtherDesc", "");  //赞助方式 - 其它(请注明)
+
+                            SetFieldValue(formFields, "33.PlaceAndDate", DateTime.Now.ToString("yyyy-MM-dd"));  //地点及日期
+                            #endregion
+
+                            filePaths.Add(outputPath);
+                            //return outputPath;
+                        }
+                        catch (Exception ex)
+                        {
+                            return Ok(JsonView(false, $"生成PDF文件时出错:{ex.Message}"));
+                        }
+                        finally
+                        {
+                            // 按正确顺序关闭资源
+                            stamper?.Close();
+                            reader?.Close();
+                            templateStream?.Close();
+                            outputStream?.Close();
+                        }
+                        #endregion
+                    }
+
                     break;
                 default:
                     return Ok(JsonView(false, "正在开发中,请等待。。。"));
@@ -5100,6 +5510,38 @@ FROM
         }
 
 
+        #region iTextSharp pdf 设置值辅助方法
+
+        /// <summary>
+        /// 设置文本值
+        /// 辅助方法
+        /// </summary>
+        /// <param name="formFields"></param>
+        /// <param name="fieldName"></param>
+        /// <param name="value"></param>
+        private static void SetFieldValue(AcroFields formFields, string fieldName, string value)
+        {
+            if (formFields.Fields.ContainsKey(fieldName) && !string.IsNullOrEmpty(value))
+            {
+                formFields.SetField(fieldName, value);
+            }
+        }
+
+        #endregion
+
+        #region 文档下载辅助实体类
+        private class SSGDetails
+        {
+            public string Three { get; set; }        //三字码
+            public string Fliagtcode { get; set; }   //航司
+            public string startDate { get; set; }   //首入申根国日期
+            public string startTime { get; set; }   //首入申根国时间
+            public string endDate { get; set; }     //离开申根国日期
+            public string endTime { get; set; }     //离开申根国时间
+        }
+
+        #endregion
+
         #endregion
 
         /// <summary>

+ 41 - 0
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -4565,6 +4565,47 @@ GROUP BY
             return Ok(JsonView(await _deepSeek.ChatAsync(question)));
         }
 
+        private class clientView
+        {
+            public int Id { get; set; }
+            public string   LastName { get; set; }
+            public string FirstName { get; set; }
+        }
+
+        /// <summary>
+        /// DeepSeek Chat 测试
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> ClientInfo(string name )
+        {
+            var clientInfos = await _sqlSugar.Queryable<Crm_DeleClient>()
+                .Where(x => x.IsDel == 0)
+                .Select(x => new clientView { Id = x.Id, LastName = x.LastName })
+                .ToListAsync();
+
+            foreach (var item in clientInfos)
+            {
+                item.LastName = AesEncryptionHelper.Decrypt(item.LastName);
+            }
+
+            var searchIds = clientInfos.Where(x => x.LastName.Contains(name)).Select(x => x.Id).ToList();
+
+            var view = await _sqlSugar.Queryable<Crm_DeleClient>()
+                .Where(x => x.IsDel == 0)
+                .Where(x => searchIds.Contains(x.Id))
+                .Select(x => new clientView { Id = x.Id, LastName = x.LastName, FirstName = x.FirstName })
+                .ToListAsync();
+            foreach (var item in view)
+            {
+                item.LastName = AesEncryptionHelper.Decrypt(item.LastName);
+                item.FirstName = AesEncryptionHelper.Decrypt(item.FirstName);
+            }
+
+
+            return Ok(JsonView(view));
+        }
         #endregion
     }
 }

+ 1 - 0
OASystem/OASystem.Api/OASystem.API.csproj

@@ -47,6 +47,7 @@
     <PackageReference Include="CurlThin.Native" Version="0.0.8" />
     <PackageReference Include="EPPlus" Version="7.4.1" />
     <PackageReference Include="Flurl.Http" Version="3.2.4" />
+    <PackageReference Include="iTextSharp" Version="5.5.13.4" />
     <PackageReference Include="JsonDiffPatch.Net" Version="2.3.0" />
     <PackageReference Include="Markdig" Version="0.33.0" />
     <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.11" />

+ 0 - 6
OASystem/OASystem.Domain/Entities/Groups/Grp_ProcessOverview.cs

@@ -138,12 +138,6 @@ namespace OASystem.Domain.Entities.Groups
         [SugarColumn(ColumnName = "ActualDone", ColumnDescription = "实际完成时间", IsNullable = true, ColumnDataType = "datetime")]
         public DateTime? ActualDone { get; set; }
 
-        ///// <summary>
-        ///// 国家
-        ///// </summary>
-        //[SugarColumn(ColumnName = "Country", ColumnDescription = "国家", ColumnDataType = "varchar(100)",IsNullable = true)]
-        //public string? Country { get; set; }
-
         /// <summary>
         /// 是否为当前节点
         /// </summary>

+ 2 - 1
OASystem/OASystem.Infrastructure/Repositories/Resource/CountryFeeRepository.cs

@@ -95,7 +95,8 @@ namespace OASystem.Infrastructure.Repositories.Resource
 
             var query = _sqlSugar.Queryable<Res_VisaFeeStandard>()
                 .LeftJoin<Sys_Users>((x, y) => x.LastUpdateUserId == y.Id)
-                .Where((x, y) => x.IsDel == 0 && x.FeeType == feeType)
+                .Where((x, y) => x.IsDel == 0)
+                .WhereIF(feeType != -1, (x, y) => x.FeeType == feeType)
                 .WhereIF(!string.IsNullOrEmpty(countryName), x => x.Country.Contains(countryName) || countryName.Contains(x.Country))
                 .OrderByDescending((x, y) => x.LastUpdateTime)
                 .Select((x, y) => new VisaFeeStandardListView