jiangjc 9 months ago
parent
commit
d5186b85cb
1 changed files with 11 additions and 7 deletions
  1. 11 7
      OASystem/OASystem.Api/Controllers/FinancialController.cs

+ 11 - 7
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -912,7 +912,7 @@ namespace OASystem.API.Controllers
                     if (doc.Range.Bookmarks["Team"] != null)
                     {
                         Bookmark mark = doc.Range.Bookmarks["Team"];
-                        mark.Text = _DelegationInfo.VisitCountry == null ? "" : _DelegationInfo.VisitCountry.Replace("|","、").ToString();
+                        mark.Text = _DelegationInfo.VisitCountry == null ? "" : _DelegationInfo.VisitCountry.Replace("|", "、").ToString();
                     }
 
                     //付款日期
@@ -1029,7 +1029,7 @@ namespace OASystem.API.Controllers
                         bookmarkArr.Add("ClientUnit", ClientItem.Key); //单位
                         bookmarkArr.Add("VisitStartDate", _DelegationInfo.VisitStartDate.ToString("yyyy年MM月dd日"));//出发日期
                         bookmarkArr.Add("name", string.Join(",", ClientItem.Select(x => x.Name).ToArray()).TrimEnd(','));//全部人员信息
-                        bookmarkArr.Add("VisitCountry", _DelegationInfo.VisitCountry.Replace("|","、"));//出访国家
+                        bookmarkArr.Add("VisitCountry", _DelegationInfo.VisitCountry.Replace("|", "、"));//出访国家
                         bookmarkArr.Add("dayTime", DateTime.Now.ToString("yyyy年MM月dd日"));//今天日期
 
                         var ClientItemList = ClientItem.ToList();
@@ -1212,7 +1212,8 @@ namespace OASystem.API.Controllers
                                 otherFee += _EnterExitCosts.Ticket;
                                 otherFeestr += $"参展门票费{_EnterExitCosts.Ticket.ToString("#0.00")}元、";
                             }
-                            if (otherFeestr.Length > 0) {
+                            if (otherFeestr.Length > 0)
+                            {
                                 otherFeestr = otherFeestr.Substring(0, otherFeestr.Length - 1);
                                 otherFeestr += "等费用";
                             }
@@ -2334,6 +2335,9 @@ namespace OASystem.API.Controllers
 
             Dictionary<int, string> dic_setData = new Dictionary<int, string>();
 
+            Sys_SetDataType stGZ = _daiRep.Query<Sys_SetDataType>(s => s.Name == "公转").First();
+            Sys_SetDataType stSZ = _daiRep.Query<Sys_SetDataType>(s => s.Name == "私转").First();
+
             foreach (var item in DailyFeePaymentData)
             {
                 if (_dailyIds != null)
@@ -2362,7 +2366,7 @@ namespace OASystem.API.Controllers
                     if (sd_transfer != null)
                     {
                         item.transferParentId = sd_transfer.STid;
-                        item.transferParentIdStr = sd_transfer.STid == 0 ? "公转" : sd_transfer.STid == 1 ? "私转" : "";
+                        item.transferParentIdStr = sd_transfer.STid == stGZ.Id ? "公转" : sd_transfer.STid == stSZ.Id ? "私转" : "";
                     }
                 }
                 else
@@ -2372,7 +2376,7 @@ namespace OASystem.API.Controllers
                     {
                         item.transferTypeIdStr = sd_transfer.Name;
                         item.transferParentId = sd_transfer.STid;
-                        item.transferParentIdStr = sd_transfer.STid == 0 ? "公转" : sd_transfer.STid == 1 ? "私转" : "";
+                        item.transferParentIdStr = sd_transfer.STid == stGZ.Id ? "公转" : sd_transfer.STid == stSZ.Id ? "私转" : "";
                         dic_setData.Add(item.transferTypeId, sd_transfer.Name);
                     }
                 }
@@ -2391,8 +2395,8 @@ namespace OASystem.API.Controllers
                 }
             }
 
-            decimal total_gz = DailyFeePaymentData.Where(s => s.transferParentId == 0).Sum(d => d.SumPrice ?? 0M);
-            decimal total_sz = DailyFeePaymentData.Where(s => s.transferParentId == 1).Sum(d => d.SumPrice ?? 0M);
+            decimal total_gz = DailyFeePaymentData.Where(s => s.transferParentId == stGZ.Id).Sum(d => d.SumPrice ?? 0M);
+            decimal total_sz = DailyFeePaymentData.Where(s => s.transferParentId == stSZ.Id).Sum(d => d.SumPrice ?? 0M);
 
             var result = new tree_Fin_DailyFeePaymentResult() { gz = total_gz, sz = total_sz, dataList = DailyFeePaymentData };