Parcourir la source

1.建团默认已出团。
2.建团默认将保险权限分配给签证岗。

leiy il y a 8 mois
Parent
commit
83e3ec051a

+ 366 - 65
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -1489,7 +1489,7 @@ namespace OASystem.API.Controllers
                         {
                             CurrPayStr = (entity.PayMoney * entity.PayPercentage / 100 * entity.DayRate).ConvertToDecimal1();
                         }
-                        
+
                     }
                     _detail.CurrPay = CurrPayStr.ToString("#0.00") + " CNY";
 
@@ -1497,14 +1497,14 @@ namespace OASystem.API.Controllers
                      * 剩余尾款
                      */
                     decimal BalanceStr = 0;
-                    if (CurrPayStr != 0 )
+                    if (CurrPayStr != 0)
                     {
                         if (entity.PayMoney - (CurrPayStr / entity.DayRate) < 0.01M)
                             BalanceStr = 0;
                         else
                             BalanceStr = (entity.PayMoney - CurrPayStr / entity.DayRate).ConvertToDecimal1();
                     }
-                    
+
                     _detail.Balance = BalanceStr.ToString("#0.00") + " " + PaymentCurrency_WaitPay;
 
                     /*
@@ -1522,7 +1522,7 @@ namespace OASystem.API.Controllers
                             Grp_HotelReservations hotelReservations = _HotelReservations.Where(s => s.Id == entity.CId).FirstOrDefault();
                             if (hotelReservations != null)
                             {
-                                decimal governmentRentFee = 0.00M, cityTaxFee = 0.00M, breakfastFee = 0.00M, roomFee = 0.00M; 
+                                decimal governmentRentFee = 0.00M, cityTaxFee = 0.00M, breakfastFee = 0.00M, roomFee = 0.00M;
                                 string governmentRentBool = "否", cityTaxBool = "否", breakfastBool = "否", roomBool = "否";
                                 string governmentRentCode = "", governmentRentName = "", cityTaxCode = "", cityTaxName = "", breakfastCode = "", breakfastName = "", roomCode = "", roomName = "";
                                 var _HotelReservationsContents1 = _HotelReservationsContents.Where(it => it.HrId == hotelReservations.Id).ToList();
@@ -1562,7 +1562,7 @@ namespace OASystem.API.Controllers
                                         cityTaxName = $"({cityTaxCurrData.Remark})";
                                     }
                                 }
-                                
+
                                 //酒店早餐
                                 var breakfastData = _HotelReservationsContents1.Find(it => it.PriceType == 2);
                                 if (breakfastData != null)
@@ -1674,7 +1674,7 @@ namespace OASystem.API.Controllers
                             if (visaInfo != null)
                             {
                                 _detail.PriceNameContent = getClientNameStr(clientNameList, visaInfo.VisaClient);
-                                _detail.PriceMsgContent =  $"签证描述:{visaInfo.VisaDescription}<br/> 备注:{visaInfo.Remark}";
+                                _detail.PriceMsgContent = $"签证描述:{visaInfo.VisaDescription}<br/> 备注:{visaInfo.Remark}";
                             }
 
                             break;
@@ -3018,7 +3018,7 @@ namespace OASystem.API.Controllers
             int sign = (int)groupData.Data.GetType().GetProperty("sign").GetValue(groupData.Data, null);
 
             await AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(ccpId, sign, QiyeWeChatEnum.GuoJiaoLeaderChat);
-           
+
             #endregion
 
             return Ok(JsonView(true, groupData.Msg, groupData.Data));
@@ -3070,12 +3070,12 @@ namespace OASystem.API.Controllers
         public IActionResult QueryAssociateSupplier(AssociateSupplierDto dto)
         {
             var dbResult = _sqlSugar.Queryable<Grp_DecreasePayments>()
-                .Where(x => x.SupplierName.Contains(dto.param) && x.IsDel == 0).ToList() 
+                .Where(x => x.SupplierName.Contains(dto.param) && x.IsDel == 0).ToList()
                 ?? new List<Grp_DecreasePayments>();
             dbResult = dbResult.Distinct(new
-                 ProductComparer ()).ToList();
+                 ProductComparer()).ToList();
 
-            var jw = JsonView(true, "success", dbResult.OrderByDescending(x=>x. Id ).Select(x => new
+            var jw = JsonView(true, "success", dbResult.OrderByDescending(x => x.Id).Select(x => new
             {
                 x.Id,
                 x.SupplierAddress,
@@ -4217,7 +4217,7 @@ namespace OASystem.API.Controllers
                         #endregion
 
                         //文件名
-                        string strFileName =  $"{_DelegationInfo.TeamName}出入境费用{Guid.NewGuid().ToString()}.docx";
+                        string strFileName = $"{_DelegationInfo.TeamName}出入境费用{Guid.NewGuid().ToString()}.docx";
                         AsposeHelper.removewatermark_v2180();
                         doc.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
@@ -5900,7 +5900,7 @@ namespace OASystem.API.Controllers
                 return Ok(jw);
             }
 
-            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 = "未找到团组信息!";
@@ -5933,16 +5933,16 @@ namespace OASystem.API.Controllers
                 var keyValue = groupArr.Key;
                 if (int.TryParse(keyValue, out int cityid))
                 {
-                   var city = _sqlSugar.Queryable<Grp_NationalTravelFee>().First(x => x.Id == cityid && x.IsDel == 0);
-                   keyValue = city == null ? keyValue : city.Country + "-" + city.City;
+                    var city = _sqlSugar.Queryable<Grp_NationalTravelFee>().First(x => x.Id == cityid && x.IsDel == 0);
+                    keyValue = city == null ? keyValue : city.Country + "-" + city.City;
                 }
 
                 List<List<Grp_CarTouristGuideGroundReservationsContentExtend>> contentArr = new List<List<Grp_CarTouristGuideGroundReservationsContentExtend>>();
-                
+
                 foreach (var item in groupArr)
                 {
-                    var content = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent, Sys_SetData>((a,b)=> a.SId == b.Id 
-                    ).Where((a,b)  => a.CTGGRId == item.Id && a.Price != 0M && a.IsDel == 0 && b.IsDel == 0).Select((a,b)=>
+                    var content = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent, Sys_SetData>((a, b) => a.SId == b.Id
+                    ).Where((a, b) => a.CTGGRId == item.Id && a.Price != 0M && a.IsDel == 0 && b.IsDel == 0).Select((a, b) =>
                      new Grp_CarTouristGuideGroundReservationsContentExtend
                      {
                          Count = a.Count,
@@ -5996,7 +5996,7 @@ namespace OASystem.API.Controllers
                     var clounmCount = 10;
                     var initStyleRow = sheet.GetRow(2);
 
-                    var arr = contentArr.SelectMany(x => x).OrderBy(x=>x.SId).ToList();
+                    var arr = contentArr.SelectMany(x => x).OrderBy(x => x.SId).ToList();
                     //var overspendArrDetail = 
 
                     var existsId = new List<CarCompare>();
@@ -6006,8 +6006,8 @@ namespace OASystem.API.Controllers
                     var curr = arr.Count > 0 ? arr[0].Currency : -1;
                     var currObj = _sqlSugar.Queryable<Sys_SetData>().First(x => x.Id == curr && x.IsDel == 0) ?? new Sys_SetData
                     {
-                         Name = "未知币种!",
-                         Remark = "未知币种!",
+                        Name = "未知币种!",
+                        Remark = "未知币种!",
                     };
 
                     sheet.GetRow(0).GetCell(1).SetCellValue($"{keyValue}费用明细(货币:{currObj.Remark})");
@@ -6078,7 +6078,7 @@ namespace OASystem.API.Controllers
                     string lastStr = "";
 
                     var queryCarArrByCityAndDiid = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations, Grp_CreditCardPayment>((x, b) => x.Id == b.CId && b.IsDel == 0 && b.CTable == 79)
-                        .Where(x => x.DiId == dto.Diid && x.Area == groupArr.Key).Select((x,b) => new
+                        .Where(x => x.DiId == dto.Diid && x.Area == groupArr.Key).Select((x, b) => new
                         {
                             b.IsAuditGM,
                             x.Id,
@@ -6104,7 +6104,7 @@ namespace OASystem.API.Controllers
 
                     foreach (var item in arr)
                     {
-                        if (existsId.FirstOrDefault(x=>x.Sid == item.SId && DateTime.Compare(x.DataPrice, item.DatePrice.ObjToDate()) == 0) == null && !overspendSoure.Values.Contains(item.SId))
+                        if (existsId.FirstOrDefault(x => x.Sid == item.SId && DateTime.Compare(x.DataPrice, item.DatePrice.ObjToDate()) == 0) == null && !overspendSoure.Values.Contains(item.SId))
                         {
                             if (thisSid != item.SId)
                             {
@@ -6146,12 +6146,12 @@ namespace OASystem.API.Controllers
                                         }
                                     }
                                     sheet.GetRow(rowStartIndex).GetCell(0).SetCellValue("合计:");
-                                    sheet.GetRow(rowStartIndex).GetCell(4).SetCellValue(arr.Where(x=>x.SId == thisSid).Sum(x=>x.Count * x.Price).ToString("F2"));
+                                    sheet.GetRow(rowStartIndex).GetCell(4).SetCellValue(arr.Where(x => x.SId == thisSid).Sum(x => x.Count * x.Price).ToString("F2"));
 
                                     //超时合计
                                     sheet.GetRow(rowStartIndex).GetCell(7).SetCellValue("超时合计:");
                                     //超时数
-                                    sheet.GetRow(rowStartIndex).GetCell(8).SetCellValue(chaoshiNumber == 0 ? "" :chaoshiNumber.ToString());
+                                    sheet.GetRow(rowStartIndex).GetCell(8).SetCellValue(chaoshiNumber == 0 ? "" : chaoshiNumber.ToString());
                                     //超时合计费用
                                     sheet.GetRow(rowStartIndex).GetCell(9).SetCellValue(totalNumber == 0 ? "" : totalNumber.ToString());
 
@@ -6168,7 +6168,7 @@ namespace OASystem.API.Controllers
                             IRow row = sheet.GetRow(rowStartIndex);
                             var whereForResult = arr.Where(x => x.SId == item.SId && DateTime.Compare(x.DatePrice.ObjToDate(), item.DatePrice.ObjToDate()) == 0).ToList();
                             var isOpenOverspendSoure = overspendSoure.Keys.Contains(item.SId);
-                            List<Grp_CarTouristGuideGroundReservationsContentExtend> overspendWhereForResult = null ;
+                            List<Grp_CarTouristGuideGroundReservationsContentExtend> overspendWhereForResult = null;
                             if (isOpenOverspendSoure)
                             {
                                 overspendWhereForResult = arr.Where(x => x.SId == overspendSoure[item.SId] && DateTime.Compare(x.DatePrice.ObjToDate(), item.DatePrice.ObjToDate()) == 0).ToList();
@@ -6178,8 +6178,8 @@ namespace OASystem.API.Controllers
 
                             for (int i = 0; i <= clounmCount; i++)
                             {
-                               var cell = row.GetCell(i);
-                               var setCellValue = InIndexOutFunction(i, whereForResult, overspendWhereForResult);
+                                var cell = row.GetCell(i);
+                                var setCellValue = InIndexOutFunction(i, whereForResult, overspendWhereForResult);
                                 if (cell == null)
                                 {
                                     cell = row.CreateCell(i);
@@ -6191,12 +6191,12 @@ namespace OASystem.API.Controllers
                                 Font.CloneStyleFrom(cell.CellStyle.GetFont(workbook));
                                 Font.Color = IndexedColors.Red.Index;   // 选择字体颜色
                                 fontRed.SetFont(Font);
-                                
+
                                 byte[] rgb = new byte[3] { 255, 242, 204 };
                                 var BackgroundColor255_242_204 = workbook.CreateCellStyle();
                                 BackgroundColor255_242_204.CloneStyleFrom(cell.CellStyle);
-                                
-                                byte[] rgb1 = new byte[3] { 189,215, 238 };
+
+                                byte[] rgb1 = new byte[3] { 189, 215, 238 };
 
                                 if (workbook is XSSFWorkbook)
                                 {
@@ -6311,9 +6311,9 @@ namespace OASystem.API.Controllers
 
                     using (var stream = new MemoryStream())
                     {
-                        workbook.Write(stream,true);
+                        workbook.Write(stream, true);
                         stream.Flush();
-                        stream.Seek(0, SeekOrigin.Begin); 
+                        stream.Seek(0, SeekOrigin.Begin);
                         MemoryStream memoryStream = new MemoryStream();
                         stream.CopyTo(memoryStream);
                         memoryStream.Seek(0, SeekOrigin.Begin);
@@ -6336,7 +6336,7 @@ namespace OASystem.API.Controllers
                 var byts = io.ConvertZipStream(Zips);
                 io.ByteToFile(byts, AppSettingsHelper.Get("ExcelBasePath") + $"\\ExportLocalGuidePriceDetail\\{group.TeamName}_地接费用明细.zip");
                 //http://132.232.92.186:24/Office/Word/EnterExitCost/File/
-                jw = JsonView(true, "success" , new { url  = AppSettingsHelper.Get("OfficeBaseUrl") + $"\\Office\\Excel\\ExportLocalGuidePriceDetail\\{group.TeamName}_地接费用明细.zip" });
+                jw = JsonView(true, "success", new { url = AppSettingsHelper.Get("OfficeBaseUrl") + $"\\Office\\Excel\\ExportLocalGuidePriceDetail\\{group.TeamName}_地接费用明细.zip" });
             }
             else
             {
@@ -6352,7 +6352,7 @@ namespace OASystem.API.Controllers
             switch (i)
             {
                 case 0:
-                    outStr = arr[0].SidName; 
+                    outStr = arr[0].SidName;
                     break;
 
                 case 1:
@@ -6372,7 +6372,7 @@ namespace OASystem.API.Controllers
                     {
                         var curr = _sqlSugar.Queryable<Sys_SetData>().First(x => x.Id == arrOverspendSoure[0].Currency && x.IsDel == 0);
                         var unit = _sqlSugar.Queryable<Sys_SetData>().First(x => x.Id == arrOverspendSoure[0].Units && x.IsDel == 0);
-                        outStr = arrOverspendSoure.Sum(x=>x.Price).ToString("F2") + curr?.Remark + "/" + unit?.Name;
+                        outStr = arrOverspendSoure.Sum(x => x.Price).ToString("F2") + curr?.Remark + "/" + unit?.Name;
                     }
                     break;
 
@@ -7711,7 +7711,7 @@ namespace OASystem.API.Controllers
             //     Grp_GroupCostParameter());
             var GroupCostParameterMap = _mapper.Map<List<Grp_GroupCostParameterDto>>(GroupCostParameter);
 
-            bool hotelIsTrue = _sqlSugar.Queryable<Grp_HotelInquiry>().Where(x => x.DiId == dto.Diid && x.IsDel == 0 ).Count() > 0;
+            bool hotelIsTrue = _sqlSugar.Queryable<Grp_HotelInquiry>().Where(x => x.DiId == dto.Diid && x.IsDel == 0).Count() > 0;
 
             return Ok(JsonView(new
             {
@@ -7730,7 +7730,7 @@ namespace OASystem.API.Controllers
                 baoPi = _GroupCostParameterRepository.GetBaoPi(diid),
                 blackCodeIsTrue = create.Code == 0 ? true : false,
                 hotelIsTrue = hotelIsTrue,
-            })) ;
+            }));
         }
 
         /// <summary>
@@ -7786,7 +7786,7 @@ namespace OASystem.API.Controllers
             {
                 _sqlSugar.BeginTran();
                 isTrue = await _GroupCostRepository.
-                    SaveGroupCostList(Grp_groups, dto.Diid,dto.Userid); //列表
+                    SaveGroupCostList(Grp_groups, dto.Diid, dto.Userid); //列表
                 isTrue = await _checkBoxs.SaveCheckBoxs(Grp_CheckBoxs, dto.Diid); //选中项
                 isTrue = await _CostTypeHotelNumberRepository.SaveHotelNumber(Grp_HotelNumber, dto.Userid, dto.Diid); //酒店房间数量
                 isTrue = await _GroupCostParameterRepository.SaveAsync(Grp_CostParameters, dto.Userid, dto.Diid); //系数
@@ -7905,7 +7905,7 @@ namespace OASystem.API.Controllers
                         {
 
                         }
-                        
+
 
                         #endregion
 
@@ -9559,7 +9559,7 @@ 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
                             };
@@ -9597,7 +9597,7 @@ namespace OASystem.API.Controllers
         public IActionResult CraeteGroupCostTravel(GroupCostInItDto dto)
         {
             var jw = JsonView(false);
-            var Create =_GroupCostRepository.
+            var Create = _GroupCostRepository.
                 CreateGroupCostByBlackCode(dto.Diid);
 
             jw.Msg = Create.Msg;
@@ -9640,7 +9640,7 @@ namespace OASystem.API.Controllers
                 if (!dto.Param.IsNullOrWhiteSpace())
                 {
 
-                   
+
 
                     string sql = $@"
 SELECT gdi.TeamName , gctggr.Area, gctggr.PriceName  , gctggrc.Id  ,gctggrc.Price , gctggrc.DatePrice , gctggrc.PriceContent , gctggrc.Currency , gctggr.ServiceStartTime , gctggr.ServiceEndTime 
@@ -9653,7 +9653,7 @@ ORDER by  gctggrc.id DESC
 
                     dbResult = await _sqlSugar.SqlQueryable<HistoryCarDataView>(sql).ToListAsync();
 
-                    
+
 
                     var numeberResult = await Task.Run(() =>
                     {
@@ -9737,18 +9737,18 @@ ORDER by  gctggrc.id DESC
                 var view = dbResult.Select(x => {
 
                     decimal dp = 0.00M;
-                    var startB = DateTime.TryParse(x.Start.ToString(),out DateTime startD);
+                    var startB = DateTime.TryParse(x.Start.ToString(), out DateTime startD);
                     var endB = DateTime.TryParse(x.End.ToString(), out DateTime endD);
                     if (string.IsNullOrWhiteSpace(x.DatePrice))
                     {
                         if (startB && endB)
                         {
                             var timesp = endD.Subtract(startD);
-                            if ((timesp.Days + 1) != 0 )
+                            if ((timesp.Days + 1) != 0)
                             {
                                 dp = x.Price / (timesp.Days + 1);
                             }
-                            
+
                         }
                     }
                     else
@@ -9769,13 +9769,13 @@ ORDER by  gctggrc.id DESC
                         x.DatePrice,
                         dayPrice = dp.ToString("F2"),
                     };
-                }).OrderByDescending(x=>x.id).ToList();
+                }).OrderByDescending(x => x.id).ToList();
 
                 jw = JsonView(true, "获取成功!", view);
             }
             catch (Exception e)
             {
-                jw = JsonView(false,e.Message);
+                jw = JsonView(false, e.Message);
             }
 
             return Ok(jw);
@@ -9929,7 +9929,7 @@ ORDER by  gctggrc.id DESC
             #endregion
 
             return Ok(await _hotelPriceRep._Details(_dto.PortType, _dto.Id));
-           
+
         }
 
         /// <summary>
@@ -9964,8 +9964,8 @@ ORDER by  gctggrc.id DESC
             else if (_dto.Id > 1) // Edit
             {
                 if (pageFunAuthView.EditAuth == 0) return Ok(JsonView(false, "您没有编辑权限!"));
-                 
-            }else return Ok(JsonView(false, "请输入正确的数据Id!"));
+
+            } else return Ok(JsonView(false, "请输入正确的数据Id!"));
 
             #endregion
 
@@ -10514,7 +10514,7 @@ ORDER by  gctggrc.id DESC
             if (isIntType)
             {
                 _currency = currDatas.Find(it => it.Id == currId)?.Name ?? "";
-                
+
             }
 
             var teamRate = await _teamRateRep.PostGroupTeamRateItemByDiIdAndCTableId(1, _dto.DiId, 76);
@@ -10523,7 +10523,7 @@ ORDER by  gctggrc.id DESC
             if (currInfo == null)
             {
                 return Ok(JsonView(StatusCodes.Status400BadRequest, $"团组汇率-->酒店模块 {_currency} 币种未设置汇率,不支持预定成本Excel导出", ""));
-                
+
             }
 
             if (!_currency.ToUpper().Equals("CNY"))
@@ -10593,9 +10593,9 @@ ORDER by  gctggrc.id DESC
                     City = item.City,
                     HotelName = item.HotelName,
                     Date = $"{item.CheckInDate} - {item.CheckOutDate}",
-                   // SingleRoomCount = item.SingleRoomCount,
+                    // SingleRoomCount = item.SingleRoomCount,
                     SingleRoomPrice = singleRoomFeeStr,
-                   // DoubleRoomCount = item.DoubleRoomCount,
+                    // DoubleRoomCount = item.DoubleRoomCount,
                     DoubleRoomPrice = doubleRoomFeeStr,
                     //SuiteRoomCount = item.SuiteRoomCount,
                     SuiteRoomPrice = suiteRoomFeeStr,
@@ -10616,7 +10616,7 @@ ORDER by  gctggrc.id DESC
                     CardPrice = cardPriceStr,
                     Remark = ccpInfo.Remark
 
-                }); 
+                });
             }
 
             #endregion
@@ -10642,7 +10642,7 @@ ORDER by  gctggrc.id DESC
 
             #region 删除指定行
 
-            bool singleDel = true, doubleDel = true, suiteDel = true, otherDel = true, zcDel = true, dsDel = true, cssDel = true,cpDel=true, remarkDel = true;
+            bool singleDel = true, doubleDel = true, suiteDel = true, otherDel = true, zcDel = true, dsDel = true, cssDel = true, cpDel = true, remarkDel = true;
             int singleIndex = dt.Columns["SingleRoomPrice"].Ordinal,
                 doubleIndex = dt.Columns["DoubleRoomPrice"].Ordinal,
                 suiteIndex = dt.Columns["SuiteRoomPrice"].Ordinal,
@@ -10655,7 +10655,7 @@ ORDER by  gctggrc.id DESC
             //删除指定列
             foreach (DataRow item in dt.Rows)
             {
-                string singleStr = item["SingleRoomPrice"].ToString(); 
+                string singleStr = item["SingleRoomPrice"].ToString();
                 bool containsDigitButNotZero1 = !singleStr.StartsWith("0") && Regex.IsMatch(singleStr, @"[1-9]");
                 if (containsDigitButNotZero1) singleDel = false;
                 singleIndex = dt.Columns["SingleRoomPrice"].Ordinal;
@@ -10720,13 +10720,13 @@ ORDER by  gctggrc.id DESC
         /// <param name="file"></param>
         /// <param name="columnIndex"></param>
         /// <param name="isDel"></param>
-        private void DeleteColumn(string file, int columnIndex,bool isDel)
+        private void DeleteColumn(string file, int columnIndex, bool isDel)
         {
 
             Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(file);
             //wb.Save(file);
             Aspose.Cells.Worksheet sheet1 = wb.Worksheets[0];
-           
+
             if (sheet1 != null)
             {
                 if (isDel)
@@ -10743,7 +10743,7 @@ ORDER by  gctggrc.id DESC
         /// </summary>
         /// <param name="file"></param>
         /// <param name="sheetName"></param>
-        private void DeleteSheet(string file, string sheetName="")
+        private void DeleteSheet(string file, string sheetName = "")
         {
             Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(file);
             //wb.Save(file);
@@ -12052,7 +12052,7 @@ ORDER by  gctggrc.id DESC
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostHotelInquiryPageItem(HotelInquiryPageItemDto _dto)
         {
-            var res = await _hotelInquiryRep._PageItem(_dto.PageIndex,_dto.PageSize,_dto.PortType,_dto.DiId);
+            var res = await _hotelInquiryRep._PageItem(_dto.PageIndex, _dto.PageSize, _dto.PortType, _dto.DiId);
             if (res.Code != 0) return Ok(JsonView(false, res.Msg));
             var view = res.Data as PageDataViewBase;
             return Ok(JsonView(true, res.Msg, view.Data, view.Total));
@@ -12070,7 +12070,7 @@ ORDER by  gctggrc.id DESC
         {
             var res = await _hotelInquiryRep._Info(_dto.PortType, _dto.Id);
             if (res.Code != 0) return Ok(JsonView(false, res.Msg));
-           
+
             return Ok(JsonView(true, res.Msg, res.Data));
         }
 
@@ -12100,7 +12100,7 @@ ORDER by  gctggrc.id DESC
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostHotelInquiryDel(HotelInquiryDelDto _dto)
         {
-            var res = await _hotelInquiryRep._Del(_dto.Id,_dto.DeleteUserId);
+            var res = await _hotelInquiryRep._Del(_dto.Id, _dto.DeleteUserId);
             if (res.Code != 0) return Ok(JsonView(false, res.Msg));
 
             return Ok(JsonView(true, res.Msg, res.Data));
@@ -12166,7 +12166,7 @@ ORDER by  gctggrc.id DESC
                 }
             }
             return Ok(JsonView(true, "操作成功", new { countryDatas = countrys, teamNameDatas = teamNames }));
-               
+
         }
 
         /// <summary>
@@ -12300,6 +12300,307 @@ ORDER by  gctggrc.id DESC
 
         #endregion
 
+        #region 国家信息 数据 注释
+        //public class paramJsonDto
+        //{
+        //    public List<CountriesInfo> str { get; set; }
+
+        //}
+
+        //[HttpPost]
+        //public async Task<IActionResult> LoadCitiesInitData(paramJsonDto dto)
+        //{
+        //    //List<CountriesInfo> infos = new List<CountriesInfo>();
+        //    //infos = JsonConvert.DeserializeObject<List<CountriesInfo>>(dto.str);
+        //    List<Sys_Cities> cities = new List<Sys_Cities>();
+        //    List<Sys_Cities> districts = new List<Sys_Cities>();
+        //    var counties = _sqlSugar.Queryable<Sys_Countries>().Where(it => it.IsDel == 0).ToList();
+
+        //    _sqlSugar.BeginTran();
+        //    int countitiesIndex = 0;
+        //    foreach (var item in dto.str)
+        //    {
+
+        //        dynamic data = item.c;
+        //        int countriesId = counties.Find(it => it.Name_CN.Equals(item.cn))?.Id ?? 0;
+
+        //        if (data != null)
+        //        {
+        //            countitiesIndex++;
+        //            foreach (var item1 in data)
+        //            {
+        //                string cnname = item1.cn;
+        //                string enname = item1.en;
+
+        //                Sys_Cities provinceInfo = new Sys_Cities()
+        //                {
+        //                    CountriesId = countriesId,
+        //                    Name_CN = cnname,
+        //                    Name_EN = enname,
+        //                    ParentId = 0,
+        //                    IsCapital = 1,
+        //                    CreateUserId = 208,
+        //                    CreateTime = DateTime.Now,
+        //                    IsDel = 0
+        //                };
+
+        //                if (item1.lv == "province") //省份
+        //                {
+        //                    provinceInfo.Level = 1;
+        //                    int provinceId = 0;
+        //                    var provinceInfo1 = _sqlSugar.Queryable<Sys_Cities>().Where(it => it.CountriesId == countriesId && it.Level == 1 && it.Name_CN.Equals(cnname)).First();
+        //                    if (provinceInfo1 != null) provinceId = provinceInfo1.Id;
+        //                    else provinceId = _sqlSugar.Insertable<Sys_Cities>(provinceInfo).ExecuteReturnIdentity();
+
+        //                    var data1 = item1.c;
+        //                    foreach (var item2 in data1)
+        //                    {
+        //                        if (item2.lv == "city")
+        //                        {
+        //                            string citycnname = item2.cn;
+        //                            string cityenname = item2.en;
+
+        //                            Sys_Cities cityInfo = new Sys_Cities()
+        //                            {
+        //                                CountriesId = countriesId,
+        //                                ParentId = provinceId,
+        //                                Level = 2,
+        //                                Name_CN = citycnname,
+        //                                Name_EN = cityenname,
+        //                                IsCapital = 1,
+        //                                CreateUserId = 208,
+        //                                CreateTime = DateTime.Now,
+        //                                IsDel = 0
+        //                            };
+        //                            if (item2.c != null)
+        //                            {
+        //                                int cityId = 0;
+        //                                var citiesInfo = _sqlSugar.Queryable<Sys_Cities>().Where(it => it.CountriesId == countriesId && it.Level == 2 && it.Name_CN.Equals(citycnname)).First();
+        //                                if (citiesInfo != null) cityId = citiesInfo.Id;
+        //                                else cityId = _sqlSugar.Insertable<Sys_Cities>(cityInfo).ExecuteReturnIdentity();
+
+        //                                foreach (var item3 in item2.c)
+        //                                {
+        //                                    if (item3.lv == "district")
+        //                                    {
+        //                                        var districtInfo = new Sys_Cities()
+        //                                        {
+        //                                            CountriesId = countriesId,
+        //                                            Name_CN = item3.cn,
+        //                                            Name_EN = item3.en,
+        //                                            Level = 3,
+        //                                            ParentId = cityId,
+        //                                            IsCapital = 1,
+        //                                            CreateUserId = 208,
+        //                                            CreateTime = DateTime.Now,
+        //                                            IsDel = 0
+        //                                        };
+        //                                        //if (districts.Find(it => it.CountriesId == countriesId && it.ParentId == cityId && it.Name_CN.Equals(districtInfo.Name_CN)) == null)
+        //                                        //{
+        //                                        districts.Add(districtInfo);
+        //                                        //}
+        //                                    }
+        //                                }
+        //                            }
+        //                            else
+        //                            {
+        //                                //if (cities.Find(it => it.CountriesId == countriesId && it.ParentId == provinceId && it.Name_CN.Equals(citycnname)) == null)
+        //                                //{
+        //                                cities.Add(cityInfo);
+        //                                //}
+        //                            }
+        //                        }
+        //                    }
+        //                }
+        //                else if (item1.lv == "city")//城市
+        //                {
+        //                    provinceInfo.Level = 2;
+
+        //                    if (item1.c != null)
+        //                    {
+        //                        int cityId = 0;
+        //                        var citiesInfo = _sqlSugar.Queryable<Sys_Cities>().Where(it => it.CountriesId == countriesId && it.Level == 1 && it.Name_CN.Equals(provinceInfo.Name_CN)).First();
+        //                        if (citiesInfo != null) cityId = citiesInfo.Id;
+        //                        else cityId = _sqlSugar.Insertable<Sys_Cities>(provinceInfo).ExecuteReturnIdentity();
+
+        //                        foreach (var item3 in item1.c)
+        //                        {
+        //                            if (item3.lv == "district")
+        //                            {
+        //                                var districtInfo = new Sys_Cities()
+        //                                {
+        //                                    CountriesId = countriesId,
+        //                                    Name_CN = item3.cn,
+        //                                    Name_EN = item3.en,
+        //                                    Level = 3,
+        //                                    ParentId = cityId,
+        //                                    IsCapital = 1,
+        //                                    CreateUserId = 208,
+        //                                    CreateTime = DateTime.Now,
+        //                                    IsDel = 0
+        //                                };
+        //                                //if (districts.Find(it => it.CountriesId == countriesId && it.ParentId == cityId && it.Name_CN.Equals(districtInfo.Name_CN)) == null)
+        //                                //{
+        //                                districts.Add(districtInfo);
+        //                                //}
+        //                            }
+        //                        }
+        //                    }
+        //                    else
+        //                    {
+        //                        //if (cities.Find(it =>  it.CountriesId == countriesId && it.Name_CN.Equals(provinceInfo.Name_CN)) == null)
+        //                        //{
+        //                        cities.Add(provinceInfo);
+        //                        //}
+        //                    }
+        //                }
+        //            }
+        //        }
+        //    }
+
+        //    var procinceDatas = _sqlSugar.Queryable<Sys_Cities>().ToList();
+
+        //    cities = cities.Distinct().ToList();
+        //    districts = districts.Distinct().ToList();
+        //    var citiesDatas = cities.Where(it => it.Level == 2).ToList();
+        //    //var districtDatas = cities.Where(it => it.Level == 3).ToList();
+        //    cities.AddRange(districts);
+
+        //    var citiesAdd = _sqlSugar.Insertable<Sys_Cities>(cities).ExecuteReturnIdentity();
+        //    //_sqlSugar.RollbackTran();
+        //    _sqlSugar.CommitTran();
+
+        //    return Ok(JsonView(false, "操作成功!"));
+        //}
+
+        //[HttpPost]
+        //public async Task<IActionResult> LoadCitiesInitInfo(CounrtiesDto dto)
+        //{
+        //    List<CountitiesInfo> infos = dto.MyProperty;
+        //    List<Sys_Cities> cityInfos = new List<Sys_Cities>();
+        //    _sqlSugar.BeginTran();
+
+        //    var countities = _sqlSugar.Queryable<Sys_Countries>().Where(it => it.IsDel == 0).ToList();
+        //    var citities = _sqlSugar.Queryable<Sys_Cities>().Where(it => it.IsDel == 0 && it.Level == 2).ToList();
+
+        //    foreach (var item in infos)
+        //    {
+        //        var countryInfo = countities.Where(it => it.ThreeCode.Equals(item.country_code3)).FirstOrDefault();
+        //        if (countryInfo != null)
+        //        {
+        //            var cityInfo = citities.Where(it => it.CountriesId == countryInfo.Id).ToList();
+
+        //            var cityInfo1 = cityInfo.Where(it => item.capital_name_chinese.Contains(it.Name_CN)).FirstOrDefault();
+        //            if (cityInfo1 != null)
+        //            {
+        //                cityInfo1.IsCapital = 0;
+        //                cityInfos.Add(cityInfo1);
+        //            }
+        //        }
+        //    }
+
+
+        //    var update = _sqlSugar.Updateable<Sys_Cities>(cityInfos)
+        //                          .UpdateColumns(it => it.IsCapital)
+        //                          .WhereColumns(it => it.Id)
+        //                          .ExecuteCommand();
+
+        //    //_sqlSugar.RollbackTran();
+        //    _sqlSugar.CommitTran();
+
+        //    return Ok(JsonView(false, "操作成功!"));
+        //}
+
+        //public class CounrtiesDto
+        //{
+        //    public List<CountitiesInfo> MyProperty { get; set; }
+        //}
+
+        //public class CountitiesInfo
+        //{
+        //    /// <summary>
+        //    /// 圣约翰
+        //    /// </summary>
+        //    public string capital_name_chinese { get; set; }
+        //    /// <summary>
+        //    /// 
+        //    /// </summary>
+        //    public string capital_name { get; set; }
+        //    /// <summary>
+        //    /// 
+        //    /// </summary>
+        //    public string country_type { get; set; }
+        //    /// <summary>
+        //    /// 安提瓜和巴布达
+        //    /// </summary>
+        //    public string country_name_chinese { get; set; }
+        //    /// <summary>
+        //    /// 安提瓜和巴布达
+        //    /// </summary>
+        //    public string country_name_chinese_short { get; set; }
+        //    /// <summary>
+        //    /// 安提瓜和巴布达
+        //    /// </summary>
+        //    public string country_name_chinese_UN { get; set; }
+        //    /// <summary>
+        //    /// 
+        //    /// </summary>
+        //    public string country_name_english_abbreviation { get; set; }
+        //    /// <summary>
+        //    /// 
+        //    /// </summary>
+        //    public string country_name_english_formal { get; set; }
+        //    /// <summary>
+        //    /// 
+        //    /// </summary>
+        //    public string country_name_english_UN { get; set; }
+        //    /// <summary>
+        //    /// 
+        //    /// </summary>
+        //    public string continent_name { get; set; }
+        //    /// <summary>
+        //    /// 
+        //    /// </summary>
+        //    public string subregion_name { get; set; }
+        //    /// <summary>
+        //    /// 
+        //    /// </summary>
+        //    public string country_code2 { get; set; }
+        //    /// <summary>
+        //    /// 
+        //    /// </summary>
+        //    public string country_code3 { get; set; }
+        //    /// <summary>
+        //    /// 
+        //    /// </summary>
+        //    public string phone_code { get; set; }
+        //}
+
+
+        //public class CountriesInfo : BasicInfo
+        //{
+        //    public List<CitiesInfo> c { get; set; }
+        //}
+
+        //public class CitiesInfo : BasicInfo
+        //{
+        //    public List<AreaInfo> c { get; set; }
+        //}
+
+        //public class AreaInfo : BasicInfo
+        //{
+        //    public List<AreaInfo> c { get; set; }
+        //}
+
+        //public class BasicInfo
+        //{
+        //    public string code { get; set; }
+        //    public string cn { get; set; }
+        //    public string lv { get; set; }
+        //    public string en { get; set; }
+        //}
+        #endregion
+
 
         /// <summary>
         /// 报批行程初始化

+ 4 - 1
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -681,9 +681,12 @@ namespace OASystem.API.OAMethodLib
 
 
             //82  团组客户保险 --> 国交部(7) 经理(32),主管(22) 岗位
+            //2024-06-25 默认将保险权限分配给签证岗。 签证(26) 岗位
+
+            List<int> insurancePositions = new List<int>() { 32, 22, 26 };
             _GroupsTaskAssignments.AddRange(
                 userDatas
-                .Where(it => it.DepId == 7 && (it.JobPostId == 22 || it.JobPostId == 32))
+                .Where(it => it.DepId == 7 && insurancePositions.Contains(it.JobPostId))
                 .Select(it => new Grp_GroupsTaskAssignment()
                 {
                     DIId = diId,

+ 3 - 0
OASystem/OASystem.Api/Program.cs

@@ -40,6 +40,9 @@ var _config = new ConfigurationBuilder()
                  .Build();
 builder.Services.AddSingleton(new AppSettingsHelper(_config));
 
+//ÉèÖÃÇëÇó²ÎÊý¿É²»Ìî
+builder.Services.AddControllers(options => options.SuppressImplicitRequiredAttributeForNonNullableReferenceTypes = true);
+
 // Add services to the container.
 builder.Services.AddControllersWithViews();
 builder.Services.AddControllers()

+ 19 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -600,6 +600,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         else countrys = countryReq;
                     }
 
+                    //建团时 默认出团 设置 团组code
+                    string teamCode="";
+                    string teamCodeSql = string.Format("Select TourCode From Grp_DelegationInfo");
+                    var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
+
+                    while (true)
+                    {
+                        teamCode = Tools.CommonFun.GetRandomAllStr(6);
+
+                        if (!teamCodeItem.Equals(teamCode))
+                        {
+                            break;
+                        }
+                    }
+
+
                     Grp_DelegationInfo delegationInfo = new Grp_DelegationInfo()
                     {
                         SalesQuoteNo = dto.SalesQuoteNo,
@@ -626,7 +642,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         TontractTime = Convert.ToDateTime(dto.TontractTime),
                         PaymentMoney = dto.PaymentMoney,
                         PayDay = dto.PayDay,
-                        TourCode = "",
+                        TourCode = teamCode,
+                        GroupsOperator = dto.UserId,
+                        GroupsTime = DateTime.Now,
                         SalesDate = DateTime.Now,
                         IsState = 0, //默认团组未完成 0
                         JietuanTime = DateTime.Now,