Commit bc884f69 authored by fangxinjiang's avatar fangxinjiang

客户服务平台-fxj

parent 8c11c35e
...@@ -103,4 +103,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> { ...@@ -103,4 +103,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
IPage<SysUser> cspUserPage(Page page, @Param("deptId")String deptId, @Param("userName")String userName, IPage<SysUser> cspUserPage(Page page, @Param("deptId")String deptId, @Param("userName")String userName,
@Param("nickName")String nickName, @Param("nickName")String nickName,
@Param("projectNo")String projectNo); @Param("projectNo")String projectNo);
List<String> getCspUserByDeptId(@Param("deptId")String deptId);
} }
...@@ -37,10 +37,12 @@ import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDeptMapper; ...@@ -37,10 +37,12 @@ import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDeptMapper;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysUserMapper; import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysUserMapper;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptRelationService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptRelationService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptService; import com.yifu.cloud.plus.v1.yifu.admin.service.SysDeptService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.UserPermissionVo; import com.yifu.cloud.plus.v1.yifu.common.core.vo.UserPermissionVo;
import com.yifu.cloud.plus.v1.yifu.common.ldap.util.LdapUtil; import com.yifu.cloud.plus.v1.yifu.common.ldap.util.LdapUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
...@@ -73,6 +75,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -73,6 +75,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
private final SysUserMapper sysUserMapper; private final SysUserMapper sysUserMapper;
private final RedisUtil redisUtil;
/** /**
* 添加信息部门 * 添加信息部门
* @param dept 部门 * @param dept 部门
...@@ -599,6 +603,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -599,6 +603,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
baseMapper.updateById(updateEntity); baseMapper.updateById(updateEntity);
List<DeptSortVo> moveVos = dept.getDeptSortList(); List<DeptSortVo> moveVos = dept.getDeptSortList();
baseMapper.batchUpdateSort(moveVos); baseMapper.batchUpdateSort(moveVos);
//清理用户权限
List<String> userNames = sysUserMapper.getCspUserByDeptId(dept.getDeptId());
if (Common.isNotNull(userNames)){
for (String us:userNames){
redisUtil.remove(CacheConstants.USER_DETAILS +"::"+ us);
}
}
}catch (Exception e){ }catch (Exception e){
log.error("客户服务平台机构变更异常",e); log.error("客户服务平台机构变更异常",e);
return R.failed(CommonConstants.UPDATE_DATA_FAIL); return R.failed(CommonConstants.UPDATE_DATA_FAIL);
......
...@@ -441,4 +441,10 @@ ...@@ -441,4 +441,10 @@
ORDER BY u.create_time DESC ORDER BY u.create_time DESC
</select> </select>
<select id="getCspUserByDeptId" resultType="java.lang.String">
select c.username from sys_dept a
LEFT JOIN sys_user_dept_permission b on a.dept_id=b.dept_id
LEFT JOIN sys_user c on c.user_id = b.user_id
where a.dept_id=#{deptId} or FIND_IN_SET(#{deptId},a.ancestors);
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment