가격조사 결재번호로 조회 기능 추가

This commit is contained in:
2025-05-27 08:19:02 +00:00
parent 4fe7b35b0e
commit 01b8092d3f
3 changed files with 36 additions and 1 deletions

View File

@@ -50,12 +50,32 @@ public class PrcsController {
{CustomErrorResponse.class }))) {CustomErrorResponse.class })))
}) })
@GetMapping("/prcs/{prcsNo}") @GetMapping("/prcs/{prcsNo}")
public ResponseEntity findSearchPage( public ResponseEntity findDetail(
@Parameter(description = "가격조사번호") @PathVariable(required = false) String prcsNo @Parameter(description = "가격조사번호") @PathVariable(required = false) String prcsNo
) { ) {
return ResponseEntity.ok(prcsService.findDetail(prcsNo)); return ResponseEntity.ok(prcsService.findDetail(prcsNo));
} }
@Operation(summary = "가격조사 상세조회 (apprNo)", description = "결재번호로 조회")
@ApiResponses({
@ApiResponse(description = "Success", responseCode = "200",
content = @Content(mediaType = "application/json",
schema = @Schema(oneOf =
{PrcsResponse.class}))),
@ApiResponse(description = "Not found", responseCode = "404",
content = @Content(mediaType = "text/plain", schema = @Schema(oneOf =
{String.class}))),
@ApiResponse(description = "Internal Error", responseCode = "500",
content = @Content(mediaType = "application/json", schema = @Schema(oneOf =
{CustomErrorResponse.class })))
})
@GetMapping("/prcs/approval/{apprNo}")
public ResponseEntity findByApprNoDetail(
@Parameter(description = "결재번호") @PathVariable(required = false) String apprNo
) {
return ResponseEntity.ok(prcsService.findByApprNoDetail(apprNo));
}
@Operation(summary = "가격조사 조회 (페이징)", description = "전체 조회") @Operation(summary = "가격조사 조회 (페이징)", description = "전체 조회")
@ApiResponses({ @ApiResponses({
@ApiResponse(description = "Success", responseCode = "200", @ApiResponse(description = "Success", responseCode = "200",

View File

@@ -26,6 +26,9 @@ public interface PrcsService {
@Transactional @Transactional
PrcsResponse findDetail(String prcsNo); PrcsResponse findDetail(String prcsNo);
@Transactional
PrcsResponse findByApprNoDetail(String apprNo);
@Transactional @Transactional
PageResponse findExternalSearch(String bizNo, String cateCd, String title, String regNm, String regSdt, String regEdt, Pageable pageable); PageResponse findExternalSearch(String bizNo, String cateCd, String title, String regNm, String regSdt, String regEdt, Pageable pageable);

View File

@@ -123,6 +123,18 @@ public class PrcsServiceImpl implements PrcsService {
} }
} }
@Transactional
@Override
public PrcsResponse findByApprNoDetail(String apprNo) {
ApprMst apprMst = apprMstRepository.findByApprNo(apprNo);
Prcs prcs = apprMst.getPrcs();
if(prcs != null) {
return PrcsResponse.from(prcs);
} else {
throw new CustomException(ErrorCode.FIND_ERR);
}
}
@Transactional @Transactional
@Override @Override
public PageResponse findExternalSearch(String bizNo, String cateCd, String title, String regNm, String regSdt, String regEdt, Pageable pageable) { public PageResponse findExternalSearch(String bizNo, String cateCd, String title, String regNm, String regSdt, String regEdt, Pageable pageable) {