Explorar el Código

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

yuanrf hace 7 meses
padre
commit
63f00ab3b5

+ 18 - 58
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -1605,26 +1605,8 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostPaymentRefundAndOtherMoneyInfo(PaymentRefundAndOtherMoneyInfoDto dto)
         {
-            try
-            {
-                if (dto == null)
-                {
-                    return Ok(JsonView(false, "参数不能为空!"));
-                }
-
-                Result _result = await _paymentRefundAndOtherMoneyRep._Info(dto);
-
-                if (_result.Code != 0)
-                {
-                    return Ok(JsonView(false, _result.Msg));
-                }
-
-                return Ok(JsonView(true, "查询成功!", _result.Data));
-            }
-            catch (Exception ex)
-            {
-                return Ok(JsonView(false, ex.Message));
-            }
+            if (dto == null) return Ok(JsonView(false, "参数不能为空!"));
+            return Ok(_paymentRefundAndOtherMoneyRep._Info(dto));
         }
 
         /// <summary>
@@ -1637,50 +1619,28 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostPaymentRefundAndOtherMoneyAddOrEdit(PaymentRefundAndOtherMoneyAddOrEditDto dto)
         {
-            try
-            {
-                if (dto == null) return Ok(JsonView(false, "参数不能为空!"));
-                if (dto.PageId <= 0) return Ok(JsonView(false, "请传入正确的的页面Id!"));
-                if (dto.UserId <= 0) return Ok(JsonView(false, "请传入正确的的员工Id!"));
+            if (dto == null) return Ok(JsonView(false, "参数不能为空!"));
+            if (dto.PageId <= 0) return Ok(JsonView(false, "请传入正确的的页面Id!"));
+            if (dto.UserId <= 0) return Ok(JsonView(false, "请传入正确的的员工Id!"));
 
-                #region 页面功能权限处理
-                PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
-                pageFunAuth = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
+            #region 页面功能权限处理
+            PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
+            pageFunAuth = await GeneralMethod.PostUserPageFuncDatas(dto.UserId, dto.PageId);
 
-                #endregion
-
-                if (dto.Status == 1) //add
-                {
-                    if (pageFunAuth.AddAuth == 0)
-                    {
-                        return Ok(JsonView(false, "您没有当前页面添加权限!"));
-                    }
-                }
-                else if (dto.Status == 2) //edit
-                {
-                    if (pageFunAuth.EditAuth == 0)
-                    {
-                        return Ok(JsonView(false, "您没有当前页面编辑权限!"));
-                    }
-                }
-                else
-                {
-                    return Ok(JsonView(false, "请输入正确的操作状态! 1 添加 2 修改!"));
-                }
-
-                Result _result = await _paymentRefundAndOtherMoneyRep._AddOrEdit(dto);
-
-                if (_result.Code != 0)
-                {
-                    return Ok(JsonView(false, _result.Msg));
-                }
+            #endregion
 
-                return Ok(JsonView(true, "操作成功!"));
+            if (dto.Status == 1) //add
+            {
+                if (pageFunAuth.AddAuth == 0) return Ok(JsonView(false, "您没有当前页面添加权限!"));
             }
-            catch (Exception ex)
+            else if (dto.Status == 2) //edit
             {
-                return Ok(JsonView(false, ex.Message));
+                if (pageFunAuth.EditAuth == 0) return Ok(JsonView(false, "您没有当前页面编辑权限!"));
             }
+            else return Ok(JsonView(false, "请输入正确的操作状态! 1 添加 2 修改!"));
+
+            return Ok(await _paymentRefundAndOtherMoneyRep._AddOrEdit(dto));
+
         }
         #endregion
 

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

@@ -1949,7 +1949,7 @@ namespace OASystem.API.Controllers
                         if (entity.CTable == 76 || entity.CTable == 79)
                         {
                             if (entity.IsAuditGM == 3) overBudgetStr = "未超预算";
-                            else overBudgetStr = "超预算";
+                            else overBudgetStr = _feeAuditRep.IsOverBudget(entity.CTable, entity.DIId, entity.CId);
                         }
                         else
                         {
@@ -10059,6 +10059,7 @@ ORDER by  gctggrc.id DESC
 
                 //自动审核
                 var autoAdit = await _feeAuditRep.FeeAutomaticAudit(1, _dto.DiId, hotelId);
+                //if (autoAdit.Code != 200) _view.Msg += $"\r\n{autoAdit.Msg}";
 
                 _logger.LogInformation($"【酒店自动审核】【{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}】执行调用   调用结果:{JsonConvert.SerializeObject(autoAdit)}");
             }

+ 3 - 3
OASystem/OASystem.Api/OAMethodLib/SignalR/Hubs/ChatHub.cs

@@ -24,7 +24,7 @@ namespace OASystem.API.OAMethodLib.Hub.Hubs
         /// 已登录的用户信息
         /// </summary>
         //public static List<UserModel> OnlineUser { get; set; } = new List<UserModel>();
-
+         
         public ChatHub(ILogger<ChatHub> logger, CommonService common)
         {
             _logger = logger;
@@ -55,8 +55,8 @@ namespace OASystem.API.OAMethodLib.Hub.Hubs
         }
 
         /// <summary>
-        /// 客户端连接服务端
-        /// </summary>
+        /// </summary>        
+        /// /// 客户端连接服务端
         /// <returns></returns>
         public override Task OnConnectedAsync()
         {

+ 9 - 0
OASystem/OASystem.Domain/Dtos/Financial/PaymentRefundAndOtherMoneyDto.cs

@@ -122,5 +122,14 @@ namespace OASystem.Domain.Dtos.Financial
         /// 备注
         /// </summary>
         public string? Remark { get; set; }
+
+        /// <summary>
+        /// 对方开户行
+        /// </summary>
+        public string OtherBankName { get; set; }
+        /// <summary>
+        /// 对方银行账号
+        /// </summary>
+        public string OtherSideNo { get; set; }
     }
 }

+ 8 - 0
OASystem/OASystem.Domain/ViewModels/Financial/Fin_PaymentRefundAndOtherMoneyView.cs

@@ -139,6 +139,14 @@ namespace OASystem.Domain.ViewModels.Financial
         /// 备注
         /// </summary>
         public string? Remark { get; set; }
+        /// <summary>
+        /// 对方开户行
+        /// </summary>
+        public string OtherBankName { get; set; }
+        /// <summary>
+        /// 对方银行账号
+        /// </summary>
+        public string OtherSideNo { get; set; }
 
     }
 }

+ 76 - 44
OASystem/OASystem.Infrastructure/Repositories/Financial/PaymentRefundAndOtherMoneyRepository.cs

@@ -173,23 +173,44 @@ namespace OASystem.Infrastructure.Repositories.Financial
         /// </summary>
         /// <param name="diId"></param>
         /// <returns></returns>
-        public async Task<Result> _Info(PaymentRefundAndOtherMoneyInfoDto dto)
+        public async Task<JsonView> _Info(PaymentRefundAndOtherMoneyInfoDto dto)
         {
+            var _view = new JsonView() { Code = StatusCodes.Status204NoContent };
            
             if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)  //1 Web 2 Android 3 Ios
             {
-                string sql = string.Format(@"Select prom.Id,ccp.Id CcpId,prom.DiId,prom.PriceName,prom.Price,prom.CurrencyId,ccp.Payee,ccp.PayDId,
-										 ccp.OrbitalPrivateTransfer,ccp.ConsumptionPatterns,prom.PayType,prom.Remark
-										 From Fin_PaymentRefundAndOtherMoney prom 
-										 Left Join Grp_CreditCardPayment ccp On ccp.CId = prom.id And ccp.CTable = 285 And ccp.IsDel = 0
-										 Where prom.IsDel = 0 And ccp.DIId = prom.DiId And prom.Id = {0}", dto.Id);
+                string sql = string.Format(@"
+SELECT
+  prom.Id,
+  ccp.Id CcpId,
+  prom.DiId,
+  prom.PriceName,
+  prom.Price,
+  prom.CurrencyId,
+  ccp.Payee,
+  ccp.PayDId,
+  ccp.OrbitalPrivateTransfer,
+  ccp.ConsumptionPatterns,
+  prom.PayType,
+  prom.Remark,
+  ccp.OtherBankName,
+  ccp.OtherBankName
+FROM
+  Fin_PaymentRefundAndOtherMoney prom
+  LEFT JOIN Grp_CreditCardPayment ccp ON ccp.CId = prom.id
+  AND ccp.CTable = 285
+  AND ccp.IsDel = 0
+WHERE
+  prom.IsDel = 0
+  AND ccp.DIId = prom.DiId
+  AND prom.Id = {0}", dto.Id);
                 var data = await _sqlSugar.SqlQueryable<Fin_PaymentRefundAndOtherMoneyInfoView>(sql).FirstAsync();
 
                 if (data != null)
                 {
-                    _result.Data = data;
-                    _result.Code = 0;
-                    _result.Msg = "查询成功!";
+                    _view.Data = data;
+                    _view.Code = 200;
+                    _view.Msg = "查询成功!";
                 }
                 else
                 {
@@ -199,10 +220,10 @@ namespace OASystem.Infrastructure.Repositories.Financial
             }
             else
             {
-                _result.Msg = "请输入正确的端口号! 1 Web 2 Android 3 Ios;";
+                _view.Msg = "请输入正确的端口号! 1 Web 2 Android 3 Ios;";
             }
            
-            return _result;
+            return _view;
         }
 
         /// <summary>
@@ -210,8 +231,9 @@ namespace OASystem.Infrastructure.Repositories.Financial
         /// </summary>
         /// <param name="diId"></param>
         /// <returns></returns>
-        public async Task<Result> _AddOrEdit(PaymentRefundAndOtherMoneyAddOrEditDto dto)
+        public async Task<JsonView> _AddOrEdit(PaymentRefundAndOtherMoneyAddOrEditDto dto)
         {
+            var _view = new JsonView() { Code = StatusCodes.Status204NoContent };
             if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)  //1 Web 2 Android 3 Ios
             {
                 #region 参数处理
@@ -285,8 +307,8 @@ namespace OASystem.Infrastructure.Repositories.Financial
                     PaymentCurrency = dto.CurrencyId,
                     DayRate = dayRate,
                     CompanyBankNo = string.Empty,
-                    OtherBankName = string.Empty,
-                    OtherSideNo = string.Empty,
+                    OtherBankName = dto.OtherBankName,
+                    OtherSideNo = dto.OtherSideNo,
                     OtherSideName = string.Empty,
                     MFOperator = 0,
                     MFOperatorDate = string.Empty,
@@ -322,18 +344,35 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 {
                     #region 添加数据验证
 
-                    string sql = string.Format(@"Select prom.Id,ccp.Id CcpId,prom.DiId,prom.PriceName,prom.Price,prom.CurrencyId,ccp.Payee,ccp.PayDId,
-										 ccp.OrbitalPrivateTransfer,ccp.ConsumptionPatterns,prom.PayType,prom.Remark
-										 From Fin_PaymentRefundAndOtherMoney prom 
-										 Left Join Grp_CreditCardPayment ccp On ccp.CId = prom.id And ccp.CTable = 285 
-										 Where prom.IsDel = 0 And ccp.IsDel = 0 And ccp.DIId = prom.DiId And prom.PriceName = '{0}'",
-                                         _PaymentRefundAndOtherMoney.PriceName);
+                    string sql = string.Format(@"
+SELECT
+  prom.Id,
+  ccp.Id CcpId,
+  prom.DiId,
+  prom.PriceName,
+  prom.Price,
+  prom.CurrencyId,
+  ccp.Payee,
+  ccp.PayDId,
+  ccp.OrbitalPrivateTransfer,
+  ccp.ConsumptionPatterns,
+  prom.PayType,
+  prom.Remark
+FROM
+  Fin_PaymentRefundAndOtherMoney prom
+  LEFT JOIN Grp_CreditCardPayment ccp ON ccp.CId = prom.id
+  AND ccp.CTable = 285
+WHERE
+  prom.IsDel = 0
+  AND ccp.IsDel = 0
+  AND ccp.DIId = prom.DiId
+  AND prom.PriceName = '{0}'",_PaymentRefundAndOtherMoney.PriceName);
                     var data = await _sqlSugar.SqlQueryable<Fin_PaymentRefundAndOtherMoneyInfoView>(sql).FirstAsync();
 
                     if (data != null)
                     {
-                        _result.Msg = "费用名称已存在,请勿重新添加!";
-                        return _result;
+                        _view.Msg = "费用名称已存在,请勿重新添加!";
+                        return _view;
                     }
                    
                     #endregion
@@ -344,22 +383,22 @@ namespace OASystem.Infrastructure.Repositories.Financial
 
                     if (addReturnId <= 0)
                     {
-                        _result.Msg = "操作失败!收款退还与其他款项添加失败!";
+                        _view.Msg = "操作失败!收款退还与其他款项添加失败!";
                         _sqlSugar.RollbackTran();
-                        return _result;
+                        return _view;
                     }
                     _CreditCardPayment.CId = addReturnId;
                     var addStatus = await _sqlSugar.Insertable(_CreditCardPayment).ExecuteReturnIdentityAsync();
                     if (addStatus <= 0)
                     {
-                        _result.Msg = "操作失败!付款类型添加失败!";
+                        _view.Msg = "操作失败!付款类型添加失败!";
                         _sqlSugar.RollbackTran();
-                        return _result;
+                        return _view;
                     }
 
                     _sqlSugar.CommitTran();
-                    _result.Msg = "操作成功!";
-                    _result.Code = 0;
+                    _view.Msg = "操作成功!";
+                    _view.Code = 200;
                 }
                 else if (dto.Status == 2) //修改
                 {
@@ -376,9 +415,9 @@ namespace OASystem.Infrastructure.Repositories.Financial
 
                     if (prom_update <= 0)
                     {
-                        _result.Msg = "操作失败!收款退还与其他款项修改失败!";
+                        _view.Msg = "操作失败!收款退还与其他款项修改失败!";
                         _sqlSugar.RollbackTran();
-                        return _result;
+                        return _view;
                     }
 
                     var ccp_update = await _sqlSugar.Updateable(_CreditCardPayment)
@@ -398,27 +437,20 @@ namespace OASystem.Infrastructure.Repositories.Financial
                                                    .ExecuteCommandAsync();
                     if (ccp_update <= 0)
                     {
-                        _result.Msg = "操作失败!付款信息修改失败!";
+                        _view.Msg = "操作失败!付款信息修改失败!";
                         _sqlSugar.RollbackTran();
-                        return _result;
+                        return _view;
                     }
 
                     _sqlSugar.CommitTran();
-                    _result.Msg = "操作成功!";
-                    _result.Code = 0;
-                }
-                else
-                {
-                    _result.Msg = "请输入正确的操作状态! 1 添加 2 修改;";
+                    _view.Msg = "操作成功!";
+                    _view.Code = 200;
                 }
-
-            }
-            else
-            {
-                _result.Msg = "请输入正确的端口号! 1 Web 2 Android 3 Ios;";
+                else _view.Msg = "请输入正确的操作状态! 1 添加 2 修改;";
             }
+            else _view.Msg = "请输入正确的端口号! 1 Web 2 Android 3 Ios;";
 
-            return _result;
+            return _view;
         }
     }
 }

+ 331 - 79
OASystem/OASystem.Infrastructure/Repositories/Groups/FeeAuditRepository.cs

@@ -40,16 +40,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
             List<int> stids = new List<int>() { 17, 66 };
             var setData = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && stids.Contains(x.STid)).ToList();
             string _teamCurrency = string.Empty;
-            decimal _rate = 0.00M;
-            var groupInfo = _sqlSugar.Queryable< Grp_GroupCostParameter >().Where(x => x.IsDel ==0 && x.DiId == diId).First();
+           
+            var groupInfo = _sqlSugar.Queryable<Grp_GroupCostParameter>().Where(x => x.IsDel == 0 && x.DiId == diId).First();
             if (groupInfo == null) { _view.Msg = $"团组成本信息未填写!"; return _view; }
             _teamCurrency = groupInfo.Currency;
             //币种验证  统一为currencycode三字码
-            if (int.TryParse(_teamCurrency,out int currency))
-            {
-                _teamCurrency = setData.Find(x => x.Id == currency)?.Name ?? "";
-            }
-            _rate = groupInfo.Rate;
+            if (int.TryParse(_teamCurrency,out int currency)) _teamCurrency = setData.Find(x => x.Id == currency)?.Name ?? "";
+
 
             string costContentSql = $"Select * From Grp_GroupCost";
             var costContents =  _sqlSugar.SqlQueryable<GroupCostAuditView>(costContentSql).Where(x => x.IsDel == 0 && x.Diid == diId).ToList();
@@ -70,25 +67,34 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
             if (feeType == 1)
             {
-                var hotelCostInfo = _sqlSugar.Queryable<Grp_HotelReservations>().Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId).First();
+                //1089	对冲账或其他 不在审核范围
+                var hotelCostInfo = _sqlSugar.Queryable<Grp_HotelReservations>().Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId && x.CheckType != 1089).First();
                 var hotelCostDetails = _sqlSugar.Queryable<Grp_HotelReservationsContent>().Where(x => x.IsDel == 0 && x.DiId == diId && x.HrId == dataId).ToList();
                 if (hotelCostInfo == null)
                 {
                     _view.Msg = $"酒店费用数据未填写";
+                    QuashAudit(76, diId, dataId);
                     return _view;
                 }
 
-                //验证币种是否相等
-                string hotelCurrency = setData.Find(x => x.Id == hotelCostInfo.CardPriceCurrency)?.Name ?? "";
-                if (hotelCurrency != _teamCurrency)
+                //酒店费用金额 == 0 不自动审核
+                if (hotelCostInfo.CardPrice == 0.0000M)
                 {
-                    if (!hotelCurrency.Equals("CNY"))
-                    {
-                        _view.Msg = $"酒店预订费用币种与团组成本币种不一致,请手动审核";
-                        return _view;
-                    }
+                    _view.Msg = $"酒店费用金额 == 0 不自动审核";
+                    QuashAudit(76, diId, dataId);
+                    return _view;
                 }
-                else _rate = 1.0000M;
+
+
+                //获取C表汇率
+                decimal _rate = 1.0000M;
+                var roomFeeInfo = hotelCostDetails.Where(x => x.PriceType == 1).First();
+                if (roomFeeInfo == null)
+                {
+                    _view.Msg = $"酒店房间费用付款数据未填写";
+                    return _view;
+                }
+                _rate = roomFeeInfo.Rate == 0.0000M ? 1.0000M : roomFeeInfo.Rate;
 
                 bool isAutoAudit = true; //是否自动审核
                 DateTime checkIn = Convert.ToDateTime(hotelCostInfo.CheckInDate),
@@ -97,7 +103,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 var hotelCostInfos = costContents.Where(x => Convert.ToDateTime(x.Date) >= checkIn && Convert.ToDateTime(x.Date) <= checkOut).ToList();
                 if (hotelCostInfos.Count < 1) isAutoAudit = false;
 
-                decimal otherFee = hotelCostDetails.Where(x => x.PriceType != 1).Sum(x => x.Price);
+                decimal otherFee = hotelCostDetails.Where(x => x.PriceType != 1).Sum(x => x.Price * (x.Rate == 0.0000M ? 1.0000M : x.Rate));
                 if (otherFee > 0) { otherFee /= (checkOut-checkIn).Days; }
                 var hotelCostInfosGroup = hotelCostInfos.GroupBy(x => x.Date);
                 foreach (var item in hotelCostInfosGroup)
@@ -108,19 +114,19 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     decimal hotelSuiteRoomFee = item.Sum(x => x.HotelSuiteRoomFee);
                     //1.判断费用是否 <= 成本费用
                     //1.1 判断单间费用
-                    decimal singleRoomPrice = hotelCostInfo.SingleRoomPrice + otherFee;
+                    decimal singleRoomPrice = (hotelCostInfo.SingleRoomPrice + otherFee) * _rate;
                     if (singleRoomPrice > 0) if (singleRoomPrice > hotelSingleRoomFee * _rate) isAutoAudit = false;
 
                     //1.2 判断双人间费用
-                    decimal doubleRoomPrice = hotelCostInfo.DoubleRoomPrice + otherFee;
+                    decimal doubleRoomPrice = (hotelCostInfo.DoubleRoomPrice + otherFee) * _rate;
                     if (doubleRoomPrice > 0) if (doubleRoomPrice > hotelDoubleRoomFee * _rate) isAutoAudit = false;
 
                     //1.3 判断套房费用
-                    decimal suiteRoomPrice = hotelCostInfo.SuiteRoomPrice + otherFee;
+                    decimal suiteRoomPrice = (hotelCostInfo.SuiteRoomPrice + otherFee) * _rate;
                     if (suiteRoomPrice > 0) if (suiteRoomPrice > hotelSuiteFee * _rate) isAutoAudit = false;
 
                     //1.4 判断其他房型费用
-                    decimal otherRoomPrice = hotelCostInfo.OtherRoomPrice + otherFee;
+                    decimal otherRoomPrice = (hotelCostInfo.OtherRoomPrice + otherFee) * _rate;
                     if (otherRoomPrice > 0) if (otherRoomPrice > hotelSuiteRoomFee * _rate) isAutoAudit = false;
                 }
 
@@ -142,24 +148,16 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
                 else {
                     //撤销该条数据的自动审核 --> 该条数据的审核状态是自动审核  3 --> 0
-                    var ccpInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>()
-                                           .Where(s => s.DIId == diId && s.CTable == 76 && s.CId == dataId && s.IsAuditGM == 3)
-                                           .First();
-                    if (ccpInfo != null)
+
+                    var quashStatus = QuashAudit(76,diId,dataId);
+
+                    if (quashStatus)
                     {
-                        var ccpUpdate = _sqlSugar.Updateable<Grp_CreditCardPayment>()
-                                       .SetColumns(it => it.IsAuditGM == 0)
-                                       .SetColumns(it => it.AuditGMOperate == 0)
-                                       .SetColumns(it => it.AuditGMDate == string.Empty)
-                                       .Where(s => s.Id == ccpInfo.Id)
-                                       .ExecuteCommand();
-                        if (ccpUpdate > 0)
-                        {
-                            _view.Code = 200;
-                            _view.Msg = "费用超团组成本,自动审核撤销成功!";
-                            return _view;
-                        }
+                        _view.Code = 200;
+                        _view.Msg = "费用超团组成本,自动审核撤销成功!";
+                        return _view;
                     }
+                    
                 }
             }
             else if (feeType == 2)
@@ -195,18 +193,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     _view.Msg = $"OP费用费用内容未填写";
                     return _view;
                 }
-                string opCurrencyName = setData.Find(x => x.Id == opContents[0].Currency)?.Name ?? "";
-                //1.1币种验证
-                if (!opCurrencyName.Equals(_teamCurrency))
+                //获取C表汇率
+                decimal _rate = 1.0000M;
+                var payInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(x => x.IsDel == 0 && x.DIId == diId && x.CTable == 79 && x.Id == dataId).First();
+                if (payInfo == null)
                 {
-                    if (!opCurrencyName.Equals("CNY"))
-                    {
-                        _view.Msg = $"OP费用币种与团组成本币种不一致,请手动审核";
-                        return _view;
-                    }
+                    _view.Msg = $"OP费用付款数据未填写";
+                    return _view;
                 }
-                else _rate = 1.0000M;
+                _rate = payInfo.DayRate;
 
+                string opCurrencyName = setData.Find(x => x.Id == opContents[0].Currency)?.Name ?? "";
+                
                 var opBasicDatas = setData.Where(x => x.STid == 17).ToList(); //费用类型基础数据
                 bool isAutoAudit = true;
                 if (!DateTime.TryParse(opinfos.ServiceStartTime, out DateTime startDt1) || !DateTime.TryParse(opinfos.ServiceEndTime, out DateTime endDt1))
@@ -257,56 +255,56 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     //车费 91
                     var opCarCost = item.FirstOrDefault(x => x.SId == 91);
-                    if (opCarCost != null) if (opCarCost.Price > _rate * opCostInfo.Sum(x => x.CarFee)) isAutoAudit = false;
+                    if (opCarCost != null) if (opCarCost.Price * _rate > _rate * opCostInfo.Sum(x => x.CarFee)) isAutoAudit = false;
                     //982 车超时费 -- 暂无
                     //92  导游费
                     var opGuideCost = item.FirstOrDefault(x => x.SId == 92);
-                    if (opGuideCost != null) if (opGuideCost.Price > _rate * opCostInfo.Sum(x => x.GuideFee)) isAutoAudit = false;
+                    if (opGuideCost != null) if (opGuideCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideFee)) isAutoAudit = false;
                     //94  导游景点费
                     var opGuideScenicCost = item.FirstOrDefault(x => x.SId == 94);
-                    if (opGuideScenicCost != null) if (opGuideScenicCost.Price > _rate * opCostInfo.Sum(x => x.GuideScenicFee)) isAutoAudit = false;
+                    if (opGuideScenicCost != null) if (opGuideScenicCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideScenicFee)) isAutoAudit = false;
                     //95  导游小费
                     var opGuideTipCost = item.FirstOrDefault(x => x.SId == 95);
-                    if (opGuideTipCost != null) if (opGuideTipCost.Price > _rate * opCostInfo.Sum(x => x.GuideTipFee)) isAutoAudit = false;
+                    if (opGuideTipCost != null) if (opGuideTipCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideTipFee)) isAutoAudit = false;
                     //983 导游餐补
                     var opGuideMealCost = item.FirstOrDefault(x => x.SId == 983);
-                    if (opGuideMealCost != null) if (opGuideMealCost.Price > _rate * opCostInfo.Sum(x => x.GuideMealFee)) isAutoAudit = false;
+                    if (opGuideMealCost != null) if (opGuideMealCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideMealFee)) isAutoAudit = false;
                     //984 导游房补
                     var opGuideRoomCost = item.FirstOrDefault(x => x.SId == 984);
-                    if (opGuideRoomCost != null) if (opGuideRoomCost.Price > _rate * opCostInfo.Sum(x => x.GuideRoomFee)) isAutoAudit = false;
+                    if (opGuideRoomCost != null) if (opGuideRoomCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideRoomFee)) isAutoAudit = false;
                     //985 导游交通
                     var opGuideTrafficCost = item.FirstOrDefault(x => x.SId == 985);
-                    if (opGuideTrafficCost != null) if (opGuideTrafficCost.Price > _rate * opCostInfo.Sum(x => x.GuideTrafficFee)) isAutoAudit = false;
+                    if (opGuideTrafficCost != null) if (opGuideTrafficCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideTrafficFee)) isAutoAudit = false;
                     //96  接送机费 -- 暂无
                     //97  其他费用 -- 暂无
                     //979 司机工资
                     var opDriverCost = item.FirstOrDefault(x => x.SId == 979);
-                    if (opDriverCost != null) if (opDriverCost.Price > _rate * opCostInfo.Sum(x => x.DriverFee)) isAutoAudit = false;
+                    if (opDriverCost != null) if (opDriverCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverFee)) isAutoAudit = false;
                     //980 司机小费
                     var opDriverTipCost = item.FirstOrDefault(x => x.SId == 980);
-                    if (opDriverTipCost != null) if (opDriverTipCost.Price > _rate * opCostInfo.Sum(x => x.DriverTipFee)) isAutoAudit = false;
+                    if (opDriverTipCost != null) if (opDriverTipCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverTipFee)) isAutoAudit = false;
                     //981 司机餐补
                     var opDriverMealCost = item.FirstOrDefault(x => x.SId == 981);
-                    if (opDriverMealCost != null) if (opDriverMealCost.Price > _rate * opCostInfo.Sum(x => x.DriverMealFee)) isAutoAudit = false;
+                    if (opDriverMealCost != null) if (opDriverMealCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverMealFee)) isAutoAudit = false;
                     //988 客户早餐费用
                     var opClientBreakfastCost = item.FirstOrDefault(x => x.SId == 988);
-                    if (opClientBreakfastCost != null) if (opClientBreakfastCost.Price > _rate * opCostInfo.Sum(x => x.ClientBreakfastFee)) isAutoAudit = false;
+                    if (opClientBreakfastCost != null) if (opClientBreakfastCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientBreakfastFee)) isAutoAudit = false;
                     //93  客户午餐费用
                     var opClientLunchCost = item.FirstOrDefault(x => x.SId == 93);
-                    if (opClientLunchCost != null) if (opClientLunchCost.Price > _rate * opCostInfo.Sum(x => x.ClientLunchFee)) isAutoAudit = false;
+                    if (opClientLunchCost != null) if (opClientLunchCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientLunchFee)) isAutoAudit = false;
                     //989 客户晚餐费用
                     var opClientDinnerCost = item.FirstOrDefault(x => x.SId == 989);
-                    if (opClientDinnerCost != null) if (opClientDinnerCost.Price > _rate * opCostInfo.Sum(x => x.ClientDinnerFee)) isAutoAudit = false;
+                    if (opClientDinnerCost != null) if (opClientDinnerCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientDinnerFee)) isAutoAudit = false;
                     //990 景点门票费
                     var opScenicTicketCost = item.FirstOrDefault(x => x.SId == 990);
-                    if (opScenicTicketCost != null) if (opScenicTicketCost.Price > _rate * opCostInfo.Sum(x => x.ScenicTicketFee)) isAutoAudit = false;
+                    if (opScenicTicketCost != null) if (opScenicTicketCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ScenicTicketFee)) isAutoAudit = false;
                     //991 饮料/零食/水果
                     var opDrinkSnackFruitCost = item.FirstOrDefault(x => x.SId == 991);
-                    if (opDrinkSnackFruitCost != null) if (opDrinkSnackFruitCost.Price > _rate * opCostInfo.Sum(x => x.DrinkSnackFruitFee)) isAutoAudit = false;
+                    if (opDrinkSnackFruitCost != null) if (opDrinkSnackFruitCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DrinkSnackFruitFee)) isAutoAudit = false;
                     //992 住补费用 -- 暂无
                     //994 翻译费
                     var opTranslatorCost = item.FirstOrDefault(x => x.SId == 994);
-                    if (opTranslatorCost != null) if (opTranslatorCost.Price > _rate * opCostInfo.Sum(x => x.TranslatorFee)) isAutoAudit = false;
+                    if (opTranslatorCost != null) if (opTranslatorCost.Price * _rate > _rate * opCostInfo.Sum(x => x.TranslatorFee)) isAutoAudit = false;
                     //1059    导游超时费用 -- 暂无
                     //1070    尾款金额 -- 暂无
                     //1071    其他额外费用 -- 暂无
@@ -335,23 +333,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 else
                 {
                     //撤销该条数据的自动审核 --> 该条数据的审核状态是自动审核  3 --> 0
-                    var ccpInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>()
-                                           .Where(s => s.DIId == diId && s.CTable == 79 && s.CId == dataId && s.IsAuditGM == 3)
-                                           .First();
-                    if (ccpInfo != null)
+                    if (QuashAudit(79,diId,dataId))
                     {
-                        var ccpUpdate = _sqlSugar.Updateable<Grp_CreditCardPayment>()
-                                       .SetColumns(it => it.IsAuditGM == 0)
-                                       .SetColumns(it => it.AuditGMOperate == 0)
-                                       .SetColumns(it => it.AuditGMDate == string.Empty)
-                                       .Where(s => s.Id == ccpInfo.Id)
-                                       .ExecuteCommand();
-                        if (ccpUpdate > 0)
-                        {
-                            _view.Code = 200;
-                            _view.Msg = "费用超团组成本,自动审核撤销成功!";
-                            return _view;
-                        }
+                        _view.Code = 200;
+                        _view.Msg = "费用超团组成本,自动审核撤销成功!";
+                        return _view;
                     }
                 }
             }
@@ -360,5 +346,271 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return _view;
         }
 
+        /// <summary>
+        /// hotel、op 撤销自动审核的数据
+        /// </summary>
+        /// <param name="type">
+        /// 酒店 76
+        /// op   79
+        /// </param>
+        /// <param name="diId"></param>
+        /// <param name="dataId"></param>
+        /// <returns></returns>
+        private bool QuashAudit(int type, int diId, int dataId)
+        {
+            //撤销该条数据的自动审核 --> 该条数据的审核状态是自动审核  3 --> 0
+            var ccpInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>()
+                                   .Where(s => s.DIId == diId && s.CTable == type && s.CId == dataId && s.IsAuditGM == 3)
+                                   .First();
+            if (ccpInfo != null)
+            {
+                var ccpUpdate = _sqlSugar.Updateable<Grp_CreditCardPayment>()
+                               .SetColumns(it => it.IsAuditGM == 0)
+                               .SetColumns(it => it.AuditGMOperate == 0)
+                               .SetColumns(it => it.AuditGMDate == string.Empty)
+                               .Where(s => s.Id == ccpInfo.Id)
+                               .ExecuteCommand();
+                if (ccpUpdate > 0)
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        //
+        /// <summary>
+        /// 费用自动审核
+        /// </summary>
+        /// <param name="feeType">
+        /// 1.酒店 76 
+        /// 2.op 79
+        /// </param>
+        /// <param name="diId">团组Id</param>
+        /// <param name="dataId">数据Id(模块类型主表Id)</param>
+        /// <returns></returns>
+        public string IsOverBudget(int feeType, int diId, int dataId)
+        {
+
+            string _view ="-";
+            if (diId < 1) {  return _view; }
+            if (dataId < 1) { return _view; }
+
+            List<int> stids = new List<int>() { 17, 66 };
+            var setData = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && stids.Contains(x.STid)).ToList();
+            string _teamCurrency = string.Empty;
+
+            var groupInfo = _sqlSugar.Queryable<Grp_GroupCostParameter>().Where(x => x.IsDel == 0 && x.DiId == diId).First();
+            if (groupInfo == null) { return _view; }
+            _teamCurrency = groupInfo.Currency;
+            //币种验证  统一为currencycode三字码
+            if (int.TryParse(_teamCurrency, out int currency)) _teamCurrency = setData.Find(x => x.Id == currency)?.Name ?? "";
+
+
+            string costContentSql = $"Select * From Grp_GroupCost";
+            var costContents = _sqlSugar.SqlQueryable<GroupCostAuditView>(costContentSql).Where(x => x.IsDel == 0 && x.Diid == diId).ToList();
+            if (costContents.Count < 1) {  return _view; }
+
+            //处理 成本详细信息 日期为空
+            for (int i = 0; i < costContents.Count; i++)
+            {
+                if (string.IsNullOrEmpty(costContents[i].Date))
+                {
+                    int index = i - 1;
+                    if (index >= 0)
+                    {
+                        costContents[i].Date = costContents[index].Date;
+                    }
+                }
+            }
+
+            if (feeType == 1)
+            {
+                var hotelCostInfo = _sqlSugar.Queryable<Grp_HotelReservations>().Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId).First();
+                var hotelCostDetails = _sqlSugar.Queryable<Grp_HotelReservationsContent>().Where(x => x.IsDel == 0 && x.DiId == diId && x.HrId == dataId).ToList();
+                if (hotelCostInfo == null) return _view;
+
+                //获取C表汇率
+                decimal _rate = 1.0000M;
+                var roomFeeInfo = hotelCostDetails.Where(x => x.PriceType == 1).First();
+                if (roomFeeInfo == null) return _view;
+
+                _rate = roomFeeInfo.Rate == 0.0000M ? 1.0000M : roomFeeInfo.Rate;
+
+                bool isAutoAudit = true; //是否自动审核
+                DateTime checkIn = Convert.ToDateTime(hotelCostInfo.CheckInDate),
+                         checkOut = Convert.ToDateTime(hotelCostInfo.CheckOutDate);
+                if (checkOut > checkIn) checkOut = checkOut.AddDays(-1); //房费计算,结束日期为前一天
+                var hotelCostInfos = costContents.Where(x => Convert.ToDateTime(x.Date) >= checkIn && Convert.ToDateTime(x.Date) <= checkOut).ToList();
+                if (hotelCostInfos.Count < 1) isAutoAudit = false;
+
+                decimal otherFee = hotelCostDetails.Where(x => x.PriceType != 1).Sum(x => x.Price * (x.Rate == 0.0000M ? 1.0000M : x.Rate));
+                if (otherFee > 0) { otherFee /= (checkOut - checkIn).Days; }
+                var hotelCostInfosGroup = hotelCostInfos.GroupBy(x => x.Date);
+                foreach (var item in hotelCostInfosGroup)
+                {
+                    decimal hotelSingleRoomFee = item.Sum(x => x.HotelSingleRoomFee);
+                    decimal hotelDoubleRoomFee = item.Sum(x => x.HotelDoubleRoomFee);
+                    decimal hotelSuiteFee = item.Sum(x => x.HotelSuiteFee);
+                    decimal hotelSuiteRoomFee = item.Sum(x => x.HotelSuiteRoomFee);
+                    //1.判断费用是否 <= 成本费用
+                    //1.1 判断单间费用
+                    decimal singleRoomPrice = (hotelCostInfo.SingleRoomPrice + otherFee) * _rate;
+                    if (singleRoomPrice > 0) if (singleRoomPrice > hotelSingleRoomFee * _rate) isAutoAudit = false;
+
+                    //1.2 判断双人间费用
+                    decimal doubleRoomPrice = (hotelCostInfo.DoubleRoomPrice + otherFee) * _rate;
+                    if (doubleRoomPrice > 0) if (doubleRoomPrice > hotelDoubleRoomFee * _rate) isAutoAudit = false;
+
+                    //1.3 判断套房费用
+                    decimal suiteRoomPrice = (hotelCostInfo.SuiteRoomPrice + otherFee) * _rate;
+                    if (suiteRoomPrice > 0) if (suiteRoomPrice > hotelSuiteFee * _rate) isAutoAudit = false;
+
+                    //1.4 判断其他房型费用
+                    decimal otherRoomPrice = (hotelCostInfo.OtherRoomPrice + otherFee) * _rate;
+                    if (otherRoomPrice > 0) if (otherRoomPrice > hotelSuiteRoomFee * _rate) isAutoAudit = false;
+                }
+
+                //2.判断是否自动审核
+                if (isAutoAudit)
+                {
+                    return $"未超预算";
+                }
+            }
+            else if (feeType == 2)
+            {
+                //1.基础数据参数验证
+                var priceType = new List<int>() { 1062 };
+                var opinfos = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
+                                       .Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId && !priceType.Contains(x.PriceType))
+                                       .First();
+                //var opinfos = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
+                //                       .Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId )
+                //                       .First();
+                if (opinfos == null) return _view;
+                //1.含超时费用/超支费用 手动审核
+                if (opinfos.SelectCheck.Contains("超时") || opinfos.SelectCheck.Contains("超支") || opinfos.SelectCheck.Contains("尾款")) return _view;
+                //1.参数验证
+                var opCheckPriceTyeps = opinfos.SelectCheck.Split(',');
+                var opCheckPriceTyepIds = setData.Where(x => opinfos.SelectCheck.Split(',').Contains(x.Name)).Select(x => x.Id).ToList();
+                var opContents = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>()
+                    .Where(x => x.IsDel == 0 && x.DiId == diId && x.CTGGRId == dataId && opCheckPriceTyepIds.Contains(x.SId))
+                    .OrderBy(x => x.DatePrice, OrderByType.Asc)
+                    .ToList();
+                if (opContents.Count < 1) return _view;
+
+                //获取C表汇率
+                decimal _rate = 1.0000M;
+                var payInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(x => x.IsDel == 0 && x.DIId == diId && x.CTable == 79 && x.Id == dataId).First();
+                if (payInfo == null) return _view;
+                _rate = payInfo.DayRate;
+
+                string opCurrencyName = setData.Find(x => x.Id == opContents[0].Currency)?.Name ?? "";
+
+                var opBasicDatas = setData.Where(x => x.STid == 17).ToList(); //费用类型基础数据
+                bool isAutoAudit = true;
+                if (!DateTime.TryParse(opinfos.ServiceStartTime, out DateTime startDt1) || !DateTime.TryParse(opinfos.ServiceEndTime, out DateTime endDt1)) return _view;
+
+                DateTime startDt = startDt1;
+                DateTime endDt = endDt1;
+                var opCostDatas = costContents.Where(it => Convert.ToDateTime(it.Date) >= startDt && Convert.ToDateTime(it.Date) <= endDt).ToList();
+                if (opCostDatas.Count < 1) return _view;
+
+                var noAuditFeeTypeIds = new List<int> {
+                   982 ,//982 车超时费 -- 暂无
+                   96  ,//96  接送机费 -- 暂无
+                   97  ,//97  其他费用 -- 暂无
+                   992 ,//992 住补费用 -- 暂无
+                   1059,//1059    导游超时费用 -- 暂无
+                   1070,//1070    尾款金额 -- 暂无
+                   1071,//1071    其他额外费用 -- 暂无
+                   1073,//1073    翻译超时费 -- 暂无
+                   1074,//1074    早餐超支费用 -- 暂无
+                   1075,//1075    午餐超支费用 -- 暂无
+                   1076,//1076    晚餐超支费用 -- 暂无
+                };
+                //费用类型筛选 包含 feeTypeIds && 包含这些类型费用大于0
+                var noAuditFeeContents = opContents.Where(x => x.Price > 0 && noAuditFeeTypeIds.Contains(x.SId)).ToList();
+                if (noAuditFeeContents.Count > 0) return _view;
+
+                //2.按天按项 检查费用是否超过预算 
+                var opDayContent = opContents.GroupBy(x => x.DatePrice);
+
+
+                foreach (var item in opDayContent)
+                {
+                    var opCostInfo = opCostDatas.Where(x => Convert.ToDateTime(x.Date) == item.Key).ToList();
+                    if (opCostInfo.Count < 1) continue;
+
+                    //车费 91
+                    var opCarCost = item.FirstOrDefault(x => x.SId == 91);
+                    if (opCarCost != null) if (opCarCost.Price * _rate > _rate * opCostInfo.Sum(x => x.CarFee)) isAutoAudit = false;
+                    //982 车超时费 -- 暂无
+                    //92  导游费
+                    var opGuideCost = item.FirstOrDefault(x => x.SId == 92);
+                    if (opGuideCost != null) if (opGuideCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideFee)) isAutoAudit = false;
+                    //94  导游景点费
+                    var opGuideScenicCost = item.FirstOrDefault(x => x.SId == 94);
+                    if (opGuideScenicCost != null) if (opGuideScenicCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideScenicFee)) isAutoAudit = false;
+                    //95  导游小费
+                    var opGuideTipCost = item.FirstOrDefault(x => x.SId == 95);
+                    if (opGuideTipCost != null) if (opGuideTipCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideTipFee)) isAutoAudit = false;
+                    //983 导游餐补
+                    var opGuideMealCost = item.FirstOrDefault(x => x.SId == 983);
+                    if (opGuideMealCost != null) if (opGuideMealCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideMealFee)) isAutoAudit = false;
+                    //984 导游房补
+                    var opGuideRoomCost = item.FirstOrDefault(x => x.SId == 984);
+                    if (opGuideRoomCost != null) if (opGuideRoomCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideRoomFee)) isAutoAudit = false;
+                    //985 导游交通
+                    var opGuideTrafficCost = item.FirstOrDefault(x => x.SId == 985);
+                    if (opGuideTrafficCost != null) if (opGuideTrafficCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideTrafficFee)) isAutoAudit = false;
+                    //96  接送机费 -- 暂无
+                    //97  其他费用 -- 暂无
+                    //979 司机工资
+                    var opDriverCost = item.FirstOrDefault(x => x.SId == 979);
+                    if (opDriverCost != null) if (opDriverCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverFee)) isAutoAudit = false;
+                    //980 司机小费
+                    var opDriverTipCost = item.FirstOrDefault(x => x.SId == 980);
+                    if (opDriverTipCost != null) if (opDriverTipCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverTipFee)) isAutoAudit = false;
+                    //981 司机餐补
+                    var opDriverMealCost = item.FirstOrDefault(x => x.SId == 981);
+                    if (opDriverMealCost != null) if (opDriverMealCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverMealFee)) isAutoAudit = false;
+                    //988 客户早餐费用
+                    var opClientBreakfastCost = item.FirstOrDefault(x => x.SId == 988);
+                    if (opClientBreakfastCost != null) if (opClientBreakfastCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientBreakfastFee)) isAutoAudit = false;
+                    //93  客户午餐费用
+                    var opClientLunchCost = item.FirstOrDefault(x => x.SId == 93);
+                    if (opClientLunchCost != null) if (opClientLunchCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientLunchFee)) isAutoAudit = false;
+                    //989 客户晚餐费用
+                    var opClientDinnerCost = item.FirstOrDefault(x => x.SId == 989);
+                    if (opClientDinnerCost != null) if (opClientDinnerCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientDinnerFee)) isAutoAudit = false;
+                    //990 景点门票费
+                    var opScenicTicketCost = item.FirstOrDefault(x => x.SId == 990);
+                    if (opScenicTicketCost != null) if (opScenicTicketCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ScenicTicketFee)) isAutoAudit = false;
+                    //991 饮料/零食/水果
+                    var opDrinkSnackFruitCost = item.FirstOrDefault(x => x.SId == 991);
+                    if (opDrinkSnackFruitCost != null) if (opDrinkSnackFruitCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DrinkSnackFruitFee)) isAutoAudit = false;
+                    //992 住补费用 -- 暂无
+                    //994 翻译费
+                    var opTranslatorCost = item.FirstOrDefault(x => x.SId == 994);
+                    if (opTranslatorCost != null) if (opTranslatorCost.Price * _rate > _rate * opCostInfo.Sum(x => x.TranslatorFee)) isAutoAudit = false;
+                    //1059    导游超时费用 -- 暂无
+                    //1070    尾款金额 -- 暂无
+                    //1071    其他额外费用 -- 暂无
+                    //1073    翻译超时费 -- 暂无
+                    //1074    早餐超支费用 -- 暂无
+                    //1075    午餐超支费用 -- 暂无
+                    //1076    晚餐超支费用 -- 暂无
+                }
+
+                //更改审核状态
+                if (isAutoAudit) return _view;
+            }
+            else return _view; 
+
+            return _view;
+        }
+
     }
 }