diff --git a/src/main/java/com/interplug/qcast/biz/object/ObjectController.java b/src/main/java/com/interplug/qcast/biz/object/ObjectController.java index 43efd463..4b2e1d68 100644 --- a/src/main/java/com/interplug/qcast/biz/object/ObjectController.java +++ b/src/main/java/com/interplug/qcast/biz/object/ObjectController.java @@ -63,13 +63,20 @@ public class ObjectController { return objectService.selectSaleStoreList(saleStoreId, firstFlg, userId); } - @Operation(description = "1차점 ID 및 판매점명을 조회한다. (saleStoreLevel=2 인 경우)") + @Operation(description = "1차점 ID 및 판매점명을 조회한다. (saleStoreLevel > 1 인 경우)") @GetMapping("/saleStore/{saleStoreId}/firstAgent") @ResponseStatus(HttpStatus.OK) public SaleStoreResponse selectFirstAgentInfo(@PathVariable String saleStoreId) throws Exception { return objectService.selectFirstAgentInfo(saleStoreId); } + @Operation(description = "상위 판매점 정보를 조회한다.") + @GetMapping("/saleStore/{saleStoreId}/parentInfo") + @ResponseStatus(HttpStatus.OK) + public SaleStoreResponse selectParentAgentInfo(@PathVariable String saleStoreId, String storeLvl) throws Exception { + return objectService.selectParentAgentInfo(saleStoreId, storeLvl); + } + @Operation(description = "물건정보 목록을 조회한다.") @GetMapping("/list") @ResponseStatus(HttpStatus.OK) diff --git a/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java b/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java index 25103967..02a6120b 100644 --- a/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java +++ b/src/main/java/com/interplug/qcast/biz/object/ObjectMapper.java @@ -28,6 +28,9 @@ public interface ObjectMapper { // 1차점 ID/명 조회 (saleStoreLevel = '2' 인 경우) public SaleStoreResponse selectFirstAgentInfo(String saleStoreId); + // 상위 판매점 정보 조회 + public SaleStoreResponse selectParentAgentInfo(String saleStoreId, String storeLvl); + // 물건정보 메인 목록 조회 public List selectObjectMainList(ObjectRequest objectRequest); diff --git a/src/main/java/com/interplug/qcast/biz/object/ObjectService.java b/src/main/java/com/interplug/qcast/biz/object/ObjectService.java index a62ad928..9cd24951 100644 --- a/src/main/java/com/interplug/qcast/biz/object/ObjectService.java +++ b/src/main/java/com/interplug/qcast/biz/object/ObjectService.java @@ -174,6 +174,14 @@ public class ObjectService { return result; } + public SaleStoreResponse selectParentAgentInfo(String saleStoreId, String storeLvl) throws Exception { + SaleStoreResponse result = objectMapper.selectParentAgentInfo(saleStoreId, storeLvl); + if (result == null) { + throw new QcastException(ErrorCode.NOT_FOUND, message.getMessage("common.message.no.data")); + } + return result; + } + /** * 물건정보 메인 목록 조회 * diff --git a/src/main/java/com/interplug/qcast/biz/object/dto/SaleStoreResponse.java b/src/main/java/com/interplug/qcast/biz/object/dto/SaleStoreResponse.java index 60fc775c..3be2b265 100644 --- a/src/main/java/com/interplug/qcast/biz/object/dto/SaleStoreResponse.java +++ b/src/main/java/com/interplug/qcast/biz/object/dto/SaleStoreResponse.java @@ -27,6 +27,12 @@ public class SaleStoreResponse { @Schema(description = "1차점판매점명") private String firstAgentName; + @Schema(description = "상위판매점ID") + private String parentSaleAgentId; + + @Schema(description = "상위판매점명") + private String parentAgentName; + @Schema(description = "영업사원명") private String businessCharger; diff --git a/src/main/resources/mappers/object/objectMapper.xml b/src/main/resources/mappers/object/objectMapper.xml index e68ac8bf..e32e4fa7 100644 --- a/src/main/resources/mappers/object/objectMapper.xml +++ b/src/main/resources/mappers/object/objectMapper.xml @@ -151,6 +151,17 @@ AND A.DEL_FLG = '0' + +