견적서 API 변경

This commit is contained in:
LAPTOP-L3VE7KK2\USER 2024-11-13 09:07:03 +09:00
parent 6022619231
commit 6ad6ce2cd3
8 changed files with 222 additions and 6 deletions

View File

@ -21,7 +21,10 @@ public interface EstimateMapper {
// 아이템 마스터 목록 조회
public List<ItemResponse> selectItemMasterList(EstimateRequest estimateRequest);
// 아이템 마스터 목록 조회
// 견적서 지붕재 목록 조회
public List<RoofResponse> selectEstimateRoofList(EstimateRequest estimateRequest);
// 견적서 특이사항 목록 조회
public List<NoteResponse> selectEstimateNoteList(NoteRequest noteRequest);
// 아이템 마스터 목록 조회

View File

@ -10,9 +10,7 @@ import com.interplug.qcast.biz.object.dto.ObjectResponse;
import com.interplug.qcast.biz.object.dto.PlanRequest;
import com.interplug.qcast.biz.object.dto.PlanResponse;
import com.interplug.qcast.biz.pwrGnrSimulation.PwrGnrSimService;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimGuideResponse;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRequest;
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimResponse;
import com.interplug.qcast.config.Exception.ErrorCode;
import com.interplug.qcast.config.Exception.QcastException;
import com.interplug.qcast.config.message.Messages;
@ -115,8 +113,8 @@ public class EstimateService {
/**
* QSP 아이템 가격 목록 조회
*
* @param priceRequest
* @return PriceResponse
* @param priceRequest QSP 관련 아이템 목록 정보
* @return PriceResponse QSP 아이템 가격 목록
* @throws Exception
*/
public EstimateApiResponse selectItemPriceList(PriceRequest priceRequest) throws Exception {
@ -156,10 +154,25 @@ public class EstimateService {
return response;
}
/**
* 견적 특이사항 목록 조회
*
* @param noteRequest 견적 특이사항 조회 정보
* @return List<NoteResponse> 견적 특이사항 목록
* @throws Exception
*/
public List<NoteResponse> selectSpecialNoteList(NoteRequest noteRequest) throws Exception {
return estimateMapper.selectEstimateNoteList(noteRequest);
}
/**
* 견적서 상세 조회
*
* @param objectNo 물건번호
* @param planNo 플랜번호
* @return EstimateResponse 견적서 상세 정보
* @throws Exception
*/
public EstimateResponse selectEstimateDetail(String objectNo, String planNo) throws Exception {
// Validation
if (StringUtils.isEmpty(objectNo)) {
@ -204,6 +217,12 @@ public class EstimateService {
return response;
}
/**
* 견적서 저장
*
* @param estimateRequest 견적서 저장 정보
* @throws Exception
*/
public void insertEstimate(EstimateRequest estimateRequest) throws Exception {
// Validation
if (StringUtils.isEmpty(estimateRequest.getObjectNo())) {
@ -522,6 +541,13 @@ public class EstimateService {
}
}
/**
* 견적서 복사
*
* @param estimateRequest 견적서 복사 정보
* @return EstimateResponse 견적서 복사 상세 정보
* @throws Exception
*/
public EstimateResponse insertEstimateCopy(EstimateRequest estimateRequest) throws Exception {
// Validation
if (StringUtils.isEmpty(estimateRequest.getObjectNo())) {
@ -613,6 +639,14 @@ public class EstimateService {
return response;
}
/**
* 견적서 엑셀 다운로드
*
* @param request HttpServletRequest
* @param response HttpServletResponse
* @param estimateRequest 견적서 엑셀 다운로드 요청 정보
* @throws Exception
*/
public void excelDownload(
HttpServletRequest request, HttpServletResponse response, EstimateRequest estimateRequest)
throws Exception {
@ -648,6 +682,13 @@ public class EstimateService {
estimateResponse.setNoteList(noteList);
}
// 지붕재 목록 조회
RoofInfoResponse roofInfoResponse = new RoofInfoResponse();
List<RoofResponse> roofList = estimateMapper.selectEstimateRoofList(estimateRequest);
roofInfoResponse.setRoofList(roofList);
estimateResponse.setRoofInfo(roofInfoResponse);
// 아이템 목록 조회
List<ItemResponse> estimateItemList = estimateMapper.selectEstimateItemList(estimateRequest);
@ -701,7 +742,7 @@ public class EstimateService {
PwrGnrSimRequest pwrGnrSimRequest = new PwrGnrSimRequest();
pwrGnrSimRequest.setObjectNo(estimateResponse.getObjectNo());
pwrGnrSimRequest.setPlanNo(estimateResponse.getPlanNo());
/*
PwrGnrSimResponse pwrGnrSimResponse =
pwrGnrSimService.selectPwrGnrSimulation(pwrGnrSimRequest);
if (pwrGnrSimResponse != null) {
@ -719,6 +760,7 @@ public class EstimateService {
}
estimateResponse.setPwrGnrSim(pwrGnrSimResponse);
*/
excelUtil.download(
request,
@ -911,6 +953,12 @@ public class EstimateService {
return quoteList;
}
/**
* Object => Map 변환 함수
*
* @param vo Object
* @return Map<String, Object> Map 변환 정보
*/
public Map<String, Object> convertVoToMap(Object vo) {
Map<String, Object> result = new HashMap<String, Object>();
@ -928,6 +976,12 @@ public class EstimateService {
return result;
}
/**
* List<Object> => List<Map> 변환 함수
*
* @param target List<Object>
* @return List<Map<String, Object>> List<Map> 변환 정보
*/
public static <T> List<Map<String, Object>> convertListToMap(Collection<T> target) {
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();

View File

@ -80,6 +80,9 @@ public class EstimateResponse {
@Schema(description = "기준풍속ID")
private String standardWindSpeedId;
@Schema(description = "기준풍속명")
private String standardWindSpeedName;
@Schema(description = "가대 메이커명")
private String supportMeaker;
@ -175,6 +178,12 @@ public class EstimateResponse {
@Schema(description = "경칭")
private String objectNameOmit;
@Schema(description = "도도부현명")
private String prefName;
@Schema(description = "지역명")
private String areaName;
@Schema(description = "물건정보 비고")
private String objectRemarks;
@ -235,6 +244,9 @@ public class EstimateResponse {
@Schema(description = "첨부파일 목록")
List<FileResponse> fileList;
@Schema(description = "지붕재 정보")
RoofInfoResponse roofInfo;
@Schema(description = "발전시뮬레이션 정보")
PwrGnrSimResponse pwrGnrSim;
}

View File

@ -19,6 +19,9 @@ public class EstimateSendResponse {
@Schema(description = "물건명")
private String objectName;
@Schema(description = "경칭코드")
private String objectNameOmitCd;
@Schema(description = "견적서 등록일")
private String estimateDetailCreateDate;

View File

@ -62,6 +62,9 @@ public class ItemRequest {
@Schema(description = "아이템 변경 여부")
private String itemChangeFlg;
@Schema(description = "PC 아이템 ID")
private String pcItemId;
@Schema(description = "W")
private String pnowW;

View File

@ -0,0 +1,20 @@
package com.interplug.qcast.biz.estimate.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
// @Data
@Getter
@Setter
public class RoofInfoResponse {
@Schema(description = "지붕면 목록")
private List<RoofResponse> roofList;
@Schema(description = "지붕면 파워컨디셔너 목록")
private List<RoofResponse> roofPcList;
@Schema(description = "지붕면 용량 목록")
private List<RoofResponse> roofVolList;
}

View File

@ -0,0 +1,67 @@
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 RoofResponse {
@Schema(description = "물건번호")
private String objectNo;
@Schema(description = "플랜번호")
private String planNo;
@Schema(description = "지붕재 번호")
private String roofNo;
@Schema(description = "지붕면")
private String roofSurface;
@Schema(description = "지붕재 아이템 ID")
private String roofMaterialId;
@Schema(description = "지붕재 아이템명")
private String roofMaterialName;
@Schema(description = "공법 ID")
private String supportMethodId;
@Schema(description = "공법명")
private String supportMethodName;
@Schema(description = "시공사양 ID")
private String constructSpecification;
@Schema(description = "시공사양명")
private String constructSpecificationName;
@Schema(description = "지붕재 아이템명")
private String roofMaterialIdMulti;
@Schema(description = "공법명")
private String supportMethodIdMulti;
@Schema(description = "시공방법명")
private String constructSpecificationMulti;
@Schema(description = "가대메이커명")
private String supportMeaker;
@Schema(description = "경사")
private String slope;
@Schema(description = "각도")
private String angle;
@Schema(description = "방위각")
private String azimuth;
@Schema(description = "면조도구분")
private String surfaceType;
@Schema(description = "설치높이")
private String setupHeight;
}

View File

@ -84,7 +84,9 @@
SELECT
P.OBJECT_NO
, P.PLAN_NO
, CONVERT(VARCHAR(10), P.DRAWING_ESTIMATE_CREATE_DATE, 121) AS DRAWING_ESTIMATE_CREATE_DATE
, P.ESTIMATE_VALIDITY_TERM
, P.SNOWFALL
, P.ESTIMATE_TYPE
, P.ESTIMATE_OPTION
, P.PKG_ASP
@ -94,9 +96,20 @@
, O.OBJECT_NAME
, O.OBJECT_NAME_OMIT
, (SELECT SALE_STORE_ID FROM M_USER WHERE USER_ID = O.CREATE_USER) AS CREATE_SALE_STORE_ID
, ISNULL(MP.PREF_NAME, '') AS PREF_NAME
, ISNULL(MPA.AREA_NAME, '') AS AREA_NAME
, ISNULL(C1.CODE_NM, '') AS STANDARD_WIND_SPEED_NAME
FROM T_PLAN P WITH (NOLOCK)
INNER JOIN T_OBJECT O WITH (NOLOCK)
ON P.OBJECT_NO = O.OBJECT_NO
LEFT OUTER JOIN M_PREFECTURE MP WITH (NOLOCK)
ON O.PREF_ID = MP.PREF_ID
LEFT OUTER JOIN M_PREFECTURE_AREA MPA WITH (NOLOCK)
ON O.PREF_ID = MPA.PREF_ID
AND O.AREA_ID = MPA.AREA_ID
LEFT OUTER JOIN M_COMM_L C1 WITH (NOLOCK)
ON C1.HEAD_CD = '202000'
AND P.STANDARD_WIND_SPEED_ID = C1.CODE
WHERE P.OBJECT_NO = #{objectNo}
AND P.PLAN_NO = #{planNo}
) T
@ -112,6 +125,7 @@
O.OBJECT_NO
, O.SALE_STORE_ID
, O.OBJECT_NAME
, O.OBJECT_NAME_OMIT
, O.RECEIVE_COMPANY_NAME
, O.RECEIVE_USER
, O.DELIVERY_ZIP_NO
@ -139,6 +153,7 @@
, CONVERT(NVARCHAR(10), P.CREATE_DATETIME, 121) AS ESTIMATE_DETAIL_CREATE_DATE
, P.LAST_EDIT_DATETIME
, P.LAST_EDIT_USER
, (SELECT CODE FROM M_COMM_L WHERE HEAD_CD = '200800' AND CODE_NM = O.OBJECT_NAME_OMIT) AS OBJECT_NAME_OMIT_CD
FROM T_PLAN P WITH (NOLOCK)
INNER JOIN T_OBJECT O WITH (NOLOCK)
ON P.OBJECT_NO = O.OBJECT_NO
@ -167,6 +182,7 @@
, PE.SPECIAL_NOTE_CD
, PE.ITEM_CHANGE_FLG
, I.PNOW_W
, I.ITEM_GROUP
, CASE WHEN I.ITEM_GROUP = 'MODULE_' THEN '1' ELSE '0' END AS MODULE_FLG
FROM T_PART_ESTIMATE PE WITH (NOLOCK)
INNER JOIN M_ITEM I WITH (NOLOCK)
@ -199,6 +215,40 @@
</foreach>
</select>
<select id="selectEstimateRoofList" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="com.interplug.qcast.biz.estimate.dto.RoofResponse">
/* sqlid : com.interplug.qcast.biz.estimate.selectEstimateRoofList */
SELECT
P.OBJECT_NO
, P.PLAN_NO
, P.SETUP_HEIGHT
, P.SURFACE_TYPE
, RE.ROOF_SURFACE
, RE.ROOF_MATERIAL_ID
, RE.SUPPORT_METHOD_ID
, RE.CONSTRUCT_SPECIFICATION
, RE.SLOPE
, RE.ANGLE
, RE.AZIMUTH
, ISNULL(C1.CODE_NM, '') AS ROOF_MATERIAL_NAME
, ISNULL(C2.CODE_NM, '') AS SUPPORT_METHOD_NAME
, ISNULL(C3.CODE_NM, '') AS CONSTRUCT_SPECIFICATION_NAME
FROM T_PLAN P WITH (NOLOCK)
INNER JOIN T_ROOF_ESTIMATE RE WITH (NOLOCK)
ON P.OBJECT_NO = RE.OBJECT_NO
AND P.PLAN_NO = RE.PLAN_NO
LEFT OUTER JOIN M_COMM_L C1 WITH (NOLOCK)
ON C1.HEAD_CD = '201900'
AND RE.ROOF_MATERIAL_ID = C1.CODE
LEFT OUTER JOIN M_COMM_L C2 WITH (NOLOCK)
ON C2.HEAD_CD = '202100'
AND RE.SUPPORT_METHOD_ID = C2.CODE
LEFT OUTER JOIN M_COMM_L C3 WITH (NOLOCK)
ON C3.HEAD_CD = '201300'
AND RE.CONSTRUCT_SPECIFICATION = C3.CODE
WHERE P.OBJECT_NO = #{objectNo}
AND P.PLAN_NO = #{planNo}
</select>
<select id="selectEstimateNoteList" parameterType="com.interplug.qcast.biz.estimate.dto.NoteRequest" resultType="com.interplug.qcast.biz.estimate.dto.NoteResponse">
/* sqlid : com.interplug.qcast.biz.estimate.selectEstimateNoteList */
SELECT
@ -303,6 +353,8 @@
, PKG_ASP = NULL
, PRICE_CD = #{priceCd}
, SURFACE_TYPE = #{surfaceType}
, CREATE_DATETIME = GETDATE()
, CREATE_USER = #{userId}
</when>
<otherwise>
, CHARGER = #{charger}
@ -445,6 +497,7 @@
, ITEM_NAME
, SPECIFICATION
, AMOUNT
, PC_ITEM_ID
)
SELECT
#{roofNo} AS ROOF_NO
@ -455,6 +508,7 @@
, I.ITEM_NAME
, I.PNOW_W
, #{amount}
, #{pcItemId}
FROM M_ITEM I WITH (NOLOCK)
WHERE I.ITEM_ID = #{itemId}
</insert>