fix
This commit is contained in:
parent
da7f9f0c88
commit
46b7a7591c
@ -5,7 +5,9 @@ import com.google.common.collect.Lists;
|
|||||||
import com.lz.common.utils.DateUtils;
|
import com.lz.common.utils.DateUtils;
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.StringUtil;
|
import com.lz.common.utils.StringUtil;
|
||||||
|
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.flow.entity.FlowStart;
|
import com.lz.modules.flow.entity.FlowStart;
|
||||||
import com.lz.modules.flow.entity.StaffRole;
|
import com.lz.modules.flow.entity.StaffRole;
|
||||||
@ -52,6 +54,8 @@ public class AssessServiceImpl implements AssessService {
|
|||||||
private StaffRoleService staffRoleService;
|
private StaffRoleService staffRoleService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private FlowStartService flowStartService;
|
private FlowStartService flowStartService;
|
||||||
|
@Autowired
|
||||||
|
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageUtils userTaskList(AssessTaskReq req,Long userId) {
|
public PageUtils userTaskList(AssessTaskReq req,Long userId) {
|
||||||
@ -101,21 +105,29 @@ public class AssessServiceImpl implements AssessService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
if (staffRole.getDepartmentId() == 1) {
|
||||||
if (CollectionUtils.isNotEmpty(staffRoleDepartments)) {
|
DepartmentsStaffRelateEntity entity = departmentsStaffRelateService.selectByStaffId(staffId);
|
||||||
List<String> allDepart = new ArrayList<>();
|
List<String> strings = staffService.selectAllDeparmentIdsByDepartmentParentId(entity.getDepartmentId());
|
||||||
staffRoleDepartments.forEach(staffRoleDepartment -> {
|
log.info("获取到权限对应的部门 " + JSON.toJSONString(strings));
|
||||||
List<String> strings = staffService.selectAllDeparmentIdsByDepartmentParentId(staffRoleDepartment.getDepartmentId());
|
return strings;
|
||||||
allDepart.addAll(strings);
|
|
||||||
});
|
|
||||||
|
|
||||||
List<String> collect = allDepart.stream().distinct().collect(Collectors.toList());
|
|
||||||
log.info("获取到权限对应的部门 " + JSON.toJSONString(collect));
|
|
||||||
return collect;
|
|
||||||
}
|
}
|
||||||
log.info("未获取到用户权限对应的部门 roleID: " + staffRole.getId());
|
else if(staffRole.getDepartmentId() == 2){
|
||||||
return Collections.EMPTY_LIST;
|
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
||||||
}
|
if (CollectionUtils.isNotEmpty(staffRoleDepartments)) {
|
||||||
|
List<String> allDepart = new ArrayList<>();
|
||||||
|
staffRoleDepartments.forEach(staffRoleDepartment -> {
|
||||||
|
List<String> strings = staffService.selectAllDeparmentIdsByDepartmentParentId(staffRoleDepartment.getDepartmentId());
|
||||||
|
allDepart.addAll(strings);
|
||||||
|
});
|
||||||
|
|
||||||
|
List<String> collect = allDepart.stream().distinct().collect(Collectors.toList());
|
||||||
|
log.info("获取到权限对应的部门 " + JSON.toJSONString(collect));
|
||||||
|
return collect;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info("未获取到用户权限对应的部门 roleID: " + staffRole.getId());
|
||||||
|
return Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user