Kaynağa Gözat

出入境费用明细
文件下载 初步调试

leiy 11 ay önce
ebeveyn
işleme
711abb8caa

+ 46 - 36
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -61,6 +61,7 @@ using MathNet.Numerics;
 using System.Security.Policy;
 using System.Xml;
 using OASystem.Domain.Dtos.QiYeWeChat;
+using static NPOI.POIFS.Crypt.CryptoFunctions;
 
 namespace OASystem.API.Controllers
 {
@@ -3711,11 +3712,13 @@ namespace OASystem.API.Controllers
                         decimal mealsFeeTotal = _DayAndCosts.Where(it => it.Type == 2).Sum(it => it.SubTotal);  // 伙食费费
                         decimal miscellaneousFeeTotal = _DayAndCosts.Where(it => it.Type == 3).Sum(it => it.SubTotal);  // 公杂费
                         decimal tainFeeTotal = _DayAndCosts.Where(it => it.Type == 4).Sum(it => it.SubTotal);  // 培训费
-                        dic.Add("InsidePay", _EnterExitCosts.InsidePay.ToString("#0.00"));
+
+                        decimal insidePayTotal = _EnterExitCosts.InsidePay;
 
                         string row1_1 = "";
                         if (_EnterExitCosts.Visa > 0)
                         {
+                            //insidePayTotal += _EnterExitCosts.Visa;
                             row1_1 = $"签证费: {_EnterExitCosts.Visa.ToString("#0.00")} 人民币/人";
                             if (!string.IsNullOrEmpty(_EnterExitCosts.VisaRemark))
                             {
@@ -3726,24 +3729,29 @@ namespace OASystem.API.Controllers
                         string row1_2 = "";
                         if (_EnterExitCosts.YiMiao > 0)
                         {
+                            //insidePayTotal += _EnterExitCosts.YiMiao;
                             row1_2 += $"疫苗费:{_EnterExitCosts.YiMiao.ToString("#0.00")} 人民币/人";
                         }
                         if (_EnterExitCosts.HeSuan > 0)
                         {
+                            //insidePayTotal += _EnterExitCosts.HeSuan;
                             row1_2 += $"核酸检测费:{_EnterExitCosts.HeSuan.ToString("#0.00")} 人民币/人";
                         }
                         if (_EnterExitCosts.Service > 0)
                         {
+                            //insidePayTotal += _EnterExitCosts.Service;
                             row1_2 += $"服务费:{_EnterExitCosts.Service.ToString("#0.00")} 人民币/人";
                         }
 
                         string row1_3 = "";
                         if (_EnterExitCosts.Safe > 0)
                         {
+                            //insidePayTotal += _EnterExitCosts.Safe;
                             row1_3 += $"保险费:{_EnterExitCosts.Safe.ToString("#0.00")} 人民币/人";
                         }
                         if (_EnterExitCosts.Ticket > 0)
                         {
+                            //insidePayTotal += _EnterExitCosts.Ticket;
                             row1_3 += $"参展门票:{_EnterExitCosts.Ticket.ToString("#0.00")} 人民币/人";
                         }
                         string row1 = "";
@@ -3751,6 +3759,8 @@ namespace OASystem.API.Controllers
                         if (!string.IsNullOrEmpty(row1_2)) row1 += $"{row1_2}\r\n";
                         if (!string.IsNullOrEmpty(row1_3)) row1 += $"{row1_3}";
 
+
+                        dic.Add("InsidePay", insidePayTotal.ToString("#0.00"));
                         dic.Add("Row1Str", row1);
 
                         dic.Add("OutsideJJ", _EnterExitCosts.OutsideJJPay.ToString("#0.00"));
@@ -3763,10 +3773,10 @@ namespace OASystem.API.Controllers
 
                         string miscellaneousFeeTotalStr = miscellaneousFeeTotal.ToString("#0.00");
                         dic.Add("SubGZF", miscellaneousFeeTotalStr);
-                        dic.Add("SubPX", tainFeeTotal.ToString("#0.00"));
+                        //dic.Add("SubPX", tainFeeTotal.ToString("#0.00"));
 
-                        decimal subJJC = _EnterExitCosts.InsidePay + stayFeeTotal + mealsFeeTotal + miscellaneousFeeTotal + tainFeeTotal + _EnterExitCosts.OutsideJJPay;
-                        decimal subGWC = _EnterExitCosts.InsidePay + stayFeeTotal + mealsFeeTotal + miscellaneousFeeTotal + tainFeeTotal + _EnterExitCosts.OutsaideGWPay;
+                        decimal subJJC = insidePayTotal + stayFeeTotal + mealsFeeTotal + miscellaneousFeeTotal + tainFeeTotal + _EnterExitCosts.OutsideJJPay;
+                        decimal subGWC = insidePayTotal + stayFeeTotal + mealsFeeTotal + miscellaneousFeeTotal + tainFeeTotal + _EnterExitCosts.OutsaideGWPay;
                         dic.Add("SubJJC", subJJC.ToString("#0.00"));
                         dic.Add("SubGWC", subGWC.ToString("#0.00"));
 
@@ -3991,10 +4001,10 @@ namespace OASystem.API.Controllers
                             //builder.MoveToCell(0, accommodationStartIndex, 0, 0);
                             //builder.Write(DeleClientList[i].LastName + DeleClientList[i].Name); 
                             builder.MoveToCell(0, accommodationStartIndex, 1, 0);
-                            builder.Write(dac.Place == null ? "" : dac.Place);//城市
+                            builder.Write(placeData.Find(it => it.Id == dac.NationalTravelFeeId)?.Country ?? "Unknown");//城市
                             builder.MoveToCell(0, accommodationStartIndex, 2, 0);
 
-                            string currency = _CurrDatas.Find(it => it.Id == dac.Currency).Name;
+                            string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Name ?? "Unknown";
                             builder.Write(currency);//币种
                             builder.MoveToCell(0, accommodationStartIndex, 3, 0);
                             builder.Write(dac.Cost.ToString("#0.00"));//标准
@@ -4007,7 +4017,7 @@ namespace OASystem.API.Controllers
                             builder.MoveToCell(0, accommodationStartIndex, 7, 0);
 
                             decimal rate = 0.00M;
-                            rate = rateDatas.Find(it => it.CurrencyCode.Equals(currency)).Rate;
+                            rate = rateDatas.Find(it => it.CurrencyCode.Equals(currency))?.Rate ?? 0.00M;
 
                             builder.Write(rate.ToString("#0.0000"));//汇率
                             builder.MoveToCell(0, accommodationStartIndex, 8, 0);
@@ -4015,7 +4025,7 @@ namespace OASystem.API.Controllers
                             decimal rbmPrice = rate * dac.SubTotal;
                             builder.Write(rbmPrice.ToString("#0.00"));//折合人民币
                             accommodationStartIndex++;
-                            dac1totalPrice += rbmPrice;
+                            dac1totalPrice += Convert.ToDecimal(rbmPrice.ToString("#0.00"));
                         }
 
                         dic.Add("dac1totalPrice", dac1totalPrice.ToString("#0.00"));
@@ -4045,9 +4055,9 @@ namespace OASystem.API.Controllers
                             }
 
                             builder.MoveToCell(0, foodandotherStartIndex, 1, 0);
-                            builder.Write(dac.Place == null ? "" : dac.Place);//城市
+                            builder.Write(placeData.Find(it => it.Id == dac.NationalTravelFeeId)?.Country ?? "Unknown");//城市
                             builder.MoveToCell(0, foodandotherStartIndex, 2, 0);
-                            string currency = _CurrDatas.Find(it => it.Id == dac.Currency).Name;
+                            string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Name ?? "Unknown" ;
                             builder.Write(currency);//币种
                             builder.MoveToCell(0, foodandotherStartIndex, 3, 0);
                             builder.Write(dac.Cost.ToString("#0.00"));//标准
@@ -4060,18 +4070,18 @@ namespace OASystem.API.Controllers
                             builder.MoveToCell(0, foodandotherStartIndex, 7, 0);
 
                             decimal rate = 0.00M;
-                            rate = rateDatas.Find(it => it.CurrencyCode.Equals(currency)).Rate;
+                            rate = rateDatas.Find(it => it.CurrencyCode.Equals(currency))?.Rate ?? 0.00M;
 
                             builder.Write(rate.ToString("#0.0000"));//汇率
 
                             builder.MoveToCell(0, foodandotherStartIndex, 8, 0);
                             decimal rbmPrice = rate * dac.SubTotal;
-                            builder.Write(rbmPrice.ToString());//折合人民币
+                            builder.Write(rbmPrice.ToString("#0.00"));//折合人民币
                             foodandotherStartIndex++;
-                            dac2totalPrice += rbmPrice;
+                            dac2totalPrice += Convert.ToDecimal(rbmPrice.ToString("#0.00"));
                         }
 
-                        dic.Add("dac2totalPrice", dac2totalPrice.ToString());
+                        dic.Add("dac2totalPrice", dac2totalPrice.ToString("#0.00"));
 
                         for (int i = foodandotherStartIndex + (15 - dac2.Count); i > (dac2.Count == 0 ? 1 : 0) + foodandotherStartIndex; i--)
                         {
@@ -4117,8 +4127,8 @@ namespace OASystem.API.Controllers
                                     var spDotandEmpty = item.Split('.')[1].Split(' ').Where(x => !string.IsNullOrEmpty(x)).ToList();
                                     var depCode = spDotandEmpty[2].Substring(0, 3);
                                     var arrCode = spDotandEmpty[2].Substring(3, 3);
-                                    string depName = threeCodes.Find(it => it.Three.Equals(depCode)).City,
-                                           arrName = threeCodes.Find(it => it.Three.Equals(arrCode)).City;
+                                    string depName = threeCodes.Find(it => it.Three.Equals(depCode))?.City ?? "Unknwon",
+                                           arrName = threeCodes.Find(it => it.Three.Equals(arrCode))?.City ?? "Unknown";
 
                                     list.Add(depName);
                                     list.Add(arrName);
@@ -4200,22 +4210,23 @@ namespace OASystem.API.Controllers
                         decimal dac1totalPrice = 0.00M, dac2totalPrice = 0.00M;
                         foreach (var item in dac1)
                         {
+                            item.Place = placeData.Find(it => it.Id == item.NationalTravelFeeId)?.Country ?? "Unknown";
                             if (place.Contains(item.Place))
                             {
                                 continue;
                             }
-
                             DataRow row = dtdac1.NewRow();
-                            row["city"] = item.Place;
-                            row["curr"] = item.Currency;
-                            row["criterion"] = item.Cost;
-                            row["number"] = 1;
-                            row["day"] = dac1.FindAll(x => x.Place == item.Place).Count;
 
-                            string currency = _CurrDatas.Find(it => it.Id == item.Currency).Name;
-                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency).Rate;
+                            row["city"] = placeData.Find(it => it.Id == item.NationalTravelFeeId)?.Country ?? "Unknown";
 
+                            string currency = _CurrDatas.Find(it => it.Id == item.Currency)?.Name ?? "Unknwon";
+                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency)?.Rate ?? 0.00M;
+                            row["curr"] = currency;
                             row["rate"] = rate;
+                            row["criterion"] = item.Cost;
+                            row["number"] = 1;
+                            row["day"] = dac1.FindAll(x => x.NationalTravelFeeId == item.NationalTravelFeeId).Count;
+
                             //row["costRMB"] = rbmPrice;
 
                             dtdac1.Rows.Add(row);
@@ -4225,22 +4236,22 @@ namespace OASystem.API.Controllers
                         place = new List<string>();
                         foreach (var item in dac2)
                         {
+                            item.Place = placeData.Find(it => it.Id == item.NationalTravelFeeId)?.Country ?? "Unknown";
                             if (place.Contains(item.Place))
                             {
                                 continue;
                             }
                             DataRow row = dtdac2.NewRow();
                             row["city"] = item.Place;
-                            row["curr"] = item.Currency;
+                            string currency = _CurrDatas.Find(it => it.Id == item.Currency)?.Name ?? "Unknwon";
+                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency)?.Rate ?? 0.00M;
+                            row["curr"] = currency;
+                            row["rate"] = rate;
                             row["criterion"] = item.Cost;
                             row["number"] = 1;
                             row["day"] = dac2.FindAll(x => x.Place == item.Place).Count;
                             //row["cost"] = item.SubTotal;
 
-                            string currency = _CurrDatas.Find(it => it.Id == item.Currency).Name;
-                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency).Rate;
-
-                            row["rate"] = rate;
                             //row["costRMB"] = rbmPrice;
 
                             dtdac2.Rows.Add(row);
@@ -4404,10 +4415,10 @@ namespace OASystem.API.Controllers
                             //builder.MoveToCell(0, accommodationStartIndex, 0, 0);
                             //builder.Write(DeleClientList[i].LastName + DeleClientList[i].Name); 
                             builder.MoveToCell(0, accommodationStartIndex, 1, 0);
-                            builder.Write(dac.Place == null ? "" : dac.Place);//城市
+                            builder.Write(placeData.Find(it => it.Id == dac.NationalTravelFeeId)?.Country ?? "Unknown");//城市
                             builder.MoveToCell(0, accommodationStartIndex, 2, 0);
 
-                            string currency = _CurrDatas.Find(it => it.Id == dac.Currency).Name;
+                            string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Name ?? "Unknwon";
                             builder.Write(currency);//币种
                             builder.MoveToCell(0, accommodationStartIndex, 3, 0);
                             builder.Write(dac.Cost.ToString("#0.00"));//标准
@@ -4419,7 +4430,7 @@ namespace OASystem.API.Controllers
                             builder.Write(dac.SubTotal.ToString("#0.00"));//小计
                             builder.MoveToCell(0, accommodationStartIndex, 7, 0);
 
-                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency).Rate;
+                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency)?.Rate ?? 0.00M;
                             builder.Write(rate.ToString("#0.0000"));//汇率
                             builder.MoveToCell(0, accommodationStartIndex, 8, 0);
 
@@ -4449,10 +4460,10 @@ namespace OASystem.API.Controllers
                             }
 
                             builder.MoveToCell(0, foodandotherStartIndex, 1, 0);
-                            builder.Write(dac.Place == null ? "" : dac.Place);//城市
+                            builder.Write(placeData.Find(it => it.Id == dac.NationalTravelFeeId)?.Country ?? "Unknown");//城市
                             builder.MoveToCell(0, foodandotherStartIndex, 2, 0);
 
-                            string currency = _CurrDatas.Find(it => it.Id == dac.Currency).Name;
+                            string currency = _CurrDatas.Find(it => it.Id == dac.Currency)?.Name ?? "Unknwon";
                             builder.Write(currency);//币种
                             builder.MoveToCell(0, foodandotherStartIndex, 3, 0);
                             builder.Write(dac.Cost.ToString("#0.00"));//标准
@@ -4464,7 +4475,7 @@ namespace OASystem.API.Controllers
                             builder.Write(dac.SubTotal.ToString("#0.00"));//小计
                             builder.MoveToCell(0, foodandotherStartIndex, 7, 0);
 
-                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency).Rate;
+                            decimal rate = rateDatas.Find(it => it.CurrencyCode == currency)?.Rate ?? 0.00M;
                             builder.Write(rate.ToString());//汇率
                             builder.MoveToCell(0, foodandotherStartIndex, 8, 0);
 
@@ -4537,7 +4548,6 @@ namespace OASystem.API.Controllers
                             builder.Write(DeleClientList[i].Job);
                         }
 
-
                         //删除多余行
                         while (tableOne.Rows.Count > DeleClientList.Count + 1)
                         {

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

@@ -123,7 +123,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             Result result = new Result() { Code =-1,Msg="操作失败!" };
 
             var enterExitCost = _mapper.Map<Grp_EnterExitCost>(dto);
-            enterExitCost.InsidePay = enterExitCost.Visa + enterExitCost.YiMiao + enterExitCost.HeSuan + enterExitCost.Service + enterExitCost.Safe + enterExitCost.Ticket;
+            //enterExitCost.InsidePay = enterExitCost.Visa + enterExitCost.YiMiao + enterExitCost.HeSuan + enterExitCost.Service + enterExitCost.Safe + enterExitCost.Ticket;
             var quarterageData = _mapper.Map<List<Grp_DayAndCost>>(dto.QuarterageData);  //住宿费 1
             quarterageData = quarterageData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();