Pārlūkot izejas kodu

团组成本 各模块(酒店,地接,机票)成本提示

leiy 11 mēneši atpakaļ
vecāks
revīzija
f7afbb4071

+ 60 - 31
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -58,6 +58,7 @@ using SixLabors.Fonts.Tables.AdvancedTypographic;
 using Microsoft.EntityFrameworkCore;
 using System.Security.Cryptography.Xml;
 using MathNet.Numerics;
+using System.Security.Policy;
 
 namespace OASystem.API.Controllers
 {
@@ -5681,7 +5682,7 @@ namespace OASystem.API.Controllers
 
 
         /// <summary>
-        ///     
+        ///  团组成本 各模块(酒店,地接,机票)成本提示
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -5746,27 +5747,55 @@ namespace OASystem.API.Controllers
                     }
                 }
                 
-                GroupCostModulePromptView _view = new GroupCostModulePromptView()
-                { 
-                    CurrencyCode = _GroupCostParameters[0].Currency,
-                    Rate = _GroupCostParameters[0].Rate
-                };
-
-                decimal _rate = 0.00M;
+                GroupCostModulePromptView _view = new GroupCostModulePromptView();
+;
                 List<GroupCostModulePromptInfo> _ModulePromptInfos = new List<GroupCostModulePromptInfo>();
                 foreach (var item in _GroupCostParameters)
                 {
+
+                    decimal _rate = item.Rate;
+                    decimal _scale = 0.95M;
+                    #region 处理地接价格比例 总经理 国交部经理 主管 不下调 其他人 下调 5% 
+                    var userInfo = _usersRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.IsDel == 0 && it.Id == dto.UserId).First();
+                    if (userInfo != null)
+                    {
+                        if (userInfo.DepId == 1 || userInfo.DepId == 7)
+                        {
+                            if (userInfo.JobPostId == 1 || userInfo.JobPostId == 22 || userInfo.JobPostId == 32)
+                            {
+                                _scale = 1.00M;
+                            }
+                        }
+                    }
+                    #endregion
+
+                  
+
                     GroupCostModulePromptInfo modulePromptInfo = new GroupCostModulePromptInfo()
                     {
+                        CurrencyCode = item.Currency,
+                        Rate = _rate,
                         CostType = item.CostType,
                         CostTypeStartTime = Convert.ToDateTime(item.CostTypeStartTime).ToString("yyyy-MM-dd"),
                         CostTypeEndTime = Convert.ToDateTime(item.CostTypeendTime).ToString("yyyy-MM-dd"),
-                        CostTypeNumber = item.CostTypenumber,
-                        IndividualCost = item.DJCB / item.CostTypenumber,
-                        TotlaCost = item.DJCB
+                        CostTypeNumber = item.CostTypenumber
                     };
+                    if (_GroupCostParameters.Count > 1)
+                    {
+                        modulePromptInfo.CostTypeNumber = item.CostTypenumber;
+                       
+                    }
+                    else
+                    {
+                        modulePromptInfo.CostTypeNumber = item.LYJRS;
+                    }
+
+                    if (dto.CTable == 79)
+                    {
+                        modulePromptInfo.IndividualCost = item.DJCB / modulePromptInfo.CostTypeNumber;
+                        modulePromptInfo.TotalCost = item.DJCB;
+                    }
 
-                    _rate = item.Rate;
                     List<string> costTypes = new List<string>() { "A","B" };
 
                     List<Grp_GroupCost> _GroupCostsTypeData = new List<Grp_GroupCost>();
@@ -5815,20 +5844,6 @@ namespace OASystem.API.Controllers
                             );
                             break;
                         case 79: // 车/导游地接
-                            decimal _scale = 0.95M;
-                            #region 总经理 国交部经理 主管 不下调 其他人 下调 5%
-                            var userInfo = _usersRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.IsDel == 0 && it.Id == dto.UserId).First();
-                            if (userInfo != null)
-                            {
-                                if (userInfo.DepId == 1 || userInfo.DepId == 7)
-                                {
-                                    if (userInfo.JobPostId == 1 || userInfo.JobPostId == 22 || userInfo.JobPostId == 32)
-                                    {
-                                        _scale = 1.00M;
-                                    }
-                                }
-                            }
-                            #endregion
 
                             datas.AddRange(
                                 _GroupCostsTypeData.Select(it => new
@@ -5843,17 +5858,31 @@ namespace OASystem.API.Controllers
                                     DrinksSnacksFruitFee = it.B_R_F * _rate * _scale,
                                     TravelSupplies = it.TE * _rate * _scale,
                                     LeadersFee = it.TLF * _rate * _scale,
+                                    CarFee1 = it.CarCost * _rate * _scale,
+                                    CarType = it.CarType,
+                                    SpentCash = it.PC * _rate * _scale,
                                 })
                             );
 
                             break;
                         case 85: // 机票
-                           
-                            datas.AddRange(
-                                _GroupCostsTypeData.Select(it => new
+                            datas.Add(
+                                new
                                 {
-                                   
-                                })
+                                    AirType = "经济舱",
+                                    AirNum = item.JJCRS,
+                                    AirDRCB = item.JJCCB,
+                                    AirZCB = (item.JJCRS * item.JJCCB)
+                                }
+                            );
+                            datas.Add(
+                                new
+                                {
+                                    AirType = "公务舱",
+                                    AirNum = item.GWCRS,
+                                    AirDRCB = item.GWCCB,
+                                    AirZCB = (item.GWCRS * item.GWCCB)
+                                }
                             );
 
                             break;

+ 5 - 4
OASystem/OASystem.Domain/ViewModels/Groups/GroupCostParameterView.cs

@@ -20,15 +20,16 @@ namespace OASystem.Domain.ViewModels.Groups
     /// </summary>
     public class GroupCostModulePromptView
     {
-        public string CurrencyCode { get; set; }
-
-        public decimal Rate { get; set; }
 
         public List<GroupCostModulePromptInfo> ModulePromptInfos { get; set; }
     }
 
     public class GroupCostModulePromptInfo
     {
+        public string CurrencyCode { get; set; }
+
+        public decimal Rate { get; set; }
+
         /// <summary>
         /// 分段成本 A B
         /// </summary>
@@ -46,7 +47,7 @@ namespace OASystem.Domain.ViewModels.Groups
         /// <summary>
         /// 总成本
         /// </summary>
-        public decimal TotlaCost { get; set; }
+        public decimal TotalCost { get; set; }
 
         public object Data { get; set; }
     }