|
|
|
@ -182,54 +182,54 @@ public class ServiceApplicationsService { |
|
|
|
// 检查角色类型
|
|
|
|
boolean isAssociationRole = UserTypeEnum.CEO.getDesc().equals(roleCode); |
|
|
|
boolean isFirmAdminRole = UserTypeEnum.CTO.getDesc().equals(roleCode); // 律所管理员
|
|
|
|
|
|
|
|
if (isAssociationRole) { |
|
|
|
// 协会用户(CEO):可以看到所有律所提交的数据,但只显示associationAuditStatus为待审核(1)、通过(3)和拒绝(4)的数据和自己创建的数据
|
|
|
|
// CEO作为最高权限用户,不需要限制在特定部门范围内,直接设置includeAssociationReviewed即可
|
|
|
|
queryForm.setIncludeAssociationReviewed(true); |
|
|
|
} else if (isFirmAdminRole) { |
|
|
|
// 律所管理员(cto):能看到自己部门范围内的数据,但只显示firmAuditStatus为待审核、通过和拒绝的数据和自己创建的数据
|
|
|
|
Integer oneByRoleId = dataScopeViewService.getOneByRoleId(roleIdList.get(0).getRoleId()); |
|
|
|
// 获取自己部门范围内的数据
|
|
|
|
List<Long> departmentEmployees = new ArrayList<>(); |
|
|
|
if (DataScopeViewTypeEnum.ME.getValue().equals(oneByRoleId)) { |
|
|
|
departmentEmployees = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.ME, requestUser.getUserId()); |
|
|
|
} else if (DataScopeViewTypeEnum.DEPARTMENT.getValue().equals(oneByRoleId)) { |
|
|
|
departmentEmployees = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.DEPARTMENT, requestUser.getUserId()); |
|
|
|
} |
|
|
|
|
|
|
|
// 确保包含当前用户ID,以便能看到自己创建的数据
|
|
|
|
if (departmentEmployees == null) { |
|
|
|
departmentEmployees = new ArrayList<>(); |
|
|
|
} |
|
|
|
if (!departmentEmployees.contains(requestUser.getUserId())) { |
|
|
|
departmentEmployees.add(requestUser.getUserId()); |
|
|
|
} |
|
|
|
|
|
|
|
queryForm.setEmployeeIdList(departmentEmployees); |
|
|
|
// 律所管理员可以查看部门内所有已审核数据以及自己创建的有效数据(明确排除未提交的草稿)
|
|
|
|
queryForm.setIncludeFirmReviewed(true); |
|
|
|
} else { |
|
|
|
// 律所普通用户:只能看到自己提交的数据,包括所有firmAuditStatus状态
|
|
|
|
Integer oneByRoleId = dataScopeViewService.getOneByRoleId(roleIdList.get(0).getRoleId()); |
|
|
|
if (DataScopeViewTypeEnum.ME.getValue().equals(oneByRoleId)) { |
|
|
|
longs = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.ME, requestUser.getUserId()); |
|
|
|
} else if (DataScopeViewTypeEnum.DEPARTMENT.getValue().equals(oneByRoleId)) { |
|
|
|
longs = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.DEPARTMENT, requestUser.getUserId()); |
|
|
|
} |
|
|
|
// 确保普通用户至少能看到自己的数据,如果longs为空或不包含当前用户ID,则添加当前用户ID
|
|
|
|
if (longs == null) { |
|
|
|
longs = new ArrayList<>(); |
|
|
|
} |
|
|
|
if (!longs.contains(requestUser.getUserId())) { |
|
|
|
longs.add(requestUser.getUserId()); |
|
|
|
if (!UserTypeEnum.Admin.getDesc().equals(roleCode)) { |
|
|
|
if (isAssociationRole) { |
|
|
|
// 协会用户(CEO):可以看到所有律所提交的数据,但只显示associationAuditStatus为待审核(1)、通过(3)和拒绝(4)的数据和自己创建的数据
|
|
|
|
// CEO作为最高权限用户,不需要限制在特定部门范围内,直接设置includeAssociationReviewed即可
|
|
|
|
queryForm.setIncludeAssociationReviewed(true); |
|
|
|
} else if (isFirmAdminRole) { |
|
|
|
// 律所管理员(cto):能看到自己部门范围内的数据,但只显示firmAuditStatus为待审核、通过和拒绝的数据和自己创建的数据
|
|
|
|
Integer oneByRoleId = dataScopeViewService.getOneByRoleId(roleIdList.get(0).getRoleId()); |
|
|
|
// 获取自己部门范围内的数据
|
|
|
|
List<Long> departmentEmployees = new ArrayList<>(); |
|
|
|
if (DataScopeViewTypeEnum.ME.getValue().equals(oneByRoleId)) { |
|
|
|
departmentEmployees = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.ME, requestUser.getUserId()); |
|
|
|
} else if (DataScopeViewTypeEnum.DEPARTMENT.getValue().equals(oneByRoleId)) { |
|
|
|
departmentEmployees = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.DEPARTMENT, requestUser.getUserId()); |
|
|
|
} |
|
|
|
|
|
|
|
// 确保包含当前用户ID,以便能看到自己创建的数据
|
|
|
|
if (departmentEmployees == null) { |
|
|
|
departmentEmployees = new ArrayList<>(); |
|
|
|
} |
|
|
|
if (!departmentEmployees.contains(requestUser.getUserId())) { |
|
|
|
departmentEmployees.add(requestUser.getUserId()); |
|
|
|
} |
|
|
|
|
|
|
|
queryForm.setEmployeeIdList(departmentEmployees); |
|
|
|
// 律所管理员可以查看部门内所有已审核数据以及自己创建的有效数据(明确排除未提交的草稿)
|
|
|
|
queryForm.setIncludeFirmReviewed(true); |
|
|
|
} else { |
|
|
|
// 律所普通用户:只能看到自己提交的数据,包括所有firmAuditStatus状态
|
|
|
|
Integer oneByRoleId = dataScopeViewService.getOneByRoleId(roleIdList.get(0).getRoleId()); |
|
|
|
if (DataScopeViewTypeEnum.ME.getValue().equals(oneByRoleId)) { |
|
|
|
longs = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.ME, requestUser.getUserId()); |
|
|
|
} else if (DataScopeViewTypeEnum.DEPARTMENT.getValue().equals(oneByRoleId)) { |
|
|
|
longs = dataScopeViewService.getCanViewEmployeeId(DataScopeViewTypeEnum.DEPARTMENT, requestUser.getUserId()); |
|
|
|
} |
|
|
|
// 确保普通用户至少能看到自己的数据,如果longs为空或不包含当前用户ID,则添加当前用户ID
|
|
|
|
if (longs == null) { |
|
|
|
longs = new ArrayList<>(); |
|
|
|
} |
|
|
|
if (!longs.contains(requestUser.getUserId())) { |
|
|
|
longs.add(requestUser.getUserId()); |
|
|
|
} |
|
|
|
queryForm.setEmployeeIdList(longs); |
|
|
|
// 普通用户不需要审核状态过滤,可以看到自己所有状态的数据
|
|
|
|
queryForm.setNoStatusFilter(true); |
|
|
|
} |
|
|
|
queryForm.setEmployeeIdList(longs); |
|
|
|
// 普通用户不需要审核状态过滤,可以看到自己所有状态的数据
|
|
|
|
queryForm.setNoStatusFilter(true); |
|
|
|
queryForm.setCurrentUserId(requestUser.getUserId()); // 传递当前用户ID用于SQL中的特殊过滤
|
|
|
|
} |
|
|
|
queryForm.setCurrentUserId(requestUser.getUserId()); // 传递当前用户ID用于SQL中的特殊过滤
|
|
|
|
|
|
|
|
List<ServiceApplicationsVO> list = serviceApplicationsDao.queryPage(page, queryForm); |
|
|
|
if (!CollectionUtils.isEmpty(list)) { |
|
|
|
//翻译单位名称和用户名称
|
|
|
|
@ -1440,6 +1440,7 @@ public class ServiceApplicationsService { |
|
|
|
for (LawyerStatisticsVO statisticsVO : lawyerStatisticsVOPageResult) { |
|
|
|
// 创建新的查询表单对象以避免修改原始对象
|
|
|
|
LawyerStatisticsQueryForm queryForm = SmartBeanUtil.copy(originalQueryForm, LawyerStatisticsQueryForm.class); |
|
|
|
queryForm.setFirmId(statisticsVO.getFirmId()); |
|
|
|
if (queryForm.getQuarter() == null) { |
|
|
|
// 如果没有指定季度,使用上一季度的时间范围
|
|
|
|
TimeVo startQuarter = DateTimeUtil.getStartQuarter(); |
|
|
|
|