yuanrf 1 день назад
Родитель
Сommit
65b5c3b251

+ 2 - 1
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -5352,7 +5352,8 @@ namespace OASystem.API.Controllers
                     ExtOver = new
                     {
                         Limit = di?.ExtOverLimit ?? 0.00m,
-                        Currency = di?.ExtOverCurrency ?? 836
+                        Currency = di?.ExtOverCurrency ?? 836,
+                        CurrencyName = di?.CurrencyName ?? "人民币"
                     },
                     GroupExtraPrice = await _groupExtraCostRepository.GetGroupExtraPriceByDiId(dto.diId)
                 };

+ 19 - 5
OASystem/OASystem.Infrastructure/Repositories/Financial/GroupExtraCostRepository.cs

@@ -29,6 +29,11 @@ namespace OASystem.Infrastructure.Repositories.Financial
         /// 已用金额
         /// </summary>
         public decimal UsedAmount { get; set; }
+
+        /// <summary>
+        /// 金额币种名称
+        /// </summary>
+        public string RemainingCurrencyName { get; set; }
     }
     /// <summary>
     /// 财务 - 团组超支费用
@@ -59,8 +64,9 @@ namespace OASystem.Infrastructure.Repositories.Financial
             .ToListAsync();
 
             var upperLimit = _sqlSugar.Queryable<Grp_DelegationInfo>()
-            .Where(x => x.Id == diId && x.IsDel == 0)
-            .Select(x => new { x.ExtOverLimit, x.ExtOverCurrency })
+            .LeftJoin<Sys_SetData>((x, y) => x.ExtOverCurrency == y.Id && y.IsDel == 0)
+            .Where((x, y) => x.Id == diId && x.IsDel == 0)
+            .Select((x, y) => new { x.ExtOverLimit, x.ExtOverCurrency, CurrencyName = y.Name })
             .First();
 
             if (upperLimit == null)
@@ -71,7 +77,8 @@ namespace OASystem.Infrastructure.Repositories.Financial
                     RemainingAmount = 0,
                     RemainingCurrency = 836, //RMB
                     RemainingPercentage = 1,
-                    UsedAmount = 0
+                    UsedAmount = 0,
+                    RemainingCurrencyName = "人民币"
                 };
             }
 
@@ -83,7 +90,8 @@ namespace OASystem.Infrastructure.Repositories.Financial
                     RemainingAmount = upperLimit.ExtOverLimit,
                     RemainingCurrency = upperLimit.ExtOverCurrency,
                     RemainingPercentage = 1,
-                    UsedAmount = 0
+                    UsedAmount = 0,
+                    RemainingCurrencyName = upperLimit.CurrencyName
                 };
             }
 
@@ -95,6 +103,8 @@ namespace OASystem.Infrastructure.Repositories.Financial
             decimal remainingPercentage = 0;
             //已用额度
             decimal usedAmount = 0;
+            //币种名称
+            string remainingCurrencyName = string.Empty;
 
             //获取超支部分的汇率
             var currRate = await _setDataRepository.PostCurrencyByDiid(diId, 1015, upperLimit.ExtOverCurrency);
@@ -128,6 +138,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 }
 
                 usedAmount = rmbPrice;
+                remainingCurrencyName = "人民币";
             }
             else
             {
@@ -144,6 +155,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                         remainingPercentage = 1;
                     }
                     usedAmount = sumPriceList.Sum(x => x.PriceSum);
+                    remainingCurrencyName = upperLimit.CurrencyName;
                 }
                 else
                 {
@@ -161,6 +173,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                         remainingPercentage = 1;
                     }
                     usedAmount = rmbPrice;
+                    remainingCurrencyName = "人民币";
                 }
             }
 
@@ -173,7 +186,8 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 RemainingAmount = remainingAmount,
                 RemainingCurrency = remainingCurrency,
                 RemainingPercentage = remainingPercentage,
-                UsedAmount = usedAmount
+                UsedAmount = usedAmount,
+                RemainingCurrencyName = remainingCurrencyName
             };
         }
     }