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 = "비행 현황 상세")
@Tag(name = "비행 이력 현황", description = "비행 이력 현황 관련 API")
@ApiImplicitParam(name = "id",value = "관제ID", dataTypeClass = String.class)
public ResponseEntity<? extends BasicResponse> detail(@PathVariable String id) {
AnlsHstryModel result = null;
public ResponseEntity<? extends BasicResponse> detail(AnlsHstryRqModel rq) {
ComnPagingRs<AnlsHstryModel> 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<AnlsHstryModel>(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<? extends BasicResponse> log(AnlsHstryRqModel rq) {
ComnPagingRs<AnlsHstryDetailModel> result = null;
public ResponseEntity<? extends BasicResponse> log(@PathVariable String id) {
List<AnlsHstryDetailModel> 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<List>(result));
}

33
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<AnlsHstryModel> detail(AnlsHstryRqModel rq) throws Exception{
AnlsHstryModel model = new AnlsHstryModel();
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<>();
ComnPagingRs<AnlsHstryModel> response = new ComnPagingRs<>();
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());
@ -131,5 +112,13 @@ public class AnlsHstryService {
response.setTotalPage(totalPage);
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
* @return
*/
public PageImpl<AnlsHstryDetailModel> listCntrlHstryPage(String id, Pageable pageable){
public PageImpl<AnlsHstryModel> listCntrlHstryPage(String id, Pageable pageable){
QCtrCntrlBas qCntrlBasEntity = QCtrCntrlBas.ctrCntrlBas;
QCtrCntrlHstry qCtrCntrHstry = QCtrCntrlHstry.ctrCntrlHstry;
@ -572,7 +572,7 @@ public List<AnlsHstryModel> cntrlBasNormalList(AnlsHstryRqModel rq, String idntf
BooleanBuilder builder = new BooleanBuilder();
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.hstrySno ,
qCtrCntrHstry.trmnlId ,

Loading…
Cancel
Save