Selaa lähdekoodia

签证费用录用->自动审核数据源更改为Res_VisaFeeStandard;签证国家列表数据源更改为:Res_VisaFeeStandard 文本显示更改eg:法国(因公)、法国(因私)

Lyyyi 1 päivä sitten
vanhempi
commit
6e85135f6a

+ 10 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -14945,7 +14945,16 @@ FROM
             };
 
             //签证费用标准国家Data
-            var visaCountryFeeData = _sqlSugar.Queryable<Res_CountryFeeCost>().Where(x => x.IsDel == 0).Select(x => new { x.Id, Country = x.VisaCountry }).ToList();
+            var visaSql = string.Format(@"select 
+Id,
+case 
+    when FeeType = 0 then Country+'(因公)'
+    when FeeType = 1 then Country+'(因私)'
+    else Country+'(未设置)'
+end as 'Country'
+ from Res_VisaFeeStandard where isdel = 0");
+
+            var visaCountryFeeData = _sqlSugar.SqlQueryable<dynamic>(visaSql).ToList();
             var data = new
             {
                 Payment = _Payment,

+ 30 - 6
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaPriceRepository.cs

@@ -342,16 +342,40 @@ Left Join Sys_SetData as sd With(Nolock) On c.PayDId = sd.Id
             c.RMBPrice = c.PayMoney;
             c.DayRate = 1.0000M;
 
-            #region 自动审核处理
+            //todo:费用标准需更改为 Res_VisaFeeStandardDetails
+            #region 自动审核处理 
             var isAutoAudit = false;
             if (dto.IsThird == 0)
             {
-                var visaFeeInfo = _sqlSugar.Queryable<Res_CountryFeeCost>().Where(x => x.IsDel == 0 && x.VisaCountry.Equals(dto.Area)).First();
-                if (visaFeeInfo != null) {
+                var area = dto.Area;
+                var feeType = 0; // 0 因公 1 因私
+                if (area.Contains("因公")) feeType = 0;
+                else if (area.Contains("因私")) feeType = 1;
+
+                var visaFeeInfo = _sqlSugar.Queryable<Res_VisaFeeStandard>()
+                    .Where(x => x.IsDel == 0 && x.FeeType == feeType && area.Contains(x.Country))
+                    .First();
+                if (visaFeeInfo != null) 
+                {
+                    //因公默认四川省
+                    var visaDetails = _sqlSugar.Queryable<Res_VisaFeeStandardDetails>()
+                        .Where(x => x.IsDel == 0 && x.ParentId == visaFeeInfo.Id && x.ProvinceId == 122)
+                        .First();
+
+                    decimal visaFeePrice = 0.00M;
+
+                    if (dto.AgencyFeeType == 1)
+                    {
+                        if (!visaDetails.IsVisaExemptionSmall) visaFeePrice += visaDetails.SmallVisaPrice;
+                        visaFeePrice += visaDetails.SmallAgencyFee;
+                    }
+                    else if (dto.AgencyFeeType == 2)
+                    {
+                        if (!visaDetails.IsVisaExemptionLarge) visaFeePrice += visaDetails.LargeVisaPrice;
+                        visaFeePrice += visaDetails.LargeAgencyFee;
+
+                    }
 
-                    var visaFeePrice = visaFeeInfo.VisaPrice;
-                    if (dto.AgencyFeeType == 1) visaFeePrice += visaFeeInfo.PettyBusinessAgencyFee;
-                    else if (dto.AgencyFeeType == 2) visaFeePrice += visaFeeInfo.GrandBusinessAgencyFee;
                     var visaFeeTotalPrice = visaFeePrice * dto.VisaNumber;
                     if (dto.VisaPrice <= visaFeeTotalPrice)
                     {