Commit a48d68ad authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.7' into MVP1.7.7

parents 70a01c4f 07825874
......@@ -17,7 +17,7 @@ import java.util.Date;
* @date 2025-02-25 14:48:11
*/
@Data
@ColumnWidth(15)
@ColumnWidth(17)
public class EmployeeRegistrationExportVo implements Serializable {
@ExcelAttribute(name = "员工姓名")
......
......@@ -17,7 +17,7 @@ import java.util.Date;
* @date 2025-02-25 14:48:11
*/
@Data
@ColumnWidth(15)
@ColumnWidth(17)
public class EmployeeRegistrationHrExportVo implements Serializable {
@ExcelAttribute(name = "项目编码")
......
......@@ -51,6 +51,8 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
List<SysDept> getDeptListByDeptId(@Param("deptIdSplit") String deptIdSplit, @Param("deptId") Long deptId);
List<SysDept> getDeptListByDeptIdSet(@Param("departIdSet") Set<String> departIdSet);
/**
* 客户服务平台——查询部门管理数据
*
......
......@@ -345,6 +345,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
// 获取用户部门集合
Set<String> allDepartIdSet = new HashSet<>();
Set<String> departIdSet = authority.getDepartIdSet();
if(Common.isEmpty(departIdSet)){
return cspDeptTree;
}
List<SysDeptVo> deptVoList = baseMapper.cspDeptListByDeptIdSet(dept, departIdSet);
if(Common.isNotNull(deptVoList)){
// 将指定部门和祖级部门都存到一个集合里
......@@ -629,7 +632,6 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
List<DeptSortVo> moveVos = dept.getDeptSortList();
baseMapper.batchUpdateSort(moveVos);
// 清理用户权限
// List<String> userNames = sysUserMapper.getCspUserByDeptId(dept.getDeptId());
List<String> userNames = sysUserMapper.getCspUserByProjectNo(updateEntity.getProjectNo());
if (Common.isNotNull(userNames)){
for (String us:userNames){
......
......@@ -218,16 +218,22 @@ public class SysUserDeptPermissionServiceImpl extends ServiceImpl<SysUserDeptPer
if (CommonConstants.ZERO_STRING.equals(tPermissionInfo.getPermissionsType())) {
// 全部数据
authority.setHaveAll(true);
// redisUtil.set(CacheConstants.PROJECT_USER_PERMISSION + projectNoStr +"_"+ userId, authority);
} else if (CommonConstants.THREE_STRING.equals(tPermissionInfo.getPermissionsType())) {
// 指定部门权限
if (Common.isNotKong(tPermissionInfo.getAppointDeptScope())) {
authority.setHaveAll(false);
String[] appointDeptIdArr = tPermissionInfo.getAppointDeptScope().split(CommonConstants.COMMA_STRING);
Set<String> appointDeptIdSet = Arrays.stream(appointDeptIdArr).collect(Collectors.toSet());
authority.setDepartIdSet(appointDeptIdSet);
// 过滤被删除的数据
sysDeptList = sysDeptMapper.getDeptListByDeptIdSet(appointDeptIdSet);
Set<String> normalDeptIdSet = new HashSet<>();
if(Common.isNotNull(sysDeptList)){
for(SysDept dept : sysDeptList){
normalDeptIdSet.add(dept.getDeptId().toString());
}
}
authority.setDepartIdSet(normalDeptIdSet);
authority.setUserId(userId);
// redisUtil.set(CacheConstants.PROJECT_USER_PERMISSION + projectNoStr +"_"+ userId, authority);
} else {
log.error("获取用户权限失败,该用户指定部门权限为空{}", userId);
authority.setHaveAll(false);
......
......@@ -63,6 +63,23 @@
and (dept_id = #{deptId} or ancestors like concat(#{deptIdSplit}, '%'))
</select>
<select id="getDeptListByDeptIdSet" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDept">
select
dept_id as deptId,
name as deptName
from
sys_dept
where
del_flag = '0'
<if test="departIdSet != null and departIdSet.size > 0">
AND dept_id in
<foreach item="idStr" index="index" collection="departIdSet" open="(" separator=","
close=")">
#{idStr}
</foreach>
</if>
</select>
<select id="cspDeptList" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptVo">
select d.dept_id, d.name, d.parent_id,d.ancestors,sort_order
from sys_dept d
......
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