| 
						
						
							
								
							
						
						
					 | 
					@ -163,7 +163,7 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { | 
					 | 
					 | 
					        if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            //开关开启后,areaCode必填
 | 
					 | 
					 | 
					            //开关开启后,areaCode必填
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            String originalAreaCode =originalEntity.getAreaCode(); | 
					 | 
					 | 
					            String originalAreaCode =originalEntity.getAreaCode(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            checkEditAgencyFormDTO(formDTO,originalAreaCode); | 
					 | 
					 | 
					            checkEditAgencyFormDTO(formDTO,originalEntity); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            // 1、之前当前组织没有编码,本次修改设置了编码
 | 
					 | 
					 | 
					            // 1、之前当前组织没有编码,本次修改设置了编码
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            // 2、之前已经有编码,本次修改为了其他编码
 | 
					 | 
					 | 
					            // 2、之前已经有编码,本次修改为了其他编码
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalAreaCode)) { | 
					 | 
					 | 
					            if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalAreaCode)) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -306,7 +306,9 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * 如果当前客户开启了areaCode,校验参数逼单 | 
					 | 
					 | 
					     * 如果当前客户开启了areaCode,校验参数逼单 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param formDTO | 
					 | 
					 | 
					     * @param formDTO | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     */ | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO,String originalAreaCode) { | 
					 | 
					 | 
					    private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO,CustomerAgencyEntity originalEntity) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        //根组织不允许修改
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (StringUtils.isNotBlank(originalEntity.getPid()) && !NumConstant.ZERO_STR.equals(originalEntity.getPid())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (StringUtils.isBlank(formDTO.getAreaCode())) { | 
					 | 
					 | 
					            if (StringUtils.isBlank(formDTO.getAreaCode())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open areaCode不能为空", "组织区划不能为空"); | 
					 | 
					 | 
					                throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open areaCode不能为空", "组织区划不能为空"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -314,13 +316,14 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open parentAreaCode不能为空", "请先设置上级组织的组织区划"); | 
					 | 
					 | 
					                throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open parentAreaCode不能为空", "请先设置上级组织的组织区划"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            //如果当前组织已经使用了自定义编码,不允许在选择其他。
 | 
					 | 
					 | 
					            //如果当前组织已经使用了自定义编码,不允许在选择其他。
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (StringUtils.isNotBlank(originalAreaCode) | 
					 | 
					 | 
					            if (StringUtils.isNotBlank(originalEntity.getAreaCode()) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                && originalAreaCode.contains("UD") | 
					 | 
					 | 
					                    && originalEntity.getAreaCode().contains("UD") | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    && StringUtils.isNotBlank(formDTO.getAreaCode()) | 
					 | 
					 | 
					                    && StringUtils.isNotBlank(formDTO.getAreaCode()) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    && "other".equals(formDTO.getAreaCode())) { | 
					 | 
					 | 
					                    && "other".equals(formDTO.getAreaCode())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义编码不允许修改", "自定义组织区划代码不允许修改"); | 
					 | 
					 | 
					                throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义编码不允许修改", "自定义组织区划代码不允许修改"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param formDTO | 
					 | 
					 | 
					     * @param formDTO | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -398,7 +401,7 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2021.5.26 sun 添加当前组织对应客户的根组织级别返参  end
 | 
					 | 
					 | 
					        //2021.5.26 sun 添加当前组织对应客户的根组织级别返参  end
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2:查询本机关的所有上级机关,按自上而下层级顺序
 | 
					 | 
					 | 
					        //2:查询本机关的所有上级机关,按自上而下层级顺序
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (null == entity.getPids()) { | 
					 | 
					 | 
					        if (StringUtils.isBlank(entity.getPids())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            agencysResultDTO.setParentList(parentList); | 
					 | 
					 | 
					            agencysResultDTO.setParentList(parentList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return new Result<AgencysResultDTO>().ok(agencysResultDTO); | 
					 | 
					 | 
					            return new Result<AgencysResultDTO>().ok(agencysResultDTO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |