|
@@ -29,11 +29,13 @@ using OASystem.Domain.ViewModels.Groups;
|
|
using OASystem.Domain.ViewModels.Statistics;
|
|
using OASystem.Domain.ViewModels.Statistics;
|
|
using OASystem.Infrastructure.Repositories.Financial;
|
|
using OASystem.Infrastructure.Repositories.Financial;
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
|
|
+using OfficeOpenXml;
|
|
using Quartz.Util;
|
|
using Quartz.Util;
|
|
using SqlSugar;
|
|
using SqlSugar;
|
|
using SqlSugar.Extensions;
|
|
using SqlSugar.Extensions;
|
|
using System.Collections;
|
|
using System.Collections;
|
|
using System.Data;
|
|
using System.Data;
|
|
|
|
+using System.Data.OleDb;
|
|
using System.Diagnostics;
|
|
using System.Diagnostics;
|
|
using System.Globalization;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.IO;
|
|
@@ -3555,7 +3557,6 @@ FROM
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
public async Task<IActionResult> DecreasePaymentsSelect(DecreasePaymentsDto dto)
|
|
public async Task<IActionResult> DecreasePaymentsSelect(DecreasePaymentsDto dto)
|
|
{
|
|
{
|
|
-
|
|
|
|
#region 参数验证
|
|
#region 参数验证
|
|
|
|
|
|
if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数!"));
|
|
if (dto.UserId < 1) return Ok(JsonView(false, "请传入有效的UserId参数!"));
|
|
@@ -3646,7 +3647,6 @@ FROM
|
|
if (dto.Id < 1) return Ok(JsonView(false, "请传入有效的数据Id!"));
|
|
if (dto.Id < 1) return Ok(JsonView(false, "请传入有效的数据Id!"));
|
|
|
|
|
|
return Ok(await _decreasePaymentsRep.QueryDecreasePaymentsById(dto));
|
|
return Ok(await _decreasePaymentsRep.QueryDecreasePaymentsById(dto));
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -3678,6 +3678,129 @@ FROM
|
|
return Ok(jw);
|
|
return Ok(jw);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ [HttpPost]
|
|
|
|
+ public async Task<IActionResult> DecreasePaymentsOTAMate(IFormFile file)
|
|
|
|
+ {
|
|
|
|
+ if (file.Length < 1) return Ok(JsonView(false, "请上传文件!"));
|
|
|
|
+
|
|
|
|
+ string fileName = file.FileName;
|
|
|
|
+ if (!fileName.EndsWith(".xlsx") && !fileName.EndsWith(".xls"))
|
|
|
|
+ {
|
|
|
|
+ return Ok(JsonView(false, "请上传Excel文件!"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ var path = @$"{AppSettingsHelper.Get("GrpFileBasePath")}团组增减款项相关文件/团组其他款项(OTA)";
|
|
|
|
+ if (!Directory.Exists(path))
|
|
|
|
+ {
|
|
|
|
+ Directory.CreateDirectory(path);
|
|
|
|
+ }
|
|
|
|
+ var filePath = @$"{path}/{fileName}";
|
|
|
|
+
|
|
|
|
+ using (FileStream fs = System.IO.File.Create(filePath))
|
|
|
|
+ {
|
|
|
|
+ file.CopyTo(fs);
|
|
|
|
+ fs.Flush();
|
|
|
|
+ }
|
|
|
|
+ if (!System.IO.File.Exists(filePath)) return Ok(JsonView(false, "文件不存在!"));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ DataTable dt = ExcelToDataTable(filePath);
|
|
|
|
+ if (dt == null) return Ok(JsonView(false, $"您上传的Excel工作表没有内容,请检查!!!"));
|
|
|
|
+ dt.TableName = "TB";
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ dt.Columns[0].ColumnName = "OTAOrderNo";
|
|
|
|
+ dt.Columns[1].ColumnName = "PackageName";
|
|
|
|
+ dt.Columns[2].ColumnName = "IsPay";
|
|
|
|
+ dt.Columns[3].ColumnName = "IsShipments";
|
|
|
|
+ dt.Columns[4].ColumnName = "IsSendBack";
|
|
|
|
+ dt.Columns[5].ColumnName = "OrderTime";
|
|
|
|
+ dt.Columns[6].ColumnName = "UseTime";
|
|
|
|
+ dt.Columns[7].ColumnName = "Quantity";
|
|
|
|
+ dt.Columns[8].ColumnName = "Days";
|
|
|
|
+ dt.Columns[9].ColumnName = "QuantityShipped";
|
|
|
|
+ dt.Columns[9].ColumnName = "TotalPrice";
|
|
|
|
+ dt.Columns[9].ColumnName = "GroupName";
|
|
|
|
+ dt.Columns[9].ColumnName = "OATotalPrice";
|
|
|
|
+
|
|
|
|
+ var otaOrderNos = new List<string>();
|
|
|
|
+ foreach (DataRow item in dt.Rows)
|
|
|
|
+ {
|
|
|
|
+ otaOrderNos.Add(item["OTAOrderNo"].ToString());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var oaDatas = await _sqlSugar.Queryable<Grp_DecreasePayments>()
|
|
|
|
+ .LeftJoin<Grp_DelegationInfo>((dp, di) => dp.DiId == di.Id)
|
|
|
|
+ .Where((dp, di) => dp.IsDel == 0 && dp.PriceName.Contains("wifi") || otaOrderNos.Contains(dp.OTAOrderNo))
|
|
|
|
+ .Select((dp, di) => new
|
|
|
|
+ {
|
|
|
|
+ dp.PriceName,
|
|
|
|
+ dp.OTAOrderNo,
|
|
|
|
+ dp.FeeTotal,
|
|
|
|
+ di.TeamName,
|
|
|
|
+ })
|
|
|
|
+ .ToListAsync();
|
|
|
|
+
|
|
|
|
+ foreach (DataRow item in dt.Rows)
|
|
|
|
+ {
|
|
|
|
+ var otaOrderNo = item["OTAOrderNo"].ToString();
|
|
|
|
+ var oaData = oaDatas.Find(x => x.OTAOrderNo.Contains(otaOrderNo));
|
|
|
|
+ if (oaData == null) continue;
|
|
|
|
+
|
|
|
|
+ item["GroupName"] = oaData.TeamName;
|
|
|
|
+ item["OATotalPrice"] = oaData.FeeTotal.ToString("#0.00");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ string fileName1 = $"OTA_WIFI费用{DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";
|
|
|
|
+ Dictionary<string, object> pairs = new Dictionary<string, object>();
|
|
|
|
+ List<DataTable> datas = new List<DataTable>();
|
|
|
|
+ datas.Add(dt);
|
|
|
|
+ url = AsposeHelper.ExpertExcelToModel("信用卡对账模板-美元卡.xls", $"CreditCardBill", fileName1, pairs, datas);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return Ok(JsonView(true));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ #region
|
|
|
|
+ private DataTable ExcelToDataTable(string filePath)
|
|
|
|
+ {
|
|
|
|
+ DataTable dataTable = new DataTable();
|
|
|
|
+ using (var package = new ExcelPackage(new FileInfo(filePath)))
|
|
|
|
+ {
|
|
|
|
+ ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
|
|
|
+ ExcelWorksheet worksheet = package.Workbook.Worksheets.First();
|
|
|
|
+ int rowCount = worksheet.Dimension.Rows;
|
|
|
|
+ int colCount = worksheet.Dimension.Columns;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (int col = 1; col <= colCount; col++)
|
|
|
|
+ {
|
|
|
|
+ dataTable.Columns.Add(worksheet.Cells[1, col].Value.ToString());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (int row = 2; row <= rowCount; row++)
|
|
|
|
+ {
|
|
|
|
+ DataRow dataRow = dataTable.NewRow();
|
|
|
|
+ for (int col = 1; col <= colCount; col++)
|
|
|
|
+ {
|
|
|
|
+ dataRow[col - 1] = worksheet.Cells[row, col].Value;
|
|
|
|
+ }
|
|
|
|
+ dataTable.Rows.Add(dataRow);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return dataTable;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 文件上传、删除
|
|
#region 文件上传、删除
|
|
@@ -15397,7 +15520,6 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
|
|
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
-
|
|
|
|
#region 团组接待意见调查 Grp_ReceptionOpinionSurvey
|
|
#region 团组接待意见调查 Grp_ReceptionOpinionSurvey
|
|
|
|
|
|
|
|
|
|
@@ -15434,15 +15556,6 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
|
|
if (groupId < 1) Ok(JsonView(false,"请传入有效的diId"));
|
|
if (groupId < 1) Ok(JsonView(false,"请传入有效的diId"));
|
|
|
|
|
|
var data = await _opinionaireRep.Query(x => x.DiId == groupId)
|
|
var data = await _opinionaireRep.Query(x => x.DiId == groupId)
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
.Select(x => new
|
|
.Select(x => new
|
|
{
|
|
{
|
|
x.Id,
|
|
x.Id,
|
|
@@ -15523,6 +15636,30 @@ And (UnitName != '' Or UnitName != null) {sqlWhere}");
|
|
return Ok(JsonView("操作成功!"));
|
|
return Ok(JsonView("操作成功!"));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ [HttpDelete("{diId}")]
|
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
|
+ public async Task<IActionResult> OpinionaireUserList(int diId)
|
|
|
|
+ {
|
|
|
|
+ if (diId < 1) Ok(JsonView(false, "请传入有效的diId"));
|
|
|
|
+
|
|
|
|
+ var data = await _opinionaireRep.Query(x => x.DiId == diId)
|
|
|
|
+ .Select(x => new {
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ .ToListAsync();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return Ok(JsonView(data));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
|