|
|
|
@ -64,27 +64,24 @@ public class AnlsSmltService {
|
|
|
|
|
String appAuth = jwtTokenUtil.getUserAuthByToken(); |
|
|
|
|
List<JwtGroupModel> groupAuth = jwtTokenUtil.getGroupAuthByToken(); |
|
|
|
|
int cstmrSno = jwtTokenUtil.getCstmrSnoByToken(); |
|
|
|
|
List<JwtGroupModel> groupAdminList = new ArrayList<>(); |
|
|
|
|
for(JwtGroupModel list : groupAuth) { |
|
|
|
|
if(list.getGroupAuthCd().equals("MASTER") || list.getGroupAuthCd().equals("LEADER")) { |
|
|
|
|
groupAdminList.add(list); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<AnlsHstryModel> resultList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
if(appAuth.equals("SUPER")||appAuth.equals("ADMIN")) { // App 권한이 수퍼 / 어드민일 경우 목록 전부 표출
|
|
|
|
|
resultList = query.listCntrlBas(rq); |
|
|
|
|
} else if(groupAdminList.size()>0) { // App 권한은 user이지만 group 권한이 LEADER / MASTER인 그룹이 있는 경우 해당 그룹의 비행 이력 목록 표출
|
|
|
|
|
for (JwtGroupModel list : groupAdminList) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(appAuth.equals("USER") || appAuth.equals("ROLE_USER")) { // App 권한은 user이지만 group 권한이 LEADER / MASTER인 그룹이 있는 경우 해당 그룹의 비행 이력 목록 표출
|
|
|
|
|
for (JwtGroupModel list : groupAuth) { |
|
|
|
|
if(list.getGroupAuthCd().equals("MASTER") || list.getGroupAuthCd().equals("LEADER")) { |
|
|
|
|
List<AnlsHstryModel> result = query.cntrlBasAuthList(rq, list.getGroupId()); |
|
|
|
|
if (result.size() > 0) { |
|
|
|
|
resultList.addAll(result); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (resultList == null || resultList.size() == 0) { /* App 권한이 유저이면서 group 권한도 모두 NORMAL인 ID인 경우 본인이 생성한 |
|
|
|
|
기체만 조회 */ |
|
|
|
|
} |
|
|
|
|
if ( resultList.size() < 1) { /* App 권한이 유저이면서 group 권한도 모두 NORMAL인 ID인 경우 본인이 생성한 기체만 조회 */ |
|
|
|
|
List<ComIdntfBas> idntfList = comIdntBasRepository.findIdntfNumber(cstmrSno); |
|
|
|
|
if (idntfList.size() > 0) { |
|
|
|
|
for (ComIdntfBas list : idntfList) { |
|
|
|
@ -106,7 +103,6 @@ public class AnlsSmltService {
|
|
|
|
|
resultList.addAll(query.cntrlBasNormalPlanList(rq, list.getPlanSno())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
Comparator<AnlsHstryModel> comparator = (o1, o2) -> { |
|
|
|
|
if (DateUtils.diffSecond(o1.getCntrlStDt(), o2.getCntrlStDt()) < 0) { |
|
|
|
|
return 1; |
|
|
|
@ -118,6 +114,9 @@ public class AnlsSmltService {
|
|
|
|
|
|
|
|
|
|
Collections.sort(resultList, comparator); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return resultList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|