|
@@ -75,14 +75,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
public async Task<Result> AirTicketResList(AirTicketResDto dto)
|
|
|
{
|
|
|
- Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
+ Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
|
|
|
Grp_DelegationInfo _DelegationInfo = _sqlSugar.Queryable<Grp_DelegationInfo>().First(it => it.Id == dto.DiId);
|
|
|
if (_DelegationInfo != null)
|
|
|
{
|
|
|
string sql = string.Format(@"select a.*,c.IsAuditGM,(select Name from Sys_SetData where Id=a.cType) as 'CTypeName',(select Name from
|
|
|
Sys_SetData where Id=a.PreCurrency) as 'PreCurrencyStr',(select Name from Sys_SetData where Id=a.Currency)
|
|
|
- as 'CurrencyStr' from Grp_AirTicketReservations a,Grp_CreditCardPayment c where a.id=c.CId and a.isdel={1}
|
|
|
+ as 'CurrencyStr' from Grp_AirTicketReservations a,Grp_CreditCardPayment c where a.id=c.CId and a.isdel={1} and c.IsDel={1}
|
|
|
and a.DIId={0} Order By a.CreateTime desc", dto.DiId, 0);
|
|
|
List<AirTicketReservationsView> _AirTicketReservations = _sqlSugar.SqlQueryable<AirTicketReservationsView>(sql).ToList();
|
|
|
|
|
@@ -103,7 +103,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Res_ThreeCode arrData = _sqlSugar.Queryable<Res_ThreeCode>().First(it => it.IsDel == 0 && it.Three == arrCode);
|
|
|
|
|
|
string day = spDotandEmpty[2].Substring(2, 2);//日
|
|
|
- string monthAbbreviations = spDotandEmpty[1].Substring(4, 3).ToUpper();//月份
|
|
|
+ string monthAbbreviations = spDotandEmpty[2].Substring(4, 3).ToUpper();//月份
|
|
|
switch (monthAbbreviations)
|
|
|
{
|
|
|
case "JAN":
|
|
@@ -146,7 +146,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
string tate = $"{monthAbbreviations}月{day}日";
|
|
|
item.FlightDescription += rowindex + ". " + depData.AirPort + " " + arrData.AirPort + " (" + tate + ")\r\n";
|
|
|
}
|
|
|
- catch (Exception)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
item.FlightDescription = "录入数据不规范!请检查";
|
|
|
break;
|
|
@@ -214,10 +214,20 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
}
|
|
|
//团组成本预算表查询
|
|
|
- Grp_GroupCostParameter _GroupCostParameter = _sqlSugar.Queryable<Grp_GroupCostParameter>().First(a => a.DiId == dto.DiId);
|
|
|
+ Grp_GroupCostParameter _GroupCostParameter = _sqlSugar.Queryable<Grp_GroupCostParameter>().First(a => a.DiId == dto.DiId && a.IsDel==0);
|
|
|
|
|
|
AirGroupCostParameterView _AirgroupCostParameter = _mapper.Map<AirGroupCostParameterView>(_GroupCostParameter);
|
|
|
-
|
|
|
+ for (int i = 0; i <_AirTicketReservations.Count; i++)
|
|
|
+ {
|
|
|
+ string [] ClientArr= _AirTicketReservations[i].ClientName.Split(',');
|
|
|
+
|
|
|
+ foreach (var item in ClientArr)
|
|
|
+ {
|
|
|
+ Crm_GroupCustomer crm_GroupCustomer = _sqlSugar.Queryable<Crm_GroupCustomer>().Where(a => a.IsDel==0 && a.Id==int.Parse(item)).First();
|
|
|
+ _AirTicketReservations[i].ClientNameStr+=crm_GroupCustomer.Pinyin+',';
|
|
|
+ }
|
|
|
+ _AirTicketReservations[i].ClientNameStr=_AirTicketReservations[i].ClientNameStr.Substring(0, _AirTicketReservations[i].ClientNameStr.Length-1);
|
|
|
+ }
|
|
|
var data = new
|
|
|
{
|
|
|
DelegationInfo = _DelegationInfo,
|
|
@@ -242,20 +252,24 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
|
|
|
List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == 85).ToList();
|
|
|
-
|
|
|
+ List<GroupNameView> grp_NameView = new List<GroupNameView>();
|
|
|
string DiId = "";
|
|
|
foreach (var item in grp_GroupsTaskAssignment)
|
|
|
{
|
|
|
DiId += item.DIId + ",";
|
|
|
}
|
|
|
- DiId = DiId.Substring(0, DiId.Length - 1);
|
|
|
+ if (DiId.Length>1)
|
|
|
+ {
|
|
|
+ DiId = DiId.Substring(0, DiId.Length - 1);
|
|
|
+
|
|
|
string sql = string.Format(@"select * from Grp_DelegationInfo where Id in({0}) and IsDel={1}", DiId, 0);
|
|
|
List<Grp_DelegationInfo> grp_Delegations = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
|
|
|
- if (grp_Delegations.Count == 0)
|
|
|
+
|
|
|
+ if (grp_Delegations.Count == 0)
|
|
|
{
|
|
|
return result = new Result() { Code = -1, Msg = "查询失败!" };
|
|
|
}
|
|
|
- List<GroupNameView> grp_NameView = new List<GroupNameView>();
|
|
|
+
|
|
|
foreach (var item in grp_Delegations)
|
|
|
{
|
|
|
GroupNameView groupNameView = new GroupNameView();
|
|
@@ -263,6 +277,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
groupNameView.GroupName = item.TeamName;
|
|
|
grp_NameView.Add(groupNameView);
|
|
|
}
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region 其他下拉框查询
|
|
@@ -306,8 +321,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Grp_AirTicketReservations grp_AirTicket = _mapper.Map<Grp_AirTicketReservations>(dto.AirTicketResOpData);
|
|
|
if (dto.Status == 1)
|
|
|
{
|
|
|
- string selectSql = string.Format(@"select * from Grp_AirTicketReservations where ClientName='{0}' and IsDel={1}"
|
|
|
- , dto.AirTicketResOpData.ClientName, 0);
|
|
|
+ string selectSql = string.Format(@"select * from Grp_AirTicketReservations where ClientName='{0}' and IsDel={1} and FlightsCode='{2}'"
|
|
|
+ , dto.AirTicketResOpData.ClientName, 0,dto.AirTicketResOpData.FlightsCode);
|
|
|
var DeleClient = await _sqlSugar.SqlQueryable<Grp_AirTicketReservations>(selectSql).FirstAsync();//查询是否存在
|
|
|
if (DeleClient != null)
|
|
|
{
|
|
@@ -363,19 +378,32 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Grp_GroupCostParameter _GroupCostParameter = _sqlSugar.Queryable<Grp_GroupCostParameter>().First(a => a.DiId == grp_AirTicket.DIId && a.IsDel == 0);
|
|
|
if (grp_AirTicket.CType == 460)//经济舱
|
|
|
{
|
|
|
- if (Convert.ToDecimal(_GroupCostParameter.JJCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
|
|
|
+ if (_GroupCostParameter != null)
|
|
|
{
|
|
|
- grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
|
|
|
- grp_CreditCard.IsAuditGM = 3;//3 为自动审核
|
|
|
- grp_CreditCard.AuditGMOperate = 0;
|
|
|
- grp_CreditCard.AuditGMDate = "";
|
|
|
- grp_CreditCard.IsPay = 0;
|
|
|
+
|
|
|
+ if (Convert.ToDecimal(_GroupCostParameter.JJCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
|
|
|
+ {
|
|
|
+ grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
|
|
|
+ grp_CreditCard.IsAuditGM = 3;//3 为自动审核
|
|
|
+ grp_CreditCard.AuditGMOperate = 0;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var a = grp_CreditCard.RMBPrice - Convert.ToDecimal(_GroupCostParameter.JJCCB);
|
|
|
+ var b = a / Convert.ToDecimal(_GroupCostParameter.JJCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum);
|
|
|
+ grp_CreditCard.ExceedBudget = b;// 超出预算比例 换算
|
|
|
+ grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
+ grp_CreditCard.AuditGMOperate = 21;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- var a = grp_CreditCard.RMBPrice - Convert.ToDecimal(_GroupCostParameter.JJCCB);
|
|
|
- var b = a / Convert.ToDecimal(_GroupCostParameter.JJCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum);
|
|
|
- grp_CreditCard.ExceedBudget = b;// 超出预算比例 换算
|
|
|
+ grp_CreditCard.ExceedBudget = 0.00M;// 超出预算比例 换算
|
|
|
grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
grp_CreditCard.AuditGMOperate = 21;
|
|
|
grp_CreditCard.AuditGMDate = "";
|
|
@@ -385,27 +413,46 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
else if (grp_AirTicket.CType == 458)
|
|
|
{
|
|
|
- if (Convert.ToDecimal(_GroupCostParameter.GWCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
|
|
|
+ if (_GroupCostParameter != null)
|
|
|
{
|
|
|
- grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
|
|
|
- grp_CreditCard.IsAuditGM = 3;//3 为自动审核
|
|
|
- grp_CreditCard.AuditGMOperate = 21;
|
|
|
- grp_CreditCard.AuditGMDate = "";
|
|
|
- grp_CreditCard.IsPay = 0;
|
|
|
+
|
|
|
+
|
|
|
+ if (Convert.ToDecimal(_GroupCostParameter.GWCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
|
|
|
+ {
|
|
|
+ grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
|
|
|
+ grp_CreditCard.IsAuditGM = 3;//3 为自动审核
|
|
|
+ grp_CreditCard.AuditGMOperate = 21;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var a = grp_CreditCard.RMBPrice - Convert.ToDecimal(_GroupCostParameter.GWCB);
|
|
|
+ var b = a / Convert.ToDecimal(_GroupCostParameter.GWCB) * Convert.ToDecimal(grp_AirTicket.ClientNum);
|
|
|
+ grp_CreditCard.ExceedBudget = b;// 超出预算比例 换算
|
|
|
+ grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
+ grp_CreditCard.AuditGMOperate = 21;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- var a = grp_CreditCard.RMBPrice - Convert.ToDecimal(_GroupCostParameter.GWCB);
|
|
|
- var b = a / Convert.ToDecimal(_GroupCostParameter.GWCB) * Convert.ToDecimal(grp_AirTicket.ClientNum);
|
|
|
- grp_CreditCard.ExceedBudget = b;// 超出预算比例 换算
|
|
|
+ grp_CreditCard.ExceedBudget = 0.00M;// 超出预算比例 换算
|
|
|
grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
grp_CreditCard.AuditGMOperate = 21;
|
|
|
grp_CreditCard.AuditGMDate = "";
|
|
|
grp_CreditCard.IsPay = 0;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ else
|
|
|
+ {
|
|
|
+ grp_CreditCard.ExceedBudget = 0.00M;// 超出预算比例 换算
|
|
|
+ grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
+ grp_CreditCard.AuditGMOperate = 21;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
+ }
|
|
|
grp_CreditCard.CId = id;
|
|
|
grp_CreditCard.CTable = 85;
|
|
|
grp_CreditCard.PayPercentage = 100;
|
|
@@ -506,6 +553,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Grp_GroupCostParameter _GroupCostParameter = _sqlSugar.Queryable<Grp_GroupCostParameter>().First(a => a.DiId == grp_AirTicket.DIId && a.IsDel == 0);
|
|
|
if (grp_AirTicket.CType == 460)//经济舱
|
|
|
{
|
|
|
+ if (_GroupCostParameter != null)
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
if (Convert.ToDecimal(_GroupCostParameter.JJCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
|
|
|
{
|
|
|
grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
|
|
@@ -524,10 +575,29 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
grp_CreditCard.AuditGMDate = "";
|
|
|
grp_CreditCard.IsPay = 1;
|
|
|
}
|
|
|
-
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ grp_CreditCard.ExceedBudget = 0.00M;// 超出预算比例 换算
|
|
|
+ grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
+ grp_CreditCard.AuditGMOperate = 21;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
+ }
|
|
|
}
|
|
|
else if (grp_AirTicket.CType == 458)
|
|
|
{
|
|
|
+ if (_GroupCostParameter != null)
|
|
|
+ {
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ grp_CreditCard.ExceedBudget = 0.00M;// 超出预算比例 换算
|
|
|
+ grp_CreditCard.IsAuditGM = 0;//3 为自动审核
|
|
|
+ grp_CreditCard.AuditGMOperate = 21;
|
|
|
+ grp_CreditCard.AuditGMDate = "";
|
|
|
+ grp_CreditCard.IsPay = 0;
|
|
|
+ }
|
|
|
if (Convert.ToDecimal(_GroupCostParameter.GWCCB) * Convert.ToDecimal(grp_AirTicket.ClientNum) > grp_CreditCard.RMBPrice)
|
|
|
{
|
|
|
grp_CreditCard.ExceedBudget = 0;// 超出预算比例 换算
|