|
@@ -107,6 +107,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Result result = new Result() { Code = -2, Msg = "未知错误" };
|
|
|
try
|
|
|
{
|
|
|
+ ListViewBase<InvitationOfficialActivitiesView> rst = new ListViewBase<InvitationOfficialActivitiesView>() { ReceiveDt=DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") };
|
|
|
string sqlWhere = string.Empty;
|
|
|
if (!string.IsNullOrWhiteSpace(dto.Inviter))
|
|
|
{
|
|
@@ -136,10 +137,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
Regex r = new Regex("And");
|
|
|
sqlWhere = r.Replace(sqlWhere, "Where", 1);
|
|
|
}
|
|
|
-
|
|
|
- string sql = string.Format(@"select Id,DiId,InviterArea,Inviter,InviteTime,InviteCost,(select name from Sys_SetData where id=i.InviteCurrency and IsDel={0})
|
|
|
- as Currency,IsGoOfficaiaBussiness,(select IsAuditGM from Grp_CreditCardPayment where CTable=81 and CId=i.Id
|
|
|
- and IsDel={0}) as 'isAudit',Attachment from Grp_InvitationOfficialActivities i {1} order by i.id desc", 0, sqlWhere);
|
|
|
+ //10011
|
|
|
+ string sql = string.Format(@"Select Id,DiId,InviterArea,Inviter,InviteTime,
|
|
|
+ InviteCost,(Select Name From Sys_SetData Where id=i.InviteCurrency And IsDel=0) As InviteCurrency,
|
|
|
+ SendCost,(Select Name From Sys_SetData Where id=i.SendCurrency And IsDel=0) As SendCurrency,
|
|
|
+ EventsCost,(Select Name From Sys_SetData Where id=i.EventsCurrency And IsDel=0) As EventsCurrency,
|
|
|
+ TranslateCost,(Select Name From Sys_SetData Where id=i.TranslateCurrency And IsDel=0) As TranslateCurrency,
|
|
|
+ IsGoOfficaiaBussiness,
|
|
|
+ (Select PayMoney From Grp_CreditCardPayment Where CTable=81 And CId=i.Id And IsDel=0) As PayMoney,
|
|
|
+ (Select (Select Name From Sys_SetData Where Id =ccp.PaymentCurrency And IsDel=0 ) As PaymentCurrency
|
|
|
+ From Grp_CreditCardPayment ccp Where CTable=81 And CId=i.Id And IsDel=0) As PaymentCurrency,
|
|
|
+ (Select IsAuditGM From Grp_CreditCardPayment Where CTable=81 And CId=i.Id And IsDel=0) As IsAudit,
|
|
|
+ Attachment From Grp_InvitationOfficialActivities i {0} Order By i.id Desc", sqlWhere);
|
|
|
List<InvitationOfficialActivitiesView> _DecreasePayments = await _sqlSugar.SqlQueryable<InvitationOfficialActivitiesView>(sql).ToListAsync();
|
|
|
if (_DecreasePayments.Count != 0)
|
|
|
{
|
|
@@ -164,11 +173,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- ListViewBase<InvitationOfficialActivitiesView> rst = new ListViewBase<InvitationOfficialActivitiesView>();
|
|
|
+
|
|
|
rst.DataList = invitationOfficialActivities;
|
|
|
rst.DataCount = count;
|
|
|
rst.CurrPageIndex = dto.PageIndex;
|
|
|
rst.CurrPageSize = dto.PageSize;
|
|
|
+ rst.ReturnDt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
return result = new Result() { Code = 0, Msg = "查询成功!", Data = rst };
|
|
|
}
|
|
|
else
|
|
@@ -180,11 +190,11 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
|
if (dto.PageIndex != 0 && dto.PageSize != 0)
|
|
|
{
|
|
|
- ListViewBase<InvitationOfficialActivitiesView> rst = new ListViewBase<InvitationOfficialActivitiesView>();
|
|
|
rst.DataList = _DecreasePayments;
|
|
|
rst.DataCount = _DecreasePayments.Count;
|
|
|
rst.CurrPageIndex = dto.PageIndex;
|
|
|
rst.CurrPageSize = dto.PageSize;
|
|
|
+ rst.ReturnDt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
return result = new Result() { Code = 0, Msg = "暂无数据!", Data = rst };
|
|
|
}
|
|
|
else
|
|
@@ -267,8 +277,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
C.CTDId = 0;
|
|
|
C.BankNo = "";
|
|
|
C.CardholderName = "";
|
|
|
- C.PayMoney = dto.InviteCost + dto.SendCost;
|
|
|
- C.PaymentCurrency = dto.inviteCurrency;
|
|
|
+ //C.PayMoney = dto.InviteCost + dto.SendCost;
|
|
|
+ //C.PaymentCurrency = dto.InviteCurrency;
|
|
|
C.CompanyBankNo = "";
|
|
|
C.OtherBankName = "";
|
|
|
C.OtherSideNo = "";
|
|
@@ -290,7 +300,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
C.DIId = dto.DiId;
|
|
|
C.CId = id;
|
|
|
C.CTable = 81;
|
|
|
- C.PayPercentage = 0;
|
|
|
+ C.PayPercentage = 100;
|
|
|
C.PayThenMoney = 0;
|
|
|
C.PayPercentageOld = 0;
|
|
|
C.PayThenMoneyOld = 0;
|
|
@@ -300,7 +310,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
C.ExceedBudget = 0;
|
|
|
|
|
|
//获取新汇率 int diId,int CId, int currencyId
|
|
|
- var rate = await fn(dto.DiId, 81, dto.inviteCurrency);
|
|
|
+ var rate = await fn(dto.DiId, 81, dto.InviteCurrency);
|
|
|
|
|
|
if (rate.Code == 0)
|
|
|
{
|
|
@@ -318,36 +328,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- #region 旧汇率注释
|
|
|
- //设置该团组的汇率
|
|
|
- //Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 81);
|
|
|
- //if (_TeamRate != null)
|
|
|
- //{
|
|
|
- // if (dto.inviteCurrency == 49)
|
|
|
- // {
|
|
|
- // C.DayRate = _TeamRate.RateU;
|
|
|
- // C.RMBPrice = C.PayMoney * Convert.ToDecimal(_TeamRate.RateU);
|
|
|
- // //ccp.PayMoney = ccp.PayMoney * float.Parse(tr.RateU);
|
|
|
- // }
|
|
|
- // else if (dto.inviteCurrency == 51)
|
|
|
- // {
|
|
|
- // C.DayRate = _TeamRate.RateE;
|
|
|
- // C.RMBPrice = C.PayMoney * Convert.ToDecimal(_TeamRate.RateE);
|
|
|
- // //ccp.PayMoney = ccp.PayMoney * float.Parse(tr.RateE);
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // C.DayRate = 1M;
|
|
|
- // C.RMBPrice = C.PayMoney;
|
|
|
- // }
|
|
|
- //}
|
|
|
- //else
|
|
|
- //{
|
|
|
- // C.DayRate = 1M;
|
|
|
- // C.RMBPrice = C.PayMoney;
|
|
|
- //}
|
|
|
- #endregion
|
|
|
-
|
|
|
int cId = await _sqlSugar.Insertable(C).ExecuteReturnIdentityAsync();
|
|
|
if (cId != 0)
|
|
|
{
|
|
@@ -373,8 +353,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
InviteTime = thisTime,
|
|
|
Attachment = dto.Attachment,
|
|
|
InviteCost = dto.InviteCost,
|
|
|
- InviteCurrency = dto.inviteCurrency,
|
|
|
+ InviteCurrency = dto.InviteCurrency,
|
|
|
SendCost = dto.SendCost,
|
|
|
+ SendCurrency = dto.SendCurrency,
|
|
|
+ EventsCost = dto.EventsCost,
|
|
|
+ EventsCurrency = dto.EventsCurrency,
|
|
|
+ TranslateCost = dto.TranslateCost,
|
|
|
+ TranslateCurrency = dto.TranslateCurrency,
|
|
|
IsGoOfficaiaBussiness = dto.IsGoOfficaiaBussiness,
|
|
|
Remark = dto.Remark,
|
|
|
});
|
|
@@ -400,28 +385,29 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
RollbackTran();
|
|
|
result = new Result() { Code = -1, Msg = "添加失败!" };
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- int CTable = await _sqlSugar.Updateable<Res_InvitationOfficialActivityData>().Where(a => a.Id == ifNullUp.Id).SetColumns(a => new Res_InvitationOfficialActivityData
|
|
|
- {
|
|
|
- Contact = dto.Contact,
|
|
|
- Tel = dto.Tel,
|
|
|
- Email = dto.Email,
|
|
|
- Fax = dto.Fax,
|
|
|
- Address = dto.Address,
|
|
|
- Remark = dto.OtherInformation,
|
|
|
- }).ExecuteCommandAsync();
|
|
|
+ int CTable = await _sqlSugar.Updateable<Res_InvitationOfficialActivityData>()
|
|
|
+ .Where(a => a.Id == ifNullUp.Id)
|
|
|
+ .SetColumns(a => new Res_InvitationOfficialActivityData
|
|
|
+ {
|
|
|
+ Contact = dto.Contact,
|
|
|
+ Tel = dto.Tel,
|
|
|
+ Email = dto.Email,
|
|
|
+ Fax = dto.Fax,
|
|
|
+ Address = dto.Address,
|
|
|
+ Remark = dto.OtherInformation,
|
|
|
+ }).ExecuteCommandAsync();
|
|
|
}
|
|
|
|
|
|
Grp_CreditCardPayment grp_CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == grp_Invitation.Id && a.CTable == 81 && a.IsDel == 0);
|
|
|
if (grp_CreditCardPayment != null)
|
|
|
{
|
|
|
- grp_CreditCardPayment.PayMoney = dto.InviteCost + dto.SendCost;
|
|
|
+ grp_CreditCardPayment.PayMoney = dto.PayMoney;
|
|
|
|
|
|
//获取新汇率 int diId,int CId, int currencyId
|
|
|
- var rate = await fn(dto.DiId, 81, dto.inviteCurrency);
|
|
|
+ var rate = await fn(dto.DiId, 81, dto.InviteCurrency);
|
|
|
|
|
|
grp_CreditCardPayment.DayRate = 1;
|
|
|
grp_CreditCardPayment.RMBPrice = grp_CreditCardPayment.PayMoney;
|
|
@@ -436,17 +422,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.Id == grp_CreditCardPayment.Id).SetColumns(a => new Grp_CreditCardPayment
|
|
|
- {
|
|
|
- PayDId = dto.PayDId,
|
|
|
- PayMoney = grp_CreditCardPayment.PayMoney,
|
|
|
- PaymentCurrency = grp_Invitation.InviteCurrency,
|
|
|
- Payee = dto.Payee,
|
|
|
- OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer,
|
|
|
- DayRate = grp_CreditCardPayment.DayRate,
|
|
|
- RMBPrice = grp_CreditCardPayment.RMBPrice,
|
|
|
-
|
|
|
- }).ExecuteCommandAsync();
|
|
|
+ int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
+ .Where(a => a.Id == grp_CreditCardPayment.Id)
|
|
|
+ .SetColumns(a => new Grp_CreditCardPayment
|
|
|
+ {
|
|
|
+ PayDId = dto.PayDId,
|
|
|
+ PayMoney = grp_CreditCardPayment.PayMoney,
|
|
|
+ PaymentCurrency = dto.PaymentCurrency,
|
|
|
+ Payee = dto.Payee,
|
|
|
+ OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer,
|
|
|
+ DayRate = grp_CreditCardPayment.DayRate,
|
|
|
+ RMBPrice = grp_CreditCardPayment.RMBPrice,
|
|
|
+ }).ExecuteCommandAsync();
|
|
|
if (CTable != 0)
|
|
|
{
|
|
|
result = new Result() { Code = 0, Msg = "修改成功!" };
|