|
@@ -25,13 +25,8 @@ using System.Data.OleDb;
|
|
|
using System.Diagnostics;
|
|
|
using System.Globalization;
|
|
|
using System.IO.Compression;
|
|
|
-using NPOI.SS.Formula.Functions;
|
|
|
-using Org.BouncyCastle.Asn1.X509.Qualified;
|
|
|
-using MathNet.Numerics;
|
|
|
using static OASystem.API.OAMethodLib.JWTHelper;
|
|
|
-using Org.BouncyCastle.Asn1.Ocsp;
|
|
|
using OASystem.API.OAMethodLib.APNs;
|
|
|
-using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
|
|
|
using OASystem.Domain.AesEncryption;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
@@ -5368,25 +5363,27 @@ Group by PriceType ", dto.diId);
|
|
|
{
|
|
|
//提成方式:¥10/人×人数×段数(每个组团涉及的换机次数)
|
|
|
var listAir = _sqlSugar.Queryable<Grp_AirTicketReservations, Grp_DelegationInfo, Grp_CreditCardPayment>((x, a, b) => new
|
|
|
- JoinQueryInfos(
|
|
|
- JoinType.Left, a.Id == x.DIId,
|
|
|
- JoinType.Left, b.CTable == 85 && b.CId == x.Id)
|
|
|
- ).Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && a.IsDel == 0 && a.VisitDate >= StartDateTime
|
|
|
- && a.VisitDate <= EndDateTime && b.IsDel == 0 && auditState.Contains(b.IsAuditGM)) // 取消团组确认状态 && a.IsSure == 1
|
|
|
- .Select((x, a, b) => new
|
|
|
- {
|
|
|
- x.FlightsDescription,
|
|
|
- a.Id,
|
|
|
- a.TeamName,
|
|
|
- a.VisitDate,
|
|
|
- a.TeamLevSId,
|
|
|
- a.VisitPNumber,
|
|
|
- x.Price,
|
|
|
- x.ClientName,
|
|
|
- x.ClientNum,
|
|
|
- x.FlightsCode,
|
|
|
- a.IsSure
|
|
|
- }).ToList();
|
|
|
+ JoinQueryInfos(
|
|
|
+ JoinType.Left, a.Id == x.DIId,
|
|
|
+ JoinType.Left, b.CTable == 85 && b.CId == x.Id)
|
|
|
+ )
|
|
|
+ .Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && a.IsDel == 0 && a.VisitDate >= StartDateTime
|
|
|
+ && a.VisitDate <= EndDateTime && b.IsDel == 0 && auditState.Contains(b.IsAuditGM)) // 取消团组确认状态 && a.IsSure == 1
|
|
|
+ .Select((x, a, b) => new
|
|
|
+ {
|
|
|
+ x.FlightsDescription,
|
|
|
+ a.Id,
|
|
|
+ a.TeamName,
|
|
|
+ a.VisitDate,
|
|
|
+ a.TeamLevSId,
|
|
|
+ a.VisitPNumber,
|
|
|
+ x.Price,
|
|
|
+ x.ClientName,
|
|
|
+ x.ClientNum,
|
|
|
+ x.FlightsCode,
|
|
|
+ a.IsSure
|
|
|
+ })
|
|
|
+ .ToList();
|
|
|
|
|
|
var groupByid = listAir.GroupBy(x => x.Id);
|
|
|
foreach (var airArr in groupByid)
|
|
@@ -5505,25 +5502,27 @@ Group by PriceType ", dto.diId);
|
|
|
{
|
|
|
//标准团组:¥10/间/晚 * 实际订房间数 * 实际订房晚数; setdata id 1001 客人房
|
|
|
var listHotel = _sqlSugar.Queryable<Grp_HotelReservations, Grp_DelegationInfo, Grp_CreditCardPayment>((x, a, b) => new JoinQueryInfos(
|
|
|
- JoinType.Left, x.DiId == a.Id,
|
|
|
- JoinType.Left, b.CTable == 76 && b.CId == x.Id))
|
|
|
- .Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && a.VisitDate >= StartDateTime
|
|
|
- && a.VisitDate <= EndDateTime && a.IsDel == 0 && b.IsDel == 0 && x.CardPrice != 0 && auditState.Contains(b.IsAuditGM) && x.CheckType == 1001).Select((x, a, b) => new // && a.IsSure == 1
|
|
|
- {
|
|
|
- a.Id,
|
|
|
- a.TeamName,
|
|
|
- a.VisitDate,
|
|
|
- a.TeamLevSId,
|
|
|
- a.VisitPNumber,
|
|
|
- x.SingleRoomCount,
|
|
|
- x.SuiteRoomCount,
|
|
|
- x.DoubleRoomCount,
|
|
|
- x.OtherRoomCount,
|
|
|
- x.CheckInDate,
|
|
|
- x.CheckOutDate,
|
|
|
- x.HotelName,
|
|
|
- a.IsSure
|
|
|
- }).ToList();
|
|
|
+ JoinType.Left, x.DiId == a.Id,
|
|
|
+ JoinType.Left, b.CTable == 76 && b.CId == x.Id))
|
|
|
+ .Where((x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && a.VisitDate >= StartDateTime
|
|
|
+ && a.VisitDate <= EndDateTime && a.IsDel == 0 && b.IsDel == 0 && x.CardPrice != 0 && auditState.Contains(b.IsAuditGM) && x.CheckType == 1001)
|
|
|
+ .Select((x, a, b) => new // && a.IsSure == 1
|
|
|
+ {
|
|
|
+ a.Id,
|
|
|
+ a.TeamName,
|
|
|
+ a.VisitDate,
|
|
|
+ a.TeamLevSId,
|
|
|
+ a.VisitPNumber,
|
|
|
+ x.SingleRoomCount,
|
|
|
+ x.SuiteRoomCount,
|
|
|
+ x.DoubleRoomCount,
|
|
|
+ x.OtherRoomCount,
|
|
|
+ x.CheckInDate,
|
|
|
+ x.CheckOutDate,
|
|
|
+ x.HotelName,
|
|
|
+ a.IsSure
|
|
|
+ })
|
|
|
+ .ToList();
|
|
|
|
|
|
var groupByid = listHotel.GroupBy(x => x.Id);
|
|
|
var propertys = new string[] { "SingleRoomCount", "SuiteRoomCount", "DoubleRoomCount", "OtherRoomCount" };
|
|
@@ -5578,9 +5577,9 @@ Group by PriceType ", dto.diId);
|
|
|
}
|
|
|
else if (OP.Contains(userId))
|
|
|
{
|
|
|
- var OPList = _sqlSugar.Queryable<Grp_DelegationInfo>().Where((a) => a.IsDel == 0
|
|
|
- && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime // && a.IsSure == 1
|
|
|
- ).ToList();
|
|
|
+ var OPList = _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
+ .Where((a) => a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime )
|
|
|
+ .ToList(); // && a.IsSure == 1
|
|
|
|
|
|
var LvArr = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.STid == 70 && x.IsDel == 0).ToList();
|
|
|
|
|
@@ -5612,83 +5611,63 @@ Group by PriceType ", dto.diId);
|
|
|
//4)不付费公务活动部分(自己联络)额外奖励:¥200 / 团(若公务活动方与邀请方为同一机构,奖励金额为¥100 / 团);
|
|
|
//5)只发邀请的团组不付费邀请额外奖励:¥100 / 团;
|
|
|
//邀请方已授权我司签发的邀请仍按照:¥100 / 团,无额外奖励。
|
|
|
- var officialList = _sqlSugar.Queryable<Res_OfficialActivities, Grp_DelegationInfo>((x, a) =>
|
|
|
- new JoinQueryInfos(JoinType.Left, a.Id == x.DiId)
|
|
|
- ).Where((x, a) => x.IsSubmitApproval == 0 && x.IsDel == 0 && a.IsDel == 0
|
|
|
- && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime // && a.IsSure == 1
|
|
|
- )
|
|
|
- .Select((x, a) => new
|
|
|
- {
|
|
|
- a.Id,
|
|
|
- a.TeamName,
|
|
|
- a.VisitDate,
|
|
|
- x.CreateUserId,
|
|
|
- x.Type,
|
|
|
- a.TeamLevSId,
|
|
|
- x.Country,
|
|
|
- x.Area,
|
|
|
- x.Date,
|
|
|
- x.Client,
|
|
|
- a.IsSure,
|
|
|
- })
|
|
|
- .ToList();
|
|
|
+
|
|
|
+ const int payingOfficial = 50; // 付费单公务 50
|
|
|
+ const int notPayingOfficial = 200; // 不付费单场公务 200
|
|
|
+
|
|
|
+ //不付费邀请函 400 / 份 一个国家只发放一份邀请函费用,多拿的邀请函不进行叠加
|
|
|
+ //不付费单场公务 200 / 场 / 团 按照标准公务完成要求,确认实际场数
|
|
|
+ //付费单邀请函 100元 / 份 一个国家只发放一份邀请函费用
|
|
|
+ //付费单公务 50 / 场 / 团 按照标准公务完成要求,确认实际场数
|
|
|
+ //客户报批内容涉及的调研 / 参观性质点位 50 / 场 / 团 需提供给客户有效联系方式、点位地址等符合有效公务完成标准。每个国家原则上不超过2场(特殊增加场次以客户要求制定),超出部分,公司不发放提成。
|
|
|
+
|
|
|
+ var officialList = _sqlSugar.Queryable<Res_OfficialActivities, Grp_DelegationInfo>((x, a) => new JoinQueryInfos(JoinType.Left, a.Id == x.DiId))
|
|
|
+ .Where((x, a) => x.IsSubmitApproval == 0 && x.IsDel == 0 && a.IsDel == 0
|
|
|
+ && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime // && a.IsSure == 1
|
|
|
+ && x.CreateUserId == userId && x.DataSource != 1335) //客人不提成
|
|
|
+ .Select((x, a) => new
|
|
|
+ {
|
|
|
+ a.Id,
|
|
|
+ a.TeamName,
|
|
|
+ a.VisitDate,
|
|
|
+ x.CreateUserId,
|
|
|
+ x.Type,
|
|
|
+ a.TeamLevSId,
|
|
|
+ x.Country,
|
|
|
+ x.Area,
|
|
|
+ x.Date,
|
|
|
+ x.Client,
|
|
|
+ a.IsSure,
|
|
|
+ x.IsPay, // 是否付费
|
|
|
+ a.VisitPNumber,
|
|
|
+ })
|
|
|
+ .ToList();
|
|
|
|
|
|
var groups = officialList.GroupBy(x => x.Id);
|
|
|
|
|
|
foreach (var group in groups)
|
|
|
{
|
|
|
var groupinfo = officialList.First(x => x.Id == group.Key);
|
|
|
- var officialGroupList = group.GroupBy(d => d.CreateUserId);
|
|
|
- int operUserMax = 0, operMaxCount = 0;
|
|
|
-
|
|
|
- foreach (var item in officialGroupList)
|
|
|
- {
|
|
|
- if (item.Count() > operMaxCount)
|
|
|
- {
|
|
|
- operUserMax = item.Key;
|
|
|
- operMaxCount = item.Count();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
string temp = string.Empty;
|
|
|
- bool isBasics = operUserMax == userId;
|
|
|
var money = 0;
|
|
|
|
|
|
var infos = new List<string>();
|
|
|
+
|
|
|
foreach (var item in group)
|
|
|
{
|
|
|
- if (item.CreateUserId != user.Id)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- string info = string.Empty;
|
|
|
- if (item.Type == 0)
|
|
|
+ if (item.IsPay == 1) //付费公务
|
|
|
{
|
|
|
- money += (100 + 300);
|
|
|
- info = $"{item.Country} - {item.Area} - {item.Client} - {item.Date} 提成金额为 400";
|
|
|
+ infos.Add($"{item.Client} 为付费公务提成金额为 {payingOfficial}");
|
|
|
+ money += payingOfficial;
|
|
|
}
|
|
|
- else if (item.Type == 1)
|
|
|
- {
|
|
|
- money += 300;
|
|
|
- info = $"{item.Country} - {item.Area} - {item.Client} - {item.Date} 提成金额为 300";
|
|
|
- }
|
|
|
- else if (item.Type == 2)
|
|
|
+ else
|
|
|
{
|
|
|
- money += 200;
|
|
|
- info = $"{item.Country} - {item.Area} - {item.Client} - {item.Date} 提成金额为 200";
|
|
|
+ infos.Add($"{item.Client} 为非付费公务提成金额为 {notPayingOfficial}");
|
|
|
+ money += notPayingOfficial;
|
|
|
}
|
|
|
- infos.Add(info);
|
|
|
}
|
|
|
|
|
|
- if (isBasics)
|
|
|
- {
|
|
|
- infos.Add($"{groupinfo.TeamName} 该人员{user.CnName}操作场数最多,基本提成为{150}");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- infos.Add($"{groupinfo.TeamName} 操作场数不是最多人员,所以无基本提成");
|
|
|
- }
|
|
|
+ temp = "本团人数" + groupinfo.VisitPNumber + ",该人员" + user.CnName + "共操作公务数" + group.Count() + $",付费公务提成金额为{payingOfficial}" + $",非付费公务提成金额为{notPayingOfficial},"+ user.CnName + "提成共" + money + "元"; ;
|
|
|
|
|
|
resultArr.Add(new ComputeRoyaltiesView
|
|
|
{
|
|
@@ -5712,8 +5691,9 @@ Group by PriceType ", dto.diId);
|
|
|
var whereExpression = Expressionable.Create<Grp_VisaInfo, Grp_DelegationInfo, Grp_CreditCardPayment>()
|
|
|
.And(
|
|
|
(x, a, b) => x.IsDel == 0 && x.CreateUserId == userId && (b.IsAuditGM == 1 || b.IsAuditGM == 3)
|
|
|
- && a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && b.IsDel == 0 && x.IsThird == 0 && x.PassengerType == 974
|
|
|
- && auditState.Contains(b.IsAuditGM) // && a.IsSure == 1
|
|
|
+ && a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime
|
|
|
+ && b.IsDel == 0 && x.IsThird == 0 && x.PassengerType == 974
|
|
|
+ && auditState.Contains(b.IsAuditGM) // && a.IsSure == 1
|
|
|
);
|
|
|
var listVisa = _sqlSugar.Queryable<Grp_VisaInfo, Grp_DelegationInfo, Grp_CreditCardPayment>((x, a, b) => new
|
|
|
JoinQueryInfos(
|