|
|
@ -80,8 +80,6 @@ public class AnlsHstryService { |
|
|
|
//비행이력현황 list
|
|
|
|
//비행이력현황 list
|
|
|
|
public ComnPagingRs<AnlsHstryModel> list(AnlsHstryGroupModel rq){ |
|
|
|
public ComnPagingRs<AnlsHstryModel> list(AnlsHstryGroupModel rq){ |
|
|
|
Integer cstmrSno = jwtTokenUtil.getCstmrSnoByToken(); |
|
|
|
Integer cstmrSno = jwtTokenUtil.getCstmrSnoByToken(); |
|
|
|
List<JwtGroupModel> groupAuthList = jwtTokenUtil.getGroupAuthByToken(); |
|
|
|
|
|
|
|
String groupAuth = null; |
|
|
|
|
|
|
|
String appAuth = jwtTokenUtil.getUserAuthByToken(); |
|
|
|
String appAuth = jwtTokenUtil.getUserAuthByToken(); |
|
|
|
List<AnlsHstryModel>resultList = new ArrayList<>(); |
|
|
|
List<AnlsHstryModel>resultList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
@ -89,12 +87,7 @@ public class AnlsHstryService { |
|
|
|
Pageable pageable = PageRequest.of(rq.getPage()-1, rq.getRecord()); |
|
|
|
Pageable pageable = PageRequest.of(rq.getPage()-1, rq.getRecord()); |
|
|
|
|
|
|
|
|
|
|
|
if("USER".equals(appAuth) || "ROLE_USER".equals(appAuth)) { |
|
|
|
if("USER".equals(appAuth) || "ROLE_USER".equals(appAuth)) { |
|
|
|
for(JwtGroupModel list : groupAuthList) { |
|
|
|
if("NORMAL".equals(rq.getGroupId())) { |
|
|
|
if(list.getGroupId().equals(rq.getGroupId())) { |
|
|
|
|
|
|
|
groupAuth = list.getGroupAuthCd(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if("NORMAL".equals(groupAuth)) { |
|
|
|
|
|
|
|
List<ComIdntfBas> idntfList = comIdntBasRepository.findIdntfNumber(cstmrSno); /* App 권한이 유저이면서 group 권한도 모두 NORMAL인 ID인 경우 본인이 생성한 기체만 조회 */ |
|
|
|
List<ComIdntfBas> idntfList = comIdntBasRepository.findIdntfNumber(cstmrSno); /* App 권한이 유저이면서 group 권한도 모두 NORMAL인 ID인 경우 본인이 생성한 기체만 조회 */ |
|
|
|
if (idntfList.size() > 0) { |
|
|
|
if (idntfList.size() > 0) { |
|
|
|
for (ComIdntfBas list : idntfList) { |
|
|
|
for (ComIdntfBas list : idntfList) { |
|
|
@ -126,16 +119,8 @@ public class AnlsHstryService { |
|
|
|
}; |
|
|
|
}; |
|
|
|
Collections.sort(resultList, comparator); |
|
|
|
Collections.sort(resultList, comparator); |
|
|
|
|
|
|
|
|
|
|
|
long totalPage = resultList.size() % rq.getRecord() > 0 ? (resultList.size()/rq.getRecord()) + 1 : resultList.size()/rq.getRecord(); |
|
|
|
|
|
|
|
PageImpl<AnlsHstryModel> result = new PageImpl<>(resultList, pageable, resultList.size()); |
|
|
|
|
|
|
|
response.setItems(result.getContent()); |
|
|
|
|
|
|
|
response.setTotal(resultList.size()); |
|
|
|
|
|
|
|
response.setTotalPage(totalPage); |
|
|
|
|
|
|
|
response.setPage(rq.getPage()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return response; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}else { |
|
|
|
PageImpl<AnlsHstryModel> result = query.listCntrlBasRs(rq, pageable); |
|
|
|
PageImpl<AnlsHstryModel> result = query.listCntrlBasRs(rq, pageable); |
|
|
|
|
|
|
|
|
|
|
|
long total = query.countCntrlBasRs(rq, cstmrSno); |
|
|
|
long total = query.countCntrlBasRs(rq, cstmrSno); |
|
|
@ -144,6 +129,7 @@ public class AnlsHstryService { |
|
|
|
response.setTotal(total); |
|
|
|
response.setTotal(total); |
|
|
|
response.setTotalPage(totalPage); |
|
|
|
response.setTotalPage(totalPage); |
|
|
|
response.setPage(rq.getPage()); |
|
|
|
response.setPage(rq.getPage()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return response; |
|
|
|
return response; |
|
|
|
} |
|
|
|
} |
|
|
|