|
@@ -428,26 +428,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
{
|
|
{
|
|
if (diId < 1) return _result = new Result() { Code = -1, Msg = "请传入有效的DiId参数" };
|
|
if (diId < 1) return _result = new Result() { Code = -1, Msg = "请传入有效的DiId参数" };
|
|
|
|
|
|
- var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
|
- .FirstAsync(it => it.IsDel == 0 && it.Id == diId);
|
|
|
|
-
|
|
|
|
- if (groupInfo == null)
|
|
|
|
- return _result = new Result() { Code = -1, Msg = "团组信息不存在!" };
|
|
|
|
-
|
|
|
|
- var visaData = await _sqlSugar.Queryable<Grp_VisaFeeInfo>()
|
|
|
|
- .Where(it => it.IsDel == 0 && it.DiId == diId)
|
|
|
|
- .ToListAsync();
|
|
|
|
-
|
|
|
|
- var visaFeeIds = visaData.Select(x => x.Id).ToList();
|
|
|
|
- var visaCountryNames = await _sqlSugar.Queryable<Res_CountryFeeCost>()
|
|
|
|
- .Where(it => visaFeeIds.Contains(it.Id))
|
|
|
|
- .Select(it => it.VisaCountry)
|
|
|
|
- .ToListAsync();
|
|
|
|
-
|
|
|
|
- var visaCountryDatas = await VisaInfoByCountryAndCityId(visaCountryNames, groupInfo.CityId);
|
|
|
|
-
|
|
|
|
- //if (visaCountryDatas.Count == 0)
|
|
|
|
- // return _result = new Result() { Code = -1, Msg = "签证费用信息不存在!" };
|
|
|
|
|
|
+ var visaData = await _sqlSugar.Queryable<Grp_VisaFeeInfo>().Where(it => it.IsDel == 0 && it.DiId == diId).ToListAsync();
|
|
|
|
+ List<int> ids = visaData.Select(it => it.CountryVisaFeeId).ToList();
|
|
|
|
+ var visaCountryDatas = await _sqlSugar.Queryable<Res_CountryFeeCost>().Where(it => ids.Contains(it.Id)).ToListAsync();
|
|
|
|
|
|
var datas = new List<dynamic>();
|
|
var datas = new List<dynamic>();
|
|
string remark = "";
|
|
string remark = "";
|
|
@@ -462,54 +445,82 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
{
|
|
{
|
|
var countryData = visaCountryDatas.Find(it => it.Id == kvp.Key);
|
|
var countryData = visaCountryDatas.Find(it => it.Id == kvp.Key);
|
|
decimal _otherFee = kvp.FirstOrDefault()?.OtherFee * priceCoeff ?? 0;
|
|
decimal _otherFee = kvp.FirstOrDefault()?.OtherFee * priceCoeff ?? 0;
|
|
- decimal _visaFee = 0.00M;
|
|
|
|
- decimal visaFeeTotal = 0.00M;
|
|
|
|
- decimal _agencyFee = 0.00M;
|
|
|
|
- decimal _GrandBusinessAgencyFee = 0.00M;
|
|
|
|
- decimal _PettyBusinessAgencyFee = 0.00M;
|
|
|
|
-
|
|
|
|
- string remark1 = "";
|
|
|
|
- foreach (var item in kvp.ToList())
|
|
|
|
|
|
+ decimal _visaFee = Convert.ToDecimal(countryData?.VisaPrice ?? 0.00M) * priceCoeff;
|
|
|
|
+ decimal visaFeeTotal = _visaFee + _otherFee;
|
|
|
|
+ decimal _agencyFee = 0;
|
|
|
|
+ decimal _GrandBusinessAgencyFee = 0;
|
|
|
|
+ decimal _PettyBusinessAgencyFee = 0;
|
|
|
|
+
|
|
|
|
+ string remark1 = $"签证费:{_visaFee:#0.00}元、";
|
|
|
|
+
|
|
|
|
+ var obTypes = kvp.Select(it => it.OBType).Distinct().ToList();
|
|
|
|
+
|
|
|
|
+ if (obTypes.Contains(1) && obTypes.Contains(2)) //大\小公务
|
|
{
|
|
{
|
|
- if (item.OBType == 1)
|
|
|
|
|
|
+ var agencyFeeInfo = kvp.FirstOrDefault();
|
|
|
|
+ if (agencyFeeInfo.AgencyFee > 0)
|
|
{
|
|
{
|
|
- _visaFee = Convert.ToDecimal(countryData?.LargeVisaPrice ?? 0.00M) * priceCoeff;
|
|
|
|
- remark1 = $"签证费:{_visaFee:#0.00}元、";
|
|
|
|
- if (item.AgencyFee > 0)
|
|
|
|
- {
|
|
|
|
- remark1 += $@"大公务代办费:{item.AgencyFee:#0.00}元、";
|
|
|
|
- _agencyFee += item.AgencyFee;
|
|
|
|
- _GrandBusinessAgencyFee = item.AgencyFee * priceCoeff;
|
|
|
|
- }
|
|
|
|
|
|
+ remark1 += $"大/小公务代办费:{agencyFeeInfo.AgencyFee:#0.00}元、";
|
|
|
|
+ _agencyFee += agencyFeeInfo.AgencyFee;
|
|
|
|
+ _GrandBusinessAgencyFee = agencyFeeInfo.AgencyFee * priceCoeff;
|
|
}
|
|
}
|
|
- else if (item.OBType == 2)
|
|
|
|
|
|
+ }
|
|
|
|
+ else if (obTypes.Contains(1)) //大公务
|
|
|
|
+ {
|
|
|
|
+ var agencyFeeInfo = kvp.FirstOrDefault(x => x.OBType == 1);
|
|
|
|
+ if (agencyFeeInfo.AgencyFee > 0)
|
|
{
|
|
{
|
|
- _visaFee = Convert.ToDecimal(countryData?.SmallVisaPrice ?? 0.00M) * priceCoeff;
|
|
|
|
- remark1 = $"签证费:{_visaFee:#0.00}元、";
|
|
|
|
- if (item.AgencyFee > 0)
|
|
|
|
- {
|
|
|
|
- remark1 += $@"小公务代办费:{item.AgencyFee:#0.00}元、";
|
|
|
|
- _agencyFee += item.AgencyFee;
|
|
|
|
- _PettyBusinessAgencyFee = item.AgencyFee * priceCoeff;
|
|
|
|
- }
|
|
|
|
|
|
+ remark1 += $"大公务代办费:{agencyFeeInfo.AgencyFee:#0.00}元、";
|
|
|
|
+ _agencyFee += agencyFeeInfo.AgencyFee;
|
|
|
|
+ _GrandBusinessAgencyFee = agencyFeeInfo.AgencyFee * priceCoeff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (obTypes.Contains(2)) //小公务
|
|
|
|
+ {
|
|
|
|
+ var agencyFeeInfo = kvp.FirstOrDefault(x => x.OBType == 2);
|
|
|
|
+ if (agencyFeeInfo.AgencyFee > 0)
|
|
|
|
+ {
|
|
|
|
+ remark1 += $"小公务代办费:{agencyFeeInfo.AgencyFee:#0.00}元、";
|
|
|
|
+ _agencyFee += agencyFeeInfo.AgencyFee;
|
|
|
|
+ _GrandBusinessAgencyFee = agencyFeeInfo.AgencyFee * priceCoeff;
|
|
}
|
|
}
|
|
- //_visaFee += _otherFee;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //foreach (var item in kvp.ToList())
|
|
|
|
+ //{
|
|
|
|
+ // if (item.OBType == 1)
|
|
|
|
+ // {
|
|
|
|
+ // if (item.AgencyFee > 0)
|
|
|
|
+ // {
|
|
|
|
+ // remark1 += $@"大公务代办费:{item.AgencyFee:#0.00}元、";
|
|
|
|
+ // _agencyFee += item.AgencyFee;
|
|
|
|
+ // _GrandBusinessAgencyFee = item.AgencyFee * priceCoeff;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // else if (item.OBType == 1)
|
|
|
|
+ // {
|
|
|
|
+ // if (item.AgencyFee > 0)
|
|
|
|
+ // {
|
|
|
|
+ // remark1 += $@"小公务代办费:{item.AgencyFee.ToString("#0.00")}元、";
|
|
|
|
+ // _agencyFee += item.AgencyFee;
|
|
|
|
+ // _PettyBusinessAgencyFee = item.AgencyFee * priceCoeff;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
if (remark1.Length > 0) remark1 = remark1.Substring(0, remark1.Length - 1);
|
|
if (remark1.Length > 0) remark1 = remark1.Substring(0, remark1.Length - 1);
|
|
|
|
|
|
- if (_otherFee > 0) remark1 += $@"其他费用:{_otherFee:#0.00}元";
|
|
|
|
|
|
+ if (_otherFee > 0) remark1 += $@";其他费用:{_otherFee:#0.00}元;";
|
|
|
|
|
|
visaFeeTotal += (_GrandBusinessAgencyFee + _PettyBusinessAgencyFee);
|
|
visaFeeTotal += (_GrandBusinessAgencyFee + _PettyBusinessAgencyFee);
|
|
- remark += $@"{countryData?.CountryName ?? ""}:签证总费用:{visaFeeTotal}元/人 其中({remark1});";
|
|
|
|
|
|
+ remark += $@"{countryData?.VisaCountry ?? ""}:签证总费用:{visaFeeTotal:#0.00}元/人 其中({remark1});";
|
|
|
|
|
|
feeTotal += visaFeeTotal;
|
|
feeTotal += visaFeeTotal;
|
|
|
|
|
|
datas.Add(new
|
|
datas.Add(new
|
|
{
|
|
{
|
|
- Country = countryData?.CountryName ?? "",
|
|
|
|
|
|
+ Country = countryData?.VisaCountry ?? "",
|
|
visaFeeTotal,
|
|
visaFeeTotal,
|
|
- VisaFee = _visaFee,
|
|
|
|
|
|
+ VisaFee = countryData?.VisaPrice ?? 0.00M,
|
|
GrandBusinessAgencyFee = _GrandBusinessAgencyFee,
|
|
GrandBusinessAgencyFee = _GrandBusinessAgencyFee,
|
|
PettyBusinessAgencyFee = _PettyBusinessAgencyFee,
|
|
PettyBusinessAgencyFee = _PettyBusinessAgencyFee,
|
|
OtherFee = _otherFee
|
|
OtherFee = _otherFee
|
|
@@ -524,6 +535,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
remark
|
|
remark
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+
|
|
return _result;
|
|
return _result;
|
|
}
|
|
}
|
|
|
|
|