diff --git a/src/main/java/com/palnet/biz/api/anls/hstry/controller/AnlsHstryController.java b/src/main/java/com/palnet/biz/api/anls/hstry/controller/AnlsHstryController.java index 6f09bce..cee58bc 100644 --- a/src/main/java/com/palnet/biz/api/anls/hstry/controller/AnlsHstryController.java +++ b/src/main/java/com/palnet/biz/api/anls/hstry/controller/AnlsHstryController.java @@ -71,11 +71,11 @@ public class AnlsHstryController { @ApiOperation(value = "비행 현황 상세") @Tag(name = "비행 이력 현황", description = "비행 이력 현황 관련 API") @ApiImplicitParam(name = "id",value = "관제ID", dataTypeClass = String.class) - public ResponseEntity detail(@PathVariable String id) { - AnlsHstryModel result = null; + public ResponseEntity detail(AnlsHstryRqModel rq) { + ComnPagingRs result = null; try { - result = service.detail(id); + result = service.detail(rq); } catch (Exception e) { log.error("IGNORE : {}", e); @@ -83,7 +83,7 @@ public class AnlsHstryController { .body(new ErrorResponse("Server Error", "-1")); } - return ResponseEntity.ok().body(new SuccessResponse(result)); + return ResponseEntity.ok().body(new SuccessResponse<>(result)); } @@ -92,10 +92,10 @@ public class AnlsHstryController { @ApiOperation(value = "비행 이력 데이터") @Tag(name = "비행 이력 현황", description = "비행 이력 현황 관련 API") @ApiImplicitParam(name = "id",value = "관제ID", dataTypeClass = String.class) - public ResponseEntity log(AnlsHstryRqModel rq) { - ComnPagingRs result = null; + public ResponseEntity log(@PathVariable String id) { + List result = null; try { - result = service.hstryList(rq); + result = service.hstryList(id); } catch (Exception e) { log.error("IGNORE : {}", e); @@ -103,7 +103,7 @@ public class AnlsHstryController { .body(new ErrorResponse("Server Error", "-1")); } - return ResponseEntity.ok().body(new SuccessResponse<>(result)); + return ResponseEntity.ok().body(new SuccessResponse(result)); } diff --git a/src/main/java/com/palnet/biz/api/anls/hstry/service/AnlsHstryService.java b/src/main/java/com/palnet/biz/api/anls/hstry/service/AnlsHstryService.java index 0742a67..4ac13d5 100644 --- a/src/main/java/com/palnet/biz/api/anls/hstry/service/AnlsHstryService.java +++ b/src/main/java/com/palnet/biz/api/anls/hstry/service/AnlsHstryService.java @@ -94,32 +94,13 @@ public class AnlsHstryService { return response; } - public AnlsHstryModel detail(String cntrlId) throws Exception{ + public ComnPagingRs detail(AnlsHstryRqModel rq) throws Exception{ - AnlsHstryModel model = new AnlsHstryModel(); - - Optional optional = ctrCntrlBasRepository.findById(cntrlId); - - if (!optional.isPresent()) { - throw new CustomException(ErrorCode.DATA_NOTFIND); - } - - CtrCntrlBas entity = optional.get(); - - BeanUtils.copyProperties(entity , model); - - - return model; - - } - - public ComnPagingRs hstryList(AnlsHstryRqModel rq) { - - ComnPagingRs response = new ComnPagingRs<>(); + ComnPagingRs response = new ComnPagingRs<>(); Pageable pageable = PageRequest.of(rq.getPage()-1, rq.getRecord()); - PageImpl result = query.listCntrlHstryPage(rq.getCntrlId(), pageable); + PageImpl result = query.listCntrlHstryPage(rq.getCntrlId(), pageable); long total = query.listCntrlHstryCount(rq.getCntrlId()); @@ -129,7 +110,15 @@ public class AnlsHstryService { response.setTotal(total); response.setPage(rq.getPage()); response.setTotalPage(totalPage); - + return response; + + } + + public List hstryList(String cntrlId) { + + List resultList = query.listCntrlHstry(cntrlId); + + return resultList; } } diff --git a/src/main/java/com/palnet/biz/jpa/repository/ctr/CtrCntrlQueryRepository.java b/src/main/java/com/palnet/biz/jpa/repository/ctr/CtrCntrlQueryRepository.java index 2cc19d2..bfccae2 100644 --- a/src/main/java/com/palnet/biz/jpa/repository/ctr/CtrCntrlQueryRepository.java +++ b/src/main/java/com/palnet/biz/jpa/repository/ctr/CtrCntrlQueryRepository.java @@ -564,7 +564,7 @@ public List cntrlBasNormalList(AnlsHstryRqModel rq, String idntf * @param id * @return */ - public PageImpl listCntrlHstryPage(String id, Pageable pageable){ + public PageImpl listCntrlHstryPage(String id, Pageable pageable){ QCtrCntrlBas qCntrlBasEntity = QCtrCntrlBas.ctrCntrlBas; QCtrCntrlHstry qCtrCntrHstry = QCtrCntrlHstry.ctrCntrlHstry; @@ -572,7 +572,7 @@ public List cntrlBasNormalList(AnlsHstryRqModel rq, String idntf BooleanBuilder builder = new BooleanBuilder(); builder.and(qCtrCntrHstry.cntrlId.eq(id)); - List result = query.select(Projections.bean(AnlsHstryDetailModel.class , + List result = query.select(Projections.bean(AnlsHstryModel.class , qCtrCntrHstry.cntrlId , qCtrCntrHstry.hstrySno , qCtrCntrHstry.trmnlId ,