| 
					
				 | 
			
			
				@@ -4802,6 +4802,8 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var teamLv = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.STid == 56 && x.IsDel == 0).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            var auditState = new int[] { 1 , 3 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (AirTicket.Contains(userId)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //提成方式:¥10/人×人数×段数(每个组团涉及的换机次数) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4810,7 +4812,7 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     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  && (b.IsAuditGM == 1 || b.IsAuditGM == 3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    && a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && b.IsDel == 0 && a.IsSure == 1 ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    && a.IsDel == 0 && a.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && b.IsDel == 0 && a.IsSure == 1 && auditState.Contains(b.IsAuditGM) ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .Select((x, a, b) => new 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         x.FlightsDescription, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -4939,12 +4941,12 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             else if (Hotel.Contains(userId)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                //标准团组:¥10/间/晚 * 实际订房间数 * 实际订房晚数; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //标准团组:¥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).Select((x,a,b)=> new 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    && a.VisitDate <= EndDateTime && a.IsDel == 0 && b.IsDel == 0 && x.CardPrice > 0 && a.IsSure == 1 && auditState.Contains(b.IsAuditGM) && x.CheckType == 1001).Select((x,a,b)=> new 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         a.Id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         a.TeamName, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5013,7 +5015,7 @@ 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.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && a.IsSure == 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  ).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 var LvArr = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.STid == 70 && x.IsDel == 0).ToList(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5048,7 +5050,7 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 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.VisitDate >= StartDateTime && a.VisitDate <= EndDateTime && a.IsSure == 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 .Select((x, a) => new 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5138,11 +5140,13 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 1)办理英国、加拿大、美国签证¥50元 / 人 / 团; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // 申根国家及其他所有国家¥30元 / 人 / 团; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // setdata id 974 客人 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 var existsCountry = new string[] { "英国", "加拿大", "美国" }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 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 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        && a.IsSure == 1 && auditState.Contains(b.IsAuditGM) && x.PassengerType == 974 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     ); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 var listVisa = _sqlSugar.Queryable<Grp_VisaInfo, Grp_DelegationInfo, Grp_CreditCardPayment>((x, a, b) => new 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     JoinQueryInfos( 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5363,7 +5367,8 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     Price = x.Price, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     VisitDate = x.VisitDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     TeamName = x.TeamName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    Temp = x.Temp 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Temp = x.Temp, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    IsSeed = 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 var expressionSoftDeleteWhere = Expressionable.Create<Fin_RoyaltyConfirm>() 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5371,7 +5376,7 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .And(it => it.VisitDate <= EndDateTime) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .And(it => it.IsDel == 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .And(it => it.UserId == dto.UserId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    .And(it => it.IsConfirm == 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .And(it => it.IsSeed == 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .ToExpression(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 var expressionSelectWhere = Expressionable.Create<Fin_RoyaltyConfirm>() 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5379,7 +5384,7 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .And(it => it.VisitDate <= EndDateTime) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .And(it => it.IsDel == 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .And(it => it.UserId == dto.UserId) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    .And(it => it.IsConfirm == 1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    .And(it => it.IsSeed == 1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .ToExpression(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 _sqlSugar.BeginTran(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5401,7 +5406,7 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     //调用通知 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     var title = "提成确认"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     var center = $@"{dto.StartData}-{dto.EndData}提成财务已确认,请尽快查看! 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-【{dto.StartData}-{dto.EndData}】"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+【{dto.StartData}-{dto.EndData}-{dto.CompanyId}-{dto.DeparId}-{dto.UserId}】"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     var ids = new List<int> { 235 }; //dto.UserId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations,title, center, ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5467,6 +5472,7 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     x.TeamLvStr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     x.Temp, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     x.VisitDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    x.IsSeed 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 jw = JsonView(true, "获取成功!", query); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -5518,6 +5524,33 @@ Group by PriceType ", dto.diId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return Ok(jw); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// 提成发放 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <param name="dto"></param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <returns></returns> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        [HttpPost] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public IActionResult RoyaltySeed(RoyaltySeedDto dto) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            var jw = JsonView(false); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (dto.Data != null && dto.Data.Count > 0) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                var updateCount = _sqlSugar.Updateable<Fin_RoyaltyConfirm>().SetColumns(x => new Fin_RoyaltyConfirm 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { IsSeed = 1 }).Where(x => dto.Data.Contains(x.Id) && x.IsDel == 0 && x.IsConfirm == 1).ExecuteCommand(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                var info = $"{updateCount}个团组提成发放成功!"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (dto.Data.Count > updateCount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    info += $"{dto.Data.Count - updateCount}个团组未确认!"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                jw = JsonView(true, info); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                jw.Msg = "发放的数据为空!"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return Ok(jw); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         #endregion 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |