Bläddra i källkod

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

yuanrf 1 dag sedan
förälder
incheckning
51e4f04f54

+ 5 - 7
OASystem/OASystem.Api/OAMethodLib/JuHeAPI/JuHeApiService.cs

@@ -49,10 +49,9 @@ namespace OASystem.API.OAMethodLib.JuHeAPI
                     var exchangeReq = await _httpClient.PostAsync(url,
                                         new FormUrlEncodedContent(new List<KeyValuePair<string, string>>()
                                         {
-                                        new KeyValuePair<string, string>("key",_appKey),//你申请的key 
-                                        new KeyValuePair<string, string>("type","0"),   //两种格式(0或者1,默认为0)
-                                        new KeyValuePair<string, string>("bank","3")    //(0:工商银行,1:招商银行,2:建设银行,3:中国银行,
-                                                                                        //4:交通银行,5:农业银行,默认为:0)
+                                        new KeyValuePair<string, string>("key",_appKey),// key 
+                                        new KeyValuePair<string, string>("type","0"),   // 两种格式(0或者1,默认为0)
+                                        new KeyValuePair<string, string>("bank","3")    // (0:工商银行,1:招商银行,2:建设银行,3:中国银行,4:交通银行,5:农业银行,默认为:0)
                                         }));
                     if (exchangeReq.IsSuccessStatusCode)
                     {
@@ -115,7 +114,6 @@ namespace OASystem.API.OAMethodLib.JuHeAPI
                     result.Reason = ex.Message;
                 }
                 #endregion
-
             }
             else
             {
@@ -124,13 +122,13 @@ namespace OASystem.API.OAMethodLib.JuHeAPI
             }
             return result;
         }
-
+         
         /// <summary>
         /// 处理金额带“-”的币种汇率信息
         /// </summary>
         /// <param name="input"></param>
         /// <returns></returns>
-        private string HandleMinusValue(string? input)
+        private static string HandleMinusValue(string? input)
         {
             return string.IsNullOrEmpty(input) || input.Contains("-") ? "1.00" : input;
         }

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/ProcessOverviewRepository.cs

@@ -550,7 +550,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             //2. 7个工作日,所有报批机构前部联系,邀请机构一个国家不少于4家进行重点对接(4家机构中,其中3家机构需有效对接,其中1家可为付费机构备选))
             DateTime? xy_timeBase2 = groupInfo.VisitDate;
             nodeDetails.Add(
-                GroupProcFullNodeDetails.Create(groupId, groupName, groupType, oa_proc, 2, xy_timeBase2, 7, true, oa_users)
+                GroupProcFullNodeDetails.Create(groupId, groupName, groupType, oa_proc, 2, null, 0, true, oa_users)
             );
 
             //3. 10个工作日,根据最新情况,联系公务机构1/3取得回应;邀请机构基本明确。

+ 42 - 23
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaPriceRepository.cs

@@ -28,10 +28,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
     {
         private readonly IMapper _mapper;
 
-        public VisaPriceRepository(SqlSugarClient sqlSugar, IMapper mapper)
+        private readonly DelegationInfoRepository _groupRep;
+
+        public VisaPriceRepository(SqlSugarClient sqlSugar, IMapper mapper, DelegationInfoRepository groupRep)
             : base(sqlSugar)
         {
             _mapper = mapper;
+            _groupRep = groupRep;
         }
 
 
@@ -343,6 +346,24 @@ Left Join Sys_SetData as sd With(Nolock) On c.PayDId = sd.Id
             c.RMBPrice = c.PayMoney;
             c.DayRate = 1.0000M;
 
+            // 按汇率计算人名币费用
+            var _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 80);
+            var currencyInfos = new List<CurrencyInfo>();
+            if (_TeamRate != null)
+            {
+                Sys_SetData _SetData = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == c.PaymentCurrency);
+                if (_SetData != null)
+                {
+                    currencyInfos = CommonFun.GetCurrencyChinaToList(_TeamRate.Remark);
+                    CurrencyInfo CurrencyRate = currencyInfos.FirstOrDefault(a => a.CurrencyCode == _SetData.Name);
+                    if (CurrencyRate != null)
+                    {
+                        c.RMBPrice = c.PayMoney * Convert.ToDecimal(CurrencyRate.Rate);
+                        c.DayRate = CurrencyRate.Rate;
+                    }
+                }
+            }
+
             //todo:费用标准需更改为 Res_VisaFeeStandardDetails
             #region 自动审核处理 
             var isAutoAudit = false;
@@ -350,17 +371,32 @@ Left Join Sys_SetData as sd With(Nolock) On c.PayDId = sd.Id
             {
                 var area = dto.Area;
                 var feeType = 0; // 0 因公 1 因私
-                if (area.Contains("因公")) feeType = 0;
-                else if (area.Contains("因私")) feeType = 1;
+                if (area.Contains("(因公)"))
+                {
+                    feeType = 0;
+                    area = area.Replace("(因公)", "");
+                }
+                else if (area.Contains("(因私)"))
+                {
+                    feeType = 1;
+                    area = area.Replace("(因私)", "");
+                }
 
                 var visaFeeInfo = _sqlSugar.Queryable<Res_VisaFeeStandard>()
-                    .Where(x => x.IsDel == 0 && x.FeeType == feeType && area.Contains(x.Country))
+                    .Where(x => x.IsDel == 0 && x.FeeType == feeType && x.Country.Equals(area))
                     .First();
                 if (visaFeeInfo != null) 
                 {
                     //因公默认四川省
+                    int provinceId = 122;
+                    var groupNames = await _groupRep.EnterExitCostGroupNameInfoAsync(dto.DiId);
+                    if (groupNames != null)
+                    {
+                        provinceId = groupNames.ProvinceId;
+                    }
+
                     var visaDetails = _sqlSugar.Queryable<Res_VisaFeeStandardDetails>()
-                        .Where(x => x.IsDel == 0 && x.ParentId == visaFeeInfo.Id && x.ProvinceId == 122)
+                        .Where(x => x.IsDel == 0 && x.ParentId == visaFeeInfo.Id && x.ProvinceId == provinceId)
                         .First();
 
                     decimal visaFeePrice = 0.00M;
@@ -378,7 +414,7 @@ Left Join Sys_SetData as sd With(Nolock) On c.PayDId = sd.Id
                     }
 
                     var visaFeeTotalPrice = visaFeePrice * dto.VisaNumber;
-                    if (dto.VisaPrice <= visaFeeTotalPrice)
+                    if (c.RMBPrice <= visaFeeTotalPrice)
                     {
                         isAutoAudit = true;
                         c.IsAuditGM = 3;
@@ -390,23 +426,6 @@ Left Join Sys_SetData as sd With(Nolock) On c.PayDId = sd.Id
 
             #endregion
 
-            var _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 80);
-            var currencyInfos = new List<CurrencyInfo>();
-            if (_TeamRate != null)
-            {
-                Sys_SetData _SetData = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == c.PaymentCurrency);
-                if (_SetData != null)
-                {
-                    currencyInfos = CommonFun.GetCurrencyChinaToList(_TeamRate.Remark);
-                    CurrencyInfo CurrencyRate = currencyInfos.FirstOrDefault(a => a.CurrencyCode == _SetData.Name);
-                    if (CurrencyRate != null)
-                    {
-                        c.RMBPrice = c.PayMoney * Convert.ToDecimal(CurrencyRate.Rate);
-                        c.DayRate = CurrencyRate.Rate;
-                    }
-                }
-            }
-
             if (dto.Status == 1)//添加
             {
                 var grp_Visa = _sqlSugar.Queryable<Grp_VisaInfo>()