From 7211101ac52aa4ca2978125257b4be424cfab995 Mon Sep 17 00:00:00 2001 From: "DESKTOP-6E8S9S5\\LEE" Date: Wed, 1 Apr 2026 09:10:23 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=9C=EC=A0=84=EC=8B=9C=EB=AE=AC=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EA=B4=80=EB=A0=A8=20=EA=B2=AC=EC=A0=81?= =?UTF-8?q?=EC=84=9C=20=EC=A1=B0=ED=9A=8C=20API=20=EA=B0=9C=EB=B0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/estimate/EstimateController.java | 7 ++ .../qcast/biz/estimate/EstimateMapper.java | 9 +++ .../qcast/biz/estimate/EstimateService.java | 74 +++++++++++++++---- .../biz/estimate/dto/EstimateResponse.java | 3 + .../dto/SimulationEstimateResponse.java | 24 ++++++ .../estimate/dto/SimulationItemResponse.java | 25 +++++++ .../estimate/dto/SimulationRoofResponse.java | 30 ++++++++ .../mappers/estimate/estimateMapper.xml | 42 +++++++++++ 8 files changed, 199 insertions(+), 15 deletions(-) create mode 100644 src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationEstimateResponse.java create mode 100644 src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationItemResponse.java create mode 100644 src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationRoofResponse.java diff --git a/src/main/java/com/interplug/qcast/biz/estimate/EstimateController.java b/src/main/java/com/interplug/qcast/biz/estimate/EstimateController.java index 2481a695..da424ea5 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/EstimateController.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/EstimateController.java @@ -110,4 +110,11 @@ public class EstimateController { public void deleteEstimate(@RequestBody EstimateRequest estimateRequest) throws Exception { estimateService.deleteEstimate(estimateRequest); } + + @Operation(description = "발전시뮬레이션 필요 데이터 상세 조회를 조회한다.") + @GetMapping("/simulation-estimate-info") + @ResponseStatus(HttpStatus.OK) + public SimulationEstimateResponse selectSimulationEstimateInfo(EstimateRequest estimateRequest) throws Exception { + return estimateService.selectSimulationEstimateInfo(estimateRequest); + } } diff --git a/src/main/java/com/interplug/qcast/biz/estimate/EstimateMapper.java b/src/main/java/com/interplug/qcast/biz/estimate/EstimateMapper.java index 9565ae49..2b9fdde6 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/EstimateMapper.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/EstimateMapper.java @@ -152,4 +152,13 @@ public interface EstimateMapper { public int updateEstimateInfoInit(EstimateRequest estimateRequest); public int insertCanvasPopupStatusCopy(EstimateCopyRequest estimateCopyRequest); + + // 발전시뮬레이션 지붕재 목록 조회 + public List selectSimulationEstimateRoofList(EstimateRequest estimateRequest); + + // 발전시뮬레이션 지붕재 아이템 목록 조회 + public List selectSimulationEstimateRoofModuleList(EstimateRequest estimateRequest); + + // 발전시뮬레이션 지붕재 아이템 목록 조회 + public List selectSimulationEstimateRoofPcsList(EstimateRequest estimateRequest); } diff --git a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java index 3728eed6..d62ad457 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java @@ -18,6 +18,7 @@ import java.util.stream.Collectors; import com.interplug.qcast.biz.canvaspopupstatus.CanvasPopupStatusService; import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus; +import com.interplug.qcast.biz.estimate.dto.*; import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRoofResponse; import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; @@ -41,21 +42,6 @@ import org.springframework.web.util.UriComponentsBuilder; import com.fasterxml.jackson.databind.DeserializationFeature; import com.interplug.qcast.biz.canvasStatus.CanvasStatusService; import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusCopyRequest; -import com.interplug.qcast.biz.estimate.dto.EstimateApiResponse; -import com.interplug.qcast.biz.estimate.dto.EstimateCopyRequest; -import com.interplug.qcast.biz.estimate.dto.EstimateRequest; -import com.interplug.qcast.biz.estimate.dto.EstimateResponse; -import com.interplug.qcast.biz.estimate.dto.EstimateSendRequest; -import com.interplug.qcast.biz.estimate.dto.EstimateSendResponse; -import com.interplug.qcast.biz.estimate.dto.ItemRequest; -import com.interplug.qcast.biz.estimate.dto.ItemResponse; -import com.interplug.qcast.biz.estimate.dto.NoteRequest; -import com.interplug.qcast.biz.estimate.dto.NoteResponse; -import com.interplug.qcast.biz.estimate.dto.PlanSyncResponse; -import com.interplug.qcast.biz.estimate.dto.PriceRequest; -import com.interplug.qcast.biz.estimate.dto.RoofInfoResponse; -import com.interplug.qcast.biz.estimate.dto.RoofRequest; -import com.interplug.qcast.biz.estimate.dto.RoofResponse; import com.interplug.qcast.biz.file.FileMapper; import com.interplug.qcast.biz.file.dto.FileRequest; import com.interplug.qcast.biz.file.dto.FileResponse; @@ -3013,4 +2999,62 @@ public class EstimateService { return null; } } + + /** + * 발전시뮬레이션 견적서 상세 조회 + * + * @param estimateRequest 견적서 정보(물건번호, 플랜번호) + * @return EstimateResponse 견적서 상세 정보 + * @throws Exception + */ + public SimulationEstimateResponse selectSimulationEstimateInfo(EstimateRequest estimateRequest) throws Exception { + // Validation + if (StringUtils.isEmpty(estimateRequest.getObjectNo())) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + message.getMessage("common.message.required.data", "Object No")); + } + if (StringUtils.isEmpty(estimateRequest.getPlanNo())) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + message.getMessage("common.message.required.data", "Plan No")); + } + + SimulationEstimateResponse response = new SimulationEstimateResponse(); + + // 견적서 상세 조회 + EstimateResponse estimateResponse = estimateMapper.selectEstimateDetail(estimateRequest); + + if (estimateResponse == null) { + throw new QcastException(ErrorCode.NOT_FOUND, message.getMessage("common.message.no.data")); + } else { + + // 지역코드 셋팅 + response.setObjectNo(estimateRequest.getObjectNo()); + response.setPlanNo(estimateRequest.getPlanNo()); + response.setAreaId(estimateResponse.getAreaId()); + + // 지붕면 정보 목록 조회 + List roofList = estimateMapper.selectSimulationEstimateRoofList(estimateRequest); + // 지붕면 설치 모듈 정보 목록 조회 + List roofModuleList = estimateMapper.selectSimulationEstimateRoofModuleList(estimateRequest); + + // roofModuleList roofSurfaceId 기준으로 그룹핑 + Map> roofItemMap = roofModuleList.stream() + .collect(Collectors.groupingBy(SimulationItemResponse::getRoofSurfaceId)); + + // roofList 각 항목에 매핑된 roofModuleList 세팅 + roofList.forEach(roof -> + roof.setRoofModuleList( + roofItemMap.getOrDefault(roof.getRoofSurfaceId(), Collections.emptyList()) + ) + ); + + // 지붕면 설치 PCS 목록 조회 + List pcsList = estimateMapper.selectSimulationEstimateRoofPcsList(estimateRequest); + + response.setRoofList(roofList); + response.setPcsList(pcsList); + } + + return response; + } } diff --git a/src/main/java/com/interplug/qcast/biz/estimate/dto/EstimateResponse.java b/src/main/java/com/interplug/qcast/biz/estimate/dto/EstimateResponse.java index c97b6ded..f6264ba6 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/dto/EstimateResponse.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/dto/EstimateResponse.java @@ -215,6 +215,9 @@ public class EstimateResponse { @Schema(description = "하위 판매점명") private String agencySaleStoreName; + @Schema(description = "지역코드") + private String areaId; + @Schema(description = "한랭지 대책여부") private String coldRegionFlg; diff --git a/src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationEstimateResponse.java b/src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationEstimateResponse.java new file mode 100644 index 00000000..bad984cb --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationEstimateResponse.java @@ -0,0 +1,24 @@ +package com.interplug.qcast.biz.estimate.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +public class SimulationEstimateResponse { + @Schema(description = "물건번호") + private String objectNo; + + @Schema(description = "플랜번호") + private String planNo; + + @Schema(description = "지역코드") + private String areaId; + + @Schema(description = "지붕면 정보 목록") + List roofList; + + @Schema(description = "PCS 정보 목록") + List pcsList; +} diff --git a/src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationItemResponse.java b/src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationItemResponse.java new file mode 100644 index 00000000..092f3d42 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationItemResponse.java @@ -0,0 +1,25 @@ +package com.interplug.qcast.biz.estimate.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +// @Data +@Getter +@Setter +public class SimulationItemResponse { + @Schema(description = "지붕면 ID") + private String roofSurfaceId; + + @Schema(description = "아이템 아이디") + private String itemId; + + @Schema(description = "아이템 번호") + private String itemNo; + + @Schema(description = "아이템명") + private String itemName; + + @Schema(description = "매수") + private String amount; +} diff --git a/src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationRoofResponse.java b/src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationRoofResponse.java new file mode 100644 index 00000000..de3f1554 --- /dev/null +++ b/src/main/java/com/interplug/qcast/biz/estimate/dto/SimulationRoofResponse.java @@ -0,0 +1,30 @@ +package com.interplug.qcast.biz.estimate.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +// @Data +@Getter +@Setter +public class SimulationRoofResponse { + @Schema(description = "지붕면 ID") + private String roofSurfaceId; + + @Schema(description = "지붕면") + private String roofSurface; + + @Schema(description = "경사") + private String slope; + + @Schema(description = "각도") + private String angle; + + @Schema(description = "방위각") + private String azimuth; + + @Schema(description = "지붕면 모듈 정보 목록") + List roofModuleList; +} diff --git a/src/main/resources/mappers/estimate/estimateMapper.xml b/src/main/resources/mappers/estimate/estimateMapper.xml index 74862c0b..2a18bfd8 100644 --- a/src/main/resources/mappers/estimate/estimateMapper.xml +++ b/src/main/resources/mappers/estimate/estimateMapper.xml @@ -63,6 +63,7 @@ , O.SALE_STORE_ID , B.SALE_STORE_ID AS SAP_SALE_STORE_ID , B.SAP_SALES_STORE_CD + , OI.AREA_ID , ISNULL(OI.COLD_REGION_FLG, '0') AS COLD_REGION_FLG , ISNULL(OI.SALT_AREA_FLG, '0') AS SALT_AREA_FLG , SS.FIRST_AGENT_ID @@ -1543,4 +1544,45 @@ AND PLAN_NO = #{planNo} + + + + + + \ No newline at end of file -- 2.47.2