|
@@ -43,27 +43,42 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
var stids = new List<int>() { 17, 66, 91 };
|
|
|
var setData = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && stids.Contains(x.STid)).ToList();
|
|
|
string _teamCurrency = string.Empty;
|
|
|
-
|
|
|
- var groupInfo = _sqlSugar.Queryable<Grp_GroupCostParameter>().Where(x => x.IsDel == 0 && x.DiId == diId).First();
|
|
|
- if (groupInfo == null) { _view.Msg = $"团组成本信息未填写!"; return _view; }
|
|
|
- _teamCurrency = groupInfo.Currency;
|
|
|
- decimal _teamRate = groupInfo.Rate;
|
|
|
- //币种验证 统一为currencycode三字码
|
|
|
- if (int.TryParse(_teamCurrency,out int currency)) _teamCurrency = setData.Find(x => x.Id == currency)?.Name ?? "";
|
|
|
|
|
|
- string costContentSql = $"Select * From Grp_GroupCost";
|
|
|
- var costContents = _sqlSugar.SqlQueryable<GroupCostAuditView>(costContentSql).Where(x => x.IsDel == 0 && x.Diid == diId).ToList();
|
|
|
- if (costContents.Count < 1) { _view.Msg = $"团组成本信息未填写!"; return _view; }
|
|
|
-
|
|
|
- //处理 成本详细信息 日期为空
|
|
|
- for (int i = 0; i < costContents.Count; i++)
|
|
|
+ decimal _teamRate = 0.00M;
|
|
|
+ var costContents = new List<GroupCostAuditView>();
|
|
|
+ if (feeType != 4)
|
|
|
{
|
|
|
- if (string.IsNullOrEmpty( costContents[i].Date))
|
|
|
+ var groupInfo = _sqlSugar.Queryable<Grp_GroupCostParameter>().Where(x => x.IsDel == 0 && x.DiId == diId).First();
|
|
|
+ if (groupInfo == null) { _view.Msg = $"团组成本信息未填写!"; return _view; }
|
|
|
+ _teamCurrency = groupInfo.Currency;
|
|
|
+ _teamRate = groupInfo.Rate;
|
|
|
+
|
|
|
+ //币种验证 统一为currencycode三字码
|
|
|
+ if (int.TryParse(_teamCurrency, out int currency)) _teamCurrency = setData.Find(x => x.Id == currency)?.Name ?? "";
|
|
|
+
|
|
|
+ string costContentSql = $"Select * From Grp_GroupCost";
|
|
|
+ costContents = _sqlSugar.SqlQueryable<GroupCostAuditView>(costContentSql).Where(x => x.IsDel == 0 && x.Diid == diId).ToList();
|
|
|
+
|
|
|
+ if (costContents.Count < 1) { _view.Msg = $"团组成本信息未填写!"; return _view; }
|
|
|
+
|
|
|
+ //处理 成本详细信息 日期为空
|
|
|
+ for (int i = 0; i < costContents.Count; i++)
|
|
|
{
|
|
|
- int index = i - 1;
|
|
|
- if (index >= 0)
|
|
|
+ if (string.IsNullOrEmpty(costContents[i].Date))
|
|
|
+ {
|
|
|
+ int index = i - 1;
|
|
|
+ if (index >= 0)
|
|
|
+ {
|
|
|
+ costContents[i].Date = costContents[index].Date;
|
|
|
+ var dtBool = DateTime.TryParse(costContents[i].Date, out DateTime _dateTime);
|
|
|
+ if (dtBool)
|
|
|
+ {
|
|
|
+ costContents[i].CurrTime = _dateTime;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- costContents[i].Date = costContents[index].Date;
|
|
|
var dtBool = DateTime.TryParse(costContents[i].Date, out DateTime _dateTime);
|
|
|
if (dtBool)
|
|
|
{
|
|
@@ -71,16 +86,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- var dtBool = DateTime.TryParse(costContents[i].Date, out DateTime _dateTime);
|
|
|
- if (dtBool)
|
|
|
- {
|
|
|
- costContents[i].CurrTime = _dateTime;
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (feeType == 1)
|
|
|
{
|
|
|
//1089 对冲账或其他 不在审核范围
|
|
@@ -374,7 +381,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
var currModule = 98; //其他款项
|
|
|
int groupSize = 0; // 团组人数
|
|
|
var groupDetails = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.IsDel == 0 && x.Id == diId).FirstAsync();
|
|
|
- if (groupInfo != null) groupSize = groupDetails.VisitPNumber;
|
|
|
+ if (groupDetails != null) groupSize = groupDetails.VisitPNumber;
|
|
|
|
|
|
decimal groupCostCNYTotal = costContents.Sum(x => x.TeFee) * _teamRate * groupSize; //团组成本出行物资总金额
|
|
|
if (groupCostCNYTotal <= 0.00M)
|
|
@@ -512,17 +519,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
if (auditCcpIds.Any())
|
|
|
{
|
|
|
var ccpUpd = _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
- .SetColumns(it => it.IsAuditGM == 0)
|
|
|
- .SetColumns(it => it.AuditGMOperate == 0)
|
|
|
- .SetColumns(it => it.AuditGMDate == "")
|
|
|
- .Where(s => auditCcpIds.Contains(s.Id))
|
|
|
- .ExecuteCommand();
|
|
|
+ .SetColumns(it => it.IsAuditGM == 0)
|
|
|
+ .SetColumns(it => it.AuditGMOperate == 0)
|
|
|
+ .SetColumns(it => it.AuditGMDate == string.Empty)
|
|
|
+ .Where(s => auditCcpIds.Contains(s.Id))
|
|
|
+ .ExecuteCommand();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- var insuranceCostData = insuranceCostData1.Where(x => insuranceType.Contains(x.Iid)).ToList();
|
|
|
+ //var insuranceCostData = insuranceCostData1.Where(x => insuranceType.Contains(x.Iid)).ToList();
|
|
|
+ var insuranceCostData = insuranceCostData1.ToList();
|
|
|
var currInsuranceInfo = insuranceCostData.Where(x => x.Id == dataId).FirstOrDefault();
|
|
|
if (!insuranceCostData.Any() && currInsuranceInfo == null)
|
|
|
{
|
|
@@ -553,7 +561,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
var schengenCost = insuranceCountryCostData.Where(x => schengenCountry.Contains(x.CountryName)).Sum(x => x.Cost); // 申根国费用
|
|
|
var unSchengenCost = unSchengenCountry.Count() * 35; // 非申根国费用
|
|
|
|
|
|
-
|
|
|
var groupBudgetCost = (schengenCost + unSchengenCost) * groupPeopleNum;
|
|
|
var groupActialCost = insuranceCostData.Sum(x => x.CNYPrice);
|
|
|
|