qkr7828(박재우) 2 years ago
parent
commit
997037e6c2
  1. 16
      src/main/java/com/palnet/biz/api/anls/hstry/controller/AnlsHstryController.java
  2. 33
      src/main/java/com/palnet/biz/api/anls/hstry/service/AnlsHstryService.java
  3. 4
      src/main/java/com/palnet/biz/jpa/repository/ctr/CtrCntrlQueryRepository.java

16
src/main/java/com/palnet/biz/api/anls/hstry/controller/AnlsHstryController.java

@ -71,11 +71,11 @@ public class AnlsHstryController {
@ApiOperation(value = "비행 현황 상세") @ApiOperation(value = "비행 현황 상세")
@Tag(name = "비행 이력 현황", description = "비행 이력 현황 관련 API") @Tag(name = "비행 이력 현황", description = "비행 이력 현황 관련 API")
@ApiImplicitParam(name = "id",value = "관제ID", dataTypeClass = String.class) @ApiImplicitParam(name = "id",value = "관제ID", dataTypeClass = String.class)
public ResponseEntity<? extends BasicResponse> detail(@PathVariable String id) { public ResponseEntity<? extends BasicResponse> detail(AnlsHstryRqModel rq) {
AnlsHstryModel result = null; ComnPagingRs<AnlsHstryModel> result = null;
try { try {
result = service.detail(id); result = service.detail(rq);
} catch (Exception e) { } catch (Exception e) {
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
@ -83,7 +83,7 @@ public class AnlsHstryController {
.body(new ErrorResponse("Server Error", "-1")); .body(new ErrorResponse("Server Error", "-1"));
} }
return ResponseEntity.ok().body(new SuccessResponse<AnlsHstryModel>(result)); return ResponseEntity.ok().body(new SuccessResponse<>(result));
} }
@ -92,10 +92,10 @@ public class AnlsHstryController {
@ApiOperation(value = "비행 이력 데이터") @ApiOperation(value = "비행 이력 데이터")
@Tag(name = "비행 이력 현황", description = "비행 이력 현황 관련 API") @Tag(name = "비행 이력 현황", description = "비행 이력 현황 관련 API")
@ApiImplicitParam(name = "id",value = "관제ID", dataTypeClass = String.class) @ApiImplicitParam(name = "id",value = "관제ID", dataTypeClass = String.class)
public ResponseEntity<? extends BasicResponse> log(AnlsHstryRqModel rq) { public ResponseEntity<? extends BasicResponse> log(@PathVariable String id) {
ComnPagingRs<AnlsHstryDetailModel> result = null; List<AnlsHstryDetailModel> result = null;
try { try {
result = service.hstryList(rq); result = service.hstryList(id);
} catch (Exception e) { } catch (Exception e) {
log.error("IGNORE : {}", e); log.error("IGNORE : {}", e);
@ -103,7 +103,7 @@ public class AnlsHstryController {
.body(new ErrorResponse("Server Error", "-1")); .body(new ErrorResponse("Server Error", "-1"));
} }
return ResponseEntity.ok().body(new SuccessResponse<>(result)); return ResponseEntity.ok().body(new SuccessResponse<List>(result));
} }

33
src/main/java/com/palnet/biz/api/anls/hstry/service/AnlsHstryService.java

@ -94,32 +94,13 @@ public class AnlsHstryService {
return response; return response;
} }
public AnlsHstryModel detail(String cntrlId) throws Exception{ public ComnPagingRs<AnlsHstryModel> detail(AnlsHstryRqModel rq) throws Exception{
AnlsHstryModel model = new AnlsHstryModel(); ComnPagingRs<AnlsHstryModel> response = new ComnPagingRs<>();
Optional<CtrCntrlBas> 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<AnlsHstryDetailModel> hstryList(AnlsHstryRqModel rq) {
ComnPagingRs<AnlsHstryDetailModel> response = new ComnPagingRs<>();
Pageable pageable = PageRequest.of(rq.getPage()-1, rq.getRecord()); Pageable pageable = PageRequest.of(rq.getPage()-1, rq.getRecord());
PageImpl<AnlsHstryDetailModel> result = query.listCntrlHstryPage(rq.getCntrlId(), pageable); PageImpl<AnlsHstryModel> result = query.listCntrlHstryPage(rq.getCntrlId(), pageable);
long total = query.listCntrlHstryCount(rq.getCntrlId()); long total = query.listCntrlHstryCount(rq.getCntrlId());
@ -131,5 +112,13 @@ public class AnlsHstryService {
response.setTotalPage(totalPage); response.setTotalPage(totalPage);
return response; return response;
}
public List<AnlsHstryDetailModel> hstryList(String cntrlId) {
List<AnlsHstryDetailModel> resultList = query.listCntrlHstry(cntrlId);
return resultList;
} }
} }

4
src/main/java/com/palnet/biz/jpa/repository/ctr/CtrCntrlQueryRepository.java

@ -564,7 +564,7 @@ public List<AnlsHstryModel> cntrlBasNormalList(AnlsHstryRqModel rq, String idntf
* @param id * @param id
* @return * @return
*/ */
public PageImpl<AnlsHstryDetailModel> listCntrlHstryPage(String id, Pageable pageable){ public PageImpl<AnlsHstryModel> listCntrlHstryPage(String id, Pageable pageable){
QCtrCntrlBas qCntrlBasEntity = QCtrCntrlBas.ctrCntrlBas; QCtrCntrlBas qCntrlBasEntity = QCtrCntrlBas.ctrCntrlBas;
QCtrCntrlHstry qCtrCntrHstry = QCtrCntrlHstry.ctrCntrlHstry; QCtrCntrlHstry qCtrCntrHstry = QCtrCntrlHstry.ctrCntrlHstry;
@ -572,7 +572,7 @@ public List<AnlsHstryModel> cntrlBasNormalList(AnlsHstryRqModel rq, String idntf
BooleanBuilder builder = new BooleanBuilder(); BooleanBuilder builder = new BooleanBuilder();
builder.and(qCtrCntrHstry.cntrlId.eq(id)); builder.and(qCtrCntrHstry.cntrlId.eq(id));
List<AnlsHstryDetailModel> result = query.select(Projections.bean(AnlsHstryDetailModel.class , List<AnlsHstryModel> result = query.select(Projections.bean(AnlsHstryModel.class ,
qCtrCntrHstry.cntrlId , qCtrCntrHstry.cntrlId ,
qCtrCntrHstry.hstrySno , qCtrCntrHstry.hstrySno ,
qCtrCntrHstry.trmnlId , qCtrCntrHstry.trmnlId ,

Loading…
Cancel
Save