Merge pull request 'dev' (#450) from dev into prd-deploy

Reviewed-on: #450
This commit is contained in:
ysCha 2026-04-01 13:13:05 +09:00
commit 99b0a0c651
12 changed files with 249 additions and 17 deletions

View File

@ -110,4 +110,11 @@ public class EstimateController {
public void deleteEstimate(@RequestBody EstimateRequest estimateRequest) throws Exception { public void deleteEstimate(@RequestBody EstimateRequest estimateRequest) throws Exception {
estimateService.deleteEstimate(estimateRequest); estimateService.deleteEstimate(estimateRequest);
} }
@Operation(description = "발전시뮬레이션 필요 데이터 상세 조회를 조회한다.")
@GetMapping("/simulation-estimate-info")
@ResponseStatus(HttpStatus.OK)
public SimulationEstimateResponse selectSimulationEstimateInfo(EstimateRequest estimateRequest) throws Exception {
return estimateService.selectSimulationEstimateInfo(estimateRequest);
}
} }

View File

@ -152,4 +152,13 @@ public interface EstimateMapper {
public int updateEstimateInfoInit(EstimateRequest estimateRequest); public int updateEstimateInfoInit(EstimateRequest estimateRequest);
public int insertCanvasPopupStatusCopy(EstimateCopyRequest estimateCopyRequest); public int insertCanvasPopupStatusCopy(EstimateCopyRequest estimateCopyRequest);
// 발전시뮬레이션 지붕재 목록 조회
public List<SimulationRoofResponse> selectSimulationEstimateRoofList(EstimateRequest estimateRequest);
// 발전시뮬레이션 지붕재 아이템 목록 조회
public List<SimulationItemResponse> selectSimulationEstimateRoofModuleList(EstimateRequest estimateRequest);
// 발전시뮬레이션 지붕재 아이템 목록 조회
public List<SimulationItemResponse> selectSimulationEstimateRoofPcsList(EstimateRequest estimateRequest);
} }

View File

@ -18,6 +18,7 @@ import java.util.stream.Collectors;
import com.interplug.qcast.biz.canvaspopupstatus.CanvasPopupStatusService; import com.interplug.qcast.biz.canvaspopupstatus.CanvasPopupStatusService;
import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus; import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus;
import com.interplug.qcast.biz.estimate.dto.*;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRoofResponse; import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRoofResponse;
import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -41,21 +42,6 @@ import org.springframework.web.util.UriComponentsBuilder;
import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.DeserializationFeature;
import com.interplug.qcast.biz.canvasStatus.CanvasStatusService; import com.interplug.qcast.biz.canvasStatus.CanvasStatusService;
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusCopyRequest; 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.FileMapper;
import com.interplug.qcast.biz.file.dto.FileRequest; import com.interplug.qcast.biz.file.dto.FileRequest;
import com.interplug.qcast.biz.file.dto.FileResponse; import com.interplug.qcast.biz.file.dto.FileResponse;
@ -336,11 +322,17 @@ public class EstimateService {
message.getMessage("common.message.required.data", "User ID")); message.getMessage("common.message.required.data", "User ID"));
} }
List<ItemRequest> circuitItemList = estimateRequest.getCircuitItemList(); //drawingFlg != "1" 경우 (도면 없이 저장) circuitItemList는 비어있어도 정상
List<ItemRequest> itemList = estimateRequest.getItemList();
if (itemList == null || itemList.isEmpty()) {
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "itemList"));
}
String splitStr = ""; String splitStr = "";
List<RoofRequest> orgRoofList = new ArrayList<RoofRequest>(); List<RoofRequest> orgRoofList = new ArrayList<RoofRequest>();
List<RoofRequest> roofList = new ArrayList<RoofRequest>(); List<RoofRequest> roofList = new ArrayList<RoofRequest>();
List<ItemRequest> circuitItemList = estimateRequest.getCircuitItemList();
List<ItemRequest> itemList = estimateRequest.getItemList();
estimateRequest.setTempFlg("0"); estimateRequest.setTempFlg("0");
@ -3007,4 +2999,62 @@ public class EstimateService {
return null; 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<SimulationRoofResponse> roofList = estimateMapper.selectSimulationEstimateRoofList(estimateRequest);
// 지붕면 설치 모듈 정보 목록 조회
List<SimulationItemResponse> roofModuleList = estimateMapper.selectSimulationEstimateRoofModuleList(estimateRequest);
// roofModuleList roofSurfaceId 기준으로 그룹핑
Map<String, List<SimulationItemResponse>> roofItemMap = roofModuleList.stream()
.collect(Collectors.groupingBy(SimulationItemResponse::getRoofSurfaceId));
// roofList 항목에 매핑된 roofModuleList 세팅
roofList.forEach(roof ->
roof.setRoofModuleList(
roofItemMap.getOrDefault(roof.getRoofSurfaceId(), Collections.emptyList())
)
);
// 지붕면 설치 PCS 목록 조회
List<SimulationItemResponse> pcsList = estimateMapper.selectSimulationEstimateRoofPcsList(estimateRequest);
response.setRoofList(roofList);
response.setPcsList(pcsList);
}
return response;
}
} }

View File

@ -215,6 +215,9 @@ public class EstimateResponse {
@Schema(description = "하위 판매점명") @Schema(description = "하위 판매점명")
private String agencySaleStoreName; private String agencySaleStoreName;
@Schema(description = "지역코드")
private String areaId;
@Schema(description = "한랭지 대책여부") @Schema(description = "한랭지 대책여부")
private String coldRegionFlg; private String coldRegionFlg;

View File

@ -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<SimulationRoofResponse> roofList;
@Schema(description = "PCS 정보 목록")
List<SimulationItemResponse> pcsList;
}

View File

@ -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;
}

View File

@ -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<SimulationItemResponse> roofModuleList;
}

View File

@ -12,6 +12,7 @@ import com.interplug.qcast.biz.master.dto.pcs.menualconf.ApiPcsMenualConfRequest
import com.interplug.qcast.biz.master.dto.pcs.series.ApiPcsSeriesItemRequest; import com.interplug.qcast.biz.master.dto.pcs.series.ApiPcsSeriesItemRequest;
import com.interplug.qcast.biz.master.dto.pcs.series.ApiPcsSeriesItemResponse; import com.interplug.qcast.biz.master.dto.pcs.series.ApiPcsSeriesItemResponse;
import com.interplug.qcast.biz.master.dto.pcs.voltagestepup.ApiPcsVoltageStepUpResponse; import com.interplug.qcast.biz.master.dto.pcs.voltagestepup.ApiPcsVoltageStepUpResponse;
import com.interplug.qcast.biz.master.dto.quotation.ApiQuotationErrSaveRequest;
import com.interplug.qcast.biz.master.dto.quotation.ApiQuotationItemRequest; import com.interplug.qcast.biz.master.dto.quotation.ApiQuotationItemRequest;
import com.interplug.qcast.biz.master.dto.quotation.ApiQuotationItemResponse; import com.interplug.qcast.biz.master.dto.quotation.ApiQuotationItemResponse;
import com.interplug.qcast.biz.master.dto.roofmaterial.ApiRoofMaterialResponse; import com.interplug.qcast.biz.master.dto.roofmaterial.ApiRoofMaterialResponse;
@ -294,4 +295,11 @@ public class MasterController {
HttpServletRequest request, @RequestBody ApiQuotationItemRequest quotationItemRequest) { HttpServletRequest request, @RequestBody ApiQuotationItemRequest quotationItemRequest) {
return quotationService.getQuotationItem(request.getHeader("Referer"), quotationItemRequest); return quotationService.getQuotationItem(request.getHeader("Referer"), quotationItemRequest);
} }
@Operation(description = "견적서 오류를 저장한다.")
@PostMapping("/quotationErrSave")
public ApiResponse<Void> quotationErrSave(
HttpServletRequest request, @RequestBody ApiQuotationErrSaveRequest quotationErrSaveRequest) {
return masterService.quotationErrSave(request.getHeader("Referer"), quotationErrSaveRequest);
}
} }

View File

@ -3,6 +3,7 @@ package com.interplug.qcast.biz.master;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.interplug.qcast.biz.master.dto.*; import com.interplug.qcast.biz.master.dto.*;
import com.interplug.qcast.biz.master.dto.construction.ApiConstructionResponse; import com.interplug.qcast.biz.master.dto.construction.ApiConstructionResponse;
import com.interplug.qcast.biz.master.dto.quotation.ApiQuotationErrSaveRequest;
import com.interplug.qcast.biz.master.dto.moduletype.ApiModuleTpResponse; import com.interplug.qcast.biz.master.dto.moduletype.ApiModuleTpResponse;
import com.interplug.qcast.biz.master.dto.pcs.ApiPcsInfoRequest; import com.interplug.qcast.biz.master.dto.pcs.ApiPcsInfoRequest;
import com.interplug.qcast.biz.master.dto.pcs.autorecommend.ApiPcsAutoRecommendResponse; import com.interplug.qcast.biz.master.dto.pcs.autorecommend.ApiPcsAutoRecommendResponse;
@ -126,4 +127,9 @@ public interface MasterService {
@PostMapping("/pcsConnOptionItemList") @PostMapping("/pcsConnOptionItemList")
public ApiResponse<ApiPcsConnOptionResponse> getPcsConnOptionItemList( public ApiResponse<ApiPcsConnOptionResponse> getPcsConnOptionItemList(
@RequestHeader("Referer") String referer, @RequestBody ApiPcsConnOptionRequest req); @RequestHeader("Referer") String referer, @RequestBody ApiPcsConnOptionRequest req);
// 견적서 오류 저장
@PostMapping("/quotationErrSave")
public ApiResponse<Void> quotationErrSave(
@RequestHeader("Referer") String referer, @RequestBody ApiQuotationErrSaveRequest req);
} }

View File

@ -16,4 +16,5 @@ public interface QuotationService {
@PostMapping("/item") @PostMapping("/item")
public ApiResponse<List<ApiQuotationItemResponse>> getQuotationItem( public ApiResponse<List<ApiQuotationItemResponse>> getQuotationItem(
@RequestHeader("Referer") String referer, @RequestBody ApiQuotationItemRequest req); @RequestHeader("Referer") String referer, @RequestBody ApiQuotationItemRequest req);
} }

View File

@ -0,0 +1,27 @@
package com.interplug.qcast.biz.master.dto.quotation;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "Api 견적서 오류 저장 요청 객체")
public class ApiQuotationErrSaveRequest {
@Schema(description = "물건번호")
@NotNull
public String objectNo;
@Schema(description = "플랜번호")
@NotNull
public String planNo;
@Schema(description = "오류 사유")
public String rejectRsn;
@Schema(description = "등록자 ID")
@NotNull
public String regId;
}

View File

@ -63,6 +63,7 @@
, O.SALE_STORE_ID , O.SALE_STORE_ID
, B.SALE_STORE_ID AS SAP_SALE_STORE_ID , B.SALE_STORE_ID AS SAP_SALE_STORE_ID
, B.SAP_SALES_STORE_CD , B.SAP_SALES_STORE_CD
, OI.AREA_ID
, ISNULL(OI.COLD_REGION_FLG, '0') AS COLD_REGION_FLG , ISNULL(OI.COLD_REGION_FLG, '0') AS COLD_REGION_FLG
, ISNULL(OI.SALT_AREA_FLG, '0') AS SALT_AREA_FLG , ISNULL(OI.SALT_AREA_FLG, '0') AS SALT_AREA_FLG
, SS.FIRST_AGENT_ID , SS.FIRST_AGENT_ID
@ -1543,4 +1544,45 @@
AND PLAN_NO = #{planNo} AND PLAN_NO = #{planNo}
</update> </update>
<select id="selectSimulationEstimateRoofList" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="com.interplug.qcast.biz.estimate.dto.SimulationRoofResponse">
/* sqlid : com.interplug.qcast.biz.estimate.selectSimulationEstimateRoofList */
SELECT
RE.ROOF_SURFACE_ID
, RE.OBJECT_NO
, RE.PLAN_NO
, RE.ROOF_SURFACE
, RE.SLOPE
, RE.ANGLE
, RE.AZIMUTH
FROM T_PART_ROOF_ESTIMATE RE WITH (NOLOCK)
WHERE RE.OBJECT_NO = #{objectNo}
AND RE.PLAN_NO = #{planNo}
ORDER BY RE.ROOF_SURFACE_ID
</select>
<select id="selectSimulationEstimateRoofModuleList" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="com.interplug.qcast.biz.estimate.dto.SimulationItemResponse">
/* sqlid : com.interplug.qcast.biz.estimate.selectSimulationEstimateRoofModuleList */
SELECT
PIE.ROOF_SURFACE_ID
, PIE.ITEM_ID
, PIE.ITEM_NO
, PIE.ITEM_NAME
, SUM(AMOUNT) AS AMOUNT
FROM T_PART_ROOF_ITEM_ESTIMATE PIE WITH (NOLOCK)
WHERE PIE.OBJECT_NO = #{objectNo}
AND PIE.PLAN_NO = #{planNo}
GROUP BY PIE.ROOF_SURFACE_ID, PIE.ITEM_ID , PIE.ITEM_NO, PIE.ITEM_NAME
</select>
<select id="selectSimulationEstimateRoofPcsList" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="com.interplug.qcast.biz.estimate.dto.SimulationItemResponse">
/* sqlid : com.interplug.qcast.biz.estimate.selectSimulationEstimateRoofPcsList */
SELECT
CIE.ITEM_ID
, COUNT(1) AS AMOUNT
FROM T_PART_CIRCUIT_ITEM_ESTIMATE CIE WITH (NOLOCK)
WHERE CIE.OBJECT_NO = #{objectNo}
AND CIE.PLAN_NO = #{planNo}
GROUP BY CIE.ITEM_ID
</select>
</mapper> </mapper>