Browse Source

更新 VisaFeeInfoRepository.cs 中的条件检查

修改了对 groupInfo.Code 的检查条件,从 0 改为 200,确保只有在正确的状态下执行国家拆分逻辑。同时,将对 countrys 列表的检查从 Count > 0 改为使用 Any() 方法,以提高代码的可读性和效率。
LEIYI 1 month ago
parent
commit
547513b687

+ 2 - 4
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaFeeInfoRepository.cs

@@ -69,20 +69,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
             var data = await _sqlSugar.SqlQueryable<VisaFeeInfosView>(sql).ToListAsync();
 
             //默认十行 雷怡 2024-26-08 11:26:40 
-
             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 == 200)
                 {
                     countrys = _groupRep.GroupSplitCountry((groupInfo.Data as Web_ShareGroupInfoView)?.VisitCountry ?? "");
                 }
 
-                if (countrys.Count > 0)
+                if (countrys.Any())
                 {
                     //int dataRow = 0;
-
                     foreach (var country in countrys)
                     {
                         var countryInfo = _sqlSugar.Queryable<Res_CountryFeeCost>().Where(it => it.IsDel == 0 && it.VisaCountry.Equals(country)).First();