260803_03_ENH: 연구는 자기 부서 프로젝트만 보이게 수정

This commit is contained in:
2026-08-03 09:31:22 +09:00
parent 5080b79d40
commit 1fb0912010
4 changed files with 27 additions and 4 deletions

View File

@@ -97,12 +97,15 @@ public class ProjectService {
String keyword,
String userId,
String userCmpn,
String userTeam,
Integer userRole
) {
Specification<TPrjctEntity> spec = ProjectSpecs.keywordLike(keyword)
.and(ProjectSpecs.isDelFalse());
if (userRole >= ContactConstant.OUTSOURCE_USER_ROLE) {
if (isTeamUserRole(userRole)) {
spec = spec.and(ProjectSpecs.ownerDeptEqual(userTeam));
} else if (userRole >= ContactConstant.OUTSOURCE_USER_ROLE) {
if (userRole >= ContactConstant.FIELDWORK_USER_ROLE) {
spec = spec.and(ProjectSpecs.statusIn(STATUS_1));
} else {
@@ -122,6 +125,7 @@ public class ProjectService {
ProjectSearchRequestDto req,
String userId,
String userCmpn,
String userTeam,
Integer userRole
) {
Specification<TPrjctEntity> spec = ProjectSpecs.keywordLike(req.getPrjctText())
@@ -130,7 +134,9 @@ public class ProjectService {
.and(ProjectSpecs.ownerDeptIn(req.getOwnerDeptList()))
.and(ProjectSpecs.ownerFwIn(req.getOwnerFwList()));
if (userRole >= ContactConstant.OUTSOURCE_USER_ROLE) {
if (isTeamUserRole(userRole)) {
spec = spec.and(ProjectSpecs.ownerDeptEqual(userTeam));
} else if (userRole >= ContactConstant.OUTSOURCE_USER_ROLE) {
if (userRole >= ContactConstant.FIELDWORK_USER_ROLE) {
spec = spec.and(ProjectSpecs.statusIn(STATUS_1));
} else {
@@ -405,6 +411,12 @@ public class ProjectService {
private record ResolvedSurveyUrl(String finalUrl, String fullUrl, String shortUrl) {
}
private boolean isTeamUserRole(Integer userRole) {
return userRole != null
&& userRole >= ContactConstant.RESEARCHER_USER_ROLE
&& userRole < ContactConstant.RESEARCHER_USER_ROLE + 1000;
}
private String makePrjctCd(String itrntPrjctCd) {
String prefix = itrntPrjctCd + "_";