Przeglądaj źródła

1.三公签证费用(签证费、代办费) 列表新增 国家默认签证费用相关数据

leiy 10 miesięcy temu
rodzic
commit
f9bd54b9fc

+ 1 - 1
OASystem/OASystem.Domain/ViewModels/Groups/VisaFeeInfoView.cs

@@ -38,7 +38,7 @@ namespace OASystem.Domain.ViewModels.Groups
         /// 新增
         /// 雷怡 2024-08-07 17:08:13
         /// </summary>
-        public int OBType { get; set; }
+        public int OBType { get; set; } = 1;
 
         /// <summary>
         /// 代办费公务描述

+ 5 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -185,7 +185,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 List<string> searchreplaces = new List<string>() { "|", " ", "/", ",", "," };
                 foreach (var item in searchreplaces)
                 {
-                    str = str.Replace(item, "、");
+                    if (str.Contains(item))
+                    {
+                        str = str.Replace(item, "、");
+                        break;
+                    }
                 }
             }
             return str.Trim();

+ 70 - 14
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaFeeInfoRepository.cs

@@ -69,28 +69,73 @@ namespace OASystem.Infrastructure.Repositories.Groups
             var data = await _sqlSugar.SqlQueryable<VisaFeeInfosView>(sql).ToListAsync();
 
             //默认十行 雷怡 2024-26-08 11:26:40 
-            if (data.Count <= 10)
-            {
-                int defaultRow = 10 - data.Count;
-                for (int i = 0; i < defaultRow; i++)
-                {
-                    data.Add(new VisaFeeInfosView() {
-                        Id = 0,
-                        OBType =1
-                    });
-                }
-            }
-            else if (data.Count == 0)
+
+            if (data.Count == 0)
             {
                 var groupInfo = await _groupRep.PostShareGroupInfo(new ShareGroupInfoDto() { PortType = 1, Id = diId });
                 List<string> countrys = new List<string>();
-                if (groupInfo.Code == 0) {
+                if (groupInfo.Code == 0)
+                {
                     countrys = _groupRep.GroupSplitCountry((groupInfo.Data as Web_ShareGroupInfoView)?.VisitCountry ?? "");
                 }
 
                 if (countrys.Count > 0)
                 {
+                    int dataRow = 0;
 
+                    foreach (var country in countrys)
+                    {
+                        var countryInfo = _sqlSugar.Queryable<Res_CountryFeeCost>().Where(it => it.IsDel == 0 && it.VisaCountry.Equals(country)).First();
+                        if (countryInfo != null)
+                        {
+                            data.Add(new VisaFeeInfosView()
+                            {
+                                IsChecked = 0,
+                                Country = country,
+                                VisaFee = countryInfo.VisaPrice,
+                                OBType = 1,
+                                AgencyFee = countryInfo.GrandBusinessAgencyFee
+                            });
+
+                            data.Add(new VisaFeeInfosView()
+                            {
+                                IsChecked = 0,
+                                Country = country,
+                                VisaFee = countryInfo.VisaPrice,
+                                OBType = 2,
+                                AgencyFee = countryInfo.PettyBusinessAgencyFee
+                            });
+                        }
+                        else
+                        {
+                            data.Add(new VisaFeeInfosView()
+                            {
+                                IsChecked = 0,
+                                Country = country,
+                                OBType = 1,
+                            });
+
+                            data.Add(new VisaFeeInfosView()
+                            {
+                                IsChecked = 0,
+                                Country = country,
+                                OBType = 2,
+                            });
+                        }
+                    }
+
+                    if (data.Count < 10)
+                    {
+                        int defaultRow = 10 - data.Count;
+                        for (int i = 0; i < defaultRow; i++)
+                        {
+                            data.Add(new VisaFeeInfosView()
+                            {
+                                Id = 0,
+                                OBType = 1
+                            });
+                        }
+                    }
                 }
                 else
                 {
@@ -104,7 +149,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     }
                 }
             }
-
+            else if (data.Count <= 10)
+            {
+                int defaultRow = 10 - data.Count;
+                for (int i = 0; i < defaultRow; i++)
+                {
+                    data.Add(new VisaFeeInfosView()
+                    {
+                        Id = 0,
+                        OBType = 1
+                    });
+                }
+            }
             _result.Code = 0;
             _result.Data = data;
             _result.Msg = "操作成功!";