| 
					
				 | 
			
			
				@@ -4,6 +4,7 @@ using NPOI.SS.Formula.Functions; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using OASystem.Domain; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using OASystem.Domain.Dtos.Financial; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using OASystem.Domain.Dtos.Groups; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+using OASystem.Domain.Entities.Customer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using OASystem.Domain.Entities.Financial; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using OASystem.Domain.Entities.Groups; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using OASystem.Domain.ViewModels.Financial; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -83,12 +84,67 @@ namespace OASystem.Infrastructure.Repositories.Groups 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                 (select Name from Sys_SetData where isdel=0 and v.VisaCurrency=Id) VisaCurrencyStr from 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                 Grp_VisaInfo v {0} order by CreateTime desc",sqlWhere); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     List<VisaInfoView> infoViews = _sqlSugar.SqlQueryable<VisaInfoView>(sql).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    var parseIntValue = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    var CrmIds = (from item in infoViews 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                  where item.VisaClient.Contains(",") || int.TryParse(item.VisaClient, out parseIntValue) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                  select item.VisaClient).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    var strCrmIds = string.Join(',', CrmIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    List<Crm_DeleClient> clietArr = new List<Crm_DeleClient>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (!string.IsNullOrWhiteSpace(strCrmIds)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        sql = string.Format("SELECT * FROM Crm_DeleClient cdc where id in ({0}) and IsDel  = 0", strCrmIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        clietArr = _sqlSugar.SqlQueryable<Crm_DeleClient>(sql).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     foreach (VisaInfoView view in infoViews) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if (view.IsAuditGM == 0) view.IsAuditGMStr = "未审核"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         else if (view.IsAuditGM == 1) view.IsAuditGMStr = "已通过"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         else if (view.IsAuditGM == 2) view.IsAuditGMStr = "未通过"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         else if (view.IsAuditGM == 3) view.IsAuditGMStr = "自动审核"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (view.VisaClient.Contains(",")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                var splitArr = view.VisaClient.Split(','); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                var name = string.Empty; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                var i = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                while (i < splitArr.Count()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (int.TryParse(splitArr[i], out parseIntValue)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        var clientObject = clietArr.Find(x => x.Id == parseIntValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        name += (clientObject?.LastName + clientObject?.FirstName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (i < splitArr.Count()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        name += " "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (!string.IsNullOrWhiteSpace(name)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    view.VisaClient = name.TrimEnd(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (int.TryParse(view.VisaClient, out parseIntValue)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            var name = string.Empty; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            var clientObject = clietArr.Find(x => x.Id == parseIntValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            name += (clientObject?.LastName + clientObject?.FirstName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (!string.IsNullOrWhiteSpace(name)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                view.VisaClient = name; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return result = new Result() { Code = 0, Msg = "查询成功!", Data = infoViews }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -102,12 +158,67 @@ namespace OASystem.Infrastructure.Repositories.Groups 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                             ) temp Where RowNumber Between {1} and {2}", sqlWhere, startIndex, endIndex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     List<VisaInfoView> infoViews = _sqlSugar.SqlQueryable<VisaInfoView>(sql).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    var parseIntValue = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    var CrmIds = (from item in infoViews 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                  where item.VisaClient.Contains(",") || int.TryParse(item.VisaClient, out parseIntValue) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                  select item.VisaClient).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    var strCrmIds = string.Join(',', CrmIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    List<Crm_DeleClient> clietArr = new List<Crm_DeleClient>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (!string.IsNullOrWhiteSpace(strCrmIds)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        sql = string.Format("SELECT * FROM Crm_DeleClient cdc where id in ({0}) and IsDel  = 0", strCrmIds); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        clietArr = _sqlSugar.SqlQueryable<Crm_DeleClient>(sql).ToList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     foreach (VisaInfoView view in infoViews) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if (view.IsAuditGM == 0) view.IsAuditGMStr = "未审核"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         else if (view.IsAuditGM == 1) view.IsAuditGMStr = "已通过"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         else if (view.IsAuditGM == 2) view.IsAuditGMStr = "未通过"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         else if (view.IsAuditGM == 3) view.IsAuditGMStr = "自动审核"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (view.VisaClient.Contains(",")) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                var splitArr = view.VisaClient.Split(','); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                var name = string.Empty; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                var i = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                while (i < splitArr.Count()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (int.TryParse(splitArr[i], out parseIntValue)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        var clientObject = clietArr.Find(x => x.Id == parseIntValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        name += (clientObject?.LastName + clientObject?.FirstName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    if (i < splitArr.Count()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                        name += "[*TuT*]"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                if (!string.IsNullOrWhiteSpace(name)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                    view.VisaClient = name.TrimEnd(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if (int.TryParse(view.VisaClient, out parseIntValue)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            var name = string.Empty; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            var clientObject = clietArr.Find(x => x.Id == parseIntValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            name += (clientObject?.LastName + clientObject?.FirstName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            if (!string.IsNullOrWhiteSpace(name)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                view.VisaClient = name; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     string CountSql = string.Format(@"Select COUNT(1) as Count From (	 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                             Select v.*,c.IsAuditGM,s.Name as VisaCurrencyStr 
			 |