|
@@ -4,8 +4,10 @@ using Aspose.Words.Drawing;
|
|
|
using Aspose.Words.Tables;
|
|
|
using DiffMatchPatch;
|
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
+using Microsoft.IdentityModel.Tokens;
|
|
|
using Microsoft.VisualBasic;
|
|
|
using MySqlX.XDevAPI.Relational;
|
|
|
+using NetTaste;
|
|
|
using NPOI.HSSF.UserModel;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
using NPOI.SS.UserModel;
|
|
@@ -31,11 +33,13 @@ using OASystem.Domain.Entities.Groups;
|
|
|
using OASystem.Domain.ViewModels.Financial;
|
|
|
using OASystem.Domain.ViewModels.Groups;
|
|
|
using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
|
+using OASystem.Domain.ViewModels.Statistics;
|
|
|
using OASystem.Infrastructure.Repositories.CRM;
|
|
|
using OASystem.Infrastructure.Repositories.Financial;
|
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
|
using OASystem.Infrastructure.Tools;
|
|
|
using Org.BouncyCastle.Crypto;
|
|
|
+using Org.BouncyCastle.Utilities;
|
|
|
using Quartz.Util;
|
|
|
using SqlSugar.Extensions;
|
|
|
using System.Collections;
|
|
@@ -44,6 +48,8 @@ using System.Diagnostics;
|
|
|
using System.Globalization;
|
|
|
using System.IO.Compression;
|
|
|
using System.Text.Json;
|
|
|
+using System.Web;
|
|
|
+using System.Xml.Linq;
|
|
|
using TencentCloud.Ocr.V20181119.Models;
|
|
|
using static OASystem.API.OAMethodLib.JWTHelper;
|
|
|
using static OASystem.Infrastructure.Repositories.Groups.AirTicketResRepository;
|
|
@@ -420,17 +426,27 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> CityByCountry(string countryLabel)
|
|
|
{
|
|
|
+
|
|
|
+ countryLabel=HttpUtility.UrlDecode(countryLabel);
|
|
|
var countryList = countryLabel.Split(',', StringSplitOptions.RemoveEmptyEntries).ToArray();
|
|
|
var citys = Array.Empty<string?>();
|
|
|
if (countryList.Any())
|
|
|
{
|
|
|
var cityDatas = await _sqlSugar
|
|
|
.Queryable<Grp_NationalTravelFee>()
|
|
|
- .Where(x => x.IsDel == 0 && countryList.Contains(x.Country) && !string.IsNullOrEmpty(x.City) && !x.City.Contains("城市"))
|
|
|
- .Select(x => new { x.Country,x.City })
|
|
|
- .OrderBy(x => x.Country)
|
|
|
+ .Where(x => x.IsDel == 0 && countryList.Contains(x.Country) && !string.IsNullOrEmpty(x.City))
|
|
|
.ToArrayAsync();
|
|
|
- citys = cityDatas.Select(x => x.City).ToArray();
|
|
|
+
|
|
|
+ foreach (var item in cityDatas)
|
|
|
+ {
|
|
|
+ if (item.City.Contains("城市"))
|
|
|
+ {
|
|
|
+ item.City = item.Country + "-所有城市";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var cityDatas1 = cityDatas.OrderBy(x => x.Country);
|
|
|
+
|
|
|
+ citys = cityDatas1.Select(x => x.City).Distinct().ToArray();
|
|
|
}
|
|
|
|
|
|
return Ok(JsonView(citys));
|
|
@@ -461,6 +477,80 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(await _grpOrderPreInfoRep.OpAsync(dto));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 团组前期信息 文件下载
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id">Id</param>
|
|
|
+ /// <param name="tempId">Id</param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet("{id}/{tempId}")]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> GroupOrderPreInfoFileDownload(int id, int tempId = 1404)
|
|
|
+ {
|
|
|
+ var view = await _grpOrderPreInfoRep.InfoAsync(id, tempId);
|
|
|
+
|
|
|
+ var data = view.Data as GrpOrderPreInfoView;
|
|
|
+
|
|
|
+ #region Excel
|
|
|
+ var tempPath = AppSettingsHelper.Get("ExcelTempPath");
|
|
|
+ var servicePath = AppSettingsHelper.Get("GrpFileBaseUrl");
|
|
|
+ var savePath = AppSettingsHelper.Get("ExcelBasePath") + "GroupOrderPreInfo/";
|
|
|
+ var ftpPath = AppSettingsHelper.Get("ExcelFtpPath") + "GroupOrderPreInfo/";
|
|
|
+ var fileNamePrefix = string.Empty;
|
|
|
+
|
|
|
+ if (tempId == 1405)
|
|
|
+ {
|
|
|
+ tempPath += $"无商邀版Temp.xlsx";
|
|
|
+ fileNamePrefix = $"{data.Name}_无商邀版";
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (tempId == 1406)
|
|
|
+ {
|
|
|
+ tempPath += $"有商邀版Temp.xlsx";
|
|
|
+ fileNamePrefix = $"{data.Name}_有商邀版";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //tempId == 1404 默认下载
|
|
|
+ tempPath += $"前期需客户提供信息_单接送机Temp.xlsx";
|
|
|
+ fileNamePrefix = $"{data.Name}_单接送机";
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (var item in data.Items)
|
|
|
+ {
|
|
|
+ var obj = item.NewValue;
|
|
|
+ if (obj is bool || obj is bool?)
|
|
|
+ {
|
|
|
+ if ((bool)obj == true) item.OriginVal = "是";
|
|
|
+ else item.OriginVal = "否";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var fileName = $"{fileNamePrefix}{CommonFun.GUID}.xlsx";
|
|
|
+
|
|
|
+ fileName = CommonFun.ValidFileName(fileName);
|
|
|
+
|
|
|
+ //载入模板
|
|
|
+ WorkbookDesigner designer = new WorkbookDesigner();
|
|
|
+ designer.Workbook = new Workbook(tempPath);
|
|
|
+ designer.SetDataSource("View", data.Items);
|
|
|
+ designer.Process();
|
|
|
+
|
|
|
+ if (!Directory.Exists(savePath))
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(savePath);
|
|
|
+ }
|
|
|
+
|
|
|
+ string serverPath = $"{savePath}{fileName}";
|
|
|
+ designer.Workbook.Save(serverPath);
|
|
|
+ string rst = $"{servicePath}{ftpPath}{fileName}";
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return Ok(JsonView(new { url = rst }));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 团组基本信息
|
|
@@ -5687,7 +5777,6 @@ FROM
|
|
|
peiceItemCurrencyInfos = enterExitCostCurrencys.Where(x => peiceItemCurrencys.Contains(x.CurrencyCode)).ToList();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
var _CurrDatas = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0 && it.STid == 66).ToList();
|
|
|
var _DelegationInfo = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(it => it.IsDel == 0 && it.Id == dto.DiId).First();
|
|
|
var DeleClientList = _sqlSugar.Queryable<Grp_TourClientList>()
|