| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -84,7 +84,7 @@ namespace Shentun.Peis.CustomerOrgs | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            #endregion
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					              | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return new CustomerOrg(GuidGenerator.Create()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                DisplayName = entity.DisplayName, | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -104,7 +104,8 @@ namespace Shentun.Peis.CustomerOrgs | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Remark = entity.Remark, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                ShortName = entity.ShortName, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                IsActive = entity.IsActive, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Telephone = entity.Telephone | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Telephone = entity.Telephone, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                CountryOrgCode = entity.CountryOrgCode | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -162,6 +163,7 @@ namespace Shentun.Peis.CustomerOrgs | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            targetEntity.ShortName = sourceEntity.ShortName; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            targetEntity.IsActive = sourceEntity.IsActive; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            targetEntity.Telephone = sourceEntity.Telephone; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            targetEntity.CountryOrgCode = sourceEntity.CountryOrgCode; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -227,7 +229,8 @@ namespace Shentun.Peis.CustomerOrgs | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //最大pathcode
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                var LastPathCode = (await _repository.GetListAsync(o => o.ParentId == Guid.Empty || o.ParentId == null)) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        .OrderByDescending(o => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        .OrderByDescending(o => | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            var sortCode = o.PathCode.Replace(".", ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            return Convert.ToInt32(sortCode); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -251,7 +254,8 @@ namespace Shentun.Peis.CustomerOrgs | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //最大pathcode
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                var LastPathCode = (await _repository.GetListAsync(o => o.ParentId == parentId)) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                     .OrderByDescending(o => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                     .OrderByDescending(o => | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                     { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                         var sortCode = o.PathCode.Replace(".", ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                         return Convert.ToInt32(sortCode); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                     }).Select(s => s.PathCode).FirstOrDefault(); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -306,12 +310,12 @@ namespace Shentun.Peis.CustomerOrgs | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        public async Task<CustomerOrg> GetTopCustomerOrgAsync(Guid CustomerOrgId) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var entity =  await _repository.GetAsync(CustomerOrgId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(entity.Id == GuidFlag.PersonCustomerOrgId) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            var entity = await _repository.GetAsync(CustomerOrgId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (entity.Id == GuidFlag.PersonCustomerOrgId) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return entity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(entity.PathCode.Length == 5) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (entity.PathCode.Length == 5) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return entity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -380,6 +384,6 @@ namespace Shentun.Peis.CustomerOrgs | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					         | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} |