diff --git a/pav-server/src/main/java/com/palnet/biz/api/bas/dron/controller/BasDronController.java b/pav-server/src/main/java/com/palnet/biz/api/bas/dron/controller/BasDronController.java index ac2853d2..6c778954 100644 --- a/pav-server/src/main/java/com/palnet/biz/api/bas/dron/controller/BasDronController.java +++ b/pav-server/src/main/java/com/palnet/biz/api/bas/dron/controller/BasDronController.java @@ -85,7 +85,7 @@ public class BasDronController { @GetMapping(value = "/idntf/list/{id}") @Operation(summary = "드론정보 조회", description = "드론[기체]일련번호로 식별장치를 조회합니다.") public ResponseEntity mylist(@Parameter(name="id", description = "기체일련번호", in = ParameterIn.PATH, example = "1") @PathVariable Integer id) { - List result = null; + BasIdntfModel result = null; // 기체일련번호확인[id] 입력값 검증처리 if(StringUtils.isEmpty(id)) { @@ -111,7 +111,7 @@ public class BasDronController { .body(new ErrorResponse("Server Error", "-1")); } - return ResponseEntity.ok().body(new SuccessResponse(result)); + return ResponseEntity.ok().body(new SuccessResponse<>(result)); } diff --git a/pav-server/src/main/java/com/palnet/biz/api/bas/dron/service/BasDronService.java b/pav-server/src/main/java/com/palnet/biz/api/bas/dron/service/BasDronService.java index 4ab2787b..60261633 100644 --- a/pav-server/src/main/java/com/palnet/biz/api/bas/dron/service/BasDronService.java +++ b/pav-server/src/main/java/com/palnet/biz/api/bas/dron/service/BasDronService.java @@ -84,19 +84,17 @@ public class BasDronService { * @param arcrftSno * @return */ - public List listIdntf(int arcrftSno){ + public BasIdntfModel listIdntf(int arcrftSno){ - List resultList = query.idntfList(arcrftSno); + BasIdntfModel result = query.idntfList(arcrftSno); - if(resultList.size() > 0 && resultList != null) { - for(BasIdntfModel model : resultList){ - if(model.getHpno() != null && !model.getHpno().isEmpty()){ - model.setHpno(EncryptUtils.decrypt(model.getHpno())); - } + if(result != null) { + if(result.getHpno() != null && !result.getHpno().isEmpty()){ + result.setHpno(EncryptUtils.decrypt(result.getHpno())); } } - return resultList; + return result; } /** diff --git a/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyDronQueryRepository.java b/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyDronQueryRepository.java index a16b9d2d..35256765 100644 --- a/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyDronQueryRepository.java +++ b/pav-server/src/main/java/com/palnet/biz/jpa/repository/pty/PtyDronQueryRepository.java @@ -216,7 +216,7 @@ public class PtyDronQueryRepository{ * @param arcrftSno * @return */ - public List idntfList(int arcrftSno){ + public BasIdntfModel idntfList(int arcrftSno){ QComIdntfBas idnt = QComIdntfBas.comIdntfBas; QComArcrftBas arcrft = QComArcrftBas.comArcrftBas; @@ -245,9 +245,7 @@ public class PtyDronQueryRepository{ * ORDER BY CIB.CREATE_DT ASC */ - List result = new ArrayList<>(); - - BasIdntfModel res = + BasIdntfModel result = query.select(Projections.bean(BasIdntfModel.class , idnt.arcrftSno, @@ -266,7 +264,6 @@ public class PtyDronQueryRepository{ .orderBy(idnt.createDt.asc()) .fetchFirst(); - result.add(res); return result; }