|
@@ -439,6 +439,28 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
_TableInitialization.RemoveAll(x => x.Id == 1070 || x.Id == 1071);
|
|
|
}
|
|
|
|
|
|
+ //三公费用金额以及币种
|
|
|
+ var boolParse = int.TryParse(grpCarOp.Area, out int natiId);
|
|
|
+ var NationalTravelFee = _sqlSugar.Queryable<Grp_NationalTravelFee>()
|
|
|
+ .LeftJoin<Sys_SetData>((a, b) => a.Currency == b.Id )
|
|
|
+ .Where((a, b) => a.IsDel == 0 && b.IsDel == 0)
|
|
|
+ .Select((a, b) => new
|
|
|
+ {
|
|
|
+ a.Id,
|
|
|
+ a.Currency,
|
|
|
+ CurrencyStr = b.Name,
|
|
|
+ a.FoodCost,
|
|
|
+ a.RoomCost,
|
|
|
+ a.PublicCost,
|
|
|
+ })
|
|
|
+ .First((a) => boolParse == true && a.Id == natiId);
|
|
|
+
|
|
|
+ var rate = new
|
|
|
+ {
|
|
|
+ grpCarOp.Rate,
|
|
|
+ grpCarOp.toCurr
|
|
|
+ };
|
|
|
+
|
|
|
if (dto.PortType == 1)
|
|
|
{
|
|
|
var data = new
|
|
@@ -452,6 +474,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
ssdv,
|
|
|
checkedItem,
|
|
|
existItem = _TableInitialization.Select(x => x.Name).ToList(),
|
|
|
+ NationalTravelFee,
|
|
|
+ rate
|
|
|
};
|
|
|
|
|
|
return result = new Result() { Code = 0, Msg = "查询成功", Data = data };
|
|
@@ -818,7 +842,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
var setDataCurrArr = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && x.STid == 66).ToList();
|
|
|
var number = 0; //人数
|
|
|
var aMeal = cityPrice.FoodCost.ObjToDecimal() / 2; //一顿三公费用
|
|
|
- var findSsetDataCurr = setDataCurrArr.Find(q => q.Id == carTouristList[0].Currency);
|
|
|
+ var findSsetDataCurr = setDataCurrArr.Find(q => q.Id == dto.Currency);
|
|
|
+ var printRate = 1M;
|
|
|
+
|
|
|
+ if (cityPrice.Currency != dto.Currency)
|
|
|
+ {
|
|
|
+ printRate = dto.Rate;
|
|
|
+ findSsetDataCurr = setDataCurrArr.Find(q => q.Id == dto.toCurr);
|
|
|
+ }
|
|
|
|
|
|
foreach (var item in arr)
|
|
|
{
|
|
@@ -836,7 +867,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
DateTime.Compare(x.DatePrice.ObjToDate(),q.DatePrice.ObjToDate()) == 0).Sum( q => q.Price) + x.Price;
|
|
|
|
|
|
var findSetData = setDataArr.Find(q => q.Id == keyId);
|
|
|
-
|
|
|
|
|
|
if (di.VisitPNumber > 1 && x.Count == 1)
|
|
|
{
|
|
@@ -847,9 +877,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
number = x.Count;
|
|
|
}
|
|
|
|
|
|
- dayMealPrice = dayMealPrice / number;
|
|
|
-
|
|
|
- remake = $"{x.DatePrice?.ToString("M/d")} {findSetData?.Name}{findSsetDataCurr?.Name} {dayMealPrice * number} - 财政{aMeal} * {number} = {findSsetDataCurr?.Name}{(dayMealPrice * number) - (aMeal * number)}";
|
|
|
+ dayMealPrice = dayMealPrice / number * printRate; //转三公币种
|
|
|
+ var price = (int)Math.Round((dayMealPrice * number) - (aMeal * number));
|
|
|
+ remake = $"{x.DatePrice?.ToString("M/d")} {findSetData?.Name}{findSsetDataCurr?.Name} {(int)Math.Round(dayMealPrice * number)} - 财政{aMeal} * {number} = {findSsetDataCurr?.Name}{price}";
|
|
|
}
|
|
|
|
|
|
return new Fin_GroupExtraCost
|
|
@@ -869,6 +899,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
PriceType = 1028,
|
|
|
PriceDetailType = item.Item3,
|
|
|
Remark = remake,
|
|
|
+ Area = opSingleCityId
|
|
|
};
|
|
|
}).ToList();
|
|
|
|
|
@@ -904,20 +935,19 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
|
remake += $"{start.ToString("M/d")}午餐和晚餐,";
|
|
|
exitMealCount += 2;
|
|
|
- price += (aMeal * 2 * di.VisitPNumber) - (mealPriceWu) - (mealPriceWan);
|
|
|
-
|
|
|
+ price += (aMeal * 2 * di.VisitPNumber) - (mealPriceWu * printRate) - (mealPriceWan * printRate);
|
|
|
}
|
|
|
else if (isExistsWu)
|
|
|
{
|
|
|
remake += $"{start.ToString("M/d")}午餐,";
|
|
|
exitMealCount += 1;
|
|
|
- price += (aMeal * di.VisitPNumber) - (mealPriceWu);
|
|
|
+ price += (aMeal * di.VisitPNumber) - (mealPriceWu * printRate);
|
|
|
}
|
|
|
else if (isExistsWan)
|
|
|
{
|
|
|
remake += $"{start.ToString("M/d")}晚餐,";
|
|
|
exitMealCount += 1;
|
|
|
- price += (aMeal * di.VisitPNumber) - (mealPriceWan);
|
|
|
+ price += (aMeal * di.VisitPNumber) - (mealPriceWan * printRate);
|
|
|
}
|
|
|
|
|
|
start = start.AddDays(1);
|
|
@@ -930,7 +960,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
|
remake = remake.TrimEnd(',');
|
|
|
remake += $"财政 {findSsetDataCurr?.Name} {aMeal} * {di.VisitPNumber} * {exitMealCount}餐";
|
|
|
- price = price / di.VisitPNumber / exitMealCount;
|
|
|
+ int priceInt = (int)Math.Round(price / di.VisitPNumber / exitMealCount);
|
|
|
groupExtraCostsArr.Add(new Fin_GroupExtraCost
|
|
|
{
|
|
|
Coefficient = 1,
|
|
@@ -940,14 +970,15 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
FilePath = string.Empty,
|
|
|
IsDel = 0,
|
|
|
PriceCount = di.VisitPNumber * exitMealCount * -1 ,
|
|
|
- Price = price,
|
|
|
+ Price = priceInt,
|
|
|
PriceDt = opSingle.ServiceStartTime.ObjToDate(),
|
|
|
- PriceCurrency = findSsetDataCurr == null ? carTouristList[0].Currency: findSsetDataCurr.Id ,
|
|
|
- PriceSum = (di.VisitPNumber * exitMealCount * -1) * price,
|
|
|
+ PriceCurrency = findSsetDataCurr == null ? dto.toCurr: findSsetDataCurr.Id ,
|
|
|
+ PriceSum = (di.VisitPNumber * exitMealCount * -1) * priceInt,
|
|
|
PriceName = di.TeamName + "-" + priceCity + "-" + $"退餐费(地接导入)",
|
|
|
PriceType = 1028,
|
|
|
PriceDetailType = 1088,
|
|
|
Remark = remake,
|
|
|
+ Area = opSingleCityId
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -958,9 +989,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
var QuerySgin = _sqlSugar.Queryable<Fin_GroupExtraCost>().Where(x => x.PriceName == item.PriceName && x.DiId == item.DiId && x.IsDel == 0 && x.PriceDt.ToString("yyyy-MM-dd") == item.PriceDt.ToString("yyyy-MM-dd")).First();
|
|
|
if (QuerySgin == null)
|
|
|
{
|
|
|
- _ = await PostGroupExtraCost_Operator(new Fin_GroupExtraCostDto_OP
|
|
|
+ var resultId = await PostGroupExtraCost_Operator(new Fin_GroupExtraCostDto_OP
|
|
|
{
|
|
|
- coefficient = 1,
|
|
|
+ coefficient = item.Coefficient,
|
|
|
createUser = dto.CreateUserId,
|
|
|
currency = item.PriceCurrency,
|
|
|
diId = item.DiId,
|
|
@@ -977,15 +1008,23 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
PriceDt = item.PriceDt.ToString("yyyy-MM-dd"),
|
|
|
payType = dto.PayDId,
|
|
|
costSign = dto.OrbitalPrivateTransfer,
|
|
|
- Area = opSingle.Area.ObjToInt(),
|
|
|
+ Area = item.Area
|
|
|
});
|
|
|
+ _sqlSugar.Insertable<Fin_LocalGuideRelevancyOverspend>(new Fin_LocalGuideRelevancyOverspend
|
|
|
+ {
|
|
|
+ CreateTime = DateTime.Now,
|
|
|
+ CreateUserId = dto.CreateUserId,
|
|
|
+ IsDel = 0,
|
|
|
+ LocalGuideId = opSingle.Id,
|
|
|
+ OverspendId = resultId.Data,
|
|
|
+ }).ExecuteCommand();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
item.Id = QuerySgin.Id;
|
|
|
_ = await PostGroupExtraCost_Operator(new Fin_GroupExtraCostDto_OP
|
|
|
{
|
|
|
- coefficient = 1,
|
|
|
+ coefficient = item.Coefficient,
|
|
|
createUser = dto.CreateUserId,
|
|
|
currency = item.PriceCurrency,
|
|
|
diId = item.DiId,
|
|
@@ -1162,7 +1201,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
CId = dto.Currency,
|
|
|
ServiceQuotedPrice = c.PayMoney,
|
|
|
OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer,
|
|
|
- SelectCheck = string.Join(',', dto.SelectCheck)
|
|
|
+ SelectCheck = string.Join(',', dto.SelectCheck),
|
|
|
+ Rate = dto.Rate,
|
|
|
+ toCurr = dto.toCurr
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
var data = new { ccpId = noticeCcpId, sign = noticeSign };
|
|
@@ -1278,6 +1319,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
_daiRep.CommitTran();
|
|
|
rt.Code = 0;
|
|
|
rt.Msg = "操作成功";
|
|
|
+ rt.Data = dto.Id;
|
|
|
return rt;
|
|
|
}
|
|
|
|