Преглед изворни кода

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

yuanrf пре 10 месеци
родитељ
комит
bbb16f80c5

+ 135 - 70
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -147,7 +147,7 @@ namespace OASystem.API.Controllers
             CheckBoxsRepository checkBoxs, GroupCostRepository GroupCostRepository, CostTypeHotelNumberRepository CostTypeHotelNumberRepository,
             GroupCostParameterRepository GroupCostParameterRepository, HotelPriceRepository hotelPriceRep, CustomersRepository customersRep, SetDataRepository setDataRep,
             TourClientListRepository tourClientListRep, TeamRateRepository teamRateRep, IHubContext<ChatHub, IChatClient> hubContext, UsersRepository usersRep, IJuHeApiService juHeApi,
-            InvertedListRepository invertedListRep, VisaFeeInfoRepository visaFeeInfoRep, TicketBlackCodeRepository ticketBlackCodeRep, HotelInquiryRepository hotelInquiryRep, 
+            InvertedListRepository invertedListRep, VisaFeeInfoRepository visaFeeInfoRep, TicketBlackCodeRepository ticketBlackCodeRep, HotelInquiryRepository hotelInquiryRep,
             ThreeCodeRepository threeCodeRepository, FeeAuditRepository feeAuditRep)
         {
             _mapper = mapper;
@@ -1452,7 +1452,7 @@ namespace OASystem.API.Controllers
                 /*
                  * 成本信息
                  */
-                var groupCost = _groupRepository.Query<Grp_GroupCostParameter >(s => s.DiId == _dto.DiId && s.IsDel == 0).First();
+                var groupCost = _groupRepository.Query<Grp_GroupCostParameter>(s => s.DiId == _dto.DiId && s.IsDel == 0).First();
                 decimal _groupRate = 0.0000M;
                 string _groupCurrencyCode = "-";
                 if (groupCost != null)
@@ -1462,6 +1462,7 @@ namespace OASystem.API.Controllers
                     {
                         _groupCurrencyCode = currencyItems.Find(it => it.Id == _currency)?.Name ?? "-";
                     }
+                    else _groupCurrencyCode = groupCost.Currency;
                 }
                 string costContentSql = $"Select * From Grp_GroupCost";
                 var groupCostDetails = _sqlSugar.SqlQueryable<GroupCostAuditView>(costContentSql).Where(x => x.IsDel == 0 && x.Diid == _dto.DiId).ToList();
@@ -1557,15 +1558,25 @@ namespace OASystem.API.Controllers
                                          checkOut = Convert.ToDateTime(hotelReservations.CheckOutDate);
                                 int hotel_days = (int)(checkOut - checkIn).TotalDays;
 
-                                string roomFeeStr = "";
-                                if (hotelReservations.SingleRoomPrice>0) 
-                                    roomFeeStr += $"<br/><span style='width:70px;display: inline-block;'></span>单间:{hotelReservations.SingleRoomPrice.ToString("#0.00")} * {hotelReservations.SingleRoomCount}";
-                                if (hotelReservations.DoubleRoomPrice > 0) 
-                                    roomFeeStr += $"<br/><span style='width:70px;display: inline-block;'></span>双人间:{hotelReservations.DoubleRoomPrice.ToString("#0.00")} * {hotelReservations.DoubleRoomCount}";
-                                if (hotelReservations.SuiteRoomPrice > 0) 
-                                    roomFeeStr += $"<br/><span style='width:70px;display: inline-block;'></span>套房:{hotelReservations.SuiteRoomPrice.ToString("#0.00")} * {hotelReservations.SuiteRoomCount}";
-                                if (hotelReservations.OtherRoomPrice > 0) 
-                                    roomFeeStr += $"<br/><span style='width:70px;display: inline-block;'></span>其他:{hotelReservations.OtherRoomPrice.ToString("#0.00")} * {hotelReservations.OtherRoomCount}";
+                                string roomFeeStr = "", roomFeestr1 = "";
+
+                                //是否比较房型价格
+                                bool __isSingle = false, __isDouble = false, __isSuite = false, __isOther = false;
+
+                                roomFeeStr += $"<br/><span style='width:70px;display: inline-block;'></span>";
+
+                                if (hotelReservations.SingleRoomPrice > 0)
+                                { roomFeestr1 += $"单间:{hotelReservations.SingleRoomPrice.ToString("#0.00")} * {hotelReservations.SingleRoomCount}"; __isSingle = true; }
+                                if (hotelReservations.DoubleRoomPrice > 0)
+                                { roomFeestr1 += $"双人间:{hotelReservations.DoubleRoomPrice.ToString("#0.00")} * {hotelReservations.DoubleRoomCount}"; __isDouble = true; }
+                                if (hotelReservations.SuiteRoomPrice > 0)
+                                { roomFeestr1 += $"套房:{hotelReservations.SuiteRoomPrice.ToString("#0.00")} * {hotelReservations.SuiteRoomCount}"; __isSuite = true; }
+                                if (hotelReservations.OtherRoomPrice > 0)
+                                { roomFeestr1 += $"其他:{hotelReservations.OtherRoomPrice.ToString("#0.00")} * {hotelReservations.OtherRoomCount}"; __isOther = true; }
+
+                                if (roomFeestr1.Length > 0) roomFeeStr += roomFeestr1;
+                                else roomFeeStr += "  0.00 * 0";
+
 
                                 decimal governmentRentFee = 0.00M, cityTaxFee = 0.00M, breakfastFee = 0.00M, roomFee = 0.00M;
                                 string governmentRentBool = "否", cityTaxBool = "否", breakfastBool = "否", roomBool = "否";
@@ -1639,7 +1650,7 @@ namespace OASystem.API.Controllers
                                     }
                                 }
 
-                                string hotelCostTitalStr = "<span style='font-weight:800;'>成本信息</span><br/>"; 
+                                string hotelCostTitalStr = "<span style='font-weight:800;'>成本信息</span><br/>";
                                 string hotelCostStr = "";
                                 decimal hotelCsotTotal = 0.00M;
                                 if (groupCost != null)
@@ -1649,7 +1660,7 @@ namespace OASystem.API.Controllers
                                     hotelCostStr += $"{groupCost.Currency}(汇率:{groupCost.Rate.ToString("#0.0000")})<br/>";
                                 }
 
-                                
+
                                 if (checkOut > checkIn) checkOut = checkOut.AddDays(-1);
 
 
@@ -1660,26 +1671,30 @@ namespace OASystem.API.Controllers
                                 {
                                     hotelCsotTotal += item.Sum(x => x.HotelSingleRoomFee) + item.Sum(x => x.HotelDoubleRoomFee) + item.Sum(x => x.HotelSuiteRoomFee) + item.Sum(x => x.HotelSuiteFee);
                                     hotelCost_day += @$"{item.First()?.Date ?? "-"}";
-                                    if (item.Sum(x => x.HotelSingleRoomFee) != 0) hotelCost_day += @$"   单间:{item.Sum(x => x.HotelSingleRoomFee).ToString("#0.00")}"; 
+                                    if (item.Sum(x => x.HotelSingleRoomFee) != 0) hotelCost_day += @$"   单间:{item.Sum(x => x.HotelSingleRoomFee).ToString("#0.00")}";
+                                    else { if (__isSingle) hotelCost_day += @$"   单间:0.00"; }
                                     if (item.Sum(x => x.HotelDoubleRoomFee) != 0) hotelCost_day += @$"   双人间:{item.Sum(x => x.HotelDoubleRoomFee).ToString("#0.00")}";
+                                    else { if (__isDouble) hotelCost_day += @$"   双人间:0.00"; }
                                     if (item.Sum(x => x.HotelSuiteRoomFee) != 0) hotelCost_day += @$"   小套房/豪华套房:{item.Sum(x => x.HotelSuiteRoomFee).ToString("#0.00")}";
-                                    if (item.Sum(x => x.HotelSuiteFee) != 0)  hotelCost_day += @$"   套房:{item.Sum(x => x.HotelSuiteFee).ToString("#0.00")}";
+                                    else { if (__isSuite) hotelCost_day += @$"   小套房/豪华套房:0.00"; }
+                                    if (item.Sum(x => x.HotelSuiteFee) != 0) hotelCost_day += @$"   套房:{item.Sum(x => x.HotelSuiteFee).ToString("#0.00")}";
+                                    else { if (__isOther) hotelCost_day += @$"   套房:0.00"; }
                                     hotelCost_day += @$"</br>";
                                 }
 
-                                string hotelBreakfastStr = "",hotelGovernmentRentStr = "",hotelCityTaxStr="" ;
+                                string hotelBreakfastStr = "", hotelGovernmentRentStr = "", hotelCityTaxStr = "";
                                 if (breakfastFee > 0) hotelBreakfastStr = $"酒店早餐: {breakfastFee.ToString("#0.00")} {breakfastCode} {breakfastName} 当时汇率 {breakfastData?.Rate.ToString("#0.0000")} <br/>是否由地接代付:{breakfastBool}<br/><br/>";
                                 if (governmentRentFee > 0) hotelGovernmentRentStr = $"地税: {governmentRentFee.ToString("#0.00")} {governmentRentCode} {governmentRentName} 当时汇率 {governmentRentData?.Rate.ToString("#0.0000")} <br/>是否由地接代付:{governmentRentBool}<br/><br/>";
                                 if (cityTaxFee > 0) hotelCityTaxStr = $"城市税: {cityTaxFee.ToString("#0.00")} {cityTaxCode} {cityTaxName} 当时汇率 {cityTaxData?.Rate.ToString("#0.0000")} <br/>是否由地接代付:{cityTaxBool}<br/>";
 
                                 string hotelCostTotalStr = "";// $"&nbsp;&nbsp;成本合计:{hotelCsotTotal.ToString("#0.00")}<br/>";
-                                _detail.PriceMsgContent = $"{hotelCostTitalStr}{hotelCostStr}{hotelCostTotalStr}{hotelCost_day}<br/>"+
+                                _detail.PriceMsgContent = $"{hotelCostTitalStr}{hotelCostStr}{hotelCostTotalStr}{hotelCost_day}<br/>" +
                                                           $"<span style='font-weight:800;'>{hotelReservations.HotelName} [{hotelReservations.CheckInDate} - {hotelReservations.CheckOutDate}]</span><br/>" +
                                                           $"信用卡金额:{_detail.WaitPay} ({hotelCurrncyName})<br/>" +
                                                           $"房间说明: {hotelReservations.Remark} <br/>" +
                                                           $"房间费用: {roomCode} {roomName} 当时汇率 {roomData?.Rate.ToString("#0.0000")}{roomFeeStr}  <br/>是否由地接代付:{roomBool}<br/><br/>" +
-                                                          $"{hotelBreakfastStr}"+
-                                                          $"{hotelGovernmentRentStr}"+
+                                                          $"{hotelBreakfastStr}" +
+                                                          $"{hotelGovernmentRentStr}" +
                                                           $"{hotelCityTaxStr}";
                                 _detail.PriceNameContent = hotelReservations.HotelName;
                             }
@@ -1719,7 +1734,7 @@ namespace OASystem.API.Controllers
                                 //    _detail.PriceNameContent = touristGuideGroundReservations.Area;
                                 //}
 
-                                var touristGuideGroundReservationsContents = 
+                                var touristGuideGroundReservationsContents =
                                     _CarTouristGuideGroundReservationsContent.Where(s => s.CTGGRId == touristGuideGroundReservations.Id && s.IsDel == 0 && s.Price != 0).ToList();
 
                                 string priceMsg = $"<span style='font-weight:800;'>{touristGuideGroundReservations.PriceName}({touristGuideGroundReservations.ServiceStartTime} - {touristGuideGroundReservations.ServiceEndTime})</span><br/>";
@@ -1741,13 +1756,13 @@ namespace OASystem.API.Controllers
                                         carCurrencyName = currencyData.Remark;
                                     }
 
-                                    string opCostStr =string.Empty;
+                                    string opCostStr = string.Empty;
                                     decimal opCostTypePrice = 0.00M;
                                     #region 处理成本各项费用
 
                                     var opDate = item.DatePrice?.ToString("yyyy-MM-dd");
 
-                                    
+
                                     var opCost = groupCostDetails.Where(x => x.Date.Equals(opDate)).ToList();
 
                                     if (opCost.Count > 0)
@@ -1775,12 +1790,12 @@ namespace OASystem.API.Controllers
                                             //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //992 住补费用 -- 暂无
                                             case 994: opCostTypePrice = opCost.Sum(x => x.TranslatorFee); break; //994 翻译费
                                             case 1059: opCostTypePrice = opCost.Sum(x => x.GuideOverTimeFee); break; //1059    导游超时费用
-                                            //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1070    尾款金额
-                                            //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1071    其他额外费用
-                                            //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1073    翻译超时费
-                                            //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1074    早餐超支费用
-                                            //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1075    午餐超支费用
-                                            //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1076    晚餐超支费用
+                                                                                                                     //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1070    尾款金额
+                                                                                                                     //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1071    其他额外费用
+                                                                                                                     //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1073    翻译超时费
+                                                                                                                     //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1074    早餐超支费用
+                                                                                                                     //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1075    午餐超支费用
+                                                                                                                     //case 91: opCostTypePrice = opCost.Sum(x => x.CarFee); break; //1076    晚餐超支费用
                                         }
                                         opCostStr = $"&nbsp;&nbsp;/&nbsp;&nbsp;成本:{opCostTypePrice.ToString("#0.00")} {_groupCurrencyCode}(汇率:{_groupRate.ToString("#0.0000")})";
                                     }
@@ -4058,6 +4073,22 @@ namespace OASystem.API.Controllers
                     return Ok(JsonView(false, data.Msg));
                 }
 
+                //生成默认文件pdf并且通知人员
+                var fileView = await GeneralMethod.EnterExitCostDownload(new EnterExitCostDownloadDto()
+                {
+                    DiId = dto.DiId,
+                    ExportType = 1,
+                    SubTypeId = 1005
+                }, "pdf");
+
+                //发送通知
+                string fileUrl = (string)fileView.Data.GetType().GetProperty("Url").GetValue(fileView.Data, null);
+                int sign = (int)data.Data.GetType().GetProperty("sign").GetValue(data.Data, null);
+                string md5Sign = GeneralMethod.Encrypt($"{sign}&fileName={fileUrl}");
+                string url = string.Format("http://oa.pan-american-intl.com:4399/?sign={0}&fileName={1}", sign,fileUrl);
+                await AppNoticeLibrary.SendUserMsg_GroupShare_ToGM(dto.DiId, new List<string>() { "208","5" }, dto.UserId, url);
+
+
                 return Ok(JsonView(true, data.Msg, data.Data));
             }
             catch (Exception ex)
@@ -4066,6 +4097,31 @@ namespace OASystem.API.Controllers
             }
         }
 
+        /// <summary>
+        /// 团组模块 - 出入境费用 - Confirm 费用
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostEnterExitCostIsConfirm(ConfirmCostDto dto)
+        {
+            //TODO:测试完毕需把对应的用户ID更改
+            //1、数据表添加字段
+            //2、更改字段接口()
+            var _view = await _enterExitCostRep.ConfirmCost(dto);
+
+            //3、确认成功 给财务发送消息
+            if (_view.Code == 200)
+            {
+                if (dto.Type == 1)
+                {
+                    int diId = _enterExitCostRep._sqlSugar.Queryable<Grp_EnterExitCost>().Where(x => x.IsDel == 0 && x.Id == dto.Id).First()?.DiId ?? 0;
+                    await AppNoticeLibrary.SendUserMsg_GroupShare_ToFinance(diId);
+                }
+            }
+            return Ok(_view);
+        }
+
 
         /// <summary>
         /// 团组模块 - 出入境费用 - File downlaod
@@ -4816,7 +4872,7 @@ namespace OASystem.API.Controllers
                         wb.CalculateFormula(true);
 
                         //模板文件名
-                        string strFileName = $"四川省商务厅出国经费财政先行审核表.xls";
+                        string strFileName = $"{_DelegationInfo.TeamName}-四川省商务厅出国经费财政先行审核表{DateTime.Now.ToString("yyyyMMddHHmmss")}.xls"; ;//$".xls";
                         designer.Workbook.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
                         return Ok(JsonView(true, "成功", new { Url = url }));
@@ -4996,7 +5052,7 @@ namespace OASystem.API.Controllers
                         }
 
                         //模板文件名
-                        string strFileName = $"{_DelegationInfo.TeamName}成都市因公临时出国任务和预算审批意见表(外专培训团专用).docx";
+                        string strFileName = $"{_DelegationInfo.TeamName}-成都市因公临时出国任务和预算审批意见表(外专培训团专用).docx";
                         doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
                         return Ok(JsonView(true, "成功", new { Url = url }));
@@ -5356,6 +5412,9 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, data.Msg));
             }
 
+            
+
+
             return Ok(JsonView(true, data.Msg, data.Data));
 
         }
@@ -5981,8 +6040,8 @@ namespace OASystem.API.Controllers
                 }
 
                 //自动审核
-                await _feeAuditRep.FeeAutomaticAudit(2,dto.DiId,dto.CTGGRId);
-                
+                await _feeAuditRep.FeeAutomaticAudit(2, dto.DiId, dto.CTGGRId);
+
                 #region 应用推送
                 try
                 {
@@ -6378,7 +6437,8 @@ namespace OASystem.API.Controllers
                                 cell.SetCellValue(setCellValue); //写入单元格
                             }
 
-                            if (overspendSoure.ContainsKey(thisSid)) {
+                            if (overspendSoure.ContainsKey(thisSid))
+                            {
                                 var overspendId = overspendSoure[thisSid];
                                 whereForResult = arr.Where(x => x.SId == item.SId && DateTime.Compare(x.DatePrice.ObjToDate(), item.DatePrice.ObjToDate()) == 0).ToList();
                             }
@@ -6812,7 +6872,7 @@ namespace OASystem.API.Controllers
                     }
                 }
 
-                CityStr = GeneralMethod.GetGroupCityLine(diid,"/");
+                CityStr = GeneralMethod.GetGroupCityLine(diid, "/");
                 _travelList = _sqlSugar.Queryable<Grp_TravelList>().Where(x => x.Diid == diid && x.IsDel == 0 && x.Issel == 1).ToList();
             }
 
@@ -8977,7 +9037,8 @@ namespace OASystem.API.Controllers
                             var groupCosts = _usersRep._sqlSugar.Queryable<Grp_GroupCost>().Where(it => it.IsDel == 0 && it.Diid == dto.DiId).ToList();
                             var initDatas = groupCosts.Select(it => new { date = it.Date, week = it.Date.GetWeek() == "" ? "-" : it.Date.GetWeek(), itinerary = it.ITIN }).ToList();
 
-                            modulePromptInfo.Data = new {
+                            modulePromptInfo.Data = new
+                            {
                                 airFeeData = datas,
                                 airInitData = initDatas
                             };
@@ -9152,7 +9213,8 @@ ORDER by  gctggrc.id DESC
                     }
                 }
 
-                var view = dbResult.Select(x => {
+                var view = dbResult.Select(x =>
+                {
 
                     decimal dp = 0.00M;
                     var startB = DateTime.TryParse(x.Start.ToString(), out DateTime startD);
@@ -9383,7 +9445,8 @@ ORDER by  gctggrc.id DESC
             {
                 if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
 
-            } else return Ok(JsonView(false, "请输入正确的数据Id!"));
+            }
+            else return Ok(JsonView(false, "请输入正确的数据Id!"));
 
             #endregion
 
@@ -9396,7 +9459,7 @@ ORDER by  gctggrc.id DESC
             }
 
             #region 应用推送
-            
+
             try
             {
                 int ccpId = (int)_view.Data.GetType().GetProperty("ccpId").GetValue(_view.Data, null);
@@ -9405,7 +9468,7 @@ ORDER by  gctggrc.id DESC
                 await AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(ccpId, sign, QiyeWeChatEnum.GuoJiaoLeaderChat);
 
                 //自动审核
-                await _feeAuditRep.FeeAutomaticAudit(1,_dto.DiId,hotelId);
+                await _feeAuditRep.FeeAutomaticAudit(1, _dto.DiId, hotelId);
 
             }
             catch (Exception ex)
@@ -11548,12 +11611,12 @@ ORDER by  gctggrc.id DESC
 
             bool isDepStatus = await GeneralMethod.IsMarketingStaff(dto.CurrUserId);
             List<Grp_DelegationInfo> groupInfos = new List<Grp_DelegationInfo>();
-            groupInfos =  _sqlSugar.Queryable<Grp_DelegationInfo>()
+            groupInfos = _sqlSugar.Queryable<Grp_DelegationInfo>()
                                         .Where(it => it.IsDel == 0)
                                         .WhereIF(isDepStatus, it => it.JietuanOperator == dto.CurrUserId)
                                         .OrderByDescending(it => it.CreateUserId)
                                         .ToList();
-            if (groupInfos.Count < 1) return Ok(JsonView(false,"暂无和你相关的团组信息!"));
+            if (groupInfos.Count < 1) return Ok(JsonView(false, "暂无和你相关的团组信息!"));
 
             var country = groupInfos.Select(it => it.VisitCountry).ToList();
             var diids = groupInfos.Select(it => it.Id).ToList();
@@ -11596,11 +11659,11 @@ ORDER by  gctggrc.id DESC
                                           .ToList();
 
 
-            var teamNames = groupInfos.Where(it => !string.IsNullOrEmpty(it.TeamName) )
+            var teamNames = groupInfos.Where(it => !string.IsNullOrEmpty(it.TeamName))
                                       .Select(it => it.TeamName).ToList();
 
             stopwatch.Stop();
-            return Ok(JsonView(true, $"操作成功,耗时{stopwatch.ElapsedMilliseconds} ms", new { teamNames,countriesDatas, citiesDatas = cityDatas }));
+            return Ok(JsonView(true, $"操作成功,耗时{stopwatch.ElapsedMilliseconds} ms", new { teamNames, countriesDatas, citiesDatas = cityDatas }));
 
         }
 
@@ -12247,7 +12310,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                                              .Where(it => countrys.Contains(it.Name_CN))
                                              .WhereIF(!string.IsNullOrEmpty(dto.Search), it => it.Name_CN.Contains(dto.Search))
                                              .Select(it => new { id = it.Id, name = it.Name_CN })
-                                             .ToPageListAsync(dto.PageIndex,dto.PageSize, total);
+                                             .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
 
             return Ok(JsonView(true, MsgTips.Succeed, countyDatas, total));
         }
@@ -12288,7 +12351,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
             watch.Start();
             RefAsync<int> total = 0;
             var countyDatas = await _sqlSugar.Queryable<Res_OfficialActivities>()
-                                             .InnerJoin<Grp_DelegationInfo>((oa,di) => oa.DiId == di.Id)
+                                             .InnerJoin<Grp_DelegationInfo>((oa, di) => oa.DiId == di.Id)
                                              .Where((oa, di) => oa.IsDel == 0)
                                              .WhereIF(!string.IsNullOrEmpty(dto.Search), (oa, di) => di.TeamName.Contains(dto.Search))
                                              .OrderBy((oa, di) => new { id = SqlFunc.Desc(di.Id) })
@@ -12325,7 +12388,8 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                                              .ToPageListAsync(dto.PageIndex, dto.PageSize, total);
             var userDatas = _sqlSugar.Queryable<Sys_Users>().Where(x => x.IsDel == 0).ToList();
             var setDatas = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0).ToList();
-            infos.ForEach(x => {
+            infos.ForEach(x =>
+            {
                 x.TeamDid = setDatas.Find(y => int.Parse(x.TeamDid) == y.Id)?.Name ?? "-";
                 x.JietuanOperator = userDatas.Find(y => int.Parse(x.JietuanOperator) == y.Id)?.CnName ?? "-";
                 x.TeamLevSId = setDatas.Find(y => int.Parse(x.TeamLevSId) == y.Id)?.Name ?? "-";
@@ -12448,19 +12512,20 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                                     {
                                         threeCodeStr.Add(end);
                                     }
-                                    else {
+                                    else
+                                    {
                                         threeCodeStr.Add(start);
                                         threeCodeStr.Add(end);
                                     }
                                 }
                             }
                         }
-                        var threeCodeList =  _threeCodeRepository.QueryThreeCodeArray(threeCodeStr);
+                        var threeCodeList = _threeCodeRepository.QueryThreeCodeArray(threeCodeStr);
                         var last = threeCodeStr.Last();
                         foreach (var item in threeCodeStr)
                         {
                             cityPath += (threeCodeList.Keys.Contains(item) ? threeCodeList[item].City : "【未知三字码】") + "-";
-                            if(item.Equals(last))
+                            if (item.Equals(last))
                             {
                                 stay = threeCodeList.Keys.Contains(item) ? threeCodeList[item].City : "【未知三字码】";
                             }
@@ -12498,7 +12563,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                     x.Diid,
                     chiList = chiList.Select(x1 => new
                     {
-                        timeInterval = x1.Time == null ? new string [1] : x1.Time.Split('-'),
+                        timeInterval = x1.Time == null ? new string[1] : x1.Time.Split('-'),
                         x1.Details,
                         x1.ParentId,
                         x1.Id
@@ -12508,10 +12573,10 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 
             data = data with
             {
-                 content = resultArr,
+                content = resultArr,
             };
 
-            jw = JsonView(true,"获取成功!",data);
+            jw = JsonView(true, "获取成功!", data);
 
             return Ok(jw);
         }
@@ -12525,7 +12590,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
         public IActionResult DeleteApprovalJourney(DeleteApprovalJourney dto)
         {
             var jw = JsonView(false);
-            var group = _sqlSugar.Queryable<Grp_DelegationInfo>().First(x=>x.Id == dto.Diid && x.IsDel == 0);
+            var group = _sqlSugar.Queryable<Grp_DelegationInfo>().First(x => x.Id == dto.Diid && x.IsDel == 0);
             if (group == null)
             {
                 jw.Msg = "团组参数有误!";
@@ -12536,7 +12601,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
             {
                 _sqlSugar.BeginTran();
 
-                var arr = _sqlSugar.Queryable<Grp_ApprovalTravel>().Where(x => x.Diid == dto.Diid && x.IsDel == 0).Select(x=>x.Id).ToList();
+                var arr = _sqlSugar.Queryable<Grp_ApprovalTravel>().Where(x => x.Diid == dto.Diid && x.IsDel == 0).Select(x => x.Id).ToList();
 
                 _ = _sqlSugar.Updateable<Grp_ApprovalTravelDetails>().SetColumns(x => new Grp_ApprovalTravelDetails
                 {
@@ -12596,10 +12661,10 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 
             _sqlSugar.BeginTran();
 
-            if (chiArr.Where(x=>x.id == 0).Count() == chiArr.Count)
+            if (chiArr.Where(x => x.id == 0).Count() == chiArr.Count)
             {
                 var parentIds = dto.Arr.Select(x => x.id).ToList();
-                _sqlSugar.Updateable<Grp_ApprovalTravelDetails>().Where(x => parentIds.Contains(x.ParentId) && x.IsDel == 0).SetColumns(x=>new Grp_ApprovalTravelDetails
+                _sqlSugar.Updateable<Grp_ApprovalTravelDetails>().Where(x => parentIds.Contains(x.ParentId) && x.IsDel == 0).SetColumns(x => new Grp_ApprovalTravelDetails
                 {
                     DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                     DeleteUserId = dto.UserId,
@@ -12609,13 +12674,13 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 
             try
             {
-                 _ =  _sqlSugar.Insertable<Grp_ApprovalTravelDetails>(chiArr.Where(x => x.id == 0).Select(x => new Grp_ApprovalTravelDetails
+                _ = _sqlSugar.Insertable<Grp_ApprovalTravelDetails>(chiArr.Where(x => x.id == 0).Select(x => new Grp_ApprovalTravelDetails
                 {
                     CreateTime = DateTime.Now,
                     CreateUserId = dto.UserId,
                     Details = x.details,
                     ParentId = x.parentId,
-                    Time = x.timeInterval.Where(x=>!string.IsNullOrWhiteSpace(x)).Count() > 1 ? x.timeInterval[0] + "-" + x.timeInterval[1] : "",
+                    Time = x.timeInterval.Where(x => !string.IsNullOrWhiteSpace(x)).Count() > 1 ? x.timeInterval[0] + "-" + x.timeInterval[1] : "",
                     Remark = "",
                     IsDel = 0
                 }).ToList()).ExecuteCommand();
@@ -12626,7 +12691,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                     Details = x.details,
                     ParentId = x.parentId,
                     Time = x.timeInterval.Where(x => !string.IsNullOrWhiteSpace(x)).Count() > 1 ? x.timeInterval[0] + "-" + x.timeInterval[1] : "",
-                }).ToList()).UpdateColumns(x=> new Grp_ApprovalTravelDetails
+                }).ToList()).UpdateColumns(x => new Grp_ApprovalTravelDetails
                 {
                     Details = x.Details,
                     ParentId = x.ParentId,
@@ -12639,7 +12704,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                     Date = x.date,
                 }).ToList()).UpdateColumns(x => new Grp_ApprovalTravel
                 {
-                     Date = x.Date
+                    Date = x.Date
                 }).ExecuteCommand();
 
                 _sqlSugar.CommitTran();
@@ -12827,10 +12892,10 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                             IFormatProvider ifp = new CultureInfo("zh-CN", true);
                             if (DateTime.TryParseExact(flightTime, "HH小时mm分钟", ifp, DateTimeStyles.None, out DateTime flightDataTime))
                             {
-                                flightTime = flightDataTime.Hour > 0 
-                                    ? flightDataTime.Hour.ToString() + "小时" + (flightDataTime.Minute > 0  
-                                    ? flightDataTime.Minute.ToString() + "分钟": "") : flightDataTime.Minute > 0 
-                                    ? flightDataTime.Minute.ToString() + "分钟" : "" ;
+                                flightTime = flightDataTime.Hour > 0
+                                    ? flightDataTime.Hour.ToString() + "小时" + (flightDataTime.Minute > 0
+                                    ? flightDataTime.Minute.ToString() + "分钟" : "") : flightDataTime.Minute > 0
+                                    ? flightDataTime.Minute.ToString() + "分钟" : "";
                             }
 
 
@@ -12873,7 +12938,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                             CreateUserId = dto.Userid,
                             ParentId = 0,
                             Details = trip
-                        }) ;
+                        });
 
                         var threeCodeList = _threeCodeRepository.QueryThreeCodeArray(threeCodeStr);
                         var last = threeCodeStr.Last();
@@ -12944,7 +13009,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                 jw.Code = 400;
                 jw.Msg = "生成失败!" + ex.Message;
             }
-            
+
             return Ok(jw);
         }
 
@@ -12996,7 +13061,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                 var ChiRep = _sqlSugar.Queryable<Grp_ApprovalTravelDetails>().Where(x => x.IsDel == 0 && x.ParentId == item.Id).ToList();
 
                 SetCells(tableOne, doc, SetIndex, 0, textTime);
-                
+
                 SetIndex++;
 
                 if (ChiRep.Count > 0)
@@ -13099,7 +13164,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 
             if (val.Contains("\r\n"))
             {
-                var spArr = val.Split("\r\n").Where(x=>!string.IsNullOrWhiteSpace(x));
+                var spArr = val.Split("\r\n").Where(x => !string.IsNullOrWhiteSpace(x));
                 foreach (var item in spArr)
                 {
                     //新建一个段落
@@ -13178,7 +13243,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 
             if (param.ContainsKey("isJson"))
             {
-            
+
             }
 
             if (headValues != null)
@@ -13228,7 +13293,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
                 client.Dispose();
             }
 
-             return Ok(jw);
+            return Ok(jw);
         }
 
         #endregion

+ 13 - 3
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -2412,10 +2412,12 @@ FROM
             List<int> userIds = new List<int>();
             userIds = await GetUserIds(_dto.CompanyId, _dto.GroupPickupUserId);
 
-            if (userIds.Count > 0)
+            if (userIds.Count <= 0)
             {
-                userSql = @$" And di.JietuanOperator In ({string.Join(",",userIds)})";
+                return Ok(JsonView(true, "操作成功!", new List<object> { }, 0));
             }
+            else userSql = @$" And di.JietuanOperator In ({string.Join(",", userIds)})";
+
 
             if (!string.IsNullOrEmpty(_dto.SearchCriteria))
             {
@@ -2512,6 +2514,14 @@ FROM
             {
                 userSql = string.Format(@$" AND JietuanOperator IN ({string.Join(",",userIds)})");
             }
+            else
+            {
+                return Ok(JsonView(true, "操作成功!", new
+                {
+                    customerTypeData = new List<object> { },
+                    clientGradeData = new List<object> { }
+                }));
+            }
 
             string sql = "";
 
@@ -2623,7 +2633,7 @@ Order By Count Desc");
             if (userIds.Count > 0)
             {
                 userSql = string.Format(@$" AND JietuanOperator IN ({string.Join(",", userIds)})");
-            }
+            }else return Ok(JsonView(true, "操作成功!", new List<object> { }, 0));
 
             string sql = string.Format(@$"Select 
 	ROW_NUMBER() Over(Order By Count(*) Desc) As RowNumber,

Разлика између датотеке није приказан због своје велике величине
+ 1338 - 1
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs


+ 41 - 2
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Config.cs

@@ -232,7 +232,6 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             return result;
         }
 
-
         /// <summary>
         /// 日付申请审核结果推送给申请人
         /// </summary>
@@ -295,7 +294,6 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             return result;
         }
 
-
         /// <summary>
         /// 成本通知发送给用户
         /// </summary>
@@ -320,11 +318,52 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
             return result;
         }
 
+        /// <summary>
+        /// 出入境费用明细更改通知发送给用户
+        /// </summary>
+        /// <returns></returns>
+        public static string GroupShare_ToGM(GroupShare_ToGMModel info)
+        {
+            string result = string.Format(@" `出入境费用明细操作通知`  
+
+>团组:<font color='info'>{0}</font> 
+
+>操作人员:{1}
+>操作时间:<font color='comment'>{2}</font> 
+
+[请点击进入明细进行查看或确认]({3}) ", info.TeamName, info.CreateUser, info.RefreshDate, info.Url);
+
+            return result;
+        }
+
+        /// <summary>
+        /// 出入境费用 确认 通知发送给 财务相关人员
+        /// </summary>
+        /// <returns></returns>
+        public static string GroupShare_ToFinance(GroupShare_ToUserModel info)
+        {
+            string result = string.Format(@" `出入境费用确认操作通知`  
+
+>团组:<font color='info'>{0}</font> 
+
+>操作时间:<font color='comment'>{2}</font> 
+
+[出入境费用已确认,请进行相关流程操作。] ", info.TeamName, info.RefreshDate);
+
+            return result;
+        }
     }
 
 
     #region 实体类
 
+    public class GroupShare_ToGMModel : GroupShare_ToUserModel
+    {
+        public string CreateUser { get; set; }
+
+        public string Url { get; set; }
+    }
+
     public class GroupShare_ToUserModel
     {
         public string TeamName { get; set; }

+ 75 - 1
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Library.cs

@@ -1,9 +1,11 @@
-using NPOI.SS.Formula.Functions;
+using EyeSoft.Runtime.InteropServices;
+using NPOI.SS.Formula.Functions;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Domain.ViewModels.QiYeWeChat;
 using OASystem.Infrastructure.Repositories.Groups;
+using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 
 namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
 {
@@ -523,6 +525,7 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// <returns></returns>
         public static async Task<bool> SendUserMsg_GroupStatus_PayResult(int Grp_CreditCardPaymentId, List<string> userId)
         {
+            //, QiyeWeChatEnum qiyeWeChat
             Grp_CreditCardPayment ccp = _grpDeleRep.Query<Grp_CreditCardPayment>(s => s.Id == Grp_CreditCardPaymentId).First();
             Grp_DelegationInfo group = _grpDeleRep.Query<Grp_DelegationInfo>(s => s.Id == ccp.DIId).First();
 
@@ -784,6 +787,77 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
 
         #endregion
 
+
+        #region 三公费用更改通知
+
+        /// <summary>
+        /// 三公费用更改通知发送总经理(21)
+        /// </summary>
+        /// <param name="sign"></param>
+        /// <returns></returns>
+        public static async Task<bool> SendUserMsg_GroupShare_ToGM(int diId,List<string> receivedUserIds, int updateUserId, string url)
+        {
+
+            Grp_DelegationInfo groupInfo = _grpDeleRep.Query<Grp_DelegationInfo>(s => s.Id == diId).First();
+            
+            GroupShare_ToGMModel info = new GroupShare_ToGMModel()
+            {
+                RefreshDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
+                TeamName = groupInfo.TeamName,
+                CreateUser = _grpDeleRep.Query<Sys_Users>(s => s.Id == updateUserId).First()?.CnName ?? "-",
+                Url = url
+            };
+
+            if (receivedUserIds.Count > 0)
+            {
+                List<string> qwUserIdList = GetQiyeChatUserIdList(receivedUserIds);
+                ResponseBase result = await _qiYeWeChatApiService.GroupStatus_SendMessage_ToUser_Markdown(qwUserIdList, MarkdownLib.GroupShare_ToGM(info));
+                if (result.errcode != 0)
+                {
+                    //抄送日志 
+                    return false;
+                }
+            }
+
+            return true;
+        }
+
+        /// <summary>
+        /// 三公费用确认通知发送财务部人员
+        /// </summary>
+        /// <param name="sign"></param>
+        /// <returns></returns>
+        public static async Task<bool> SendUserMsg_GroupShare_ToFinance(int diId)
+        {
+
+            Grp_DelegationInfo groupInfo = _grpDeleRep.Query<Grp_DelegationInfo>(s => s.Id == diId).First();
+
+            GroupShare_ToUserModel info = new GroupShare_ToUserModel()
+            {
+                RefreshDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
+                TeamName = groupInfo.TeamName
+            };
+
+            List<string> receivedUserIds = _grpDeleRep.Query<Sys_Users>(s => s.IsDel == 0 && s.DepId == 3).Select(x => x.Id.ToString()).ToList();
+            receivedUserIds = new List<string>() { "208","4", "233" };
+            if (receivedUserIds.Count > 0)
+            {
+                List<string> qwUserIdList = GetQiyeChatUserIdList(receivedUserIds);
+                ResponseBase result = await _qiYeWeChatApiService.GroupStatus_SendMessage_ToUser_Markdown(qwUserIdList, MarkdownLib.GroupShare_ToFinance(info));
+                if (result.errcode != 0)
+                {
+                    //抄送日志 
+                    return false;
+                }
+            }
+
+            return true;
+        }
+
+
+        #endregion
+
+
         #region 成本通知
 
         /// <summary>

+ 14 - 0
OASystem/OASystem.Domain/Dtos/Groups/EnterExitCostDto.cs

@@ -218,6 +218,20 @@ namespace OASystem.Domain.Dtos.Groups
 
     }
 
+    public class ConfirmCostDto {
+
+        /// <summary>
+        /// 类型
+        /// 1:确认 2:撤回
+        /// </summary>
+        public int Type { get; set; }
+
+        /// <summary>
+        /// 数据Id
+        /// </summary>
+        public int Id { get; set; }
+    }
+
     /// <summary>
     /// 出入境费用 - 表格导出 Dto
     /// </summary>

+ 7 - 1
OASystem/OASystem.Domain/Entities/Groups/Grp_EnterExitCost.cs

@@ -71,7 +71,6 @@ namespace OASystem.Domain.Entities.Groups
 
         #endregion
 
-
         /// <summary>
         /// 国际旅费合计(经济舱)
         /// </summary>
@@ -212,5 +211,12 @@ namespace OASystem.Domain.Entities.Groups
         public int AirGWC_Checked { get; set; }
 
         #endregion
+
+        /// <summary>
+        /// 确认费用(确认费用后 不可更改)
+        /// 1:未确认 2:已确认
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int IsConfirm { get; set; } = 1;
     }
 }

+ 51 - 5
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -9,6 +9,7 @@ using OASystem.Infrastructure.Tools;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Security.Policy;
 using System.Text;
 using System.Threading.Tasks;
 
@@ -225,8 +226,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
             trainingExpenseData = trainingExpenseData.Select(it => { it.CreateUserId = dto.UserId; return it; }).ToList();
             if (trainingExpenseData.Count > 0) subData.AddRange(trainingExpenseData);
 
-
-
             //处理币种string
             enterExitCost.CurrencyRemark = CommonFun.GetCurrencyChinaToString(dto.Currencys);
             enterExitCost.CreateUserId = dto.UserId;
@@ -238,9 +237,19 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 try
                 {
                     int enterExitId = 0;
-
+                    
                     if (enterExitCost.Id > 0) //修改
                     {
+                        //修改验证
+                        //IsConfirm == 2 不可修改
+
+                        var info = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(it => it.IsDel == 0 && it.Id == enterExitCost.Id).First();
+                        if (info.IsConfirm == 2)
+                        {
+                            result.Msg = "该团出入境费用已确认!不可更改!!";
+                            return result;
+                        }
+
                         var updateId = _sqlSugar.Updateable<Grp_EnterExitCost>(enterExitCost)
                                                 .IgnoreColumns(it => new { it.DeleteUserId, it.DeleteTime, it.CreateUserId, it.CreateTime, it.IsDel })
                                                 .ExecuteCommand();
@@ -253,14 +262,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             _sqlSugar.RollbackTran();
                             result.Msg = "修改操作失败!";
                             return result;
-
                         }
                     }
                     else
                     {
                         //效重 根据团组Id 
 
-                        var info  = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(it => it.IsDel == 0 && it.DiId == dto.DiId).First();
+                        var info = _sqlSugar.Queryable<Grp_EnterExitCost>().Where(it => it.IsDel == 0 && it.DiId == dto.DiId).First();
                         if (info != null )
                         {
                             _sqlSugar.RollbackTran();
@@ -299,6 +307,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     _sqlSugar.CommitTran();
                     result.Code = 0;
                     result.Msg = "操作成功!";
+                    result.Data = new { sign = enterExitId };
 
                 }
                 catch (Exception ex)
@@ -313,6 +322,43 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return result;
         }
 
+        /// <summary>
+        /// 确认费用
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public async Task<JsonView> ConfirmCost(ConfirmCostDto dto)
+        {
+            var _view = new JsonView() { Code = 20001, Msg = "操作失败!" };
+            if (dto.Id < 1)
+            {
+                _view.Msg = MsgTips.Id;
+                return _view;
+            }
+
+            int confirm = 1;
+            if (dto.Type == 1) confirm = 2; // 确认
+            else if (dto.Type == 2) { confirm = 1; } // 撤回
+            else
+            {
+                _view.Msg = "请传入正确的type;1:确认 2:撤回";
+                return _view;
+            }
+            var update = await _sqlSugar.Updateable<Grp_EnterExitCost>()
+                                        .SetColumns(x => new Grp_EnterExitCost() { IsConfirm = confirm })
+                                        .Where(x => x.Id == dto.Id)
+                                        .ExecuteCommandAsync();
+            if (update>0)
+            {
+                _view.Code = 200;
+                _view.Msg = "操作成功!";
+                return _view;
+            }
+
+            return _view;
+        }
+
+
         /// <summary>
         /// Del
         /// </summary>

+ 37 - 16
OASystem/OASystem.Infrastructure/Repositories/Groups/FeeAuditRepository.cs

@@ -164,19 +164,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
             else if (feeType == 2)
             {
                 //1.基础数据参数验证
-                var priceType = setData.Where(x => x.Name.Contains("尾款")).Select(x =>x.Id).ToList();
+                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)
                 {
-                    _view.Msg = $"OP费用数据未填写";
+                    _view.Msg = $"OP费用费用类型属于“尾款”或者 内容未填写";
                     return _view;
                 }
                 //1.含超时费用/超支费用 手动审核
-                if (opinfos.SelectCheck.Contains("超时") || opinfos.SelectCheck.Contains("超支"))
+                if (opinfos.SelectCheck.Contains("超时") || opinfos.SelectCheck.Contains("超支") || opinfos.SelectCheck.Contains("尾款"))
                 {
-                    _view.Msg = $"OP费用含超时费用,请手动审核";
+                    _view.Msg = @$"OP费用含尾款/超支/超时费用,请手动审核";
                     return _view;
                 }
                 //1.参数验证
@@ -220,9 +223,32 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     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)
+                {
+                    _view.Msg = @$"OP费用含尾款/超支/超时费用,请手动审核";
+                    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();
@@ -231,9 +257,7 @@ 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;
-
                     //982 车超时费 -- 暂无
-
                     //92  导游费
                     var opGuideCost = item.FirstOrDefault(x => x.SId == 92);
                     if (opGuideCost != null) if (opGuideCost.Price > _rate * opCostInfo.Sum(x => x.GuideFee)) isAutoAudit = false;
@@ -282,13 +306,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     //994 翻译费
                     var opTranslatorCost = item.FirstOrDefault(x => x.SId == 994);
                     if (opTranslatorCost != null) if (opTranslatorCost.Price > _rate * opCostInfo.Sum(x => x.TranslatorFee)) isAutoAudit = false;
-                    //1059    导游超时费用
-                    //1070    尾款金额
-                    //1071    其他额外费用
-                    //1073    翻译超时费
-                    //1074    早餐超支费用
-                    //1075    午餐超支费用
-                    //1076    晚餐超支费用
+                    //1059    导游超时费用 -- 暂无
+                    //1070    尾款金额 -- 暂无
+                    //1071    其他额外费用 -- 暂无
+                    //1073    翻译超时费 -- 暂无
+                    //1074    早餐超支费用 -- 暂无
+                    //1075    午餐超支费用 -- 暂无
+                    //1076    晚餐超支费用 -- 暂无
                 }
 
                 //更改审核状态
@@ -329,9 +353,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         }
                     }
                 }
-
-
-
             }
             else _view.Msg = $"请传入有效的feeType参数";