|
@@ -73,6 +73,7 @@ using OASystem.Domain.ViewModels.Statistics;
|
|
|
using NPOI.XSSF.Model;
|
|
|
using NetTaste;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
+using EyeSoft.Collections.Generic;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
@@ -3038,6 +3039,35 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 查询供应商名称
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ public IActionResult QueryAssociateSupplier(AssociateSupplierDto dto)
|
|
|
+ {
|
|
|
+ var dbResult = _sqlSugar.Queryable<Grp_DecreasePayments>()
|
|
|
+ .Where(x => x.SupplierName.Contains(dto.param) && x.IsDel == 0).ToList()
|
|
|
+ ?? new List<Grp_DecreasePayments>();
|
|
|
+ dbResult = dbResult.Distinct(new
|
|
|
+ ProductComparer ()).ToList();
|
|
|
+
|
|
|
+ var jw = JsonView(true, "success", dbResult.OrderByDescending(x=>x. Id ).Select(x => new
|
|
|
+ {
|
|
|
+ x.Id,
|
|
|
+ x.SupplierAddress,
|
|
|
+ x.SupplierArea,
|
|
|
+ x.SupplierContact,
|
|
|
+ x.SupplierContactNumber,
|
|
|
+ x.SupplierEmail,
|
|
|
+ x.SupplierName,
|
|
|
+ x.SupplierSocialAccount,
|
|
|
+ x.SupplierTypeId,
|
|
|
+ }).ToList());
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 文件上传、删除
|
|
@@ -3724,29 +3754,30 @@ namespace OASystem.API.Controllers
|
|
|
//默认币种显示
|
|
|
List<CurrencyInfo> _currencyInfos = new List<CurrencyInfo>()
|
|
|
{
|
|
|
- new CurrencyInfo (){ CurrencyCode="USD",CurrencyName = "美元",Rate = 0.0000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="EUR",CurrencyName = "欧元",Rate = 0.0000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="GBP",CurrencyName = "英镑",Rate = 0.0000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="JPY",CurrencyName = "日元",Rate = 0.0000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="HKD",CurrencyName = "港币",Rate = 0.0000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="USD",CurrencyName = "美元",Rate = 7.5000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="EUR",CurrencyName = "欧元",Rate = 8.0000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="GBP",CurrencyName = "英镑",Rate = 9.5000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="JPY",CurrencyName = "日元",Rate = 0.0500M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="HKD",CurrencyName = "港币",Rate = 0.9500M },
|
|
|
|
|
|
};
|
|
|
|
|
|
var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
|
|
|
if (_currencyRate.Count > 0)
|
|
|
{
|
|
|
-
|
|
|
foreach (var item in _currencyInfos)
|
|
|
{
|
|
|
var rateInfo = _currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
|
|
|
if (rateInfo != null)
|
|
|
{
|
|
|
- item.Rate = Convert.ToDecimal(rateInfo.FSellPri) / 100.00M;
|
|
|
+ decimal rate1 = Convert.ToDecimal(rateInfo.FSellPri) / 100.00M;
|
|
|
+ rate1 *= 1.03M;
|
|
|
+
|
|
|
+ item.Rate = Convert.ToDecimal(rate1.ToString("#0.00")) + 0.01M;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
return Ok(JsonView(true, "查询成功!", new
|
|
|
{
|
|
|
GroupNameData = groupNameData.Data,
|
|
@@ -3779,11 +3810,11 @@ namespace OASystem.API.Controllers
|
|
|
//默认币种显示
|
|
|
List<CurrencyInfo> _currencyInfos = new List<CurrencyInfo>()
|
|
|
{
|
|
|
- new CurrencyInfo (){ CurrencyCode="USD",CurrencyName = "美元",Rate = 0.0000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="EUR",CurrencyName = "欧元",Rate = 0.0000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="GBP",CurrencyName = "英镑",Rate = 0.0000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="JPY",CurrencyName = "日元",Rate = 0.0000M },
|
|
|
- new CurrencyInfo (){ CurrencyCode="HKD",CurrencyName = "港币",Rate = 0.0000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="USD",CurrencyName = "美元",Rate = 7.5000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="EUR",CurrencyName = "欧元",Rate = 8.0000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="GBP",CurrencyName = "英镑",Rate = 9.5000M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="JPY",CurrencyName = "日元",Rate = 0.0500M },
|
|
|
+ new CurrencyInfo (){ CurrencyCode="HKD",CurrencyName = "港币",Rate = 0.9500M },
|
|
|
};
|
|
|
|
|
|
var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
|
|
@@ -3796,11 +3827,17 @@ namespace OASystem.API.Controllers
|
|
|
if (rateInfo != null)
|
|
|
{
|
|
|
item.Rate = Convert.ToDecimal((Convert.ToDecimal(rateInfo.FSellPri == null ? 0.00M : rateInfo.FSellPri) / 100.00M).ToString("#0.0000"));
|
|
|
+
|
|
|
+ decimal rate1 = item.Rate;
|
|
|
+ rate1 *= 1.03M;
|
|
|
+
|
|
|
+ decimal rate2 = Convert.ToDecimal(rate1.ToString("#0.00")) + 0.01M;
|
|
|
+
|
|
|
reteInfos.Add(new
|
|
|
{
|
|
|
currCode = item.CurrencyCode,
|
|
|
currName = item.CurrencyName,
|
|
|
- rate = item.Rate,
|
|
|
+ rate = rate2,
|
|
|
lastUpdateDt = rateInfo.Date + " " + rateInfo.Time
|
|
|
});
|
|
|
}
|
|
@@ -5819,7 +5856,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- jw.Msg = "城市数据未空!";
|
|
|
+ jw.Msg = "城市数据为空!";
|
|
|
jw.Data = new string[0];
|
|
|
}
|
|
|
|
|
@@ -6354,11 +6391,12 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
}
|
|
|
string path = savePath + Find.TeamName + "出访日程.docx";
|
|
|
+ string ftpPath = AppSettingsHelper.Get("WordBaseUrl") + AppSettingsHelper.Get("WordFtpPath") + "Travel/export/" + Find.TeamName + "出访日程.docx";
|
|
|
|
|
|
try
|
|
|
{
|
|
|
doc.Save(path, Aspose.Words.SaveFormat.Doc);
|
|
|
- jw = JsonView(true, "导出成功", path);
|
|
|
+ jw = JsonView(true, "导出成功", ftpPath);
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
@@ -7136,6 +7174,8 @@ 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;
|
|
|
+
|
|
|
return Ok(JsonView(new
|
|
|
{
|
|
|
groupList,
|
|
@@ -7151,7 +7191,8 @@ namespace OASystem.API.Controllers
|
|
|
x.Id,
|
|
|
}).ToList(),
|
|
|
baoPi = _GroupCostParameterRepository.GetBaoPi(diid),
|
|
|
- blackCodeIsTrue = create.Code == 0 ? true : false
|
|
|
+ blackCodeIsTrue = create.Code == 0 ? true : false,
|
|
|
+ hotelIsTrue = hotelIsTrue,
|
|
|
})) ;
|
|
|
}
|
|
|
|
|
@@ -9019,6 +9060,164 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(jw);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 成本获取OP历史车费用
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ public async Task<IActionResult> GetHistoryCarData(HistoryCarDataDto dto)
|
|
|
+ {
|
|
|
+ var jw = JsonView(false);
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+ List<HistoryCarDataView> dbResult = new List<HistoryCarDataView>();
|
|
|
+ //获取现有所有车的数据
|
|
|
+ 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
|
|
|
+FROM Grp_CarTouristGuideGroundReservationsContent gctggrc inner join Grp_CarTouristGuideGroundReservations gctggr on
|
|
|
+gctggrc.CTGGRId = gctggr.Id inner JOIN Grp_DelegationInfo gdi on gctggr.DiId = gdi.Id LEFT JOIN Sys_SetData ssd on ssd.Id = gctggr.PriceType
|
|
|
+WHERE gctggr.IsDel = 0 and gctggrc.SId = 91 AND gdi.IsDel = 0 AND gctggrc.Price != 0 AND (ssd.Id in (1061,1069) or ssd.Id is NULL) AND gctggr.ServiceStartTime is not null
|
|
|
+AND gctggr.ServiceEndTime is not NULL
|
|
|
+ORDER by gctggrc.id DESC
|
|
|
+";
|
|
|
+
|
|
|
+ dbResult = await _sqlSugar.SqlQueryable<HistoryCarDataView>(sql).ToListAsync();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var numeberResult = await Task.Run(() =>
|
|
|
+ {
|
|
|
+ var numberArr = dbResult.Where(x => int.TryParse(x.Area, out int number)).ToList();
|
|
|
+ _ = dbResult.RemoveAll(x => int.TryParse(x.Area, out int number));
|
|
|
+ return numberArr;
|
|
|
+ });
|
|
|
+
|
|
|
+ var cityArr = await _sqlSugar.Queryable<Grp_NationalTravelFee>().ToListAsync();
|
|
|
+
|
|
|
+ foreach (var item in numeberResult)
|
|
|
+ {
|
|
|
+ var find = cityArr.Find(x => x.Id == int.Parse(item.Area)) ?? new Grp_NationalTravelFee
|
|
|
+ {
|
|
|
+ Country = "数据异常!",
|
|
|
+ City = string.Empty,
|
|
|
+ };
|
|
|
+ item.Area = find.Country + " " + find.City;
|
|
|
+ }
|
|
|
+
|
|
|
+ dbResult.AddRange(numeberResult);
|
|
|
+
|
|
|
+ if (dto.Param.Contains("、"))
|
|
|
+ {
|
|
|
+ var sp = dto.Param.Split("、");
|
|
|
+ dbResult = dbResult.AsParallel().WithDegreeOfParallelism(Environment.ProcessorCount)
|
|
|
+ .Where(x =>
|
|
|
+ {
|
|
|
+ return System.Array.Exists(sp, e =>
|
|
|
+ {
|
|
|
+ bool where = false;
|
|
|
+ if (x.Area != null)
|
|
|
+ {
|
|
|
+ where = x.Area.Contains(e);
|
|
|
+ if (x.Area.Contains("尾款") || x.PriceName.Contains("尾款"))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (x.PriceName != null && !where)
|
|
|
+ {
|
|
|
+ where = x.PriceName.Contains(e);
|
|
|
+ if (x.PriceName.Contains("尾款") || x.PriceName.Contains("尾款"))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return where;
|
|
|
+ });
|
|
|
+ }).ToList();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dbResult = dbResult.AsParallel().WithDegreeOfParallelism(Environment.ProcessorCount)
|
|
|
+ .Where(x =>
|
|
|
+ {
|
|
|
+ bool where = false;
|
|
|
+ if (x.Area != null)
|
|
|
+ {
|
|
|
+ where = x.Area.Contains(dto.Param);
|
|
|
+ if (x.Area.Contains("尾款") || x.PriceName.Contains("尾款"))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (x.PriceName != null && !where)
|
|
|
+ {
|
|
|
+ where = x.PriceName.Contains(dto.Param);
|
|
|
+ if (x.PriceName.Contains("尾款") || x.PriceName.Contains("尾款"))
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return where;
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .ToList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var view = dbResult.Select(x => {
|
|
|
+
|
|
|
+ decimal dp = 0.00M;
|
|
|
+ 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 )
|
|
|
+ {
|
|
|
+ dp = x.Price / (timesp.Days + 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dp = x.Price;
|
|
|
+ }
|
|
|
+
|
|
|
+ return new
|
|
|
+ {
|
|
|
+ start = startB ? startD.ToString("yyyy-MM-dd") : "",
|
|
|
+ end = endB ? endD.ToString("yyyy-MM-dd") : "",
|
|
|
+ x.Area,
|
|
|
+ x.id,
|
|
|
+ price = x.Price.ToString("F2"),
|
|
|
+ x.PriceName,
|
|
|
+ x.PriceContent,
|
|
|
+ x.TeamName,
|
|
|
+ x.DatePrice,
|
|
|
+ dayPrice = dp.ToString("F2"),
|
|
|
+ };
|
|
|
+ }).OrderByDescending(x=>x.id).ToList();
|
|
|
+
|
|
|
+ jw = JsonView(true, "获取成功!", view);
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ jw = JsonView(false,e.Message);
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 酒店预订 新 雷怡 2023-12-28 17:45
|