|  | @@ -428,7 +428,7 @@ namespace OASystem.API.Controllers
 | 
	
		
			
				|  |  |          public async Task<IActionResult> CityByCountry(string countryLabel)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            countryLabel=HttpUtility.UrlDecode(countryLabel);
 | 
	
		
			
				|  |  | +            countryLabel = HttpUtility.UrlDecode(countryLabel);
 | 
	
		
			
				|  |  |              var countryList = countryLabel.Split(',', StringSplitOptions.RemoveEmptyEntries).ToArray();
 | 
	
		
			
				|  |  |              var citys = Array.Empty<string?>();
 | 
	
		
			
				|  |  |              if (countryList.Any())
 | 
	
	
		
			
				|  | @@ -449,7 +449,7 @@ namespace OASystem.API.Controllers
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  citys = cityDatas1.Select(x => x.City).Distinct().ToArray();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              return Ok(JsonView(citys));
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -461,7 +461,7 @@ namespace OASystem.API.Controllers
 | 
	
		
			
				|  |  |          /// <returns></returns>
 | 
	
		
			
				|  |  |          [HttpGet("{id}/{tempId}")]
 | 
	
		
			
				|  |  |          [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
 | 
	
		
			
				|  |  | -        public async Task<IActionResult> GroupOrderPreInfo(int id,int tempId = 1404)
 | 
	
		
			
				|  |  | +        public async Task<IActionResult> GroupOrderPreInfo(int id, int tempId = 1404)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              return Ok(await _grpOrderPreInfoRep.InfoAsync(id, tempId));
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -511,7 +511,7 @@ namespace OASystem.API.Controllers
 | 
	
		
			
				|  |  |                  fileNamePrefix = $"{data.Name}_有商邀版";
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              else
 | 
	
		
			
				|  |  | -            { 
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  |                  //tempId == 1404 默认下载
 | 
	
		
			
				|  |  |                  tempPath += $"前期需客户提供信息_单接送机Temp.xlsx";
 | 
	
		
			
				|  |  |                  fileNamePrefix = $"{data.Name}_单接送机";
 | 
	
	
		
			
				|  | @@ -534,7 +534,8 @@ namespace OASystem.API.Controllers
 | 
	
		
			
				|  |  |                  else if (obj is string[] stringArray)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  |                      item.OriginVal = string.Join("、", stringArray);
 | 
	
		
			
				|  |  | -                } else if (obj.Equals("-"))
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                else if (obj.Equals("-"))
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  |                      item.OriginVal = "";
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -566,7 +567,7 @@ namespace OASystem.API.Controllers
 | 
	
		
			
				|  |  |                  designer.SetDataSource("View", data.Items);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              designer.Process();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              if (!Directory.Exists(savePath))
 | 
	
	
		
			
				|  | @@ -5637,7 +5638,7 @@ FROM
 | 
	
		
			
				|  |  |          /// </summary>
 | 
	
		
			
				|  |  |          /// <returns></returns>
 | 
	
		
			
				|  |  |          [HttpPost]
 | 
	
		
			
				|  |  | -        [ApiLog("Grp_EnterExitCost",OperationEnum.Add)]
 | 
	
		
			
				|  |  | +        [ApiLog("Grp_EnterExitCost", OperationEnum.Add)]
 | 
	
		
			
				|  |  |          [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
 | 
	
		
			
				|  |  |          public async Task<IActionResult> PostEnterExitCostOperate(EnterExitCostOperateDto dto)
 | 
	
		
			
				|  |  |          {
 | 
	
	
		
			
				|  | @@ -6233,7 +6234,8 @@ FROM
 | 
	
		
			
				|  |  |                              totalLabel += $"{subJJC.ToString("#0.00")} 元/人(经济舱)";
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                          //公务舱
 | 
	
		
			
				|  |  | -                        if (_EnterExitCosts.SumGWC == 1) {
 | 
	
		
			
				|  |  | +                        if (_EnterExitCosts.SumGWC == 1)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  |                              subGWC = otherFeeTotal + _EnterExitCosts.OutsideGWPay;
 | 
	
		
			
				|  |  |                              totalLabel += $"{subGWC.ToString("#0.00")} 元/人(公务舱)";
 | 
	
		
			
				|  |  |                          }
 | 
	
	
		
			
				|  | @@ -8283,7 +8285,7 @@ FROM
 | 
	
		
			
				|  |  |                              #endregion
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                          //else dic.Add("SubQT", "七、其他费用合计:  0    元/人");
 | 
	
		
			
				|  |  | -                        
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                          //删除多余行
 | 
	
		
			
				|  |  |                          while (table5.Rows.Count > table5Row)
 | 
	
		
			
				|  |  |                          {
 | 
	
	
		
			
				|  | @@ -9066,7 +9068,7 @@ FROM
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  //默认添加查看、编辑权限(创建人、自己) 
 | 
	
		
			
				|  |  | -                await _enterExitCostRep.InitPerm(dto.GroupId,dto.UserId);
 | 
	
		
			
				|  |  | +                await _enterExitCostRep.InitPerm(dto.GroupId, dto.UserId);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  var dayDatas = _sqlSugar.Queryable<Grp_DayAndCostDraft>().Where(x => x.IsDel == 0 && x.ParentId == draftId).ToList();
 | 
	
		
			
				|  |  |                  var otherDatas = _sqlSugar.Queryable<Grp_DayOtherPriceDraft>().Where(x => x.IsDel == 0 && x.ParentId == draftId).ToList();
 | 
	
	
		
			
				|  | @@ -9163,7 +9165,7 @@ FROM
 | 
	
		
			
				|  |  |          /// <returns></returns>
 | 
	
		
			
				|  |  |          private async Task<List<CurrencyInfo>> EnterExitCostMobileGetCurrencyInit()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | -            return await GeneralMethod.EnterExitCostInitRate(); 
 | 
	
		
			
				|  |  | +            return await GeneralMethod.EnterExitCostInitRate();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          /// <summary>
 | 
	
	
		
			
				|  | @@ -9282,7 +9284,7 @@ WHERE
 | 
	
		
			
				|  |  |                      item.IsView = true;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              return Ok(JsonView(true, "查询成功!", data, total));
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -10772,7 +10774,8 @@ WHERE
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              var rateInfos = await EnterExitCostMobileGetCurrencyInit();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            var info = new Grp_EnterExitCostDraft() { 
 | 
	
		
			
				|  |  | +            var info = new Grp_EnterExitCostDraft()
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  |                  DraftName = dto.DraftName,
 | 
	
		
			
				|  |  |                  CurrencyRemark = CommonFun.GetCurrencyChinaToString(rateInfos),
 | 
	
		
			
				|  |  |                  CreateUserId = dto.CurrUserId
 | 
	
	
		
			
				|  | @@ -10780,12 +10783,13 @@ WHERE
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              _sqlSugar.BeginTran();
 | 
	
		
			
				|  |  |              var draftId = await _sqlSugar.Insertable(info).ExecuteReturnIdentityAsync();
 | 
	
		
			
				|  |  | -            if (draftId < 1) {
 | 
	
		
			
				|  |  | +            if (draftId < 1)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  |                  _sqlSugar.RollbackTran();
 | 
	
		
			
				|  |  |                  return Ok(JsonView(false, "草稿创建失败!"));
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              //添加默认权限
 | 
	
		
			
				|  |  | -            await _enterExitCostDraftRep.InitPerm(draftId,dto.CurrUserId);
 | 
	
		
			
				|  |  | +            await _enterExitCostDraftRep.InitPerm(draftId, dto.CurrUserId);
 | 
	
		
			
				|  |  |              _sqlSugar.CommitTran();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              (bool viewPerm, bool assignPerm) = await _enterExitCostDraftRep.PermissionValidationAsync(draftId, dto.CurrUserId);
 | 
	
	
		
			
				|  | @@ -11203,7 +11207,7 @@ WHERE
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  bool isView1 = false;
 | 
	
		
			
				|  |  |                  if (userIds.Any(x => x == item.Id)) isView1 = true;
 | 
	
		
			
				|  |  | -                else if (viewPermissionData.Any(x => x.Id ==dto.CurrUserId) && item.Id == dto.CurrUserId) isView1 = true;
 | 
	
		
			
				|  |  | +                else if (viewPermissionData.Any(x => x.Id == dto.CurrUserId) && item.Id == dto.CurrUserId) isView1 = true;
 | 
	
		
			
				|  |  |                  perUsersView.Add(new { Id = item.Id, Name = item.Name, IsView = isView1 });
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -11943,7 +11947,7 @@ WHERE
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              int groupId = dto.DiId,
 | 
	
		
			
				|  |  |                  currUserId = dto.CurrUserId;
 | 
	
		
			
				|  |  | -            if (groupId < 1) return Ok(JsonView(false,"请传入有效的GroupId;"));
 | 
	
		
			
				|  |  | +            if (groupId < 1) return Ok(JsonView(false, "请传入有效的GroupId;"));
 | 
	
		
			
				|  |  |              if (currUserId < 1) return Ok(JsonView(false, "请传入有效的CurrUserId;"));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              var info = await _enterExitCostRep.GetEnterExitCostInfoByDiId(dto);
 | 
	
	
		
			
				|  | @@ -12050,7 +12054,7 @@ WHERE
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  |                          feeName = countryInfo.Country;
 | 
	
		
			
				|  |  |                          var city = countryInfo.City;
 | 
	
		
			
				|  |  | -                        
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                          if (!string.IsNullOrEmpty(city) && cityFilter.Any(x => !x.Contains(city)))
 | 
	
		
			
				|  |  |                          {
 | 
	
		
			
				|  |  |                              feeName += $"-{city}";
 | 
	
	
		
			
				|  | @@ -12184,11 +12188,12 @@ WHERE
 | 
	
		
			
				|  |  |              #endregion
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              #region 签证+保险 1362
 | 
	
		
			
				|  |  | -            int visaInsIndex = 1; 
 | 
	
		
			
				|  |  | +            int visaInsIndex = 1;
 | 
	
		
			
				|  |  |              int visaInsItemTypeId = 1362;
 | 
	
		
			
				|  |  |              if (infoView.Visa > 0)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                views.Add(new QuoteSubItemInfo() {
 | 
	
		
			
				|  |  | +                views.Add(new QuoteSubItemInfo()
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  |                      ItemId = visaInsItemTypeId,
 | 
	
		
			
				|  |  |                      Index = visaInsIndex,
 | 
	
		
			
				|  |  |                      FeeName = $"签证",
 | 
	
	
		
			
				|  | @@ -12300,7 +12305,7 @@ WHERE
 | 
	
		
			
				|  |  |          [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
 | 
	
		
			
				|  |  |          public async Task<IActionResult> EnterExitCostQuoteItemDel(EnterExitCostQuoteItemDelDto dto)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | -            if (dto.Id < 1) return Ok(JsonView(false,MsgTips.Id));
 | 
	
		
			
				|  |  | +            if (dto.Id < 1) return Ok(JsonView(false, MsgTips.Id));
 | 
	
		
			
				|  |  |              if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              return Ok(await _enterExitCostQuoteRep.ItemDelAsync(dto));
 | 
	
	
		
			
				|  | @@ -12319,7 +12324,7 @@ WHERE
 | 
	
		
			
				|  |  |              if (dto.CurrUserId < 1) return Ok(JsonView(false, MsgTips.UserId));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            var info = await _enterExitCostQuoteRep.InfoAsync(new EnterExitCostQuoteInfoDto() { Id= dto.Id });
 | 
	
		
			
				|  |  | +            var info = await _enterExitCostQuoteRep.InfoAsync(new EnterExitCostQuoteInfoDto() { Id = dto.Id });
 | 
	
		
			
				|  |  |              if (info == null) return Ok(JsonView(false, "报价信息未填写!"));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              var rates = info.Rates;
 | 
	
	
		
			
				|  | @@ -12349,7 +12354,7 @@ WHERE
 | 
	
		
			
				|  |  |              designer.SetDataSource("IntTravelTitle", intTravelCosts.ItemName);
 | 
	
		
			
				|  |  |              if (intTravelCosts.Infos.Any())
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                var cabClassFilter = new string[] {"经济舱","公务舱","头等舱" };
 | 
	
		
			
				|  |  | +                var cabClassFilter = new string[] { "经济舱", "公务舱", "头等舱" };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  string label = string.Empty;
 | 
	
		
			
				|  |  |                  var infos = intTravelCosts.Infos.Where(x => cabClassFilter.Contains(x.FeeName)).ToArray();
 | 
	
	
		
			
				|  | @@ -19953,10 +19958,10 @@ ORDER by  gctggrc.id DESC
 | 
	
		
			
				|  |  |              builder.CellFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single;
 | 
	
		
			
				|  |  |              builder.CellFormat.Borders.LineWidth = 1;
 | 
	
		
			
				|  |  |              builder.CellFormat.Borders.Color = Color.FromArgb(183, 183, 183);
 | 
	
		
			
				|  |  | -            
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              table.FirstRow.FirstCell.CellFormat.Width = 20; // 单位为百分比
 | 
	
		
			
				|  |  |              builder.RowFormat.Height = 40;
 | 
	
		
			
				|  |  | -            builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center; 
 | 
	
		
			
				|  |  | +            builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
 | 
	
		
			
				|  |  |              builder.Font.Name = contentFont;
 | 
	
		
			
				|  |  |              builder.Font.Size = 12;
 | 
	
		
			
				|  |  |              builder.Font.Bold = true;
 | 
	
	
		
			
				|  | @@ -20056,12 +20061,12 @@ ORDER by  gctggrc.id DESC
 | 
	
		
			
				|  |  |              doc.FirstSection.HeadersFooters.Add(footer);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              Paragraph para = new Paragraph(doc);
 | 
	
		
			
				|  |  | -            para.ParagraphFormat.Alignment = ParagraphAlignment.Right; 
 | 
	
		
			
				|  |  | +            para.ParagraphFormat.Alignment = ParagraphAlignment.Right;
 | 
	
		
			
				|  |  |              footer.AppendChild(para);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              builder.MoveTo(para);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            string imagePath = "./Images/FMGJ_Log.png"; 
 | 
	
		
			
				|  |  | +            string imagePath = "./Images/FMGJ_Log.png";
 | 
	
		
			
				|  |  |              builder.InsertImage(imagePath);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              #endregion
 | 
	
	
		
			
				|  | @@ -20077,7 +20082,7 @@ ORDER by  gctggrc.id DESC
 | 
	
		
			
				|  |  |              return Ok(JsonView(true, "操作成功!", Url));
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        private void InvertedListFileDownloadSetRow(DocumentBuilder builder, string fontName, string dateTime,string content,string reamrk)
 | 
	
		
			
				|  |  | +        private void InvertedListFileDownloadSetRow(DocumentBuilder builder, string fontName, string dateTime, string content, string reamrk)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              var fontColor = Color.FromArgb(64, 64, 64);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -20100,7 +20105,7 @@ ORDER by  gctggrc.id DESC
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              builder.InsertCell();
 | 
	
		
			
				|  |  |              builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
 | 
	
		
			
				|  |  | -            builder.ParagraphFormat.Alignment = ParagraphAlignment.Left; 
 | 
	
		
			
				|  |  | +            builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
 | 
	
		
			
				|  |  |              builder.Font.Size = 9;
 | 
	
		
			
				|  |  |              builder.Font.Bold = false;
 | 
	
		
			
				|  |  |              builder.Font.Color = fontColor;
 | 
	
	
		
			
				|  | @@ -20108,7 +20113,7 @@ ORDER by  gctggrc.id DESC
 | 
	
		
			
				|  |  |              builder.EndRow();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        private void InvertedListFileDownloadSetBorders(CellCollection cell,int index)
 | 
	
		
			
				|  |  | +        private void InvertedListFileDownloadSetBorders(CellCollection cell, int index)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              cell[index].CellFormat.Borders.Top.LineStyle = Aspose.Words.LineStyle.None;
 | 
	
		
			
				|  |  |              cell[index].CellFormat.Borders.Bottom.LineStyle = Aspose.Words.LineStyle.None;
 | 
	
	
		
			
				|  | @@ -21557,6 +21562,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  var stay = "-";
 | 
	
		
			
				|  |  |                  var cityPath = "-";
 | 
	
		
			
				|  |  | +                var arriveCountry = string.Empty;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  //添加城市路径以及住宿地
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -21565,6 +21571,41 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 | 
	
		
			
				|  |  |                  var empty = "【未收入该三字码!请机票同事录入】";
 | 
	
		
			
				|  |  |                  string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +                #region 配置公务活动时间
 | 
	
		
			
				|  |  | +                List<Tuple<int, string, string>> Times = new List<Tuple<int, string, string>>();
 | 
	
		
			
				|  |  | +                Times.Add(new Tuple<int, string, string>(9, "9:00", "10:30"));
 | 
	
		
			
				|  |  | +                Times.Add(new Tuple<int, string, string>(11, "11:00", "12:00"));
 | 
	
		
			
				|  |  | +                Times.Add(new Tuple<int, string, string>(14, "14:00", "15:30"));
 | 
	
		
			
				|  |  | +                Times.Add(new Tuple<int, string, string>(16, "16:00", "17:00"));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                List<Tuple<DateTime, List<string>>> fallTimesCheckCountry = new List<Tuple<DateTime, List<string>>>()
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,6,0,0), new List<string>{"9:00-10:30","11:00-12:00","14:00-15:30","16:00-17:00" }),
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,8,30,0), new List<string>{"11:00-12:00","14:00-15:30","16:00-17:00"}),
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,11,30,0), new List<string>{"14:00-15:30","16:00-17:00"}),
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,13,30,0), new List<string>{"16:30-17:30"}),
 | 
	
		
			
				|  |  | +                };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                List<Tuple<DateTime, List<string>>> fallTimesNotCheckCountry = new List<Tuple<DateTime, List<string>>>()
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,7,0,0), new List<string>{"9:00-10:30","11:00-12:00","14:00-15:30","16:00-17:00" }),
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,9,0,0), new List<string>{"11:00-12:00","14:00-15:30","16:00-17:00"}),
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,11,30,0), new List<string>{"14:00-15:30","16:00-17:00"}),
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,14,30,0), new List<string>{"16:30-17:30"}),
 | 
	
		
			
				|  |  | +                };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                List<Tuple<DateTime, List<string>>> takeoffTimes = new List<Tuple<DateTime, List<string>>>()
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,18,0,0), new List<string>{"9:00-10:30","11:00-12:00", "14:00-15:30","16:00-17:00" }),
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,15,30,0), new List<string>{"9:00-10:30", "11:00-12:00", "14:00-15:00","15:00-16:00"}),
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,14,00,0), new List<string>{"9:00-10:30", "11:00-12:00",}),
 | 
	
		
			
				|  |  | +                    new Tuple<DateTime,  List<string>>(new DateTime(1900,1,1,12,00,0), new List<string>{"09:00-10:00"}),
 | 
	
		
			
				|  |  | +                };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                #endregion
 | 
	
		
			
				|  |  | +                var nextDayNum = 0;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                  for (int i = 0; i < timeArr.Count; i++)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  |                      stay = "-";
 | 
	
	
		
			
				|  | @@ -21577,11 +21618,10 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      var tbSelect = dtBlack.Select(string.Format("Day = '{0}'", NewData.ToString("yyyy-MM-dd")));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    List<Tuple<int, string, string>> Times = new List<Tuple<int, string, string>>();
 | 
	
		
			
				|  |  | -                    Times.Add(new Tuple<int, string, string>(9, "9:00", "10:30"));
 | 
	
		
			
				|  |  | -                    Times.Add(new Tuple<int, string, string>(11, "11:00", "12:00"));
 | 
	
		
			
				|  |  | -                    Times.Add(new Tuple<int, string, string>(14, "14:00", "15:30"));
 | 
	
		
			
				|  |  | -                    Times.Add(new Tuple<int, string, string>(16, "16:00", "17:00"));
 | 
	
		
			
				|  |  | +                    if (nextDayNum > 0)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        nextDayNum--;
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      if (tbSelect.Length > 0)
 | 
	
		
			
				|  |  |                      {
 | 
	
	
		
			
				|  | @@ -21590,19 +21630,28 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 | 
	
		
			
				|  |  |                          bool isTrade = false;
 | 
	
		
			
				|  |  |                          string trip = string.Empty;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                        var rowLast = tbSelect.Last();
 | 
	
		
			
				|  |  | -                        var rowFirst = tbSelect.First();
 | 
	
		
			
				|  |  | -                        var airStartTime = rowFirst["StartTime"].ToString() ?? "0000";
 | 
	
		
			
				|  |  | -                        var airEndTime = rowLast["EndTime"].ToString() ?? "0000";
 | 
	
		
			
				|  |  | -                        var takeOffTime = DateTime.Parse(timeArr[i]);
 | 
	
		
			
				|  |  | -                        var fallToTime = DateTime.Parse(timeArr[i]);
 | 
	
		
			
				|  |  | -                        takeOffTime = takeOffTime.AddHours(int.Parse(airStartTime.Substring(0, 2)));
 | 
	
		
			
				|  |  | -                        takeOffTime = takeOffTime.AddMinutes(int.Parse(airStartTime.Substring(2, 2)));
 | 
	
		
			
				|  |  | -                        fallToTime = fallToTime.AddHours(int.Parse(airEndTime.Substring(0, 2)));
 | 
	
		
			
				|  |  | -                        fallToTime = fallToTime.AddMinutes(int.Parse(airEndTime.Substring(2, 2)));
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                          foreach (var item in tbSelect)
 | 
	
		
			
				|  |  |                          {
 | 
	
		
			
				|  |  | +                            if (nextDayNum == 0)
 | 
	
		
			
				|  |  | +                            {
 | 
	
		
			
				|  |  | +                                nextDayNum = Convert.ToInt32(item["Sign"]);
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                            var airStartTime = item["StartTime"].ToString() ?? "0000";
 | 
	
		
			
				|  |  | +                            var airEndTime = item["EndTime"].ToString() ?? "0000";
 | 
	
		
			
				|  |  | +                            var takeOffTime = DateTime.Parse(timeArr[i]);
 | 
	
		
			
				|  |  | +                            var fallToTime = DateTime.Parse(timeArr[i]);
 | 
	
		
			
				|  |  | +                            takeOffTime = takeOffTime.AddHours(int.Parse(airStartTime.Substring(0, 2)));
 | 
	
		
			
				|  |  | +                            takeOffTime = takeOffTime.AddMinutes(int.Parse(airStartTime.Substring(2, 2)));
 | 
	
		
			
				|  |  | +                            fallToTime = fallToTime.AddHours(int.Parse(airEndTime.Substring(0, 2)));
 | 
	
		
			
				|  |  | +                            fallToTime = fallToTime.AddMinutes(int.Parse(airEndTime.Substring(2, 2)));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                            if (nextDayNum > 0)
 | 
	
		
			
				|  |  | +                            {
 | 
	
		
			
				|  |  | +                                fallToTime = fallToTime.AddDays(nextDayNum);
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                            trip = string.Empty;
 | 
	
		
			
				|  |  |                              var start = string.Empty;
 | 
	
		
			
				|  |  |                              var end = string.Empty;
 | 
	
		
			
				|  |  |                              var threeCode = item["Three"].ToString() ?? "";
 | 
	
	
		
			
				|  | @@ -21657,109 +21706,174 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 | 
	
		
			
				|  |  |                                  };
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                              //机型判断
 | 
	
		
			
				|  |  |                              string airModel = item["AirModel"].ToString();
 | 
	
		
			
				|  |  |                              airModel = GeneralMethod.GetLonger(airModel!.Substring(0, 1)) + airModel;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                              string flightTime = item["FlightTime"].ToString();
 | 
	
		
			
				|  |  | -                            if (flightTime!.Contains(":"))
 | 
	
		
			
				|  |  | -                            {
 | 
	
		
			
				|  |  | -                                flightTime = flightTime.Replace(":", "小时");
 | 
	
		
			
				|  |  | -                                flightTime += "分钟";
 | 
	
		
			
				|  |  | -                            }
 | 
	
		
			
				|  |  | -                            if (flightTime.Contains("H"))
 | 
	
		
			
				|  |  | -                            {
 | 
	
		
			
				|  |  | -                                flightTime = flightTime.Replace("H", "小时");
 | 
	
		
			
				|  |  | -                            }
 | 
	
		
			
				|  |  | -                            if (flightTime.Contains("M"))
 | 
	
		
			
				|  |  | -                            {
 | 
	
		
			
				|  |  | -                                flightTime = flightTime.Replace("M", "分钟");
 | 
	
		
			
				|  |  | -                            }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                            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 = ParseBlackTime(flightTime);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                              //航班号
 | 
	
		
			
				|  |  |                              string flightcode = item["Fliagtcode"].ToString();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                              var aircompany = _sqlSugar.Queryable<Res_AirCompany>().First(x => x.ShortCode.ToUpper() == flightcode!.Substring(0, 2).ToUpper() && x.IsDel == 0);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                              var hsEmpty = "【此航司" + flightcode!.Substring(0, 2).ToUpper() + "未收录,请机票同事录入】";
 | 
	
		
			
				|  |  |                              if (aircompany == null)
 | 
	
		
			
				|  |  |                              {
 | 
	
		
			
				|  |  |                                  aircompany = new Res_AirCompany
 | 
	
		
			
				|  |  | -                            {
 | 
	
		
			
				|  |  | +                                {
 | 
	
		
			
				|  |  |                                      CnName = hsEmpty,
 | 
	
		
			
				|  |  |                                      EnName = hsEmpty,
 | 
	
		
			
				|  |  |                                      ShortCode = hsEmpty,
 | 
	
		
			
				|  |  |                                  };
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                            //从成都天府国际机场搭乘四川航空公司3U3961飞往东京
 | 
	
		
			
				|  |  | -                            trip += $"从{start_Object.AirPort}搭乘{aircompany.CnName}{flightcode}飞往{end_Object.City}。\r\n({start_Object.AirPort}/{end_Object.AirPort}  机型:{airModel}  飞行时间{flightTime});\r\n";
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                            isTrade = Convert.ToBoolean(item["isTransitShipment"]);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                            if (isTrade)
 | 
	
		
			
				|  |  | +                            //航班前公务安排
 | 
	
		
			
				|  |  | +                            if (tbSelect.First().Equals(item) && i != 0)
 | 
	
		
			
				|  |  |                              {
 | 
	
		
			
				|  |  | -                                trip += $"抵达{end_Object.AirPort}{item["EndBuilding"].ToString().Trim()}航站楼(中转 行李直达)\r\n";
 | 
	
		
			
				|  |  | +                                foreach (var takeoff in takeoffTimes)
 | 
	
		
			
				|  |  | +                                {
 | 
	
		
			
				|  |  | +                                    var takeoffItem1 = NewData.AddHours(takeoff.Item1.Hour).AddMinutes(takeoff.Item1.Minute);
 | 
	
		
			
				|  |  | +                                    if (DateTime.Compare(takeOffTime, takeoffItem1) > 0)
 | 
	
		
			
				|  |  | +                                    {
 | 
	
		
			
				|  |  | +                                        foreach (var addTime in takeoff.Item2)
 | 
	
		
			
				|  |  | +                                        {
 | 
	
		
			
				|  |  | +                                            chiarr.Add(new Grp_ApprovalTravelDetails
 | 
	
		
			
				|  |  | +                                            {
 | 
	
		
			
				|  |  | +                                                Time = addTime,
 | 
	
		
			
				|  |  | +                                                CreateTime = DateTime.Now,
 | 
	
		
			
				|  |  | +                                                CreateUserId = dto.Userid,
 | 
	
		
			
				|  |  | +                                                ParentId = 0,
 | 
	
		
			
				|  |  | +                                                Details = "公务活动"
 | 
	
		
			
				|  |  | +                                            });
 | 
	
		
			
				|  |  | +                                        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                                        break;
 | 
	
		
			
				|  |  | +                                    }
 | 
	
		
			
				|  |  |                                  }
 | 
	
		
			
				|  |  | -                            else
 | 
	
		
			
				|  |  | -                            {
 | 
	
		
			
				|  |  | -                                trip += "\r\n"; //$"抵达{end_Object.AirPort}{item["EndBuilding"].ToString().Trim()}航站楼,办理入境手续,之后前往提取行李\r\n";
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | +                            //从成都天府国际机场搭乘四川航空公司3U3961飞往东京
 | 
	
		
			
				|  |  | +                            //trip += $"从{start_Object.AirPort}搭乘{aircompany.CnName}{flightcode}飞往{end_Object.City}。\r\n({start_Object.AirPort}/{end_Object.AirPort}  机型:{airModel}  飞行时间{flightTime});\r\n";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                        chiarr.Add(new Grp_ApprovalTravelDetails
 | 
	
		
			
				|  |  | -                        {
 | 
	
		
			
				|  |  | -                            Time = takeOffTime.ToString("HH:mm") + "-" + fallToTime.ToString("HH:mm"),
 | 
	
		
			
				|  |  | -                            CreateTime = DateTime.Now,
 | 
	
		
			
				|  |  | -                            CreateUserId = dto.Userid,
 | 
	
		
			
				|  |  | -                            ParentId = 0,
 | 
	
		
			
				|  |  | -                            Details = trip
 | 
	
		
			
				|  |  | -                        });
 | 
	
		
			
				|  |  | +                            //乘坐四川航空3U3901次航班由成都飞往加德满都,3小时25分钟
 | 
	
		
			
				|  |  | +                            trip += $"乘坐{aircompany.CnName}{flightcode}次航班由{start_Object.City}飞往{end_Object.City},{flightTime}";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +                            isTrade = Convert.ToBoolean(item["isTransitShipment"]);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                        //添加乘车语句
 | 
	
		
			
				|  |  | -                        chiarr.Add(new Grp_ApprovalTravelDetails
 | 
	
		
			
				|  |  | -                        {
 | 
	
		
			
				|  |  | -                            Time = (fallToTime.AddHours(2.5).ToString("HH:mm") + "-" + fallToTime.AddHours(3).ToString("HH:mm")),
 | 
	
		
			
				|  |  | -                            CreateTime = DateTime.Now,
 | 
	
		
			
				|  |  | -                            CreateUserId = dto.Userid,
 | 
	
		
			
				|  |  | -                            ParentId = 0,
 | 
	
		
			
				|  |  | -                            Details = "乘车前往市区(约xx公里,大约需要xx分钟)"
 | 
	
		
			
				|  |  | -                        });
 | 
	
		
			
				|  |  | +                            if (isTrade)
 | 
	
		
			
				|  |  | +                            {
 | 
	
		
			
				|  |  | +                                //trip += $"抵达{end_Object.AirPort}{item["EndBuilding"].ToString().Trim()}航站楼(中转 行李直达)\r\n";
 | 
	
		
			
				|  |  | +                                trip += "(转机不出机场)。";
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                            //else
 | 
	
		
			
				|  |  | +                            //{
 | 
	
		
			
				|  |  | +                            //    trip += "\r\n"; //$"抵达{end_Object.AirPort}{item["EndBuilding"].ToString().Trim()}航站楼,办理入境手续,之后前往提取行李\r\n";
 | 
	
		
			
				|  |  | +                            //}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                        if (i != timeArr.Count - 1)
 | 
	
		
			
				|  |  | -                        {
 | 
	
		
			
				|  |  | -                            fallToTime = fallToTime.AddHours(2.5);
 | 
	
		
			
				|  |  | +                            chiarr.Add(new Grp_ApprovalTravelDetails
 | 
	
		
			
				|  |  | +                            {
 | 
	
		
			
				|  |  | +                                Time = takeOffTime.ToString("HH:mm") + "-" + fallToTime.ToString("HH:mm"),
 | 
	
		
			
				|  |  | +                                CreateTime = DateTime.Now,
 | 
	
		
			
				|  |  | +                                CreateUserId = dto.Userid,
 | 
	
		
			
				|  |  | +                                ParentId = 0,
 | 
	
		
			
				|  |  | +                                Details = trip
 | 
	
		
			
				|  |  | +                            });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                            foreach (var item in Times)
 | 
	
		
			
				|  |  | +                            //最后一条到达的时间安排公务
 | 
	
		
			
				|  |  | +                            if (tbSelect.Last().Equals(item) && i != timeArr.Count - 1)
 | 
	
		
			
				|  |  |                              {
 | 
	
		
			
				|  |  | -                                //排列公务时间
 | 
	
		
			
				|  |  | -                                if (fallToTime.Hour < item.Item1)
 | 
	
		
			
				|  |  | +                                bool isCheckCountry = false;
 | 
	
		
			
				|  |  | +                                if (end_Object.Country != arriveCountry)
 | 
	
		
			
				|  |  | +                                {
 | 
	
		
			
				|  |  | +                                    arriveCountry = end_Object.Country;
 | 
	
		
			
				|  |  | +                                    isCheckCountry = true;
 | 
	
		
			
				|  |  | +                                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                                if (nextDayNum == 0)
 | 
	
		
			
				|  |  |                                  {
 | 
	
		
			
				|  |  | -                                    chiarr.Add(new Grp_ApprovalTravelDetails
 | 
	
		
			
				|  |  | +                                    //需要入境的情况
 | 
	
		
			
				|  |  | +                                    if (isCheckCountry)
 | 
	
		
			
				|  |  | +                                    {
 | 
	
		
			
				|  |  | +                                        foreach (var fallTime in fallTimesCheckCountry)
 | 
	
		
			
				|  |  | +                                        {
 | 
	
		
			
				|  |  | +                                            var fallTimeItem1 = NewData.AddHours(fallTime.Item1.Hour).AddMinutes(fallTime.Item1.Minute);
 | 
	
		
			
				|  |  | +                                            if (DateTime.Compare(fallToTime, fallTimeItem1) < 0)
 | 
	
		
			
				|  |  | +                                            {
 | 
	
		
			
				|  |  | +                                                foreach (var addTime in fallTime.Item2)
 | 
	
		
			
				|  |  | +                                                {
 | 
	
		
			
				|  |  | +                                                    chiarr.Add(new Grp_ApprovalTravelDetails
 | 
	
		
			
				|  |  | +                                                    {
 | 
	
		
			
				|  |  | +                                                        Time = addTime,
 | 
	
		
			
				|  |  | +                                                        CreateTime = DateTime.Now,
 | 
	
		
			
				|  |  | +                                                        CreateUserId = dto.Userid,
 | 
	
		
			
				|  |  | +                                                        ParentId = 0,
 | 
	
		
			
				|  |  | +                                                        Details = "公务活动"
 | 
	
		
			
				|  |  | +                                                    });
 | 
	
		
			
				|  |  | +                                                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                                                break;
 | 
	
		
			
				|  |  | +                                            }
 | 
	
		
			
				|  |  | +                                        }
 | 
	
		
			
				|  |  | +                                    }
 | 
	
		
			
				|  |  | +                                    else
 | 
	
		
			
				|  |  |                                      {
 | 
	
		
			
				|  |  | -                                        Time = $"{item.Item2} - {item.Item3}",
 | 
	
		
			
				|  |  | -                                        CreateTime = DateTime.Now,
 | 
	
		
			
				|  |  | -                                        CreateUserId = dto.Userid,
 | 
	
		
			
				|  |  | -                                        ParentId = 0,
 | 
	
		
			
				|  |  | -                                        Details = "公务活动"
 | 
	
		
			
				|  |  | -                                    });
 | 
	
		
			
				|  |  | +                                        foreach (var fallTime in fallTimesNotCheckCountry)
 | 
	
		
			
				|  |  | +                                        {
 | 
	
		
			
				|  |  | +                                            var fallTimeItem1 = NewData.AddHours(fallTime.Item1.Hour).AddMinutes(fallTime.Item1.Minute);
 | 
	
		
			
				|  |  | +                                            if (DateTime.Compare(fallToTime, fallTimeItem1) < 0)
 | 
	
		
			
				|  |  | +                                            {
 | 
	
		
			
				|  |  | +                                                foreach (var addTime in fallTime.Item2)
 | 
	
		
			
				|  |  | +                                                {
 | 
	
		
			
				|  |  | +                                                    chiarr.Add(new Grp_ApprovalTravelDetails
 | 
	
		
			
				|  |  | +                                                    {
 | 
	
		
			
				|  |  | +                                                        Time = addTime,
 | 
	
		
			
				|  |  | +                                                        CreateTime = DateTime.Now,
 | 
	
		
			
				|  |  | +                                                        CreateUserId = dto.Userid,
 | 
	
		
			
				|  |  | +                                                        ParentId = 0,
 | 
	
		
			
				|  |  | +                                                        Details = "公务活动"
 | 
	
		
			
				|  |  | +                                                    });
 | 
	
		
			
				|  |  | +                                                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                                                break;
 | 
	
		
			
				|  |  | +                                            }
 | 
	
		
			
				|  |  | +                                        }
 | 
	
		
			
				|  |  | +                                    }
 | 
	
		
			
				|  |  |                                  }
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                        //添加乘车语句
 | 
	
		
			
				|  |  | +                        //chiarr.Add(new Grp_ApprovalTravelDetails
 | 
	
		
			
				|  |  | +                        //{
 | 
	
		
			
				|  |  | +                        //    Time = (fallToTime.AddHours(2.5).ToString("HH:mm") + "-" + fallToTime.AddHours(3).ToString("HH:mm")),
 | 
	
		
			
				|  |  | +                        //    CreateTime = DateTime.Now,
 | 
	
		
			
				|  |  | +                        //    CreateUserId = dto.Userid,
 | 
	
		
			
				|  |  | +                        //    ParentId = 0,
 | 
	
		
			
				|  |  | +                        //    Details = "乘车前往市区(约xx公里,大约需要xx分钟)"
 | 
	
		
			
				|  |  | +                        //});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                        //if (i != timeArr.Count - 1)
 | 
	
		
			
				|  |  | +                        //{
 | 
	
		
			
				|  |  | +                        //    fallToTime = fallToTime.AddHours(2.5);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                        //    foreach (var item in Times)
 | 
	
		
			
				|  |  | +                        //    {
 | 
	
		
			
				|  |  | +                        //        //排列公务时间
 | 
	
		
			
				|  |  | +                        //        if (fallToTime.Hour < item.Item1)
 | 
	
		
			
				|  |  | +                        //        {
 | 
	
		
			
				|  |  | +                        //            chiarr.Add(new Grp_ApprovalTravelDetails
 | 
	
		
			
				|  |  | +                        //            {
 | 
	
		
			
				|  |  | +                        //                Time = $"{item.Item2} - {item.Item3}",
 | 
	
		
			
				|  |  | +                        //                CreateTime = DateTime.Now,
 | 
	
		
			
				|  |  | +                        //                CreateUserId = dto.Userid,
 | 
	
		
			
				|  |  | +                        //                ParentId = 0,
 | 
	
		
			
				|  |  | +                        //                Details = "公务活动"
 | 
	
		
			
				|  |  | +                        //            });
 | 
	
		
			
				|  |  | +                        //        }
 | 
	
		
			
				|  |  | +                        //    }
 | 
	
		
			
				|  |  | +                        //}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |                          var threeCodeList = _threeCodeRepository.QueryThreeCodeArray(threeCodeStr);
 | 
	
		
			
				|  |  |                          var last = threeCodeStr.Last();
 | 
	
		
			
				|  |  |                          foreach (var item in threeCodeStr)
 | 
	
	
		
			
				|  | @@ -21792,7 +21906,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      string week = Day[Convert.ToInt32(NewData.DayOfWeek.ToString("d"))].ToString();
 | 
	
		
			
				|  |  |                      Grp_ApprovalTravel appro = new Grp_ApprovalTravel();
 | 
	
		
			
				|  |  | -                    appro.Date =  NewData.Month + "月" + NewData.Day + "日(" + week + ")"+ "第" + intToString(i + 1) + "天 ";
 | 
	
		
			
				|  |  | +                    appro.Date = NewData.Month + "月" + NewData.Day + "日(" + week + ")" + "第" + intToString(i + 1) + "天 ";
 | 
	
		
			
				|  |  |                      appro.Diid = dto.Diid;
 | 
	
		
			
				|  |  |                      appro.CreateUserId = dto.Userid;
 | 
	
		
			
				|  |  |                      appro.CreateTime = DateTime.Now;
 | 
	
	
		
			
				|  | @@ -21864,15 +21978,15 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              //模板路径
 | 
	
		
			
				|  |  | -            string tempPath = AppSettingsHelper.Get("WordBasePath")+ "Template/";
 | 
	
		
			
				|  |  | +            string tempPath = AppSettingsHelper.Get("WordBasePath") + "Template/";
 | 
	
		
			
				|  |  |              var fileName = string.Empty;
 | 
	
		
			
				|  |  | -            string titleFont = string.Empty,timeFont = string.Empty, contentFont = string.Empty;
 | 
	
		
			
				|  |  | +            string titleFont = string.Empty, timeFont = string.Empty, contentFont = string.Empty;
 | 
	
		
			
				|  |  |              bool bold = false;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              if (dto.FileIndex == 1)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  fileName = "公务行程导出模板.docx"; //"C:\\Server\\File\\OA2023\\Office\\Word\\Template/公务行程导出模板.docx"
 | 
	
		
			
				|  |  | -            } 
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |              else if (dto.FileIndex == 2)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  fileName = "省外办-报批.docx";
 | 
	
	
		
			
				|  | @@ -21919,7 +22033,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,titleFont,bold);
 | 
	
		
			
				|  |  | +                SetCells(tableOne, doc, SetIndex, 0, textTime, titleFont, bold);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  SetIndex++;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -21944,8 +22058,8 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 | 
	
		
			
				|  |  |                              CenterRowClone = (Aspose.Words.Tables.Row)tableOne.Rows[1].Clone(true);
 | 
	
		
			
				|  |  |                              tableOne.AppendChild(CenterRowClone);
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                        SetCells(tableOne, doc, SetIndex, 0, txtTime,timeFont,bold);
 | 
	
		
			
				|  |  | -                        SetCells(tableOne, doc, SetIndex, 1, txtDetail,contentFont, bold);
 | 
	
		
			
				|  |  | +                        SetCells(tableOne, doc, SetIndex, 0, txtTime, timeFont, bold);
 | 
	
		
			
				|  |  | +                        SetCells(tableOne, doc, SetIndex, 1, txtDetail, contentFont, bold);
 | 
	
		
			
				|  |  |                          indexChi++;
 | 
	
		
			
				|  |  |                          SetIndex++;
 | 
	
		
			
				|  |  |                      }
 | 
	
	
		
			
				|  | @@ -21966,13 +22080,45 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              string strFileName = "/Travel/ExportApprovalJourneyWord/" + group.TeamName + fileName;
 | 
	
		
			
				|  |  | -            doc.Save(AppSettingsHelper.Get("WordBasePath") + strFileName,Aspose.Words.SaveFormat.Docx);  //"C:\\Server\\File\\OA2023\\Office\\Word" + strFileName
 | 
	
		
			
				|  |  | +            doc.Save(AppSettingsHelper.Get("WordBasePath") + strFileName, Aspose.Words.SaveFormat.Docx);  //"C:\\Server\\File\\OA2023\\Office\\Word" + strFileName
 | 
	
		
			
				|  |  |              jw.Data = AppSettingsHelper.Get("WordBaseUrl") + AppSettingsHelper.Get("WordFtpPath") + strFileName;  //"C:\\Server\\File\\OA2023\\Office\\Word" + strFileName
 | 
	
		
			
				|  |  |              jw.Code = 200;
 | 
	
		
			
				|  |  |              jw.Msg = "";
 | 
	
		
			
				|  |  |              return Ok(jw);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        private string ParseBlackTime(string time)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            // 匹配可能只有分钟的情况
 | 
	
		
			
				|  |  | +            string pattern = @"(?:(\d+)H)?(?:(\d+)M)?";
 | 
	
		
			
				|  |  | +            System.Text.RegularExpressions.Match match = Regex.Match(time, pattern);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            if (match.Success)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                string hours = match.Groups[1].Value;
 | 
	
		
			
				|  |  | +                string minutes = match.Groups[2].Value;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                // 如果小时部分为空,则只显示分钟
 | 
	
		
			
				|  |  | +                if (string.IsNullOrEmpty(hours))
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    return $"{minutes}分钟";
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                // 如果分钟部分为空,则只显示小时
 | 
	
		
			
				|  |  | +                else if (string.IsNullOrEmpty(minutes))
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    return $"{hours}小时";
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                // 否则显示完整格式
 | 
	
		
			
				|  |  | +                else
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    return $"{hours}小时{minutes}分钟";
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return "未知时长";
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          private string intToString(int numberVal)
 | 
	
		
			
				|  |  |          {
 | 
	
	
		
			
				|  | @@ -22012,7 +22158,7 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
 | 
	
		
			
				|  |  |              return stringNumberVal;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        private void SetCells(Aspose.Words.Tables.Table table, Document doc, int rows, int cells, string val,string font ,bool bold)
 | 
	
		
			
				|  |  | +        private void SetCells(Aspose.Words.Tables.Table table, Document doc, int rows, int cells, string val, string font, bool bold)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              //获取table中的某个单元格,从0开始
 | 
	
		
			
				|  |  |              Cell lshCell = table.Rows[rows].Cells[cells];
 |