| 
						
						
							
								
							
						
						
					 | 
					@ -161,13 +161,14 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //当前客户开启了area_code_switch参数:open: 选择地区编码必填;closed:  无需选择地区编码
 | 
					 | 
					 | 
					        //当前客户开启了area_code_switch参数:open: 选择地区编码必填;closed:  无需选择地区编码
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { | 
					 | 
					 | 
					        if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            CustomerAgencyEntity parent = customerAgencyDao.selectById(originalEntity.getPid()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (null != parent) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                //开关开启后,areaCode必填
 | 
					 | 
					 | 
					                //开关开启后,areaCode必填
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                String originalAreaCode = originalEntity.getAreaCode(); | 
					 | 
					 | 
					                String originalAreaCode = originalEntity.getAreaCode(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                checkEditAgencyFormDTO(formDTO, originalEntity); | 
					 | 
					 | 
					                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)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                CustomerAgencyEntity parent = customerAgencyDao.selectById(originalEntity.getPid()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    String newAreaCode = getAgencyNewAreaCode(formDTO, parent); | 
					 | 
					 | 
					                    String newAreaCode = getAgencyNewAreaCode(formDTO, parent); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    originalEntity.setAreaCode(newAreaCode); | 
					 | 
					 | 
					                    originalEntity.setAreaCode(newAreaCode); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    originalEntity.setParentAreaCode(parent.getAreaCode()); | 
					 | 
					 | 
					                    originalEntity.setParentAreaCode(parent.getAreaCode()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -179,6 +180,7 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    updateSubOrg(originalEntity.getCustomerId(), formDTO, originalAreaCode); | 
					 | 
					 | 
					                    updateSubOrg(originalEntity.getCustomerId(), formDTO, originalAreaCode); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //1:更新当前组织信息
 | 
					 | 
					 | 
					        //1:更新当前组织信息
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (customerAgencyDao.updateById(originalEntity) < NumConstant.ONE) { | 
					 | 
					 | 
					        if (customerAgencyDao.updateById(originalEntity) < NumConstant.ONE) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -387,27 +389,6 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        agencysResultDTO.setCode(entity.getCode()); | 
					 | 
					 | 
					        agencysResultDTO.setCode(entity.getCode()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        agencysResultDTO.setContacts(entity.getContacts()); | 
					 | 
					 | 
					        agencysResultDTO.setContacts(entity.getContacts()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        agencysResultDTO.setMobile(entity.getMobile()); | 
					 | 
					 | 
					        agencysResultDTO.setMobile(entity.getMobile()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2021.5.26 sun 添加当前组织对应客户的根组织级别返参  start
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (null != entity) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (null == entity.getPids() || "".equals(entity.getPids())) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                agencysResultDTO.setRootlevel(entity.getLevel()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } else { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                String id = Arrays.asList(entity.getPids().split(":")).get(0); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                CustomerAgencyEntity rootEntity = customerAgencyDao.selectById(id); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (null != rootEntity) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    agencysResultDTO.setRootlevel(rootEntity.getLevel()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2021.5.26 sun 添加当前组织对应客户的根组织级别返参  end
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //2:查询本机关的所有上级机关,按自上而下层级顺序
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (StringUtils.isBlank(entity.getPids())) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            agencysResultDTO.setParentList(parentList); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return new Result<AgencysResultDTO>().ok(agencysResultDTO); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<String> listStr = Arrays.asList(entity.getPids().split(":")); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        parentList = customerAgencyDao.selectPAgencyById(listStr); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        agencysResultDTO.setParentList(parentList); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId())); | 
					 | 
					 | 
					        agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); | 
					 | 
					 | 
					        agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        agencysResultDTO.setAreaCode(StringUtils.isNotBlank(entity.getAreaCode())?entity.getAreaCode():StrConstant.EPMETY_STR); | 
					 | 
					 | 
					        agencysResultDTO.setAreaCode(StringUtils.isNotBlank(entity.getAreaCode())?entity.getAreaCode():StrConstant.EPMETY_STR); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -433,13 +414,30 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); | 
					 | 
					 | 
					                    agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        //2021.5.26 sun 添加当前组织对应客户的根组织级别返参  start
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (null != entity) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (null == entity.getPids() || "".equals(entity.getPids())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                agencysResultDTO.setRootlevel(entity.getLevel()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                String id = Arrays.asList(entity.getPids().split(":")).get(0); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                CustomerAgencyEntity rootEntity = customerAgencyDao.selectById(id); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                if (null != rootEntity) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    agencysResultDTO.setRootlevel(rootEntity.getLevel()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        //2021.5.26 sun 添加当前组织对应客户的根组织级别返参  end
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        //2:查询本机关的所有上级机关,按自上而下层级顺序
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (StringUtils.isBlank(entity.getPids())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            agencysResultDTO.setParentList(parentList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return new Result<AgencysResultDTO>().ok(agencysResultDTO); | 
					 | 
					 | 
					            return new Result<AgencysResultDTO>().ok(agencysResultDTO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					
 | 
					 | 
					 | 
					        List<String> listStr = Arrays.asList(entity.getPids().split(":")); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					    public static void main(String[] args) { | 
					 | 
					 | 
					        parentList = customerAgencyDao.selectPAgencyById(listStr); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        String m="1234"; | 
					 | 
					 | 
					        agencysResultDTO.setParentList(parentList); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        System.out.println(m.equals("1234") ? "yes" : "no"); | 
					 | 
					 | 
					        return new Result<AgencysResultDTO>().ok(agencysResultDTO); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param formDTO | 
					 | 
					 | 
					     * @param formDTO | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @return | 
					 | 
					 | 
					     * @return | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |