|
|
@@ -12,6 +12,7 @@ using OASystem.Domain.ViewModels.Groups;
|
|
|
using OASystem.Domain.ViewModels.QiYeWeChat;
|
|
|
using OASystem.Domain.ViewModels.Resource;
|
|
|
using OASystem.Infrastructure.Repositories.System;
|
|
|
+using OASystem.Infrastructure.Tools;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
@@ -62,25 +63,54 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
{
|
|
|
|
|
|
#region 团组下拉框
|
|
|
-
|
|
|
- List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == dto.CTId).ToList();
|
|
|
-
|
|
|
- string DiId = "";
|
|
|
-
|
|
|
+ var isGm = AppSettingsHelper
|
|
|
+ .Get<int>("DecreasePaymentsSelectIsGm")
|
|
|
+ .Contains(dto.UserId);
|
|
|
List<DecreasePaymentGroupView> _Delegations = new List<DecreasePaymentGroupView>();
|
|
|
- if (grp_GroupsTaskAssignment.Count > 0)
|
|
|
- {
|
|
|
|
|
|
+ if (isGm && dto.CTId != 81)
|
|
|
+ {
|
|
|
+ isGm = false;
|
|
|
+ }
|
|
|
|
|
|
- foreach (var item in grp_GroupsTaskAssignment)
|
|
|
- {
|
|
|
- DiId += item.DIId + ",";
|
|
|
- }
|
|
|
- if (DiId != "0")
|
|
|
+ if (!isGm)
|
|
|
+ {
|
|
|
+ List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == dto.CTId).ToList();
|
|
|
+ string DiId = "";
|
|
|
+ if (grp_GroupsTaskAssignment.Count > 0)
|
|
|
{
|
|
|
- DiId = DiId.Substring(0, DiId.Length - 1);
|
|
|
+ foreach (var item in grp_GroupsTaskAssignment)
|
|
|
+ {
|
|
|
+ DiId += item.DIId + ",";
|
|
|
+ }
|
|
|
+ if (DiId != "0")
|
|
|
+ {
|
|
|
+ DiId = DiId.Substring(0, DiId.Length - 1);
|
|
|
+ }
|
|
|
+ string sql = string.Format($@"Select
|
|
|
+ (select ssd.name from Sys_SetData ssd WHERE ssd.id = di.TeamLevSId) as TeamLevSId,
|
|
|
+ di.Id,
|
|
|
+ di.TeamName,
|
|
|
+ di.ClientUnit,
|
|
|
+ di.ClientName,
|
|
|
+ di.TourCode,
|
|
|
+ di.TeamDid,
|
|
|
+ sd.[Name] As TeamTypeName,
|
|
|
+ di.VisitCountry,
|
|
|
+ di.VisitStartDate,
|
|
|
+ di.VisitEndDate,
|
|
|
+ di.VisitDays,
|
|
|
+ di.VisitPNumber,
|
|
|
+ di.CreateTime
|
|
|
+ From Grp_DelegationInfo di With(NoLock)
|
|
|
+ Left Join Sys_SetData sd On di.TeamDid = sd.Id
|
|
|
+ Where di.Id in({DiId}) and di.IsDel=0
|
|
|
+ Order By di.VisitStartDate Desc");
|
|
|
+ _Delegations = _sqlSugar.SqlQueryable<DecreasePaymentGroupView>(sql).ToList();
|
|
|
}
|
|
|
-
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
string sql = string.Format($@"Select
|
|
|
(select ssd.name from Sys_SetData ssd WHERE ssd.id = di.TeamLevSId) as TeamLevSId,
|
|
|
di.Id,
|
|
|
@@ -98,10 +128,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
di.CreateTime
|
|
|
From Grp_DelegationInfo di With(NoLock)
|
|
|
Left Join Sys_SetData sd On di.TeamDid = sd.Id
|
|
|
- Where di.Id in({DiId}) and di.IsDel=0
|
|
|
+ Where di.IsDel=0
|
|
|
Order By di.VisitStartDate Desc");
|
|
|
-
|
|
|
- //DecreasePaymentGroupView
|
|
|
_Delegations = _sqlSugar.SqlQueryable<DecreasePaymentGroupView>(sql).ToList();
|
|
|
}
|
|
|
#endregion
|
|
|
@@ -189,7 +217,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
C.CardholderName = "";
|
|
|
C.PayMoney = grp_Decrease.FeeTotal;
|
|
|
C.PaymentCurrency = grp_Decrease.Currency;
|
|
|
-
|
|
|
+
|
|
|
C.CompanyBankNo = "";
|
|
|
C.OtherBankName = dto.OtherBankName;
|
|
|
C.OtherSideNo = dto.OtherSideNo;
|
|
|
@@ -382,7 +410,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
//检索历史金额
|
|
|
var histyPrice = _sqlSugar.Queryable<Grp_DecreasePayments>()
|
|
|
- .LeftJoin<Grp_CreditCardPayment>((x, a) => a.IsDel == 0 && a.CTable == 98 && a.CId == x.Id )
|
|
|
+ .LeftJoin<Grp_CreditCardPayment>((x, a) => a.IsDel == 0 && a.CTable == 98 && a.CId == x.Id)
|
|
|
.Where((x, a) => x.IsDel == 0 && x.PriceName == dto.PriceName && x.Id != grp_Decrease.Id)
|
|
|
.Select((x, a) => new
|
|
|
{
|
|
|
@@ -418,9 +446,10 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isAuto) {
|
|
|
+ if (isAuto)
|
|
|
+ {
|
|
|
|
|
|
- var execCount = _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
+ var execCount = _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
.SetColumns(a => new Grp_CreditCardPayment
|
|
|
{
|
|
|
IsAuditGM = 3, //自动审核通过
|
|
|
@@ -536,7 +565,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
if (setting != null)
|
|
|
{
|
|
|
var dbList = _sqlSugar.Queryable<Grp_DecreasePayments>()
|
|
|
- .LeftJoin<Grp_CreditCardPayment>((x,a) => x.Id == a.CId && a.IsDel == 0 && a.CTable == 98 && a.DIId == dto.DiId )
|
|
|
+ .LeftJoin<Grp_CreditCardPayment>((x, a) => x.Id == a.CId && a.IsDel == 0 && a.CTable == 98 && a.DIId == dto.DiId)
|
|
|
.Where((x, a) => x.IsDel == 0 && x.PriceName.Contains(spPriceName[0]) && x.PriceName.Contains(spPriceName[1]) && x.Id != dto.Id)
|
|
|
.Select((x, a) => new
|
|
|
{
|
|
|
@@ -558,7 +587,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
//现有金额
|
|
|
var sumPrice = dbList.Sum(x => x.RMBPrice);
|
|
|
-
|
|
|
+
|
|
|
//现有数量
|
|
|
//var sumCount = dbList.Sum(x => x.Quantity);
|
|
|
|
|
|
@@ -594,7 +623,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
})
|
|
|
.Where(a => a.CId == dto.Id && a.CTable == 98 && a.DIId == 2590)
|
|
|
.ExecuteCommand();
|
|
|
- recheck = false;
|
|
|
+ recheck = false;
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
@@ -685,7 +714,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
CommitTran();
|
|
|
|
|
|
- var data = new { ccpId = grp_CreditCardPayment.Id, sign = 2, dataId = grp_Decrease.Id ,recheck };
|
|
|
+ var data = new { ccpId = grp_CreditCardPayment.Id, sign = 2, dataId = grp_Decrease.Id, recheck };
|
|
|
|
|
|
return new JsonView() { Code = 200, Msg = "修改成功!", Data = data };
|
|
|
}
|