人员迁移

This commit is contained in:
zt
2025-11-28 19:51:41 +08:00
parent 13d33e9d53
commit 07b921d630
3 changed files with 15 additions and 0 deletions

View File

@ -662,6 +662,11 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
.eq(SubConstructionUser::getId, id) .eq(SubConstructionUser::getId, id)
.set(SubConstructionUser::getProjectId, req.getProjectId()) .set(SubConstructionUser::getProjectId, req.getProjectId())
.set(SubConstructionUser::getContractorId, req.getContractorId()); .set(SubConstructionUser::getContractorId, req.getContractorId());
userProjectRelevancyService.deleteByUserId(constructionUser.getSysUserId());
roleService.deleteRoleByUserIdAndProjectId(constructionUser.getSysUserId(),req.getProjectId());
return this.update(lambdaUpdate); return this.update(lambdaUpdate);
} }

View File

@ -223,4 +223,6 @@ public interface ISysRoleService {
List<Long> selectRoleIdsByName(String roleName); List<Long> selectRoleIdsByName(String roleName);
List<Long> selectUserIdsByRoleId(Long roleId); List<Long> selectUserIdsByRoleId(Long roleId);
void deleteRoleByUserIdAndProjectId(Long userId,Long projectId);
} }

View File

@ -665,4 +665,12 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
public List<Long> selectUserIdsByRoleId(Long roleId) { public List<Long> selectUserIdsByRoleId(Long roleId) {
return userRoleMapper.selectUserIdsByRoleId(roleId); return userRoleMapper.selectUserIdsByRoleId(roleId);
} }
@Override
public void deleteRoleByUserIdAndProjectId(Long userId, Long projectId) {
userRoleMapper.delete(Wrappers.lambdaQuery(SysUserRole.class)
.eq(SysUserRole::getUserId, userId)
.eq(SysUserRole::getProjectId, projectId)
);
}
} }