|  | @@ -28,11 +28,13 @@ import com.xunmei.common.security.utils.DictUtils;
 | 
	
		
			
				|  |  |  import com.xunmei.common.security.utils.SecurityUtils;
 | 
	
		
			
				|  |  |  import com.xunmei.system.api.domain.SysDictData;
 | 
	
		
			
				|  |  |  import com.xunmei.system.api.domain.SysOrg;
 | 
	
		
			
				|  |  | +import com.xunmei.system.api.domain.SysOrgExtend;
 | 
	
		
			
				|  |  |  import com.xunmei.system.api.vo.FindOrgTypes;
 | 
	
		
			
				|  |  |  import com.xunmei.system.api.vo.SysOrgVO;
 | 
	
		
			
				|  |  |  import com.xunmei.system.domain.SysPhysicalDefenseConstruction;
 | 
	
		
			
				|  |  |  import com.xunmei.system.dto.SysOrgDto;
 | 
	
		
			
				|  |  |  import com.xunmei.system.dto.SysPhysicalDefenseConstructionDTO;
 | 
	
		
			
				|  |  | +import com.xunmei.system.mapper.SysOrgExtendMapper;
 | 
	
		
			
				|  |  |  import com.xunmei.system.mapper.SysOrgMapper;
 | 
	
		
			
				|  |  |  import com.xunmei.system.mapper.SysPhysicalDefenseConstructionMapper;
 | 
	
		
			
				|  |  |  import com.xunmei.system.mapper.SysUserMapper;
 | 
	
	
		
			
				|  | @@ -70,6 +72,9 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private SysPhysicalDefenseConstructionMapper sysPhysicalDefenseConstructionMapper;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private SysOrgExtendMapper sysOrgExtendMapper;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      private static List<SysOrg> handleTree(Map<Long, List<SysOrg>> map, Long parentId) {
 | 
	
		
			
				|  |  |          List<SysOrg> orgList = map.get(parentId);
 | 
	
		
			
				|  |  |          if (ObjectUtil.isNotEmpty(orgList)) {
 | 
	
	
		
			
				|  | @@ -827,6 +832,15 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
 | 
	
		
			
				|  |  |                  org.setAffiliatedArea(hsAndDqOrgNames.get(1));
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +            // 机构类型 变化后 需删除 机构扩展新和 GA38 达标信息
 | 
	
		
			
				|  |  | +            if(!ObjectUtil.equal(originalOrg.getType(),org.getType()))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                // 删除GA38 信息
 | 
	
		
			
				|  |  | +                sysPhysicalDefenseConstructionMapper.delete(new LambdaQueryWrapper<SysPhysicalDefenseConstruction>().eq(SysPhysicalDefenseConstruction::getOrgId,org.getId()));
 | 
	
		
			
				|  |  | +                // 删除机构扩展信息
 | 
	
		
			
				|  |  | +                sysOrgExtendMapper.delete(new LambdaQueryWrapper<SysOrgExtend>().eq(SysOrgExtend::getOrgId,org.getId()));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              isOk = this.updateById(org);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          } else {
 | 
	
	
		
			
				|  | @@ -891,8 +905,13 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | +    @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  |      public boolean removeOrg(Long orgId) {
 | 
	
		
			
				|  |  |          boolean rel = this.removeById(orgId);
 | 
	
		
			
				|  |  | +        // 删除机构扩展信息,GA38 信息
 | 
	
		
			
				|  |  | +        sysPhysicalDefenseConstructionMapper.delete(new LambdaQueryWrapper<SysPhysicalDefenseConstruction>().eq(SysPhysicalDefenseConstruction::getOrgId,orgId));
 | 
	
		
			
				|  |  | +        sysOrgExtendMapper.delete(new LambdaQueryWrapper<SysOrgExtend>().eq(SysOrgExtend::getOrgId,orgId));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          /*
 | 
	
		
			
				|  |  |           * 重置缓存
 | 
	
		
			
				|  |  |           */
 |