| 
						
						
							
								
							
						
						
					 | 
					@ -18,7 +18,6 @@ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					package com.epmet.service.impl; | 
					 | 
					 | 
					package com.epmet.service.impl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
					 | 
					 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.baomidou.mybatisplus.core.metadata.IPage; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
					 | 
					 | 
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.constant.FieldConstant; | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.FieldConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetErrorCode; | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetErrorCode; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -34,6 +33,8 @@ import com.epmet.redis.GovRoleRedis; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.GovRoleMenuService; | 
					 | 
					 | 
					import com.epmet.service.GovRoleMenuService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.GovRoleService; | 
					 | 
					 | 
					import com.epmet.service.GovRoleService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.GovRoleUserService; | 
					 | 
					 | 
					import com.epmet.service.GovRoleUserService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.github.pagehelper.PageHelper; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.github.pagehelper.PageInfo; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.apache.commons.lang3.StringUtils; | 
					 | 
					 | 
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.springframework.beans.factory.annotation.Autowired; | 
					 | 
					 | 
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import org.springframework.stereotype.Service; | 
					 | 
					 | 
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -64,11 +65,20 @@ public class GovRoleServiceImpl extends BaseServiceImpl<GovRoleDao, GovRoleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public PageData<GovRoleDTO> page(Map<String, Object> params) { | 
					 | 
					 | 
					    public PageData<GovRoleDTO> page(Map<String, Object> params) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        IPage<GovRoleEntity> page = baseDao.selectPage( | 
					 | 
					 | 
					        Integer pageNo = Integer.valueOf((String) params.get("pageNo")); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                getPage(params, FieldConstant.CREATED_TIME, false), | 
					 | 
					 | 
					        Integer pageSize = Integer.valueOf((String) params.get("pageSize")); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                getWrapper(params) | 
					 | 
					 | 
					        String id = (String) params.get(FieldConstant.ID_HUMP); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        ); | 
					 | 
					 | 
					        String name = (String) params.get(FieldConstant.NAME_HUMP); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        return getPageData(page, GovRoleDTO.class); | 
					 | 
					 | 
					        String customerId = (String) params.get(FieldConstant.CUSTOMER_ID_HUMP); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        QueryWrapper<GovRoleEntity> wrapper = new QueryWrapper<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                .like(StringUtils.isNotBlank(name), FieldConstant.NAME, name) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                .eq(StringUtils.isNotBlank(customerId), FieldConstant.CUSTOMER_ID, customerId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        PageHelper.startPage(pageNo, pageSize); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<GovRoleEntity> list = baseDao.selectList(wrapper); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<GovRoleDTO> resList = ConvertUtils.sourceToTarget(list, GovRoleDTO.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        PageInfo<GovRoleDTO> pageInfo = new PageInfo<>(resList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return new PageData<>(resList, pageInfo.getTotal()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -79,10 +89,10 @@ public class GovRoleServiceImpl extends BaseServiceImpl<GovRoleDao, GovRoleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return ConvertUtils.sourceToTarget(entityList, GovRoleDTO.class); | 
					 | 
					 | 
					        return ConvertUtils.sourceToTarget(entityList, GovRoleDTO.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    private QueryWrapper<GovRoleEntity> getWrapper(Map<String, Object> params){ | 
					 | 
					 | 
					    private QueryWrapper<GovRoleEntity> getWrapper(Map<String, Object> params) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        String id = (String)params.get(FieldConstant.ID_HUMP); | 
					 | 
					 | 
					        String id = (String) params.get(FieldConstant.ID_HUMP); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        String name = (String)params.get(FieldConstant.NAME_HUMP); | 
					 | 
					 | 
					        String name = (String) params.get(FieldConstant.NAME_HUMP); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        String customerId = (String)params.get(FieldConstant.CUSTOMER_ID_HUMP); | 
					 | 
					 | 
					        String customerId = (String) params.get(FieldConstant.CUSTOMER_ID_HUMP); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        QueryWrapper<GovRoleEntity> wrapper = new QueryWrapper<>(); | 
					 | 
					 | 
					        QueryWrapper<GovRoleEntity> wrapper = new QueryWrapper<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id).like(StringUtils.isNotBlank(name), FieldConstant.NAME, name) | 
					 | 
					 | 
					        wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id).like(StringUtils.isNotBlank(name), FieldConstant.NAME, name) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                .eq(StringUtils.isNotBlank(customerId), FieldConstant.CUSTOMER_ID, customerId); | 
					 | 
					 | 
					                .eq(StringUtils.isNotBlank(customerId), FieldConstant.CUSTOMER_ID, customerId); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -101,7 +111,7 @@ public class GovRoleServiceImpl extends BaseServiceImpl<GovRoleDao, GovRoleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public void save(GovRoleDTO dto) { | 
					 | 
					 | 
					    public void save(GovRoleDTO dto) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        GovRoleEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleEntity.class); | 
					 | 
					 | 
					        GovRoleEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleEntity.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        insert(entity); | 
					 | 
					 | 
					        insert(entity); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //保存角色菜单关系
 | 
					 | 
					 | 
					        // 保存角色菜单关系
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        govRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); | 
					 | 
					 | 
					        govRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -110,16 +120,16 @@ public class GovRoleServiceImpl extends BaseServiceImpl<GovRoleDao, GovRoleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public void update(GovRoleDTO dto) { | 
					 | 
					 | 
					    public void update(GovRoleDTO dto) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        GovRoleEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleEntity.class); | 
					 | 
					 | 
					        GovRoleEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleEntity.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        updateById(entity); | 
					 | 
					 | 
					        updateById(entity); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //保存角色菜单关系
 | 
					 | 
					 | 
					        // 保存角色菜单关系
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        govRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); | 
					 | 
					 | 
					        govRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Transactional(rollbackFor = Exception.class) | 
					 | 
					 | 
					    @Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public void delete(String[] ids) { | 
					 | 
					 | 
					    public void delete(String[] ids) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        //联建单位负责人、社区自组织负责人两个默认解释不允许删除
 | 
					 | 
					 | 
					        // 联建单位负责人、社区自组织负责人两个默认解释不允许删除
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        GovRoleEntity entity = baseDao.selectById(ids[0]); | 
					 | 
					 | 
					        GovRoleEntity entity = baseDao.selectById(ids[0]); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if(null!=entity && "1".equals(entity.getDefaultRole())){ | 
					 | 
					 | 
					        if (null != entity && "1".equals(entity.getDefaultRole())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "系统默认角色,不允许删除", "系统默认角色,不允许删除"); | 
					 | 
					 | 
					            throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "系统默认角色,不允许删除", "系统默认角色,不允许删除"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        baseDao.deleteBatchIds(Arrays.asList(ids)); | 
					 | 
					 | 
					        baseDao.deleteBatchIds(Arrays.asList(ids)); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -144,7 +154,7 @@ public class GovRoleServiceImpl extends BaseServiceImpl<GovRoleDao, GovRoleEntit | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        entity.setRemark("默认角色"); | 
					 | 
					 | 
					        entity.setRemark("默认角色"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        entity.setDefaultRole("1"); | 
					 | 
					 | 
					        entity.setDefaultRole("1"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        list.add(entity); | 
					 | 
					 | 
					        list.add(entity); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        GovRoleEntity entity1 = ConvertUtils.sourceToTarget(entity,GovRoleEntity.class); | 
					 | 
					 | 
					        GovRoleEntity entity1 = ConvertUtils.sourceToTarget(entity, GovRoleEntity.class); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        entity1.setId(null); | 
					 | 
					 | 
					        entity1.setId(null); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        entity1.setName("社区自组织负责人"); | 
					 | 
					 | 
					        entity1.setName("社区自组织负责人"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        list.add(entity1); | 
					 | 
					 | 
					        list.add(entity1); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |